• 0

Dynamic Signatures


Question

How would I make a signature that allows users to put a piece of text into my signature? I know you can use PHP, but I don't have the slightest clue about PHP

(Apart from Cutenews stuff)

Could someone make me a saple signature, very plain, and show me how to allow users to imput text into it thru my website?

Edited by TimRogers
Link to comment
Share on other sites

Recommended Posts

  • 0
But there's something wrong, a word like "assembly" will be replaced with "***embly"...

I'm not a regular expressions expert but it's the origin of the problem.

Somebody has an idea?

585718622[/snapback]

ya, in the array you leave a space before and after the "ass" so like " ass ". You might also want to check for "ass," "ass." "ass!" etc...

That was somewhat implemented in my code above.

Link to comment
Share on other sites

  • 0
Heh, due to public interest I might re-start the DSig project..

Here's my current one :

index.jpg

Update Comment and Archives

585718984[/snapback]

Looks like I have comperition :shifty: lol

PS: Has anyone got any ways to copy text on an animated gif???

EDIT: Sorry didn't mean to double post...

Link to comment
Share on other sites

  • 0

I will be fiddling with this this afternoon.

Okay, so if i use this (below) where do i put it? As in, what file?

<?php

function lanchk($string) {

?? $obscenities = array("****"," ass ","damn","****","\$hit","bitch","######"," \@ss ");

?? foreach ($obscenities as $curse_word) {

? ? ?? if (stristr(trim($string),$curse_word)) {

? ? ? ? ?? $length = strlen($curse_word);

? ? ? ? ?? for ($i = 1; $i <= $length; $i++) {

? ? ? ? ? ? ?? $stars .= "*";

? ? ? ? ?? }

? ? ? ? ?? $string = eregi_replace($curse_word,$stars,trim($string));

? ? ? ? ?? $stars = "";

? ? ?? }

?? }

?? return $string;

}

?>

Also, how do I use a non-echo page to let users select their own?

I can add a simple page emailling me their suggestion to the same page as the "select words" page.

And also, you add the font fileEDIT 2:with all the image and everything in?

EDIT 2:

http://www.wizzyworld.com/exte:/als/sig/sig.php

it doesnt use my image? :/

Thanks,

Pete

Edited by TheTrainMan
Link to comment
Share on other sites

  • 0
Looks like I have comperition  :shifty: lol

PS: Has anyone got any ways to copy text on an animated gif???

EDIT: Sorry didn't mean to double post...

585723494[/snapback]

I only want to allow my visitors to be able to choose a message that is in a list, so that way there is no advertising or bad things in my sig :p. From what I can see....your script looks much more secure than mooodi's in the sense that your script doesn't have the text in the URL which can be easily updated to something else, like moodi's does.

Mooodi's output page

http://www.jpgodlew.com/siggy/dynamic.jpg?go=gochange&amp;newcomment=This+space+for+sale

The message can be changed very easily

Pre's script doesn't have an output page at all. If you could just add like a little thing that says "Message Updated" or something along those lines I would LOVE to use your script ;)

About the animated gif....

Replace:

$im = imagecreate(400, 130);[QUOTE]
With:
[CODE]$im = imagecreatefromgif ("yourimage.gif");  

It may or may not work with an animated gif

Link to comment
Share on other sites

  • 0
About the animated gif....

Replace:

$im = imagecreate(400, 130);[QUOTE]
With:
$im = imagecreatefromgif ("yourimage.gif");  

It may or may not work with an animated gif

585726715[/snapback]

That code doesnt work for me... and I really want to use an animated gif :cry:

Link to comment
Share on other sites

  • 0

Pre...would you be willing to release your code...or at least the part of it that updates the image without putting the imputted text in the URL?

and about the animated gif...I read around a bit and I don't think it is possible :(

Link to comment
Share on other sites

  • 0

WARNING TO OTHER MEMBERS HAVING DYNAMIC SIGS:

I just received a warning from a mod because of inappropriate material being entered in the dynamic signature.

