Random Image Block Working Prob

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Random Image Block Working Prob
Neoszion
CZ Super Newbie
 Codezwiz Site Donator
Neoszion has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Web Designer
Age: 45
Gender: Male
Fav. Sports Team: Liverpool
Website:
Status: Offline
Joined: Sep 02, 2004
0.01 posts per day
Posts: 92
Points: 10,111
   
Hi there,

I got this block from here a while back and havent been able to operate it properly yet I am writting in the code 100% right but with still no joy pics not even a thumbnail... if anyone has any insite please let me know

Heres the block code

<?php
/********************************************************/
/* Random Image Block                                   */
/* Version 1.0.0         8-02-04                        */
/* By: Telli (telli@codezwiz.com)                       */
/* http://codezwiz.com/                                 */
/* Copyright © 2001-2004 by Codezwiz                    */
/********************************************************/
if( eregi( "block-Random_Image.php",$PHP_SELF ) ) {
   Header( "Location: index.php" );
   die();
}
function Seed() {
   list($usec, $sec) = explode(' ', microtime());
   return (float) $sec + ((float) $usec * 100000);
}

//Add your image in this format <img src= you can also use links.
function ImageShow($whichimage) {
   switch($whichimage)
   {       
      case 1:
         return "<img src=images/ss/1.jpg";
      break;
      case 2:
         return "<!---ADD IMAGE #2 HERE----->";
      break;
      case 3:
         return "<!---ADD IMAGE #3 HERE----->";
      break;
      case 4:
         return "<!---ADD IMAGE #4 HERE----->";
      break;
      case 5:
         return "<!---ADD IMAGE #5 HERE----->";
      break;
      case 6:
         return "<!---ADD IMAGE #6 HERE----->";
      break;
      case 7:
         return "<!---ADD IMAGE #7 HERE----->";
      break;
      case 8:
         return "<!---ADD IMAGE #8 HERE----->";
      break;
      case 9:
         return "<!---ADD IMAGE #9 HERE----->";
      break;
      case 10:
         return "<!---ADD IMAGE #10 HERE----->";
      break;
      case 11:
         return "<!---ADD IMAGE #11 HERE----->";
      break;
      case 12:
         return "<!---ADD IMAGE #12 HERE----->";
      break;
      case 13:
         return "<!---ADD IMAGE #13 HERE----->";
      break;
      case 14:
         return "<!---ADD IMAGE #14 HERE----->";
      break;
      case 15:
         return "<!---ADD IMAGE #15 HERE----->";
      break;
     
   }
}

srand(Seed());
$randimage = rand(1,15);

$show = "<table width=\"100%\">\n<tr>\n<td align=center>\n";
$show = $show . ImageShow($randimage);
$show = $show . "</td>\n</tr>\n</table>\n";
$content = $show;
?>



Back to top Reply with quote
#2   Re: Random Image Block Working Prob
madman
CZ Moderator
madman has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Dec 06, 2004
0.00 posts per day
Posts: 21
Points: 1,234
 Yahoo Messenger  


Originally posted by Neoszion @ Tue Dec 21, 2004 11:35 am:

Hi there,

I got this block from here a while back and havent been able to operate it properly yet I am writting in the code 100% right but with still no joy pics not even a thumbnail... if anyone has any insite please let me know

Did you set up all those image tags properly?
As an example, here the modified code taken from above, using common generic image files that came with phpnuke. You may change the image path later if you wish.

<?php
/********************************************************/
/* Random Image Block                                   */
/* Version 1.0.0         8-02-04                        */
/* By: Telli (telli@codezwiz.com)                       */
/* http://codezwiz.com/                                 */
/* Copyright © 2001-2004 by Codezwiz                    */
/********************************************************/
if( eregi( "block-Random_Image.php",$PHP_SELF ) ) {
   Header( "Location: index.php" );
   die();
}
function Seed() {
   list($usec, $sec) = explode(' ', microtime());
   return (float) $sec + ((float) $usec * 100000);
}

//Add your image in this format <img src= you can also use links.
function ImageShow($whichimage) {
   switch($whichimage)
   {       
      case 1:
         return '<img border="0" src="images/left.gif" />';
      break;
      case 2:
         return '<img border="0" src="images/right.gif" />';
      break;
      case 3:
         return '<img border="0" src="images/up.gif" />';
      break;
      case 4:
         return '<img border="0" src="images/down.gif" />';
      break;
      case 5:
         return '<img border="0" src="images/left.gif" />';
      break;
      case 6:
         return '<img border="0" src="images/right.gif" />';
      break;
      case 7:
         return '<img border="0" src="images/up.gif" />';
      break;
      case 8:
         return '<img border="0" src="images/down.gif" />';
      break;
      case 9:
         return '<img border="0" src="images/left.gif" />';
      break;
      case 10:
         return '<img border="0" src="images/right.gif" />';
      break;
      case 11:
         return '<img border="0" src="images/up.gif" />';
      break;
      case 12:
         return '<img border="0" src="images/down.gif" />';
      break;
      case 13:
         return '<img border="0" src="images/left.gif" />';
      break;
      case 14:
         return '<img border="0" src="images/right.gif" />';
      break;
      case 15:
         return '<img border="0" src="images/up.gif" />';
      break;
     
   }
}

srand(Seed());
$randimage = rand(1,15);

$show = "<table width=\"100%\">\n<tr>\n<td align=center>\n";
$show = $show . ImageShow($randimage);
$show = $show . "</td>\n</tr>\n</table>\n";
$content = $show;
?>




_________________
Cheers,
madman
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum