Hi Jeremy,
First, many thanks for the great module. Seems it fits all my need.
I installed the cvs version of banner module, against 4.6.2. Everything is fine. I set up properly the terms and vocabulary for the banners. However the banners are not shown up occasionally. I refreshed the cache. Deleting manually the ".x.banner.cache" files sometime helped.
The error message is:
Cannot modify header information - headers already sent by (output started at c:\protools\banner_file.php:35) in c:\protools\includes\common.inc on line 99.
The banner_file.php and banner_db.php are in the drupal's root. And the testbed machine is under Windows, so there are not any file permissions problems.
Could you check these problems please?
Regards,
kaparo
Comments
Comment #1
sja1 commentedHello, I came across Drupal recently while looking for blogging software, and got very excited about using it to get a huge jumpstart on an educational website I need to put together fairly quickly.
Problem: I can’t get the banner module to work. I have the following test environment, all running locally on a young, healthy laptop. All the Drupal elements were downloaded and installed within days of each other.
Drupal: 4.6.3
PHPTemplate: 4.6.0
Template: Friends Electric 4.6.0
Banner Module Version: Banner-cvs.tar
(Module readme says it works for drupal. 4.6.x and PHP 4.3 or higher)
OS: XP Professional, SP2
Webserver: Apache 2.0.54
MySQL: 4.1.13a
PHP: 4.4.0
I first installed the banner module downloaded from the 4.6 download page. It wasn’t working, and after searching on the Drupal site I found a post advising installation of the CVS version of the module. I then did the following:
• Deleted the “banner” directory from the module subdirectory
• Dropped the two tables created by banner.mysql
• Installed the new module according to the instructions
NOTE: I left the banner module cache turned OFF
However, I am still having a problem getting a test banner to show up inside a node.
I am able to “upload” (I’m doing this all locally on a windows laptop) a banner, and can list it and see the banner graphic without problem under “administer –> banners view and edit”. I created a node called “Banners” in the right sidebar with the code suggested in the install file:
<?php return banner_display(); ?>. However, when each page is visualized, the node shows up empty (just the node title is visible). However, when I go to administer banners, the banner views are being incremented with every page view. The module thinks the banners are being shown.I have verified the following:
• The input type of the node is set to PHP.
• Under “administer -> access control”, both registered and non registered users have “show banners” permission. No other banner permissions are set.
• The banner module is enabled (it seemed to remember this from the old installation. i.e. it was already set to enabled the first time I entered “administer - > modules “ after reinstalling the module).
• The test banner itself is enabled when I look in “administer-banners-banner-edit”. Here the only settings I have touched are Title, URL, and status (which is “enabled”). The mime setting shows correctly.
• I have refreshed the cache, and that has not helped.
• I have verified that the table column names are exactly as in the banner.mysql, all lowercase.
• I have tried changing to the bluemarine theme, and the problem still persists
• The problem exists for both non registered and authenticated users, including user number 1.
The following error appears in the error log each time a new page is shown.
Type php
Date Friday, October 7, 2005 - 17:21
User arrigenna
Location
/devpmt/drupal/banner_db.php?pos=0&path=files&tid=0&max=1Message Illegal offset type in
C:\Archivos de programa\Apache Group\Apache2\htdocs\devpmt\drupal\banner_db.php on line 19.Severity error
Hostname 127.0.0.1
The relevant information from the banner_db file is as follows:
Version:
// $Id: banner_db.php,v 1.10 2005/04/19 12:57:42 jeremy Exp $Line 19:
$banner = $banners[$id];If I turn the banner module cache feature on, the error placed in the log on each page view changes to the following:
File copy failed.
Type php
Date Friday, October 7, 2005 - 18:15
User arrigenna
Location
/devpmt/drupal/banner_file.php?pos=0&path=files&tid=0&max=1Message Cannot modify header information - headers already sent by (output started at
C:\Archivos de programa\Apache Group\Apache2\htdocs\devpmt\drupal\banner_file.php:35) in C:\Archivos de programa\Apache Group\Apache2\htdocs\devpmt\drupal\includes\common.inc on line 99.Severity error
Hostname 127.0.0.1
:
I am just getting started with Drupal, and fairly new to PHP, but I did make an attempt to delve into the source of the error. I started from the assumption that the final
echo $banner->html;line in the banner_db wasn’t returning anything. So I did the following:
• I made a new copy of banner_db and manually included the contents of bootstrap and common inc into it.
• I added a javascript alert just after the
echo $banner->html;line• I navigated my drupal site, and no alert
• I commented everything in banner_db except my alert
• I navigated to my drupal site, and this time the alert was displayed
• I started uncommenting line by line, taking note of the lines that caused the alert to not display. The following lines seem to prevent the alert - and so perhaps the
$ banner - > htmlas well - javas cript from being passed back (the first three are from the manually included files)o
session_set_save_handler ("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc");o
session_start();o
drupal_set_header('Content-Type: text/html; charset=utf-8');o
$banner = $banners[$id];(this is the famous line 19 I mentioned above is showing up in the drupal error log)And now, I’m afraid that’s as far as I’m able to get with my limited knowledge of Drupal and PHP.
I´ve tried to be as thorough as possible in the hope that someone’s sharp eye will be able to quickly spot the problem.
Any suggestions gratefully appreciated!
Steve
Comment #2
fyl commentedbanner_db.php just doesn't match what is done in banner.module. The array references are wrong which ultimately leads to the "line 19 blowup". While the info on 4.6.0 indicates it is five months old, some of the files were updated on 7 October. Clearly this is an update that just went wrong.
Comment #3
coolmann commentedHello guys, we at nonsolocms.it (a website dealing about cms) solved the issue
modifying the row in banner_db.php.
How to do: edit banner_db.php placed in the Drupal root on your website, and
change row 19 from
$id = $ballot[$pos][$random];
into
$id = $ballot[$pos][$random][0];
The error messages means "hey dude, $id is not an integer, but an array, so
I cannot understand what $banner = $banners[$id] means" :-) This is because
something changed in ID manipulation, and you have to extract the correct one
from the array $ballot!
Moreover, we hacked the module so that it can work with Google Adsense
(without installing the adsense module). If you are interested, let us know.
have a nice day,
coolmann.
Comment #4
wulff commentedThis has been fixed in the latest drupal-4-6 version: http://cvs.drupal.org/viewcvs/drupal/contributions/modules/banner/?only_...
Comment #5
(not verified) commented