Can I Add More Adsense Units to Nabble?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Can I Add More Adsense Units to Nabble?

friar
I've paid the price to remove nabble ads on my forum, and I've added my own 728x90 adsense unit instead. They work great, but they only appear on the first post of each topic. Some of my topics have several replies on them, and I'm wondering if I can get additional ad units to appear somehow? I know adsense allows for up to 3 units on a page, so maybe I could modify nabble to display the 728x90 unit every other reply on a thread, or every 3rd reply, or maybe even the top 3 replies that way I max out the available displays.

Please let me know if this is possible, and if I need to make any code adjustments to permit this.

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Can I Add More Adsense Units to Nabble?

friar
Just checking to see if anyone has an answer to this.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Can I Add More Adsense Units to Nabble?

Pedro
Could you give your forum address, please?
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Can I Add More Adsense Units to Nabble?

friar
Reply | Threaded
Open this post in threaded view
|

Re: Can I Add More Adsense Units to Nabble?

Pedro
It is not so easy to configure these ads. Which format will you want, 3 first replies with ads,  an ad after the 3rd one? Please, choose one and I can help you better.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Can I Add More Adsense Units to Nabble?

friar
I think we're allowed up to 3 units per page with adsense, so I guess we can go with unit #1 as is, and then add 2 more, first reply, and second reply.

Let me know if that can be done.

Thank you.  
Reply | Threaded
Open this post in threaded view
|

Re: Can I Add More Adsense Units to Nabble?

Pedro
Ok, I'll prepare the best way to implement it.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Can I Add More Adsense Units to Nabble?

Pedro
In reply to this post by friar
Hi, you'll have to edit your NAML code.
go:
1- At the bottom of your app->See how NAML generates this page.
2- At the engine wheel -> "Search for macro" .
3- Macro by name -> search for "classic_row" .
4 - classic_row -> "override this macro" .
5- replace all your code with this:
<override_macro name="classic_row" requires="node_list">
    <n.if.has_small_avatar>
        <then.current_node.classic_row_with_small_avatar/>
        <else.current_node.classic_row_with_big_avatar/>
    </n.if.has_small_avatar>
    <n.if.is_last_element>
        <then.current_node.mark_as_visited/>
    </n.if.is_last_element>
    <n.if>
   <condition.both>
       <condition1.not.is_blog_topic/>
       <condition2>
           <n.int. i="[n.current_index/]">
               <n.is_less_than i="3"/>
           </n.int.>
       </condition2>      
   </condition.both>
   <then>
       <n.show_ads class="shaded-bg-color rounded" style="margin:0 0 1em;padding:.5em"/>
   </then>    
</n.if>        
</override_macro> 
6 - Save
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Can I Add More Adsense Units to Nabble?

friar
Looks like it's working, thank you for the help.

Reply | Threaded
Open this post in threaded view
|

Re: Can I Add More Adsense Units to Nabble?

friar
Hi, it seems something has changed with how these ads are displayed. You can see our forum here, click on the top post, or any post for that matter. http://activist-post-forum.947009.n3.nabble.com/;cid=1334606609720-76

Instead of showing a 728x90 unit beneath each post like it used to, I am not seeing two of the 728x90 units. Can you let me know how to fix this?

Thanks,

Brian
Reply | Threaded
Open this post in threaded view
|

Re: Can I Add More Adsense Units to Nabble?

Pedro
I will investigate it.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Can I Add More Adsense Units to Nabble?

Pedro
In reply to this post by friar
1 - override your classic_message_cell macro, like this:
<override_macro name="classic_message_cell" requires="node">
    <n.pending_notice/>
    <n.updated_notice/>
    <n.reply_notice/>
    <n.message_text/> 
</override_macro> 
2 - override your classic_row macro, change the condition2 like this:
<override_macro name="classic_row" requires="node_list">
    <n.if.has_small_avatar>
        <then.current_node.classic_row_with_small_avatar/>
        <else.current_node.classic_row_with_big_avatar/>
    </n.if.has_small_avatar>
    <n.if.is_last_element>
        <then.current_node.mark_as_visited/>
    </n.if.is_last_element>
    <n.if>
   <condition.both>
       <condition1.not.is_blog_topic/>
       <condition2>
           <n.int. i="[n.current_index/]">
               <n.is_less_than i="3"/>
           </n.int.>
       </condition2>      
   </condition.both>
   <then>
       <n.show_ad location="blog_topic" class="shaded-bg-color rounded" style="margin:0 0 1em;padding:.5em"/>
   </then>    
</n.if>        
</override_macro>
My test forum.