Station.com
Sign In Join Free Why Join?
Sony Online Entertainment
Community Store My Account Help
  Search   |   Recent Topics   |   Member Listing   |   Back to home page
Rollover signatures. Please help!
Search inside this topic:
The Matrix Online » Top » Support Forums » General Technical Help and Questions Previous Topic  |  Next Topic
Author Message


Perceptive Mind

Joined: Dec 1, 2005
Messages: 515
Location: UK
Offline

whats the code to implement two sigs to 'rollover' as they say i think..   any help much appreciated! adios!



Jacked Out

Joined: Aug 15, 2005
Messages: 4278
Offline

You'll need a php script and a server capable of running php. I don't think imageshack supports php as it just allows you to upload images, so you'll need your own website/domain that does allow the use of php. Unfortunately there are very very few such services that offer php for free.

If you do have the ability to use php then you can use a script such as this:

<?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);
}
}
?>

Which you then place in the same directory as the images you wish to "rotate." Then link to the php script for your sig by pointing to that as the image. Ie <img src="www.example.com/rotate.php">

Message edited by Chuui on 10/26/2006 05:07:01.


Systemic Anomaly

Joined: Aug 15, 2005
Messages: 2650
Location: --Everywhere-- Server: Vector - Hostile Faction: The Duality Organization: Zion
Offline

All that just for a little rotate? Screw that, Ill stick with stanionary ones.

 

Laters




Jacked Out

Joined: Aug 15, 2005
Messages: 4278
Offline

Well if you want to use a variety of different image types then the script needs to distinguish file extensions, but if you only use one type you could certainly cut most of that code out. If you don't expect to ever have any errors, you can cut another large chunk out.

Then if you only expect to use a common naming pattern such as Sig1.png Sig2.png etc. you could drasitically rewrite the image selection part too. But that "large" script (tiny in caomparison to ones I usually write) is capable of handling any file name and several file types.


Perceptive Mind

Joined: Dec 1, 2005
Messages: 515
Location: UK
Offline

thankyou very much chuui for your time and help.. but to be honest i havent a clue as to how and where to do any of that...

 

i think what i  actually meant was i wanted a 'rotator' code simply to randomly go between two different sigs...  surely theres a simple bit of code to put in my sig or something that will choose one of two pics randomly?

 

also i dont seem to have an option to add an avatar SMILEY




Systemic Anomaly

Joined: Aug 19, 2005
Messages: 3225
Location: United Kingdom
Offline

452x5 wrote:

i think what i  actually meant was i wanted a 'rotator' code simply to randomly go between two different sigs...  surely theres a simple bit of code to put in my sig or something that will choose one of two pics randomly?


mxoresource do a free rotation service *shrugs* thought you would have known since RMC merged with them and all...
log in, top left corner click settings, then down the bottom you should have 5 input boxes,
insert the URLS to where you uploaded your sigs copy the url it gives to you.

then in your profile you want <img src="http://mxoresource.com/rotator/yourmxoresourceusernamehere/">



/edit  about your avatar, you shoudl beable to on the 1st december (1year on forums point)

Message edited by UniToxic on 10/27/2006 03:13:05.



Jacked Out

Joined: Aug 15, 2005
Messages: 4278
Offline

i think what i  actually meant was i wanted a 'rotator' code simply to randomly go between two different sigs...  surely theres a simple bit of code to put in my sig or something that will choose one of two pics randomly?

Yeah there is, the code I listed in this topic =D But things like that are never simple as it requires a server-side language to run it (in this case I used PHP for that) but the SOE servers can't run the script for you, so you need a server that can and will host the images for you. That's pretty much what Resource will be doing, using a script like the one I posted here but with another section of code to work out for who the images need to be fetched (hence the need for your MXOResourcename in the URL).

 
The Matrix Online » Top » Support Forums » General Technical Help and Questions
Go to:   

Version 2.2.7.43