This makes it difficult because although I have used by own sware filter in the past, its to easy to go past it and I have no control what people say. :(

I feel sad now :cry:

Link to comment
Share on other sites

  • 0
WARNING TO OTHER MEMBERS HAVING DYNAMIC SIGS:

I just received a warning from a mod because of inappropriate material being entered in the dynamic signature.

This makes it difficult because although I have used by own sware filter in the past, its to easy to go past it and I have no control what people say. :(

I feel sad now :cry:

585739703[/snapback]

This is exactly why I want to have a list of what people can put on my sig...not have them type in anything.

Any news on that code Pre?

Link to comment
Share on other sites

  • 0

after seeing this thread I desided to give my dynamic sig an 'upgrade' all it had was a comment that could be changed to anything by anyone.

I found this thread I tried to put in a server uptime and ip address section, only to find out they wont work becuase my server has disabled the use of those certain commands to help make it more sercure.

So instead I thought id make the little bit i had a bit more 'advanced' but got stuck...

atm the comments ppl post are saved in my txt file in a list eg.

hello

test

hello world

so it posts the whole list on the image, i tried to use

$file = fopen($filename, "r");
$data = fread($file, filesize($filename));
fclose($file);
$text = explode("\r\n", $data);
imagettftext($im, 10, 0, 5, 15, $black, $font, $text[0]);

but it didnt work, then i realised the this would post the very first comment in the txt file, becuase new comments are added to the bottom of the list..so basicly does anyone know how i can do this, perhaps showing the last three comments people have made?

Link to comment
Share on other sites

  • 0

Thought i'd add a little bit here.

Here's part of my script, it filters badwords from a .txt file (one per line) which in my app is appendable from the web based control panel.

$badlist = file_get_contents("admin/banned.txt");
$badlist = split("[\n]", $badlist);

foreach ($badlist as $badword) {
	$content = trim($content);
	$badword = trim($badword);
    $content = str_replace($badword,"****", $content);
//	echo $badword . " -&gt; " . $content . "\n&lt;br&gt;";
}

admin/banned.txt is the path to the text file of course, and $content is the string with the anonymous message in. If you're using PHP5, i suggest you use str_ireplace (as its case insensitive).

anonymousjon: keep a file with JUST the current one in (to put into the script), and a logfile with each one in. Simplifies it greatly.

Edit: If you want the last 3 values, do what you're currently doing, but see how long the array is first. I cant remember off the top of my head what the function is but i'll go look for you.

Edit2: Who would have thought, the function was called count() :p

Do this (again, off the top of my head so sorry if there are any errors):

$file = fopen($filename, "r");
$data = fread($file, filesize($filename));
fclose($file);
$text = explode("\r\n", $data);
$max = count($text);
imagettftext($im, 10, 0, 5, 15, $black, $font, $text[$max]);

Then for the other 2 lines i believe you can do this

$max = $max - 1;
imagettftext($im, 10, 0, 5, 15, $black, $font, $text[$max]);

(obviously change X and Y as well)

Edited by Zero1
Link to comment
Share on other sites

  • 0

anyone know how to force jpg / png to execute through php on a IIS server? (iis 5.1 or 6.0)..and if you force it to execute through php and it is a standard image, does it cause any issues?

An idea, just change the MIME type to application/x-httpd-php (i think changing the MIME type is same as what .htaccess does for apache? i am not too familiar with that though) for jpg and png? or is that a bad idea?

Thanks :)

Edited by SkyyPunk
Link to comment
Share on other sites

  • 0

Does anyone know how I can put data into my .txt file that will not show the imputted data in the URL of the script?

This is what I DON'T want:

dynamic.jpg?go=gochange&amp;newcomment=Someone+Can+Change+This+Very+Easily

newcomment=I+don't+want=the+text+in+the+URL

All I need is a way to get the text into the data file without an output of the entered text in the URL...any ideas?

Edit:

This will be a separate file from the file that actually changes the image. The image file will just read the latest entry in the data file and update the image with that text.

Link to comment
Share on other sites

  • 0

You need to use form eg.

&lt;form name="input" action="action.php" method="post"&gt;
    tagline: &lt;input type="text" name="text"&gt;
   &lt;input type="submit" value="Go"&gt;
&lt;/form&gt;

then make text.txt which will is where the comment will be sent to, you need to chmod this to 777.

then make another php file lets call it ations.php this is the action method that the form will use

$text = $_POST["text"]; // Or use $_GET["text"] but I really don't recommend doing so!
if ($text == "") { $text = " "; } 
$filename = "text.txt"; 
$file = fopen($filename, "w");
fwrite($file,  $text);
fclose($file);

this should place whatever comment someone types in the text box into the firstline of the txt file

Link to comment
Share on other sites

  • 0

So i just make the two files and the form knows to simply add it to the text file? :s

Sorry, I really dont know how to do any of this :(

Link to comment
Share on other sites

  • 0

Ok, I'am all new to this stuff so is there a site that I can upload my php script to? It seems my ISP's webspace doesn't support it.

Link to comment
Share on other sites

  • 0

yup that should just add it to the .txt file

oops i forgot :p you will need to actually upload a txt file and name it text.txt and chmod it to 666

Hoochi, try to find a free php host, there are a few out there :)

thanks zero1, pretty similar to what I had except mine didnt use a text file so i had a huge list of nasty words in script :p

Edited by anonymousjon
Link to comment
Share on other sites

  • 0
yup that should just add it to the .txt file :)

oops i forgot :p you will need to actually upload a txt file and name it text.txt :) and chmod it to 666

Hoochi, try to find a free php host, there are a few out there :)

585758782[/snapback]

Recommend any?

Link to comment
Share on other sites

  • 0

thinking about it there arnt really any good ones..they all have ads on them etc..

I could set u up with a little bit of webspace if u like?

Link to comment
Share on other sites

  • 0
thinking about it there arnt really any good ones..they all have ads on them etc..

I could set u up with a little bit of webspace if u like?

585758812[/snapback]

Doesn't seem to be a problem, thanks Tim.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.