Add adsense code within oxwall forum topics (with cute sharing buttons).

Add adsense code within oxwall forum topics (with cute sharing buttons).

Maximize your Adsense revenue by implementing your Adsense code within your oxwall forum post. Many oxwall users have been limited to using the crappy advertisement plugin from the oxwall store for their advert including using them on forum section but has found it rather impossible to place choose a custom position for their ad (eg. Implement ads within forum topics.). In this tutorial I’m going to show you how you can place your ads just within your oxwall forum posts, after implementing this code monitor your ads click and impressions and compare them to what you use to have before, share your testimonies with others in our comment section.

This is how your forum topics will look like after implementing our custom codes.
Due to the regular oxwall updates, this post may be subject to changes from time to time so we do advise that you bookmark and check this post after every oxwall plugins updates.
Below are a few step by step tutorial that will guide you through the implementation of this code and should you encounter any problem while installing this code do not hesitate to ask your question in our comment section.
Step 1: Header Section.
  • Login to your admin dashboard (www.yoursite.com/admin)
  • Click on mouseover on settings and click on main settings
  • Click on page settings

  • Copy the following code and paste in the custom headers section

<script type=”text/javascript”>var switchTo5x=true;</script>
<script type=”text/javascript” src=”http://w.sharethis.com/button/buttons.js”></script>
<script type=”text/javascript”>stLight.options({publisher: “ur-6d8ce17d-b59f-f6aa-20e6-2cb5c1b15c78″, doNotHash: true, doNotCopy: true, hashAddressBar: false});</script>


  • Click save.
Now login to your panel or use your FTP client, locate the following files /ow_plugins/forum/views/controllers/topic_index.html (make sure to enable dev_mod so that your changes will take effect.) replace the entire content with the following code.

{style}
{literal}
.ow_forum_attachment_icon {
display: inline-block;
background-repeat: no-repeat;
cursor: pointer;
width: 14px;
height: 17px;
}
.forum_attachments_label {
margin: 15px 0 5px;
padding-left: 5px;
font-weight: bold;
}

.forum_add_post .jhtmlarea {
margin: 0px auto;
}

.post_content img { max-width: 100%; }
.post_content { overflow: hidden; }
{/literal}
{/style}

{script}
{literal}
$('#toggle_attach_link').click(function(){
$('#attach_file_inputs').toggle();
});
$('#toggle_attach_edit_link').click(function(){
$('#attach_edit_file_inputs').toggle();
});

$(".ow_forum_attachment").hover(
function(){
$(this).find("a.forum_delete_attachment").show();
},
function(){
$(this).find("a.forum_delete_attachment").hide();
}
);

$("a.forum_delete_attachment").each(function(){

var container_handler = $(this).parent();

$(this).click(function(){

if ( confirm(OW.getLanguageText('forum', 'confirm_delete_attachment')) )
{
var attachment_id = $(this).attr("rel");

var params = {};
var url = '{/literal}{url_for_route for='forum_delete_attachment'}{literal}';
params['attachmentId'] = attachment_id;

$.ajaxSetup({dataType: 'json'});

$.post(url, params, function(data){

if ( data.result == true )
{
OW.info(data.msg);

container_handler.remove();
}
else if (data.error != undefined)
{
OW.warning(data.error);
}
});
}
else
{
return false;
}
});
});
{/literal}
{/script}

{if $isHidden}
<div class="ow_stdmargin">
{$componentForumCaption}
</div>
{/if}
{$breadcrumb}

<div class="ow_smallmargin clearfix">
<div class="ow_left">{$paging}</div>
<div class="ow_right ow_txtright">{$search}</div>
</div>

<div class="ow_forum_topic_posts">

{foreach from=$postList item=post name=postList}
{capture assign='tpl'}
{capture name='info_string'}
<a href="{$avatars[$post.userId].url}">{$avatars[$post.userId].title}</a>
<span class="ow_tiny ow_ipc_date ow_remark">{$post.createStamp}</span>
{/capture}

{capture name='content'}<div style='float:left; padding: 5px; margin: 5px;'>
Paste your Adsense Code Here
</div>
<div class="post_content">{$post.text}</div>
{if $post.edited}
<div class="ow_post_comment ow_ic_edit">{text key='forum+post_edited'} <a href="{$avatars[$post.edited.userId].url}">{$avatars[$post.edited.userId].title}</a> {$post.edited.editStamp} </div>
{/if}
<span class='st_twitter_hcount' displayText='Tweet'></span>
<span class='st_stumbleupon_hcount' displayText='StumbleUpon'></span>
<span class='st_googleplus_hcount' displayText='Google +'></span>
<span class='st_pinterest_hcount' displayText='Pinterest'></span>
<span class='st_linkedin_hcount' displayText='LinkedIn'></span>
<span class='st_sharethis_hcount' displayText='ShareThis'></span>
<span class='st_email_hcount' displayText='Email'></span>
{if $enableAttachments && isset($attachments[$post.id])}
<div class="ow_small">
<div class="forum_attachments_label">{text key='forum+attachments'}:</div>
{foreach from=$attachments[$post.id] item='attm'}
<span class="ow_forum_attachment">
<span class="ow_forum_attachment_icon ow_ic_attach">&nbsp;</span>
{if $attm.downloadUrl != ''}<a href="{$attm.downloadUrl}">{$attm.fileName}</a>{else}{$attm.fileName}{/if} ({$attm.fileSize}Kb)
{if $isModerator || ($userId == $post.userId && !$topicInfo.locked)}
<a href="javascript://" class="forum_delete_attachment ow_lbutton ow_hidden" rel="{$attm.id}">delete</a>
{/if}
</span><br/>
{/foreach}
</div>
{/if}
{/ca
pture}

