Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Adsense

Hi,

I searched in addons and i didn't found any approved plugin for adsense.
Let me know if there is an addon for adsense in different name

I am looking for something which will add the adsense in between the first post.
Tagged:

Best Answer

  • ddumontddumont ✭✭
    Answer ✓
    I don't think you can do that without a special plugin.

    You can use pockets to insert an ad after the first comment and then after every x comment after that.

    There was an error rendering this rich post.

Answers

  • AoleeAolee Hobbyist & Coder ✭✭
    are you looking for something like an adsense wrapped within the first comment? (pls check www.pinoyau.info for example)

    or sandwich between the first and second comment?
  • You could always use the pockets addon

    There was an error rendering this rich post.

  • wrapped within first comment. In your site it is in the right side of first comment. instead of that, can we have adsense in between text of first comment?

    @ddumont
    Can pockets addon do what i am looking? I will get google adsense in this week
  • Find a thread that has more than five comments. I have one embedded between the 4th or so.

    There was an error rendering this rich post.

  • I just installed pockets. But i think it can't insert ads in the first comment.

    I need like this.

    Comment Title

    this is comment first line.
    ADS FROM ADSENSE
    this is few other line of the first comment
  • ddumontddumont ✭✭
    Answer ✓
    I don't think you can do that without a special plugin.

    You can use pockets to insert an ad after the first comment and then after every x comment after that.

    There was an error rendering this rich post.

  • Hi,

    I just tried to write a plugin but script tags are stripped. Any idea?
  • @Aolee can you tell me how did you do that?
  • AoleeAolee Hobbyist & Coder ✭✭
    edited September 2011
    can u post your code here? thanks
  • inside plugins, folder name is ZAdsense
    filename is class.zadsensethemehooks.php

    class ZAdsenseThemeHooks implements Gdn_IPlugin { public function DiscussionController_BeforeCommentBody_Handler ($Sender, $Args) { static $First = FALSE; if (!$First) return; $First = FALSE; echo '<script type="text/javascript">blaaa blaaa</script>'; }

    Script is stripped.
    Documentation is little bad, I am not able to understand
  • class ZAdsenseThemeHooks extends Gdn_Plugin {
  • AoleeAolee Hobbyist & Coder ✭✭
    try my adbrite code.

    save the code in a filename "class.adbrite.plugin.php" inside a folder name "Adbrite"

    <?php if (!defined('APPLICATION')) exit(); // Define the plugin: $PluginInfo['Adbrite'] = array( 'Name' => 'Adbrite', 'Description' => "Adbrite", 'Version' => '1.0', 'MobileFriendly' => FALSE, 'RequiredApplications' => FALSE, 'RequiredTheme' => FALSE, 'RequiredPlugins' => FALSE, 'RegisterPermissions' => FALSE, 'Author' => "adrian", 'AuthorEmail' => 'xxxx@gmail.com', 'AuthorUrl' => 'http://www.pinoyau.info', 'License' => 'GPLv3' ); class Adbrite extends Gdn_Plugin { public function DiscussionController_BeforeCommentBody_Handler(&$Sender) { $this->_AttachAdbrite($Sender); } protected function _AttachAdbrite(&$Sender) { static $First = TRUE; if (!$First) return; echo '<div id="adbrite" style="float:right;display:block;">'; echo<<<EOD <!-- Begin: adBrite, Generated: 2011-07-17 8:41:03 --> <script type="text/javascript"> //code here </script> <script type="text/javascript">document.write(String.fromCharCode(60,83,67,82,73,80,84));document.write(' src="http://ads.adbrite.com/mb/text_group.php?sid=1933635&zs=3138305f313530&ifr='+AdBrite_Iframe+'&ref='+AdBrite_Referrer+'" type="text/javascript">');document.write(String.fromCharCode(60,47,83,67,82,73,80,84,62));</script> <div><a target="_top" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=1933635&afsid=1" style="font-weight:bold;font-family:Arial;font-size:13px;">Your Ad Here</a></div> <!-- End: adBrite --> EOD; echo '</div>'; $First = FALSE; } public function DiscussionController_AfterCommentBody_Handler(&$Sender) { echo '<script>$(\'div.Message\').first().css("min-height","200px");</script>'; } public function Setup() { // Nothing to do here! } public function Structure() { // Nothing to do here! } }
  • Thanks for the sharing. I will do it now and let you know.
  • i have made some changes, now it is working working between the post.

    http://www.indiapublicforum.com/discussion/148/katrina-kaif-nice-photo-collection

    Thanks for your help
  • Hi, how to change the width of the columns to fit AdSense 728x90 banner in the main page?
  • @Chiprang you already made a new post for this, please don't post the same question multiple times.

    There was an error rendering this rich post.

  • @ddumont, Sorry. I was absolutely new to V forum. Point noted.
Sign In or Register to comment.