Log in

View Full Version : Randomised Signature [SAMPLE]



timROGERS
09-02-2007, 06:10 PM
Here is an example of how to make a randomised signature, that works with vBulletin's URL filtering (I am using it right now):


<?php
// NintendoNews on HabboxForum
// Minimalistic Lyrics Signature

$random = rand(1,4); // How many signature do you want to pick from? Replace 4 with the number


// Make an if statement like this for each signature, replacing
// "1" with the number of signature, and for example symphony.gif
// with yoursignature.gif
if ($random == 1)
{
header("Location: symphony.gif");
}
if ($random == 2)
{
header("Location: ruby.gif");
}
if ($random == 3)
{
header("Location: crymeariver.gif");
}
if ($random == 4)
{
header("Location: iwrotethegospel.gif");
}
?>

The comments should be self-explanatory. Now, to make it work with HabboxForum, assuming you have saved the above as signature.php, make a file called ".htaccess" and put the following in it:


RewriteEngine on
RewriteRule ^signature\.gif$ signature.php

What that does it makes it so that whenever the server detects you accessing signature.gif, it will send you to signature.php, which will then redirect you to the image. Then, you can put it into your signature in the normal way, just use the normal BBCODE, but link to the actually non-existent signature.gif :)

ColyTom
12-02-2007, 04:15 PM
That is a good guide, well done + Rep

F32
12-02-2007, 09:16 PM
Good work - does it work with av's?

I wouldn't of thought so.

Invent
12-02-2007, 09:18 PM
<?
//Chooses a random number
$num = Rand (1,6);
//Based on the random number, gives an image
switch ($num)
{
case 1:
echo "gd/reviewdude.php?text=OMG IYAR!!!! lolol ^_^";
break;
case 2:
echo "gd/reviewdude.php?text=Simon pwns j00";
break;
case 3:
echo "gd/reviewdude.php?text=Check out the poll!";
break;
case 4:
echo "gd/reviewdude.php?text=Becs FTW!";
break;
case 5:
echo "gd/reviewdude.php?text=SUPERLOVE...ZAP!";
break;
case 6:
echo "gd/reviewdude.php?text=Welcome to v5 (:";
}
?>


Same job just a different code ;p

Nice guide Tim.

nets
13-02-2007, 11:34 AM
<?
//Chooses a random number
$num = Rand (1,6);
//Based on the random number, gives an image
switch ($num)
{
case 1:
echo "gd/reviewdude.php?text=OMG IYAR!!!! lolol ^_^";
break;
case 2:
echo "gd/reviewdude.php?text=Simon pwns j00";
break;
case 3:
echo "gd/reviewdude.php?text=Check out the poll!";
break;
case 4:
echo "gd/reviewdude.php?text=Becs FTW!";
break;
case 5:
echo "gd/reviewdude.php?text=SUPERLOVE...ZAP!";
break;
case 6:
echo "gd/reviewdude.php?text=Welcome to v5 (:";
}
?>


Same job just a different code ;p

Nice guide Tim.
no that isn't the same principle? and you could just create a random string in the reviewdude.php file :/

Dentafrice1
14-02-2007, 03:05 AM
Nice guide but why not just echo the image instead of header?

timROGERS
14-02-2007, 10:45 AM
Afaik, you can't echo images - I think you'd have to use GD functions to do it, which I could but there's no point, headers do the job.

Dentafrice1
14-02-2007, 12:26 PM
echo "<img src=1.gif>";

you cant echo an image? :\

nets
14-02-2007, 12:40 PM
echo "<img src=1.gif>";

you cant echo an image? :\
...and that will work in your signature, how?

Dentafrice1
14-02-2007, 11:39 PM
...and that will work in your signature, how?


<?php
// NintendoNews on HabboxForum
// Minimalistic Lyrics Signature

$random = rand(1,4); // How many signature do you want to pick from? Replace 4 with the number


// Make an if statement like this for each signature, replacing
// "1" with the number of signature, and for example symphony.gif
// with yoursignature.gif
if ($random == 1)
{
echo "<img src=symphony.gif>";
}
if ($random == 2)
{
echo "<img src=symphony.gif>";
}
if ($random == 3)
{
echo "<img src=symphony.gif>";
}
if ($random == 4)
{
echo "<img src=symphony.gif>";
}
?>


;)

Like this: http://giantpanel.co.uk/test.php

Voldemort
15-02-2007, 12:20 AM
<?php
// NintendoNews on HabboxForum
// Minimalistic Lyrics Signature

$random = rand(1,4); // How many signature do you want to pick from? Replace 4 with the number


// Make an if statement like this for each signature, replacing
// "1" with the number of signature, and for example symphony.gif
// with yoursignature.gif
if ($random == 1)
{
echo "<img src=symphony.gif>";
}
if ($random == 2)
{
echo "<img src=symphony.gif>";
}
if ($random == 3)
{
echo "<img src=symphony.gif>";
}
if ($random == 4)
{
echo "<img src=symphony.gif>";
}
?>
;)

Like this: http://giantpanel.co.uk/test.php
no, he means doing
giantpanel.co.uk/test.php

He wants to use this as a forum signature.

Want to hide these adverts? Register an account for free!