Dynadot

[Resolved] PHP Forum Banner Rotation HELP!

Spaceship Spaceship
Watch
Impact
0
PHP Forum Banner Rotation HELP!

Hi!

I want to turn this one banner into a rotation involving 2 or more banners!

Im really not great at coding, and would apprecicate somebody to give me the correct code to put in to make this happen! for the banner just use a random image, then i can just change it!

Code:
Code:
if($i == $ad_after)
   {
      $row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
      $row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
      $num ++;

      $mini_post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#ad';
      $template->assign_block_vars('postrow', array(
         'ROW_COLOR' => '#' . $row_color,
         'ROW_CLASS' => $row_class,
         'POST_DATE' => $post_date,
         'POST_SUBJECT' => 'Advertisement',
         'MINI_POST_IMG' => $mini_post_img,
         'POSTER_NAME' => 'Advertisement',
	   'POSTER_RANK' => 'Advertiser',
         'MESSAGE' => '<div align="center"><a href="http://www.inx-gaming.co.uk"  target="_blank"><img src="http://www.inx-gaming.co.uk/images/banners/inxgaming-468x60.jpg"></img></a></div>',
         'L_MINI_POST_ALT' => $mini_post_alt,
         'U_MINI_POST' => $mini_post_url,
         'U_POST_ID' => 'ad')
      );
   }
	
}

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>

Thanks Guys!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Code:
//Enter banner image links and urls
  $image[1]='/location/of/image1.jpg'; 
  $link[1]='/location/of/link1.php'; 

  $image[2]='/location/of/image2.jpg'; 
  $link[2]='/location/of/link2.php'; 

  $image[3]='/location/of/image3.jpg'; 
  $link[3]='/location/of/link3.php'; 

  $image[4]='/location/of/image4.jpg'; 
  $link[4]='/location/of/link4.php'; 

  $image[5]='/location/of/image5.jpg'; 
  $link[5]='/location/of/link5.php'; 

$last=count($image);
$index=rand(1,$last);


if($i == $ad_after)
   {
      $row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
      $row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
      $num ++;

      $mini_post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#ad';
      $template->assign_block_vars('postrow', array(
         'ROW_COLOR' => '#' . $row_color,
         'ROW_CLASS' => $row_class,
         'POST_DATE' => $post_date,
         'POST_SUBJECT' => 'Advertisement',
         'MINI_POST_IMG' => $mini_post_img,
         'POSTER_NAME' => 'Advertisement',
	   'POSTER_RANK' => 'Advertiser',
         'MESSAGE' => '<div align="center"><a href="'.$link[$index].'"  target="_blank"><img src="'.$image[$index].'"></img></a></div>',
         'L_MINI_POST_ALT' => $mini_post_alt,
         'U_MINI_POST' => $mini_post_url,
         'U_POST_ID' => 'ad')
      );
   }
	
}

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
 
Last edited:
0
•••
re:

Hi i have put this in and it dont seem to like...
Code:
	//Enter banner image links and urls
  $image[1]='http://www.inx-gaming.co.uk/images/banners/inxgaming-468x60.jpg'; 
  $link[1]='http://www.inx-gaming.co.uk'; 

  $image[2]='http://www.jamesterror.net/ads/banner3.jpg'; 
  $link[2]='http://www.dedis-built.com; 


$last=count($image);
$index=rand(1,$last);


if($i == $ad_after)
   {
      $row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
      $row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
      $num ++;

      $mini_post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#ad';
      $template->assign_block_vars('postrow', array(
         'ROW_COLOR' => '#' . $row_color,
         'ROW_CLASS' => $row_class,
         'POST_DATE' => $post_date,
         'POST_SUBJECT' => 'Advertisement',
         'MINI_POST_IMG' => $mini_post_img,
         'POSTER_NAME' => 'Advertisement',
	   'POSTER_RANK' => 'Advertiser',
         'MESSAGE' => '<div align="center"><a href="'.$link[$index].'"  target="_blank"><img src="'.$image[$index].'"></img></a></div>',
         'L_MINI_POST_ALT' => $mini_post_alt,
         'U_MINI_POST' => $mini_post_url,
         'U_POST_ID' => 'ad')
      );
   }
	
}

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>

Can you see why?
 
0
•••
Simple, you forgot to close the quote of the second link...
 
0
•••
OMG OMG OMG OMG OMG OMG OMG Your and absolute legend Mate!

Luvya :D

Thanks Alot For Helping Me Out!

Callum
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back