Page 5 of 5

Creating a dynamic signature

Posted: Mon Feb 21, 2005 8:46 pm
by Red Squirrel
Lot of forums don't allow images that don't have a .gif,.jpg .png (and some others) extension. So make sure your "fake" image has a .jpg extension,t his is why the .htaccess part is important. It makes .jpg files parse as php, in the folder specified.

Archived topic from Iceteks, old topic ID:1293, old post ID:25550

Creating a dynamic signature

Posted: Thu May 05, 2005 7:54 pm
by Red Squirrel
Unfortunatly the re's not, at least I'm not aware of a way. Only way is to set .jpg's in the folder to parse as php, using .htaccess. You could keep it to .php and use that as an image, but if you want to post it to a forum or something it probably won't let you, since most forums only allow specific extensions.

Archived topic from Iceteks, old topic ID:1293, old post ID:26646

Creating a dynamic signature

Posted: Thu May 05, 2005 9:16 pm
by Streety
Sticking with a php extension and seeing if everything works like that will probably help to confirm that the problem is the .htaccess file but as Red Squirrel says you'll have problems using the image on forums.

Archived topic from Iceteks, old topic ID:1293, old post ID:26648

Creating a dynamic signature

Posted: Fri May 06, 2005 2:59 pm
by ZenithalRavage
hmm. Indeed I don't think the .htaccess is causing my troubles as I can get a different dynamic signature to work:

http://www.a-base.dds.nl/sigtest/random_images_signature.php

I have found code for a dynamic signature to display text feeded by RSS here.
This is an example.

I've been fiddling around with the code they give but I just can't get it to work:

http://www.a-base.dds.nl/sig_rss/rss_image_b.php
http://www.a-base.dds.nl/sig_rss/rss_image_b.txt <-code

Do any of you have an idea as to what might cause the problem?

Archived topic from Iceteks, old topic ID:1293, old post ID:26688

Creating a dynamic signature

Posted: Fri May 06, 2005 3:19 pm
by Streety
Is that the code they give or the code you are currently working with? If it is the original code they give have you changed the source image and if so what to?

A scan revealed the following errors

Unused function argument: $parser (line 38)
Unused function argument: $attrs (line 38)
Unused function argument: $parser (line 48)
Unused function argument: $name (line 48)
Unused function argument: $parser (line 52)
Assignment in condition (line 84)

I don't have time to look at it in much more detail just for the moment but I'll take a second look later.


Archived topic from Iceteks, old topic ID:1293, old post ID:26691

Creating a dynamic signature

Posted: Fri May 06, 2005 5:08 pm
by Red Squirrel
Scan? Do you have a tool to scan php for issues? or do you mean you did it by looking? Would be a neat tool to have, especially for large scripts.

Archived topic from Iceteks, old topic ID:1293, old post ID:26695

Creating a dynamic signature

Posted: Fri May 06, 2005 6:30 pm
by ZenithalRavage
Streety wrote: Is that the code they give or the code you are currently working with? If it is the original code they give have you changed the source image and if so what to?

A scan revealed the following errors

Unused function argument: $parser (line 38)
Unused function argument: $attrs (line 38)
Unused function argument: $parser (line 48)
Unused function argument: $name (line 48)
Unused function argument: $parser (line 52)
Assignment in condition (line 84)

I don't have time to look at it in much more detail just for the moment but I'll take a second look later.
Check post #9 on that page I gave to see the original code. As you can see I barely changed it except for the image and rss link. The only important thing I changed to prevent php from giving error's was change this:

