• 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

    • AI is the justification that company administrators use to lay people off; it is not the end all, be all touted in the media (many of whom can't tell a microchip from a potato chip). Greed is main driving factor behind its adoption; the other is remaining relevant in the face of competition from other entities.
    • Firefox 152.0.2 is out with fixes for performance, translation, and cloud storage services by Taras Buria A new bug-fixing update is now rolling out to Firefox users in the Release Channel. Less than a week ago, Mozilla fixed crashes on Intel Raptor Lake processors with version 152.0.1. Now, Mozilla has prepared yet another set of fixes that address problems with localization, playback issues of certain MP4 files, and performance issues on website that perform various encryption operations at once. Here is the full changelog: Firefox 152.0.2 is now available for download from Mozilla's FTP. Existing installations will get the update over the next several hours. The latest version will also be available soon on the official website, the Microsoft Store, and Neowin's Software page. You can find Firefox 152.0.2 release notes in the official documentation. In case you missed it, Mozilla released Firefox 152 earlier this month. The latest feature update brought reworked settings with a more streamlined user interface, JPEG XL support, new features for Private mode, a new way to mute a tab (just type "mute" in the address bar), and many more. You can find the complete changelog here. In other Firefox news, Mozilla recently published its roadmap, where the company detailed the upcoming Nova redesign and other features it plans to implement. Mozilla wants to make the new user interface easier to navigate and more modern, with a heavy focus on its privacy tools, such as its built-in VPN. If you are curious, you can already enable the new UI as described here.
    • Liene PixCut S1 Starter Kit gets a whopping 31% discount on Prime Day by Steven Parker Liene reached out to us to share another Prime Day exclusive deal that starts today on Amazon. It gives buyers a massive 31% off on the cost of this color sticker printer and cutting machine. It's basically an all-in-one sticker maker for DIY crafts, custom labels and gifts. It utilizes thermal dye-sublimation at 300 dpi, and offers precise "AI" auto-cutting. Here are some more of its highlights: All-in-One Convenience - Print and Cut in One Step. Say goodbye to the hassle of using separate machines. The PixCut S1 seamlessly integrates high-resolution photo printing and precise die cutting into one streamlined device. With just a few clicks on the user-friendly app, you can edit, print, and cut directly from your smartphone via Bluetooth. Create stickers in just 2 minutes! This all-in-one solution saves you time and effort, making your creative projects more enjoyable and efficient. AI Image Extraction & Precision Cutting - Unleash your creativity with the AI image extraction feature that automatically recognizes and extracts subjects from your photos. Then watch as the high-precision cutting system, guided by the same AI technology, perfectly follows every edge with pinpoint accuracy. This seamless AI-to-cut workflow ensures flawless results every time. Turn any moment into custom stickers with professional edges in minutes - just masterpieces made simple. High-Resolution Prints - Vivid and True-to-Life Colors. Utilizing thermal dye-sublimation technology, the PixCut S1 delivers stunning 300 dpi high-resolution prints with 16.7 million colors. Whether you're printing photos, stickers, or labels, you can expect vibrant, true-to-life color effects that make your creations stand out. Every detail is captured with precision, providing professional-quality results every time. AI Lab - Bring Your Imagination to Life. Upload a photo, pick a style from the Liene Photo App, and watch AI bring your vision to life instantly. Turn selfies into an anime character, a fantasy hero, or a festive holiday illustration — all with stunning realism. One style, endless versions of you. Print your AI art as custom stickers, unique gifts, or social media posts — perfect for avatars and DIY projects. No design experience required. Your creativity is just one click away from magic. Durable Stickers - Create Long-Lasting Creations .Thanks to the four-layer thermal dye-sublimation technology, the photopaper is automatically laminated during printing. Stickers produced by PixCut S1 are durable, waterproof and scratch-resistant, ensuring they remain vibrant and intactover time. Perfect for creating custom stickers, labels, and more that last. No Subscription. Just Pure Creativity. With the Liene app, available on mobile, tablet, and desktop. Unlock 40,000+ free images, fonts & elements (and growing), plus 2000+ ready-to-use templates for phone skins, lens stickers, ID cards, labels, name tags, journaling, and more. No paywalls, no hidden fees, just pure creativity. Turn any idea into a custom creation in minutes. Your imagination has no limits, neither should your software. This deal is for the Starter Kit, so what do you get? What's in the box PixCut S1 Photo Sticker Printer and Cutter x 1 Photo Sticker Cutter Ink Cartridge x 1 (36 sheets) Photo Paper 4"x6" (18 sheets) Sticker Paper 4"x7" (White) x 18 sheets Blade x 1 (Pre-installed) So in short everything you need to get printing and cutting. The Liene PixCut S1 has a 4.3 star rating after more than 1,000 reviews from customers, but we can't promise the landing page always sold this particular model, so do check out the reviews before purchasing. In any case Prime members are covered with a 30 day return or replacement should things not work out so great. Liene Pixcut S1 for $205.99 (was $299.99) 31% off Use code 15PIXCUT6 during checkout Although this is a Prime Day discount, the above code will stay live until June 30. Good to know This Amazon deal is U.S. specific, and not available in other regions unless specified. We only use first-party seller links (at the time of article publishing); ensure that you purchase from a first-party seller link only. Check out Today's Deals on Amazon | or our recent tech deals. Become a Prime member (for Students or SNAP) via Neowin Get Prime Access - Prime for half price (for qualifying Medicaid, EBT, SNAP) Subscribe to Prime Video, Audible Plus, Music Unlimited or Kindle Unlimited via Neowin As an Amazon Associate, we earn from qualifying purchases.
    • https://www.tenforums.com/tuto...b-results-windows-10-a.html Check the comment dates. Some of them are as old as 2016.
  • 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
      175
    3. 3
      PsYcHoKiLLa
      100
    4. 4
      Michael Scrip
      88
    5. 5
      neufuse
      70
  • Tell a friend

    Love Neowin? Tell a friend!