Adding Google Adsense Code to Oxwall Forums

Hey guys,
Today I am going to show you how we can add a little extra Google Ad exposure on our Oxwall based websites.

The code we were working with is as follows.

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 head section



Click save.
Now login to your cpanel or use your ftp client, locate the following file /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}

{$componentForumCaption}

{/if}
{$breadcrumb}

{$paging}
{$search}
{foreach from=$postList item=post name=postList}
{capture assign=’tpl’}
{capture name=’info_string’}
{$avatars[$post.userId].title}
{$post.createStamp}
{/capture}
{capture name=’content’}

Paste your Adsense Code Here
{$post.text}

{if $post.edited}

{text key=’forum+post_edited’} {$avatars[$post.edited.userId].title} {$post.edited.editStamp}

{/if}

{if $enableAttachments && isset($attachments[$post.id])}

{text key=’forum+attachments’}:

{foreach from=$attachments[$post.id] item=’attm’}

 
{if $attm.downloadUrl != ”}{$attm.fileName}{else}{$attm.fileName}{/if} ({$attm.fileSize}Kb)
{if $isModerator || ($userId == $post.userId && !$topicInfo.locked)}
delete
{/if}

{/foreach}

{/if}
{/capture}
{decorator name=’ipc’
avatar=$avatars[$post.userId]
content=$smarty.capture.content
infoString=$smarty.capture.info_string
toolbar=$toolbars[$post.id]
}
{/capture}
{if $page==1 && $smarty.foreach.postList.first}
{block_decorator name=’box’ addClass=’ ow_stdmargin clearfix’ capEnabled=false}

{$tpl}

{/block_decorator}
{add_content key=’socialsharing.get_sharing_buttons’}
{add_content key=’forum.topic.content.after_first_post’}
{else}

{$tpl}

{/if}
{/foreach}

{$paging}

{if $topicInfo.sticky}
{block_decorator name=’box’ type=’empty’ addClass=’ow_smallmargin ow_center’}

{text key=’forum+topic_is_sticky’}

{/block_decorator}
{/if}

{if $topicInfo.locked}
{block_decorator name=’box’ type=’empty’ addClass=’ow_smallmargin ow_center’}

{text key=’forum+topic_is_locked’}

{/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’}
{if $enableAttachments}
 
{text key=’forum+attach_files’}

{input name=’attachments’}

{/if}

{submit name=’submit’ class=’ow_positive’}

{/block_decorator}
{/form}
{/if}
{if $isHidden && !$canPost}
{block_decorator name=’box’ type=’empty’ addClass=’ow_smallmargin ow_center’}

{$postReplyPermissionErrorText}

{/block_decorator}
{/if}

{if $canEdit && $isOwner || $isModerator || $canSubscribe || $isSubscribed || $canLock}

{block_decorator name=’box’ iconClass=’ow_ic_info’ langLabel=’forum+this_topic’ addClass=’ow_stdmargin’}

{/if}
{if $canSticky}

{/if}
{if $isModerator}{if !$isHidden || $canMoveToHidden}

{/if}{/if}
{if $canEdit && $isOwner || $isModerator}

{/if}

{if $canSubscribe || $isSubscribed}


Paste your Adsense Code Here
{/if}
{/block_decorator}

{/if}

{if !$isHidden || $canMoveToHidden}
{*Move topic form*}

{/if}
(make sure to enable dev_mod so that your changes will take effect.) Click save and you’re done.

I hope you guys find this information useful. As always, make sure to check out Arvixe for the best hosting deals on the web and check out Oxwall Accessories for all your custom Oxwall needs!

Charles Benson

Tags: , , , , , , , , , , , | Posted under Oxwall, Video | RSS 2.0

Author Spotlight

Charles Benson

Charles Benson

I'm here to find you answers and give you tips on running an oxwall based website through Arvixe Web hosting. If you need anything at all feel free to get in touch with me!

Leave a Reply

Your email address will not be published. Required fields are marked *


− 1 = 6

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>