Rotating banner script

PHP coding talk.

Moderator: Moderators

Postby UseLess on Sat Mar 31, 2007 3:37 pm

Greetings,

The image is not shown because images in signatures are not allowed here.
Movie Quote:
It's not the years honey, it's the mileage...

I do not provide any install services for phpBB, Mods or Styles.
Please do not pm me for support/scripting help - you won't get any reply. If you have a question then make a post in the appropriate forum.
User avatar
UseLess
Registered User
Registered User
 
Posts: 6220
Joined: Mon Sep 27, 2004 2:14 am
Location: North East, UK

Postby gddean on Tue May 08, 2007 3:08 am

Sorry to drag up an old post but this is killing me I have been working on this for about a week now and I can not get my banner ads to work.

Here is my code in the Page header
Code: Select all
<?php
/***************************************************************************
*                              page_header.php
*                            -------------------
*   begin                : Saturday, Feb 13, 2001
*   copyright            : (C) 2001 The phpBB Group
*   email                : support@phpbb.com
*
*   $Id: page_header.php,v 1.106.2.25 2005/10/30 15:17:14 acydburn Exp $
*
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/

if ( !defined('IN_PHPBB') )
{
   die("Hacking attempt");
}

define('HEADER_INC', TRUE);

# # 
# // Banner 
# // 
# // Path to banner image dir which is relative to the forum root... 
# // i.e. http://www.trailsendcams.com/phpBB2/subSilver/images/banners/ 
# // 
# $banner_filedir = 'images/banners/'; 
# $banner_files = array(); 

# $allowed_ext = array('gif', 'png', 'jpg', 'jpeg'); 

# $dir = @opendir($banner_filedir);   

# while(($file = @readdir($dir)) !== false)   
# {   
#    $fileinfo = pathinfo($file); 
#    $file_ext = strtolower($fileinfo['extension']); 

#    if($file !== '.' && $file !== '..' && !is_dir($file) && in_array($file_ext, $allowed_ext) )   
#    {   
#        $banner_files[] = $banner_filedir . $file; 
#    }   
# }   
# @closedir($dir); 

# $template->assign_vars(array(     
#   'BANNERIMAGE' => '<img src="' . $banner_files[mt_rand(0,count($banner_files)-1)] . '" border="0" />';   
# )); 

# #


Here is my over_all header

Code: Select all
<td><a href="{U_INDEX}">{BANNERIMAGE}</a></td>


I created a banners folder in images, my question is should I of created it in the image folder in templates or the the image folder underphpBB2.

Any help would be great. Sorry in advance if I screwed something up I am just learning all of this and it is fun but sometimes frustrating.
gddean
Registered User
Registered User
 
Posts: 2
Joined: Tue May 08, 2007 2:53 am

Postby pentapenguin on Tue May 08, 2007 4:28 am

If you made the directory in images/banners/ then you should be okay.
User avatar
pentapenguin
Moderator
Moderator
 
Posts: 1466
Joined: Tue Sep 14, 2004 4:15 pm
Location: Georgia, USA

Postby DooBDee on Tue May 08, 2007 1:06 pm

Do you have '#' before the actual lines of code in your file? If you do, they are comments and wont work, you need to remove # before each line for it to work.
DooBDee
Website Ninja
DooBDee.net
User avatar
DooBDee
Moderator
Moderator
 
Posts: 3530
Joined: Tue Mar 01, 2005 6:28 pm
Location: DooBDee.net

Postby gddean on Sat May 12, 2007 2:55 am

Finally got it to work, Last question How or where do I put the code so they can transfer tot he site when they click on the logo?
gddean
Registered User
Registered User
 
Posts: 2
Joined: Tue May 08, 2007 2:53 am

Previous

Return to PHP Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron