Creating a dynamic signature
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
Archived topic from Iceteks, old topic ID:1293, old post ID:15247
Honk if you love Jesus, text if you want to meet Him!
Creating a dynamic signature
how about a way that works with most versions of php?
Archived topic from Iceteks, old topic ID:1293, old post ID:15256
Archived topic from Iceteks, old topic ID:1293, old post ID:15256
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
<?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
Honk if you love Jesus, text if you want to meet Him!
Creating a dynamic signature
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
Archived topic from Iceteks, old topic ID:1293, old post ID:15269
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
It's covered in the article. 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
Archived topic from Iceteks, old topic ID:1293, old post ID:15270
Honk if you love Jesus, text if you want to meet Him!
Creating a dynamic signature
yeah, but your talking about a new easier way to do it, and you know the first method didn't work for me.Red Squirrel wrote: It's covered in the article. 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:15302
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
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
Honk if you love Jesus, text if you want to meet Him!
Creating a dynamic signature
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
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
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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.
Archived topic from Iceteks, old topic ID:1293, old post ID:15445
Archived topic from Iceteks, old topic ID:1293, old post ID:15445
Honk if you love Jesus, text if you want to meet Him!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
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
Honk if you love Jesus, text if you want to meet Him!
Creating a dynamic signature
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
Archived topic from Iceteks, old topic ID:1293, old post ID:15454
Creating a dynamic signature
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
thanks
Archived topic from Iceteks, old topic ID:1293, old post ID:18744
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
Archived topic from Iceteks, old topic ID:1293, old post ID:18748
Honk if you love Jesus, text if you want to meet Him!
Creating a dynamic signature
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
thanks for helping me out I really apreciate it
Archived topic from Iceteks, old topic ID:1293, old post ID:18755
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
Archived topic from Iceteks, old topic ID:1293, old post ID:18756
Honk if you love Jesus, text if you want to meet Him!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
Archived topic from Iceteks, old topic ID:1293, old post ID:19437
Honk if you love Jesus, text if you want to meet Him!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
Cool, glad to see you got it working.
Archived topic from Iceteks, old topic ID:1293, old post ID:19439
Archived topic from Iceteks, old topic ID:1293, old post ID:19439
Honk if you love Jesus, text if you want to meet Him!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
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
Honk if you love Jesus, text if you want to meet Him!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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.
Archived topic from Iceteks, old topic ID:1293, old post ID:19543
Archived topic from Iceteks, old topic ID:1293, old post ID:19543
Honk if you love Jesus, text if you want to meet Him!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
Archived topic from Iceteks, old topic ID:1293, old post ID:19746
Honk if you love Jesus, text if you want to meet Him!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
Archived topic from Iceteks, old topic ID:1293, old post ID:21008
Honk if you love Jesus, text if you want to meet Him!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
Archived topic from Iceteks, old topic ID:1293, old post ID:21013
Honk if you love Jesus, text if you want to meet Him!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
Archived topic from Iceteks, old topic ID:1293, old post ID:22716
Honk if you love Jesus, text if you want to meet Him!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Creating a dynamic signature
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
Archived topic from Iceteks, old topic ID:1293, old post ID:22926
Honk if you love Jesus, text if you want to meet Him!
Creating a dynamic signature
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]