Page 4 of 5

Creating a dynamic signature

Posted: Sat Dec 27, 2003 4:39 pm
by Red Squirrel
I don't think it's possible, the way you mentioned would probably be the best way.

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

Creating a dynamic signature

Posted: Sun Dec 28, 2003 2:59 am
by wldkos
how about a way that works ;) with most versions of php?

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

Creating a dynamic signature

Posted: Sun Dec 28, 2003 1:08 pm
by Red Squirrel
I can't see why this would not work, did you at least try it?

<?php
$random = rand(1,10);
header("Cache-Control: no-cache, must-revalidate, no-store");
header("Location: http://whatever/sig/sig".$random...ot;.jpg");
?>

And don't forget there's way more to it then the code, you need to do the .htaccess thing and make it point to a normal folder jpg files and you also have to rename the php file to .jpg, as the .htaccess will make .jpg parse as php, which is why you don't want the real pictures in there.

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

Creating a dynamic signature

Posted: Sun Dec 28, 2003 2:08 pm
by wldkos
well you say there is way more to this, so why not show me the whole way. It will help me and everyone else as well, that doesn't know php.

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

Creating a dynamic signature

Posted: Sun Dec 28, 2003 2:12 pm
by Red Squirrel
It's covered in the article. :P This is the thread for feedback, there's a link on the first post, that's the article...

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

Creating a dynamic signature

Posted: Mon Dec 29, 2003 3:15 am
by wldkos
Red Squirrel wrote: It's covered in the article. :P This is the thread for feedback, there's a link on the first post, that's the article...
yeah, but your talking about a new easier way to do it, and you know the first method didn't work for me.

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

Creating a dynamic signature

Posted: Mon Dec 29, 2003 1:15 pm
by Red Squirrel
The rest is the same, it's just the code that changed. The code in the article is just one way of doing it. All you need is a way to determine what image to show, and show that image (header location etc). That's all you really need.

I think it's something with your .htaccess, or your putting the wrong path or something. Try clearning your .jpg php file and just put header("location: http://site.com/file.jpg"); and if that does not work, then the problem is with your .htaccess or path.

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

Creating a dynamic signature

Posted: Sun Jan 04, 2004 6:30 pm
by wldkos
no offense red
http://www.hotscripts.com/Detailed/19369.html

Im gonna try this, and see how similar it is.

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

Creating a dynamic signature

Posted: Sun Jan 04, 2004 7:25 pm
by Red Squirrel
You still can't get mine to work? It's not really that complicated. I was going to check out the one you posted but I can't even find a download link. :grade11math:

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

Creating a dynamic signature

Posted: Sun Jan 04, 2004 7:28 pm
by Red Squirrel
nevermind found it - you need to go to their site to get it.

This script is different though, you need to <?php include ?> it which won't work in bb code. But the rest of the script is pretty much the same idea.

I think they part you're getting wrong is the .htaccess or something. The .jpg file has to be parsed as php, and the real images must be in a *different* folder - and not a subfolder of that one either, but completly different.

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

Creating a dynamic signature

Posted: Mon Jan 05, 2004 11:52 am
by wldkos
Yeah I noticed that, but I was gonna use it for a site anyways.

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

Creating a dynamic signature

Posted: Mon Apr 05, 2004 6:46 pm
by Anonymous
Hi I have read about 50 different tutorils on how to do this and i also use 3 servers one is windows 2000 with GD librbary one is unix without GD and 3rd is linux with GD librbary turned on and every time i try no matter which server when in your example i followed to the T and when i open the siggy.jpg or i tried renaming it to png when i go to the file on the net I get the actual code just displays on the screen like it was typed there. I have the .htaccess file up don't know if that is my problem I have it exactly as u do and also another way for file specific that i found on another tutuorial. Is their any way you can send send me or upload the source files so I can pick at them or see if I can even do it with my servers? any help would be great sorry for ^^^so long
thanks

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

Creating a dynamic signature

Posted: Mon Apr 05, 2004 7:42 pm
by Red Squirrel
Try putting invalid stuff in the .htaccess to see if you get an internal server error, if not, it means it's not reading the .htaccess for some reason. It could be that the global settings have allowoverride set to no.

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

Creating a dynamic signature

Posted: Tue Apr 06, 2004 1:07 am
by Anonymous
well I tried what u said and nothing chained no error when i went to the folder or when I loded a html page from that folder just opened like their was no .htaccess file but I don't know where or even if I can since I only have 100% control on one of the servers about chainging the global setting
thanks for helping me out I really apreciate it

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

Creating a dynamic signature

Posted: Tue Apr 06, 2004 8:44 am
by Red Squirrel
It could either be the global setting, or maybe another .htaccess in a parant folder that is not allowing you to override settings in any subdirectory.

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

Creating a dynamic signature

Posted: Sun May 02, 2004 8:47 pm
by Red Squirrel
Yeah if you have a .htaccess file with allow override turned off it can cause problems.

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

Creating a dynamic signature

Posted: Sun May 02, 2004 9:42 pm
by Red Squirrel
Cool, glad to see you got it working. :D

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

Creating a dynamic signature

Posted: Fri May 07, 2004 9:30 pm
by Red Squirrel
Check these lines in the code:

20:$color = imagecolorallocate($im, 255, 255, 255); //rgb color
27:imagestring($im, 2, $px, $py+12, $string2, $color);

If I remember correctly, the 2 is the font size.

Not sure how to change the font itself. I know with GD you don't have a large selection and I'm not sure if it's possible to add some or not.



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

Creating a dynamic signature

Posted: Fri May 07, 2004 9:32 pm
by Red Squirrel
Whoops wrong thread, this is for the sig that changes and not the text sig. You can use a combination of both too though, have the image change AND the text. :D

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

Creating a dynamic signature

Posted: Wed May 19, 2004 5:50 pm
by Red Squirrel
What do you mean? Like make it go to a site? Just use the link tags of the forum you're in. Here it would be [ url= ] [ img ] sig [/ img ] [ /url ] without the spaces.

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

Creating a dynamic signature

Posted: Sun Jul 25, 2004 8:30 pm
by Red Squirrel
What exactly is the problem? Does it just not work? If that's the case make sure you have allow override yes in the main configuration. That's a common issue since it can be easly forgotten or not known of.

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

Creating a dynamic signature

Posted: Mon Jul 26, 2004 6:12 pm
by Red Squirrel
Strange, I'm really not sure then. Put <?php echo("hello world"); ?> in a .jpg file and run it. If it works properly you should get "hello world" and if there's a problem you'll get the code.

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

Creating a dynamic signature

Posted: Wed Oct 20, 2004 7:54 pm
by Red Squirrel
Actually I should rewrite that article since I did not know about the rand() function then, basically it returns a random number between a specified range. So if you go $var = rand(0,5); it will return a number between 0 and 5. So instead of the text file stuff rand would be much better to use. Not sure what I was thinking by making it use a text file.

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

Creating a dynamic signature

Posted: Sat Oct 30, 2004 9:45 pm
by Red Squirrel
Just modify that code, instead of using the file handling stuff use rand(). I'd also recomend you read the php for starters tutorial to better understand the code.

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

Creating a dynamic signature

Posted: Sun Oct 31, 2004 1:36 am
by Eine

Code: Select all

<?php 
//read folder 
$folder=opendir("." ); 

$names = Array(); 

while ($file = readdir($folder)) 
    $names[count($names)] = $file; 

closedir($folder); 

//sort file names in array 
sort($names); 

//remove any non-images from array 
$tempvar = 0; 
foreach ($names as $name) 
{ 
    $ext = strtolower(substr($name,-4)); 
    if ($ext==".jpg"||$ext==".gif"||$ext=="jpeg"||$ext==".png" ) 
        $names1[] = $name; 
} 
//random 
srand ((double) microtime() * 10000000); 
$rand_keys = array_rand ($names1, 2); 
//random image from array 
$slika = $names1[$rand_keys[0]]; 
//image dimensions 
$dimensions = GetImageSize($slika); 
header ("Location:  [B]<yourserver.com/>sigfolder.jpg[/B]//$slika" ) 
?> 
[code]

Thats the code I use.  stick that in a .php file (open notepad, copy/paste that, save it as a .php) and upload that into a folder named "sigfolder.jpg".  Now change the bolded text to your sever info.  Stick any images you want in the rotation inside of the sig folder along with the php file named "index.php"


in your sig, put "<yourserver>.com/sigfolder.jpg"   (NO "/" after the .jpg) 

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