0 members and 1,322 guests
No Members online
» Site Navigation
» Stats
Members: 35,443
Threads: 103,072
Posts: 826,684
Top Poster: cc.RadillacVIII (7,429)
|
-
Randomizing Tag
I have been asked a lot how I get my tag to change all the time, so I will just post how to do it.
First, you need to have access to a host that you can put all the tags you want within 1 folder, and it has to be able to handle PHP files.
Create a folder that will contain all your images, and the PHP file, which you can name anything that you want. Upload all the tags you want to be randomized within it, and create a PHP file named tag.php.
Within the PHP file, you will have to put the following code:
PHP Code:
<?php
$folder = '.';
$extList = array();
$extList['gif'] = 'image/gif';
$extList['jpg'] = 'image/jpeg';
$extList['jpeg'] = 'image/jpeg';
$extList['png'] = 'image/png';
$img = null;
if (substr($folder,-1) != '/') {
$folder = $folder.'/';
}
if (isset($_GET['img'])) {
$imageInfo = pathinfo($_GET['img']);
if (
isset( $extList[ strtolower( $imageInfo['extension'] ) ] ) &&
file_exists( $folder.$imageInfo['basename'] )
) {
$img = $folder.$imageInfo['basename'];
}
} else {
$fileList = array();
$handle = opendir($folder);
while ( false !== ( $file = readdir($handle) ) ) {
$file_info = pathinfo($file);
if (
isset( $extList[ strtolower( $file_info['extension'] ) ] )
) {
$fileList[] = $file;
}
}
closedir($handle);
if (count($fileList) > 0) {
$imageNumber = time() % count($fileList);
$img = $folder.$fileList[$imageNumber];
}
}
if ($img!=null) {
$imageInfo = pathinfo($img);
$contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ];
header ($contentType);
readfile($img);
} else {
if ( function_exists('imagecreate') ) {
header ("Content-type: image/png");
$im = @imagecreate (100, 100)
or die ("Cannot initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 0,0,0);
imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color);
imagepng ($im);
imagedestroy($im);
}
}
?>
Now, when adding this into your signature, just use the image tags like normal, but instead of linking it to a picture, link to the php file, and add /image.jpg to the end of it to disguise it as an image file. So it will look something like:
http://www.website.com/images/tag.php/image.jpg.
That is all there is too it.
Commissions and stickers available via linktree here.
-
oh
i thought you just had a new one like everyday LOL
-
Lol, even though I noticed, because I always take the time to look at your work , I hadn't really thought about it.
Just me being brainless; ooh, it changed, but I never really got to; huh, what changed?
Thanks for sharing!
-
I get a lot of questions about my tag, asking how it does it, if it is just me constantly putting a different one, or what, so I just thought I would be nice and post how I did it.
Commissions and stickers available via linktree here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|