Currently ads can only be in one group. the groups-> ads relationship would be great if it could be many<->many, instead of one-> many as it is now.

Comments

jeremy’s picture

Yes, it would be nice, but it's not a priority for me right now. It's very much designed one-many at the moment.

jeremy’s picture

A recent redesign of the file-cache struct brings this possibility a little closer.

The following still needs to be done so one ad can live in multiple groups:

  • Create a new table for relating ads to groups. Something like:
          db_query("CREATE TABLE {ad_group} (
            aid INT UNSIGNED NOT NULL DEFAULT 0,
            gid INT UNSIGNED NOT NULL DEFAULT 0,
            KEY (aid),
            KEY (gid),
            PRIMARY KEY  (aid, gid))");
    
  • Update the group selection field to be a multiple select field, saving all selections in the new ad_group table
  • Create an ad module update function in ad.install to move gid from the ad table to the ad_group table
  • Update adserve logic to pull gid information from new ad_group table
jeremy’s picture

On second thought, it makes more sense to support displaying ads by taxonomy rather than try and duplicate taxonomy functionality in the ad group tables.

I think the proper direction for this is to first add support for displaying ads based on their taxonomy, and then migrating the group logic from using a custom ad_groups table to using the existing taxonomy tables. It should be possible to do this while still retaining the same simple user interface.

jeremy’s picture

Version: 4.7.x-1.0-beta7 »

I just checked in a very large commit that replaces the custom ad_groups stuff with taxonomy. This is a very large change and thus needs a lot of testing. I do not recommend upgrading a production site to the development code base at this time, only test sites. The end result is (in the 4.7.x development tree) it's now possible to assign ads to multiple groups. It's also possible to build blocks that display ads from multiple groups.

These changes have not yet been merged into the 5.x development tree.

jeremy’s picture

I just checked in a very large commit that replaces the custom ad_groups stuff with taxonomy. This is a very large change and thus needs a lot of testing. I do not recommend upgrading a production site to the development code base at this time, only test sites. The end result is (in the 4.7.x development tree) it's now possible to assign ads to multiple groups. It's also possible to build blocks that display ads from multiple groups.

These changes have not yet been merged into the 5.x development tree.

jeremy’s picture

Assigned: Unassigned » jeremy
Status: Active » Fixed

These changes have been committed to the 5.x development tree too. Marking fixed, though odds are this is going to cause some bugs that may take a little while to shake out.

It is now possible to assign ads to multiple groups (and to display ads from multiple groups in one block, etc).

Anonymous’s picture

Status: Fixed » Closed (fixed)