Jump to content



Photo

Random Sigs


  • Please log in to reply
48 replies to this topic

#1 RaQ

RaQ

    I'm.. Me!

  • Joined: 24-April 02
  • Location: stafford, virignia

Posted 09 November 2002 - 03:28

I have one signature, soon to be a couple, in http://www.alexkelm.com/signatures/

Now i've seen people, like timdorr, using those "PHP sigs" well php is enabled on my account but i don't understand how?

How can I setup my profile on Neowin for signature, to randomly roate through the signatures (all *.pngs) in /signatures/ and exclude the ones from /source/ :D

Thanks so much.
- Alex


#2 Keldyn

Keldyn

    Neowinian Senior

  • Joined: 26-September 01

Posted 09 November 2002 - 03:37

Thread moved to Web programming support

There was a dedicated thread to this topic a while back. I wonder what happened to it :unsure: One of the php gurus will be sure to help you out.

#3 Prasanth

Prasanth

    Neowinian Senior

  • Joined: 02-March 02

Posted 09 November 2002 - 03:40

$URL1="sigs/sig1.jpg";
$URL2="sigs/sig2.jpg";
$URL3="sigs/sig3.jpg";

srand((double) microtime() * 1000000);
$random = rand(1,3);

if($random == 1)
@header ("Location: $URL1");
elseif ($random == 2)
@header ("Location: $URL2");
elseif ($random == 3)
@header ("Location: $URL3");
?>

#4 Daniel F.

Daniel F.

    Deputy Head

  • Tech Issues Solved: 1
  • Joined: 10-July 01
  • Location: UK
  • OS: Windows 8
  • Phone: Android 4.2.2

Posted 09 November 2002 - 03:41

to make a php sig:

name ur pics 1.gif, 2.gif ...... 5.gif

Put them in a folder called "sig"

then copy & paste into notepage

<?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"); 
srand((double)microtime()*1000000); 

$i = 0; 
$dir = opendir("sig/"); 
while(($im = readdir($dir))) { 
    if($im != ".." && $im != "."){ 
       $image[$i] = $im; 
       $i++; 
    } 
}  
closedir($dir); 

$len = count($image)-1; 
$n = rand(0,$len); 

if(!readfile("sig/".$image[$n])){ 
   readfile("icons/error.gif"); 
} 

?>

save as sig.php and place in the main dir so the images folder is below/sub dir

then call it via html/bb code

example [*img*]mysig.php[*/img*] remove *

#5 dayle

dayle

    Neowinian

  • Joined: 09-April 02

Posted 09 November 2002 - 04:02

does this php thing work with all accounts on neowin

#6 Daniel F.

Daniel F.

    Deputy Head

  • Tech Issues Solved: 1
  • Joined: 10-July 01
  • Location: UK
  • OS: Windows 8
  • Phone: Android 4.2.2

Posted 09 November 2002 - 06:46

yes im using a php sig.












P.S Yes i know the dx pic doesnt look right and i need to change it ok ;)

#7 Ricky Baby

Ricky Baby

    Yurp

  • Joined: 01-July 02

Posted 09 November 2002 - 11:35

thx for the code voodoo - im just making some extra sigs to use it

#8 Ricky Baby

Ricky Baby

    Yurp

  • Joined: 01-July 02

Posted 09 November 2002 - 13:12

does the sig.php need to be on a php enabled server by any chance or will newin server parse it?

#9 vetMr magoo

Mr magoo

    Neowinian

  • Joined: 29-September 01

Posted 09 November 2002 - 13:33

atm i dont think you can do it due to using invision.

#10 kairon

kairon

    Best.Game.Ever.

  • Joined: 03-February 02
  • Location: Currently: US In a year and a half: U.K or Canada

Posted 09 November 2002 - 13:40

does the sig.php need to be on a php enabled server by any chance or will newin server parse it?

Uh, php code is all server side, meaning the server that the PHP is on, so in short, no, neowin will not parse it and you need your own php enabled server.

#11 vetMr magoo

Mr magoo

    Neowinian

  • Joined: 29-September 01

Posted 09 November 2002 - 13:48

sorry

ill rephrase that- last week we had it set so php sigs werent working- but now its been changed.

#12 Ricky Baby

Ricky Baby

    Yurp

  • Joined: 01-July 02

Posted 09 November 2002 - 13:55

Uh, php code is all server side, meaning the server that the PHP is on, so in short, no, neowin will not parse it and you need your own php enabled server.

okay

i know about php but i was wondering on the case of this as it could be this server doing it

ive got a choice of where to put it if neowin parsed it for me

#13 OP RaQ

RaQ

    I'm.. Me!

  • Joined: 24-April 02
  • Location: stafford, virignia

Posted 09 November 2002 - 19:53

For PNG's,

<?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/png"); 
srand((double)microtime()*1000000);
$i = 0; 
$dir = opendir("/YOUR DIRECTORY/"); 
while(($im = readdir($dir))) { 
   if($im != ".." && $im != "."){ 
      $image[$i] = $im; 
      $i++; 
   } 
}  
closedir($dir); 
$len = count($image)-1; 
$n = rand(0,$len); 
if(!readfile("/YOUR DIRECTORY/".$image[$n])){ 
  readfile("/YOUR DIRECTORY/random.png"); 
} 
?>

:yes:

i did it! see


what theres no upside down arrow? well just look down.

#14 Ricky Baby

Ricky Baby

    Yurp

  • Joined: 01-July 02

Posted 09 November 2002 - 22:48

yea ive got mine working aswell

#15 IanD

IanD

    SX Junkie

  • Joined: 12-April 02
  • Location: Atlanta

Posted 10 November 2002 - 00:00

i think ima gunna use it too! :D



Click here to login or here to register to remove this ad, it's free!