function charData($parser, $data) {
global $store, $array;


into this:


function charData($parser, $data) {
global $store, $array, $count, $maxent;

Archived topic from Iceteks, old topic ID:1293, old post ID:26699

Creating a dynamic signature

Posted: Fri May 06, 2005 6:55 pm
by Streety
Red Squirrel wrote: Scan?  Do you have a tool to scan php for issues?  or do you mean you did it by looking?  Would be a neat tool to have, especially for large scripts.
I have a trial copy of Zend Development Environment 3.5.0. You know those trials you get from certain places on the internet. ;)

It's 30 Mb if you want me to send it to you.

ZenithalRavage, are you aware you're using a different version of rss? I don't know if that would make any difference though.

Archived topic from Iceteks, old topic ID:1293, old post ID:26701

Creating a dynamic signature

Posted: Fri May 06, 2005 7:18 pm
by ZenithalRavage
Streety wrote: ZenithalRavage, are you aware you're using a different version of rss?  I don't know if that would make any difference though.
Yea I noticed, but I tried it with different RSS feeds (2.0) and that doesn't make a difference :(

thanx for noticing though ;)

this is pretty weird though, I changed the feed to another again now and when I refresh my sig quicky sometimes it does show the image but never with any text. Could this be because this feed might be slower or something?

http://www.a-base.dds.nl/sig_rss/rss_image_b.php
http://www.a-base.dds.nl/sig_rss/rss_image_b.txt <-code

Archived topic from Iceteks, old topic ID:1293, old post ID:26702

Creating a dynamic signature

Posted: Fri May 06, 2005 8:36 pm
by Streety
Yeah I'm getting the same thing, you have to click it fairly fast though (you must have been desperate!). You could try saving the file to your own server, that should make it faster but it would seem unlikely that that's the error.

I'm playing around with creating images myself now and I'm reminded just what a pain it is. I don't know if it will work for you as your code is more complex but i'm going through my code and editing it out between note tags (i.e. /* */). I started off hiding everything and have finally got it down to just one line. I've still no idea what the problem is but at least I know where the problem is. It's back to http://www.php.net for me.

Archived topic from Iceteks, old topic ID:1293, old post ID:26703

Creating a dynamic signature

Posted: Fri May 06, 2005 8:48 pm
by ZenithalRavage
Streety wrote: Yeah I'm getting the same thing, you have to click it fairly fast though (you must have been desperate!). You could try saving the file to your own server, that should make it faster but it would seem unlikely that that's the error.

I'm playing around with creating images myself now and I'm reminded just what a pain it is. I don't know if it will work for you as your code is more complex but i'm going through my code and editing it out between note tags (i.e. /* */). I started off hiding everything and have finally got it down to just one line. I've still no idea what the problem is but at least I know where the problem is. It's back to http://www.php.net for me.
hmm. I think the problem is with my host because I tested the standard example code the PHP manual gives for the imagettftext function and that gives me the same error!
http://www.a-base.dds.nl/sig_rss/test.php
http://www.a-base.dds.nl/sig_rss/test.txt <-code

I emailed my host about this, I'll keep you all informed

Archived topic from Iceteks, old topic ID:1293, old post ID:26704

Creating a dynamic signature

Posted: Fri May 06, 2005 8:49 pm
by ZenithalRavage
oops sorry doublepost (page hung after reply so I pressed add reply again)

Archived topic from Iceteks, old topic ID:1293, old post ID:26705

Creating a dynamic signature

Posted: Fri May 06, 2005 9:13 pm
by Streety
I've just run it on my server and it also gives an error.

Using the following code though appears to work

Code: Select all

<?php
// Set the content-type
header("Content-type: image/png");

// Create the image
$im = imagecreate(400, 30);

// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);

// The text to draw
$text = 'Testing...';

ImageFill($im, 0, 0, $grey);
imagestring($im, 5, 5, 5, $text, $black);

// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?> [code]

Instead of using imagettftext I just used imagestring.  It must be imagettftext that is causing the problem.  Presumably you need to get the tff file from somewhere and enclose it in the folder. 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:1293, old post ID:26706[/size][/color]

Creating a dynamic signature

Posted: Fri May 06, 2005 9:21 pm
by Streety
The code on the php site does work.

Code: Select all

<?php
// Set the content-type
header("Content-type: image/png");

// Create the image
$im = imagecreate(400, 30);

// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);

// The text to draw
$text = 'Testing...';
// Replace path by your own font path
$font = 'arial.ttf';

// Add some shadow to the text
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);

// Add the text
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);

// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?> [code]

