[support] rotating views

Ronald Ashri ronald at istos.it
Tue Feb 10 05:37:32 UTC 2009


Hi Bob,

using D5 does not exclude using OpenX - OpenX is an open source ad 
platform. You can use that to serve your banners and the integration 
with Drupal is simply a question of inserting the javascript code in the 
right place. We use Google Ad Manager so as to save on having to handle 
ads on our own server.

However, based on your description you actually need views so as to 
decide which banner to display and something like OpenX or Google Ad 
Manager would add another system to handle and to keep in synx with your 
website - instead you could create a module that:

1. instantiates the view in code that sorts nodes based on the proximity 
filter and a ad_display_counter value (an extra - hidden to users - CCK 
field)
2. displays the view in the block
3. The nodes that got displayed get their ad_display_counter field updated
4. Next time round the nodes with lower counter values will be the 
chosen ones

This is a relatively simple module and will handle the job - it's not as 
simple as a module that already does the job but it beats having to code 
a module from scratch you can still reuse the views functionality.

Hope this helps,

Ronald



Christopher M. Jones wrote:
> No, stuck with D5 for now.
>
> Bob Morse wrote:
>    
>> Have you tried Openx? http://drupal.org/project/openx (for D6 only).
>>
>> Christopher M. Jones wrote:
>>      
>>> Ok, all points well taken. Since you handle lots of ads, maybe you can
>>> give me some advice for how else to proceed. We have a directory of
>>> service providers on our site. The provider record is a cck type with
>>> geocoded address. The results are displayed using Views, using the gmap
>>> proximity search.
>>>
>>> Now they want to sell ads by location, so that providers' ads are
>>> displayed on searches that return results within a certain proximity of
>>> them.
>>>
>>> I thought this might be doable by building the ad block as a View with a
>>> proximity argument, same as the actual search results. Thus my interest
>>> in views for this task.
>>>
>>> I thought to chuck Advertisement for two reasons: first, I can't see a
>>> way to do the above with it, though it does have geoip. Maybe I should
>>> just convince the client to do things that way, instead. But aside from
>>> that, we're having problems with the flash_ad module, which doesn't seem
>>> to track clicks properly. I've read the big thread on that topic
>>> (reference escapes me) but I just haven't had a chance to try out all
>>> the patches and combinations of patches that are mentioned there. The
>>> sum of shortcomings seemed to suggest to me that we wanted to look
>>> elsewhere.
>>>
>>> Any suggestions?
>>>
>>>
>>> Ronald Ashri wrote:
>>>
>>>        
>>>> Hi Christopher - we handle lots of ads on our websites and Views would
>>>> not be the way to go for the critical ads - you only have the random
>>>> feature which is not something that provides any guarantees in fairness
>>>> across the same day, etc.
>>>>
>>>> I also don't know to which extend it is worth creating a view of banners
>>>> and then rotating them - views is really best suited for results that
>>>> can be cached to a certain extend - especially on sites that are visited
>>>> often.
>>>>
>>>> Given that code is needed the best at this point is probably a custom
>>>> module that resolves your specific problem.
>>>>
>>>> Just out of curiosity why do you want to stop using the Advertisement
>>>> module?
>>>>
>>>> Ronald
>>>>
>>>>
>>>> Christopher M. Jones wrote:
>>>>
>>>>          
>>>>> Hmm. Yes, for starters. But since this is for ads, it's important to be
>>>>> able to guarantee the advertiser a certain number of views per page
>>>>> load. So I'm not sure random would fly. And now I'm thinking that I
>>>>> probably need some code in there to get certain ads displaying more
>>>>> often than others. So maybe I really do need to write this code.
>>>>>
>>>>> John Callahan wrote:
>>>>>
>>>>>
>>>>>            
>>>>>> Could you create a view that displays only one item and sorted randomly?
>>>>>>
>>>>>> - John
>>>>>>
>>>>>>
>>>>>> Christopher M. Jones wrote:
>>>>>>
>>>>>>
>>>>>>              
>>>>>>> I'm looking for a way to rotate views. I've seen "Views Rotator", but it
>>>>>>> doesn't look like it does exactly what I want. I need the view to rotate
>>>>>>> for each time a page is loaded, while views rotator rotates on the same
>>>>>>> page via jquery.
>>>>>>>
>>>>>>> What I'm after is a way to replace the advertisement module using views
>>>>>>> and click filter. A different ad should show each time the user loads a
>>>>>>> page. I'm thinking that I need to set a cookie to hold the incremented
>>>>>>> offset, and pull that value into the view whenever it is called. I can
>>>>>>> write this code, but I'd rather drop a module in and call it done.
>>>>>>> Anybody know of any thing that will do this for D5.x?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>                


More information about the support mailing list