It looks like you're new here. If you want to get involved, click one of these buttons!
My addons: NillaBlog | Vanoogle
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>'; }
class ZAdsenseThemeHooks extends Gdn_Plugin {
<?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! } }
Answers
or sandwich between the first and second comment?
- Spam
- Abuse
0 · Insightful Awesome LOL ·My addons: NillaBlog | Vanoogle
- Spam
- Abuse
0 · Insightful Awesome LOL ·@ddumont
Can pockets addon do what i am looking? I will get google adsense in this week
- Spam
- Abuse
0 · Insightful Awesome LOL ·My addons: NillaBlog | Vanoogle
- Spam
- Abuse
0 · Insightful Awesome LOL ·I need like this.
Comment Title
this is comment first line.
ADS FROM ADSENSE
this is few other line of the first comment
- Spam
- Abuse
0 · Insightful Awesome LOL ·I just tried to write a plugin but script tags are stripped. Any idea?
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·http://vanillaforums.org/discussion/16092/embedding-adbrite-code-in-discussions-helper_functions.php#Item_8
- Spam
- Abuse
0 · Insightful Awesome LOL ·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
- Spam
- Abuse
0 · Insightful Awesome LOL ·class ZAdsenseThemeHooks extends Gdn_Plugin {- Spam
- Abuse
0 · Insightful Awesome LOL ·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!
}
}
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·http://www.indiapublicforum.com/discussion/148/katrina-kaif-nice-photo-collection
Thanks for your help
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·My addons: NillaBlog | Vanoogle
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·