• 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

Pages (3): 1 2 3 Next »
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  
Offline Grimly
04-23-2009, 02:49 PM,
#2
Member
Posts: 1,059
Threads: 82
Joined: May 2008

nice:D
Thanks for the tip

[Image: signature2b.png]
Taking what's yours since 816 A.S.
  Reply  
Offline Cyberanson
04-23-2009, 03:57 PM,
#3
Member
Posts: 1,555
Threads: 100
Joined: Mar 2008

If you want the easier method, I could also provide the files, so the only thing you have to do would be to upload them to your webspace and adding images.

ALG Waste Disposal
Faction Status - Recruitment - Message Dump
[Image: image.png]
Rheinland Military Information Center | Marinenachrichtendienst Central Computer
  Reply  
Offline Weedalot
04-23-2009, 05:45 PM,
#4
Member
Posts: 2,364
Threads: 38
Joined: Oct 2008

cool, so where do you set how much seconds it will take for it to switch?

♠ Because we can ♠
  Reply  
Offline Patriot
04-23-2009, 05:49 PM,
#5
Member
Posts: 537
Threads: 56
Joined: Oct 2007

' Wrote:cool, so where do you set how much seconds it will take for it to switch?



Thats a rotating signature by refreshing page.

  Reply  
Offline Cyberanson
04-23-2009, 06:03 PM,
#6
Member
Posts: 1,555
Threads: 100
Joined: Mar 2008

Patriot is right here. As this is a server-side PHP script, you have to refresh the page. Reload the picture without refreshing the page would require JavaScript, which isn't possible for this purpose.

ALG Waste Disposal
Faction Status - Recruitment - Message Dump
[Image: image.png]
Rheinland Military Information Center | Marinenachrichtendienst Central Computer
  Reply  
Offline Weedalot
04-23-2009, 08:00 PM,
#7
Member
Posts: 2,364
Threads: 38
Joined: Oct 2008

' Wrote:Patriot is right here. As this is a server-side PHP script, you have to refresh the page. Reload the picture without refreshing the page would require JavaScript, which isn't possible for this purpose.
oh i know that. i mean something else.... When you refresh it will it always change to the next one... In that site you mention it does not do it every time i refresh the page.

♠ Because we can ♠
  Reply  
Offline Cyberanson
04-23-2009, 09:18 PM,
#8
Member
Posts: 1,555
Threads: 100
Joined: Mar 2008

That's because I only have 3 images, yet. The rand() function pics one. So you have currently a 33,33% chance to get a certain picture.

ALG Waste Disposal
Faction Status - Recruitment - Message Dump
[Image: image.png]
Rheinland Military Information Center | Marinenachrichtendienst Central Computer
  Reply  
Offline Recoil9000
05-05-2009, 05:52 AM, (This post was last modified: 05-05-2009, 05:55 AM by Recoil9000.)
#9
Member
Posts: 413
Threads: 33
Joined: Feb 2009

where might i get the webspace to host the pictures?

[Image: recoil-1.png]
  Reply  
Offline Cyberanson
05-05-2009, 09:03 AM,
#10
Member
Posts: 1,555
Threads: 100
Joined: Mar 2008

Recoil, I sent you a PM about that.

To all others: I could provide you a subdomain on one of my servers, where you can store up to 10MB of pictures and access them via the random signature script.
Additionaly I could offer you to set up the system so that all you have to do is upload your pictures...

I would demand a reasonable amount of virtual money for this service.

ALG Waste Disposal
Faction Status - Recruitment - Message Dump
[Image: image.png]
Rheinland Military Information Center | Marinenachrichtendienst Central Computer
  Reply  
Pages (3): 1 2 3 Next »


  • 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