{deco
rator name='ipc'
avatar=$avatars[$post.userId] content=$smarty.capture.content
infoString=$smarty.capture.info_string
toolbar=$toolbars[$post.id] }
{/ca
pture}

{if $page==1 && $smarty.foreach.postList.first}
{block_decorator name='box' addClass=' ow_stdmargin clearfix' capEnabled=false}<div id="post-{$post.id}">{$tpl}</div>{/block_decorator}
{add_content key='socialsharing.get_sharing_buttons'}
{add_content key='forum.topic.content.after_first_post'}
{else}
<div class="ow_stdmargin clearfix" id="post-{$post.id}">{$tpl}</div>
{/if}

{/fo
reach}
</div>

<div class="ow_stdmargin ow_txtright">{$paging}</div>

{if $topicInfo.sticky}
{block_decorator name='box' type='empty' addClass='ow_smallmargin ow_center'}
<div class="ow_forum_status"><span class="ow_ic_push_pin ow_icon"></span> {text key='forum+topic_is_sticky'}</div>
{/block_decorator}
{/if}

<div class="forum_add_post clearfix">

<div class="ow_left" style="width: 70%;">
{if $topicInfo.locked}
{block_decorator name='box' type='empty' addClass='ow_smallmargin ow_center'}
<div class="ow_nocontent ow_forum_status"><span class="ow_ic_lock ow_icon"></span> {text key='forum+topic_is_locked'}</div>
{/block_decorator}
{elseif ( !$isHidden && ($canPost || $isModerator) ) || ( $isHidden && $canPost ) }
{form name='add-post-form'}
{block_decorator name='box' iconClass='ow_ic_write' langLabel='forum+add_post_title' addClass='ow_stdmargin'}
{input name='text' class="ow_smallmargin"}
{error name='text'}<br />
{if $enableAttachments}
<span class="ow_forum_attachment_icon ow_ic_attach">&nbsp;</span>
<a href="javascript://" id="toggle_attach_link">{text key='forum+attach_files'}</a><br /><br />
<div class="ow_hidden ow_smallmargin" id="attach_file_inputs">
{input name='attachments'}
</div>
{/if}
<div class="clearfix"><div class="ow_right">{submit name='submit' class='ow_positive'}</div></div>
{/block_decorator}
{/form}
{/if}
{if $isHidden && !$canPost}
{block_decorator name='box' type='empty' addClass='ow_smallmargin ow_center'}
<div class="ow_nocontent ow_forum_status"><span class="ow_ic_warning ow_icon"></span> {$postReplyPermissionErrorText}</div>
{/block_decorator}
{/if}
</div>

{if $canEdit && $isOwner || $isModerator || $canSubscribe || $isSubscribed || $canLock}
<div class="ow_right" style="width: 27%;">
{block_decorator name='box' iconClass='ow_ic_info' langLabel='forum+this_topic' addClass='ow_stdmargin'}
<ul class="ow_smallmargin ow_bl_narrow clearfix ow_small">
{if $canLock}<li><a class="sticky_topic" href="javascript://">{if $topicInfo.sticky}{text key='forum+unsticky_topic'}{else}{text key='forum+sticky_topic'}{/if}</a></li>{/if}
{if $canSticky}<li><a class="lock_topic" href="javascript://">{if $topicInfo.locked}{text key='forum+unlock_topic'}{else}{text key='forum+lock_topic'}{/if}</a></li>{/if}
{if $isModerator}{if !$isHidden || $canMoveToHidden}<li><a class="move_topic" href="javascript://">{text key='forum+move_topic'}</a></li>{/if}{/if}
{if $canEdit && $isOwner || $isModerator}
<li><a class="delete_topic" href="javascript://">{text key='forum+delete_topic'}</a></li>
{/if}
</ul>
{if $canSubscribe || $isSubscribed}
<input type="checkbox" id="cb-subscribe" {if $isSubscribed}checked="checked"{/if} />
<label for="cb-subscribe">{text key='forum+subscribe'}</label>

Paste your Adsense Code Here
{/if}
{/block_decorator}
</div>
{/if}
<
/div>

{if !$isHidden || $canMoveToHidden}
{*Move topic form*}
<div id="move_topic_form" style="display: none;">
<div class="ow_center">
{form name='move-topic-form'}

{input name='group-id'}
<b>{error name='group-id'}</b><br /><br />

{input name='topic-id'}

<div class="ow_submit">{submit name='save'}</div>
{/form}
</div>
</div>
{/if}

Save your code and you are done!

The following two tabs change content below.

Ebenezer Obasi

Senior executive editor at EwtNet
A web developer, IT undergrad, terrible entrepreneur, internet freak and a man of a few other incongruous talents, Ebenezer has been writing on technology since 2012, and plans to do so until a few days before his ultimate fate: cryogenic preservation. If resurrected, he is likely to go back to writing on technology.
  • TAGS :

Recieve Free Email Updates!

Leave a Reply