If you're on a windows xp machine just go to C:WINDOWSFonts select your font (I just stuck with arial) and copy that into the directory of your web server.  I couldn't copy the file from inside windows explorer but my ftp client had no trouble. 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:1293, old post ID:26707[/size][/color]

Creating a dynamic signature

Posted: Sat May 07, 2005 5:04 am
by ZenithalRavage
Streety wrote: If you're on a windows xp machine just go to C:WINDOWSFonts select your font (I just stuck with arial) and copy that into the directory of your web server. I couldn't copy the file from inside windows explorer but my ftp client had no trouble.
Imagestring works for me too :)

I have uploaded arial.ttf to the same folder, even put that putenv GDFONTPATH in there but alas still nogo, I'm waiting what my host has to say about this....

Archived topic from Iceteks, old topic ID:1293, old post ID:26735

Creating a dynamic signature

Posted: Sat May 07, 2005 5:09 am
by Streety
Good old imagestring! :D

That imagettftext doesn't work even with the ttf file in the same folder for you is odd. That code worked perfectly for me. Hopefully your host will know what the problem is.

Archived topic from Iceteks, old topic ID:1293, old post ID:26737

Creating a dynamic signature

Posted: Sat May 07, 2005 7:38 am
by ZenithalRavage
Guest wrote: dynasig.net
that's pretty cewl, but I'm trying to make a dynamic sig with RSS feed.

I've tried altering the code I have to use imagestring instead of imagettftext, this made it to produce an image at least, but with only four zero's. Changing the feed does not help. I wonder if I can achieve this at all using imagestring. Any idea's?

http://www.a-base.dds.nl/sig_rss/rss_image_d.php
http://www.a-base.dds.nl/sig_rss/rss_image_d.txt <-code

Still haven't heard from my host....

Archived topic from Iceteks, old topic ID:1293, old post ID:26739

Creating a dynamic signature

Posted: Sat May 07, 2005 8:24 am
by ZenithalRavage
Hey I'm getting closer!

I had to rearrange the code a bit behind imagestring but at least it's taking info from the feed now!

http://www.a-base.dds.nl/sig_rss/rss_image_d.php
http://www.a-base.dds.nl/sig_rss/rss_image_d.txt <-code

woei!

Archived topic from Iceteks, old topic ID:1293, old post ID:26740

Creating a dynamic signature

Posted: Sat May 07, 2005 8:51 am
by ZenithalRavage
Sorry for posting again, but this imagestring isn't half bad, see what I baked in the oven:

http://www.a-base.dds.nl/sig_rss/zr_sig_rss.php :banana:

Archived topic from Iceteks, old topic ID:1293, old post ID:26741

Creating a dynamic signature

Posted: Sat May 07, 2005 9:19 am
by Streety
Hey, that is getting better! :)

The text starts to fade out a bit as it goes across into the darker background. You could try creating a shadow as in the script from the php.net site. Might make it a bit more clear.

Archived topic from Iceteks, old topic ID:1293, old post ID:26742

Creating a dynamic signature

Posted: Sat May 07, 2005 3:28 pm
by ZenithalRavage
Streety wrote: Hey, that is getting better! :)

The text starts to fade out a bit as it goes across into the darker background. You could try creating a shadow as in the script from the php.net site. Might make it a bit more clear.
thanx, well I lightend the background a bit more, this is pretty much how I want it ;)
sig's here don't allow hyperlinking an image that sucks but this is possible on almost every other site I'm on so there the image links to my site, pretty cool stuff B)

Archived topic from Iceteks, old topic ID:1293, old post ID:26749

Creating a dynamic signature

Posted: Mon May 09, 2005 2:11 pm
by ZenithalRavage
phew, Imagettftext works now! I got a reply from my webhost and all I had to do was put ./ infront of the fontname, so instead of:

$font = "arial.ttf";

this:

$font = "./arial.ttf";

sheesh :huh:

So if someone has similar problems and the host does not allow the GDFONTPATH command, this could be your solution ;)

Archived topic from Iceteks, old topic ID:1293, old post ID:26791