I was upgrading from an old version of banner to the latest version, I had a taxonomy already assigned.

Although the module appeared to install I couldn't see any banners. Searching the issues I wondered if it was connected with not having a 'banner group' taxonomy. After much deinstalling and even having to delete the old banner table I finally managed to trigger _banner_create_vocabulary and wish I hadn't. It created 'banner group' but then added the children to my existing volcabulary category set banner group to a required and empty taxonomy and has now removed my ability to remove banners from my taxonomy category (the box is there and ticked but greyed out). Help please!

Also - why is the taxonomy defined in such a cloak and dagger way and not definable openly in settings? I should think it will cause a problem with people using translations of Drupal as well as anyone who wants to use their own named taxonomy or eixsintg taxonomy for banner categorisation....

Comments

rseiser’s picture

yes, I got the same problem when I switched to the latest files on CVS (banner.module) v 1.70.2.7.
I can easily cicumvent this particular problem by chosing some other category together with banner, and then edit it and remove the banner checkbox. So it looks like just the defaults are wrong, otherwise it seems ok.

I have lots of other problems which confuse me a lot. It generates some banner groups, but I can't set anywhere how many it should generate, like I could in an older version. Also, it doesn't ask for the group when I make a banner. Also not sure what the taxonomy allows me to do with the new module.
So I will switch to an older version for now.

By the way, I am switching from versions the following way:
-remove banner module in "settings\modules"
-run this on the database: DELETE FROM system WHERE name='banner';
-remove all banner related taxonomy terms in "settings\categories"
-remove banner related blocks in "settings\blocks"
-delete table banner in database (All my banners will be gone)
-remove the folder ./modules/banner and the two banner* files in ./
-copy new version to create ./modules/banner
-copy the two banner*.php files to ./ (some install scripts don't seem to have this lines anymore)
-add banner module in "settings\modules"

Point me to a better complete version if there is one that works. A little more description in the readme.txt/istall.txt would help.

rseiser’s picture

publishing,
thanks for the encouragement. I tried it again with a complete reinstall (see previous post) of the CVS banner module, and everything is working great. I used the files that display on http://cvs.drupal.org/viewcvs/drupal/contributions/modules/banner/ if one selects Drupal-4-7.

I now understand the system:
Instead of groups 0-9 in the old system, the new system uses 3 "Banner group"s (through taxonomy) that it creates. These are the ones that have greyed checkboxes, since they must be type "banner". One can also add a separate vocabulary (type "banner", not greyed), that lets one to make a second (possible multiple) selection. Example: "Product group": "Books", "CDs". This lets me organize my banners into "Books" or "CDs" (or both).
The new module also creates three default blocks for "Banner group 1", 2 and 3, which correspond to the respective taxonomy groups. This block then displays 1-5 banners from the group, but has no other options. I didn't use this block.
Instead I created a regular block "advertising", in which I used a custom statement depending on the user. The only thing I had to find out was the $group value for "Banner group 1" in which I had all my banners. The code for my block "advertising" looks something like this:

<?php 
global $user;
$roles = $user->roles;
$approved_roles = array('authenticated user', 'club member');
if (count(array_intersect($roles, $approved_roles)) == 0) {
  $number_of_ads=3; 
} else {
  $number_of_ads=1;
}
print banner_display(37, $number_of_ads); 
//displays a number of ads from group 37 (banner 1)
?>

I found the group (i.e. 37) by using a similar sql statement as in the function banner_display():
SELECT tn2.tid FROM node n INNER JOIN term_node tn ON n.nid = tn.nid INNER JOIN term_node tn2 ON n.nid = tn2.nid INNER JOIN banner b ON n.vid = b.vid;

sun’s picture

Status: Active » Closed (works as designed)