d2jsp
Log InRegister
d2jsp Forums > d2jsp > General Help > General Help Archive > How To Set Up An Image/signature Rotator > By Ichigokurosaki
Closed New Topic New Poll
Member
Posts: 15,893
Joined: Sep 16 2007
Gold: 12,025.00
Nov 30 2008 11:54am
How to set up a Image/Signature Rotator
by IchigoKurosaki

General Information:
This Guide will require a PHP supporting Webspace.The Script I will use in this Guide is written in PHP5. You have to find your own one, which wont be difficult since there are many free webhosters which are supporting PHP5, or find a friend who give u a little space/a folder in his webspace.

Step 1:

Create a new folder in your Webspace/in your Domain Control Panel.
eg.: yourdomain.com/signature.png
Yes, the folder is named Signature.png, just like an image.

Step 2:

Create a new text file in your new folder,
eg.: yourdomain.com/signature.png/url.txt
Now Edit the text file and write all direct links of the Signatures you want to rotate in the text file (IMPORTANT: ONE URL PER LINE)
Close and Save the Text file.

Step 3:

Create a new file (eg text file) and edit change the extension to .php .
IMPORTANT: it has to be named index.php
eg.: change yourdomain.com/signature.png/index.txt to yourdomain.com/signature.png/index.php

Step 4:

Now copy and paste this Script into your file index.php:
Code

<?php
Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
Header("Pragma: no-cache");
Header("Content-Type: image/gif");

$sigs = file("http://yourdomain.com/signature.png/url.txt");  // Change http://yourdomain.com/signature.png/url.txt to your address!!!
$rotate = $sigs[rand(0, count($sigs) - 1)];
$rotate = substr($rotate, 0, strlen($rotate) - 1);
readfile($rotate);
?>


Step 4 Explanation:
  • <?php icon_pointr.gif opens the php language
  • The "Header" Lines forces the image to not have Cache and to be a GIF image
    DO NOT TOUCH THESE LINES UNLESS YOU EXACTLY KNOW WHAT YOU'RE DOING
  • $sigs icon_pointr.gif a variable that will be the listing of your URL's in your url.txt File
    // icon_pointr.gif indicates a comment in the script
  • $rotate icon_pointr.gif will be hte link which will be replaced every time with yourdomain.com/signature.png
  • readfile icon_pointr.gif executes the script
  • ?> icon_pointr.gif closes the PHP-Scripting Part END OF FILE

Step 5:

Now you are finished with scripting. All you had to do is creating the url.txt and insert ur Signature direct links and create the index.php and copy-paste the script from the CodeBox.
To use the rotator, you have to insert this code into your Signature:

Code
[img]http://yourdomain.com/signature.png[/img]


just don't forget to change the example url "yourdomain.com" into the one you are using!

Hope i Could Help you all!


Best Regards

~IchigoKurosaki
Go Back To General Help Archive Topic List
Closed New Topic New Poll