Jump to content

Multiple Ads Per Zone


magj

Recommended Posts

Hi

 

I'm somewhat new to revive but I already use it in basic mode for some of my pages , This is a scenario which I couldn't find a solution for:

 

I have several banner position in one of my pages (namely 6 banners)

 

Is there any method to use a "single invocation code" to display 6 banners out of 30 in every page display?

 

Best

Regards

Link to comment
Share on other sites

  • 1 month later...

Actually - I think the question was multiple banners per zone with one call - instead of multiple zones.

I know that if you want to call it six times; you can use the spc and pass zones=1|1|1|1|1|1 (6 ones) and that would call it 6 times.

 

Has anyone worked on the adSelect to support multiple banners, in my case - I want ALL the banners for a zone.

 

I've written a module that delivers JSON data so that another front-end can render how it needs to be; but I want it to pull all banners for a zone.

 

Any ideas?

Link to comment
Share on other sites

I have one solution - I modified my ajson.php to do the following:

 

    $allAds = MAX_cacheGetZoneLinkedAdInfos ($thisZoneid);
    $aBannerIds = array_keys($allAds['xAds']);
    foreach( $aBannerIds as $adId){
        $what = "zone:".$thisZoneid.",+bannerid:".$adId;
        $aBanners[] = MAX_adSelect($what, $campaignid, $target, $source, $withtext, $charset, $context, true, $ct0, $loc, $referer);
    }
 

This dumps all of the banners for each zone that is passed to the delivery.

Link to comment
Share on other sites

With a little additional work; here is how I can control to present all of them or just some based on a limit parameter: For reference; this is within the foreach of an array of zones being passed - you can see this in most of the delivery files (e.g. ax.php: line 4307)

 

    if ( $limit === 0 ){
        $allAds = MAX_cacheGetZoneLinkedAdInfos ($thisZoneid);
        $aBannerIds = array_keys($allAds['xAds']);
        foreach( $aBannerIds as $adId){
            $what = "zone:".$thisZoneid.",+bannerid:".$adId;
            $aBanners[] = MAX_adSelect($what, $campaignid, $target, $source, $withtext, $charset, $context, true, $ct0, $loc, $referer);
        }        
    } else {
        $what = "zone:".$thisZoneid;
        do {
            $aBanners[] = MAX_adSelect($what, $campaignid, $target, $source, $withtext, $charset, $context, true, $ct0, $loc, $referer);                    
        } while(--$limit > 0);
    }
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...