• Home
  • Index
  • Search
  • Download
  • Server Rules
  • House Roleplay Laws
  • Player Utilities
  • Player Help
  • Forum Utilities
  • Returning Player?
  • Toggle Sidebar
Interactive Nav-Map
Tutorials
New Wiki
ID reference
Restart reference
Players Online
Player Activity
Faction Activity
Player Base Status
Discord Help Channel
DarkStat
Server public configs
POB Administration
Missing Powerplant
Stuck in Connecticut
Account Banned
Lost Ship/Account
POB Restoration
Disconnected
Member List
Forum Stats
Show Team
View New Posts
View Today's Posts
Calendar
Help
Archive Mode




Hi there Guest,  
Existing user?   Sign in    Create account
Login
Username:
Password: Lost Password?
 
  Discovery Gaming Community The Community Media Center
« Previous 1 … 155 156 157 158 159 … 216 Next »
Rotating banner signature

Server Time (24h)

Players Online

Active Events - Scoreboard

Latest activity

Rotating banner signature
Offline Cyberanson
04-23-2009, 02:19 PM,
#1
Member
Posts: 1,555
Threads: 100
Joined: Mar 2008

Because I can't stand services like clintonio.com, I decided to create my own rotating signature set. Here's the way it's done:

1. prerequisites
For this rotating signature you need:
  1. some webspace
  2. an enabled mod_rewrite Apache module
  3. a working PHP interpreter
2. the code
All the things which follow can be accomplished with an IDE of your choice or simply Notepad.

Copy this code into a fresh file:
Code:
<IfModule mod_rewrite.c>
&nbsp;&nbsp;&nbsp;&nbsp;RewriteEngine on

&nbsp;&nbsp;&nbsp;&nbsp;RewriteRule ^image\.png$ image.php
&nbsp;&nbsp;&nbsp;&nbsp;
</IfModule>
This means, that your webserver will change all requests to http://mydomain.com/image.png to http://mydomain.com/image.php. This is needed, because IPB only handles image file types in signatures. You could also choose .jpg or .gif.

Save this file as .htaccess.

Next one. Create a new file and put this in it:
Code:
<?php

foreach (glob("*.png") as $filename) {
&nbsp;&nbsp;&nbsp;&nbsp;$img[] = $filename;
}

header("Content-Type: image/png");
readfile($img[rand(0,sizeof($img)-1)]);

?>
Explanation: $img is an array of image file names which is located in the current directory. Upload as many files as you wish. The only important point: the filetype has to match the given value.

The next line has to be changed, according to your images. If you prefer jpg, use this:
Code:
header("Content-Type: image/jpg");
The system should be clear.

Save this file as image.php.

Now load both files into a directory of your choice on your webserver. Copy as many image files of your preferred type into the same directory.

After you finished, change your signature to something like this:
Code:
http://mydomain.com/directory/image.png

And voila... you should have a beautifuly rotating signature.

Saving traffic
In order to use external URLs for your images, just use this code in your image.php:
Code:
<?php

$file = array(
&nbsp;&nbsp;&nbsp;&nbsp;"<put image url here>",
&nbsp;&nbsp;&nbsp;&nbsp;"<put image url here>"
);

header("Content-Type: image/png");
readfile($file[rand(0,sizeof($file)-1)]);

?>

Add as many URLs as you like, works the same and saves your server traffic.

If you have questions or problems... just ask here.

ALG Waste Disposal
Faction Status - Recruitment - Message Dump
[Image: image.png]
Rheinland Military Information Center | Marinenachrichtendienst Central Computer
  Reply  


Messages In This Thread
Rotating banner signature - by Cyberanson - 04-23-2009, 02:19 PM
Rotating banner signature - by Grimly - 04-23-2009, 02:49 PM
Rotating banner signature - by Cyberanson - 04-23-2009, 03:57 PM
Rotating banner signature - by Weedalot - 04-23-2009, 05:45 PM
Rotating banner signature - by Patriot - 04-23-2009, 05:49 PM
Rotating banner signature - by Cyberanson - 04-23-2009, 06:03 PM
Rotating banner signature - by Weedalot - 04-23-2009, 08:00 PM
Rotating banner signature - by Cyberanson - 04-23-2009, 09:18 PM
Rotating banner signature - by Recoil9000 - 05-05-2009, 05:52 AM
Rotating banner signature - by Cyberanson - 05-05-2009, 09:03 AM
Rotating banner signature - by Cyberanson - 06-30-2009, 06:52 PM
Rotating banner signature - by Birdtalon - 06-30-2009, 06:53 PM
Rotating banner signature - by Cyberanson - 09-17-2009, 12:23 PM
Rotating banner signature - by Akura - 09-17-2009, 01:35 PM
Rotating banner signature - by Cyberanson - 09-17-2009, 02:23 PM
Rotating banner signature - by Cyberanson - 10-02-2009, 08:32 AM
Rotating banner signature - by Cyberanson - 01-21-2010, 05:14 PM
Rotating banner signature - by schlurbi - 01-25-2010, 04:05 PM
Rotating banner signature - by Not Espi - 01-25-2010, 04:21 PM
Rotating banner signature - by Waratah - 01-25-2010, 04:50 PM
Rotating banner signature - by Lux - 01-25-2010, 04:57 PM

  • View a Printable Version
  • Subscribe to this thread


Users browsing this thread:
1 Guest(s)



Powered By MyBB, © 2002-2025 MyBB Group. Theme © 2014 iAndrew & DiscoveryGC
  • Contact Us
  •  Lite mode
Linear Mode
Threaded Mode