• 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
https://www.neowin.net/forum/topic/301987-dynamic-signatures/
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.

  • 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...

  • 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
  • 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

  • 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:

  • 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:

  • 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?

  • 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?

  • 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
  • 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
  • 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.

  • 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

  • 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
  • 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?

  • 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.

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

    • No registered users viewing this page.
  • Posts

    • Exactly, this is just the beginning. I hope that by that time, our inept politicians devise something like a Universal Basic Income, because unemployment and poverty rates will skyrocket otherwise. And believe me, robots that perform physical work aren't a matter of IF, but WHEN. No career is truly safe from AI/robots, it's just a matter of time.
    • Subtitle Edit 5.0.0 by Razvan Serea Subtitle Edit is a powerful, free, and user-friendly subtitle editing tool designed for creating, editing, and converting subtitles for videos. It supports a wide range of subtitle formats, including SRT, ****, and SUB, allowing users to easily modify and adjust subtitles for accurate timing and formatting. With its intuitive interface, Subtitle Edit provides a variety of features such as waveform audio display, spell-check, subtitle synchronization, and real-time video preview, making it an ideal choice for both beginners and professionals. The software also includes powerful tools for batch processing, translating subtitles, and converting between different subtitle formats. Subtitle Edit features: Create/adjust/sync/translate subtitle lines Convert between SubRib, MicroDVD, Advanced Sub Station Alpha, Sub Station Alpha, D-Cinema, SAMI, youtube sbv, and many more (300+ different formats!) Cool audio visualizer control - can display wave form and/or spectrogram Video player uses mpv, DirectShow, or VLC media player Visually sync/adjust a subtitle (start/end position and speed) Audio to text (speech recognition) via Whisper or Vosk/Kaldi Auto Translation via Google translate Rip subtitles from a (decrypted) dvd Import and OCR VobSub sub/idx binary subtitles Import and OCR Blu-ray .sup files - bd sup reading is based on Java code from BDSup2Sub Can open subtitles embedded inside Matroska files Can open subtitles (text, closed captions, VobSub) embedded inside mp4/mv4 files Can open/OCR XSub subtitles embedded inside divx/avi files Can open/OCR DVB and teletext subtitles embedded inside .ts/.m2ts (Transport Stream) files Can open/OCR Blu-ray subtitles embedded inside .m2ts (Transport Stream) files Merge/split subtitles Adjust display time Fix common errors wizard....and more. Subtitle Edit 5.0.0 changelog: Subtitle Edit 5 is a major new release and a big step for the project. For the first time, Subtitle Edit runs natively on Windows, macOS, and Linux from a single, modern, cross-platform codebase. The builds are self-contained, so no separate .NET installation is required, and on macOS and Linux the needed media components (mpv/ffmpeg) are bundled in. Please read before upgrading: Subtitle Edit 5 is a new application, not just an update of Subtitle Edit 4. It has been rebuilt from the ground up to be cross-platform, so: It is not 100% the same app. The look, layout, and some workflows have changed. Some things are in different places, and a few behave differently than in SE4. Not every SE4 feature exists in SE5 yet. SE5 covers all the core editing, conversion, sync, video playback, OCR, and online services, but some of the more specialized SE4 tools are not available yet. Features will continue to be added. If you rely on a specific SE4 feature that is missing, please keep SE4 installed alongside SE5. The easiest way to run both side by side is to use the Portable versions of SE4 and SE5, which keep their settings separate and do not interfere with each other. Which version should I use? Subtitle Edit 5: recommended for most users on Windows 10 (22H2) or newer, macOS 12+, and Linux. Subtitle Edit 4: please continue to use SE4 if you are on an older Windows version (Windows 7/8), or on older / slower computers where SE5 may not run well. SE4 remains available and is the right choice in those cases. To run SE4 and SE5 at the same time, use the Portable versions - you can try SE5 while keeping SE4 as a fallback. Download: Subtitle Edit 5.0.0 | ARM64 | ~60.0 MB (Open Source) Download: Subtitle Edit Portable | 103.0 MB View: Subtitle Edit Homepage | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Google Pixel 11 series: Here's what to expect by Hamid Ganji Google Pixel 10 series In recent years, Google has successfully turned its Pixel devices into worthy contenders in the smartphone market. The search giant is now preparing to launch the Pixel 11 series in just a few months, and many Pixel fans are likely wondering what Google has in store for them this year. The next lineup of Google smartphones includes four devices: the Pixel 11, Pixel 11 Pro, Pixel 11 Pro XL, and Pixel 11 Pro Fold. This year, we don’t expect Google to bring revolutionary upgrades to its handsets, and the Pixel 11 series is likely to receive modest hardware improvements alongside a slew of AI-powered features. Here are the rumored specifications of the Google Pixel 11 series ahead of its official debut: When will the new Pixel phones be unveiled? The last two generations of Google Pixel phones (Pixel 9 series and Pixel 10 series) were launched in August, unlike the previous three generations that debuted in October. With that in mind, we expect Google to unveil the Pixel 11 series sometime in August 2026. The exact launch date has yet to be confirmed. Google Pixel 11 CAD renders - Image via AndroidHeadlines How much will the Pixel 11 series cost? Predicting the final price of upcoming smartphones has become increasingly difficult. As you may know, RAM and memory prices are rising sharply, leading to significant increases in the cost of consumer electronics. Recently, Apple CEO Tim Cook said that price increases for some future Apple products are unavoidable, suggesting that the iPhone 18 series could become more expensive. Google has remained tight-lipped about any potential price increases for the Pixel 11 series. If the company manages to maintain last year’s pricing structure, here’s what the lineup could cost: Pixel 11: $799 Pixel 11 Pro: $999 Pixel 11 Pro XL: $1,199 Pixel 11 Pro Fold: $1,799 Given current market conditions, it may be difficult for Google to avoid raising prices unless it adopts cost-saving measures, such as equipping the base model with 8GB of RAM. Google Pixel 11 series anticipated specs: We expect the Google Pixel 11 series to debut with a new Tensor G6 processor as well as an upgraded camera system. The overall design, however, is expected to remain largely unchanged across the lineup. Specifications Pixel 11 Pixel 11 Pro Pixel 11 Pro XL Pixel 11 Pro Fold Display 6.3-inch LTPO AMOLED / 120Hz refresh rate / up to 3100 nits of brightness 6.3-inch Super Actua LTPO OLED, 120Hz refresh rate, up to 3600 nits of brightness 6.8-inch Super Actua LTPO OLED, 120Hz refresh rate, up to 3600 nits of brightness 8-inch inner screen and 6.4-inch outer display, 120Hz refresh rate, up to 3600 nits of brightness RAM & Processor Tensor G6 / 8-12GB of RAM Tensor G6 / 12-16GB of RAM Tensor G6 / 12-16GB of RAM Tensor G6 / 16GB of RAM Storage options 128GB or 256GB 256GB, 512GB, 1TB 256GB, 512GB, 1TB 256GB, 512GB, 1TB Camera 50MP main sensor, 13MP ultra-wide, 10.8MP 5x telephoto, 10.5MP front camera 50MP main camera, 48MP ultra-wide, 48MP telephoto with 5x optical zoom, 42MP selfie camera 50MP main camera, 48MP ultra-wide, 48MP telephoto with 5x optical zoom, 42MP selfie camera 50MP main camera, 10.5MP ultra-wide camera, 10.8MP telephoto camera, 10MP front camera, 10MP inner camera Battery 4,840 mAh 4,707 mAh 5,000 mAh 4,658 mAh Software Android 17 Android 17 Android 17 Android 17 The Pixel 11 series won’t be a major departure from its predecessor, with Google instead focusing on subtle improvements and AI additions such as Gemini Intelligence. However, a patent filed by Google suggests the company is working on a removable battery for its smartphones, and we could see this feature make its way to the Pixel 11 Pro Fold. Given that nearly all smartphones today lack removable batteries, such a feature would be a welcome addition to future Pixel devices. That said, it may not arrive with this year’s lineup after all, and the final decision is yet to be made by Google. The Pixel 11 series could also face an uphill battle in the market. In the Android segment, Samsung is performing well with the Galaxy S26 series, while the Galaxy Z Fold 8 lineup is also expected to launch next month. On the other hand, Apple is preparing to unveil the iPhone 18 Pro and iPhone 18 Pro Max in September alongside its first foldable iPhone.
    • At least AMD is still taking Windows 10 seriously (after the oops) before it consumer extended support ends. @WaltC - Memories, 2x Voodoo in SLI with a Riva TNT with an Aureal A3D soundcard.
  • Recent Achievements

    • One Month Later
      timbobit earned a badge
      One Month Later
    • One Month Later
      nates earned a badge
      One Month Later
    • Week One Done
      Almohandis earned a badge
      Week One Done
    • Rookie
      dorf went up a rank
      Rookie
    • First Post
      mike_rumble earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      475
    2. 2
      +Edouard
      172
    3. 3
      PsYcHoKiLLa
      105
    4. 4
      Michael Scrip
      88
    5. 5
      Steven P.
      70
  • Tell a friend

    Love Neowin? Tell a friend!