View Full Version : Mini Mods - Google Adsense (or other) in a Block like an Individual Profile comment
YankForum
04-05-2010, 10:00 PM
This simple hack enables you to add an advertising block to every member's profile page , this block looks just like other comments posted to the user's profile and is an encouraging way to force visitors clicking on it !
https://vborg.vbsupport.ru/attachment.php?attachmentid=115398&stc=1&d=1270590260
It's a pretty simple template edit. I promise if there will be a need , i'll prepare it as a plugin , with no template edit !
Installation:
1-upload the "upload" folder (1 image file)
2-only one template edit :
vbulletin>Styles & Templates>Style Manager>edit templates>Member Info Templates>memberinfo_block_visitormessaging :
Find :
{vb:raw block_data.messagebits}
ADD before it (in case you want your add to be displayed on top of comments) or after it (in case you want your add to be displayed below all comments) , code below:
<li class="postbit postbit-lite postcontainer<vb:if condition="!$message['avatarurl']"> noavatar</vb:if>" id="vmessage_{vb:raw message.vmid}">
<a href="#" class="avatarlink">
<img src="/images/avatars/asdhkwjhqdkh.gif" alt="Sponsored Ads" />
</a>
<div class="postbithead">
<label for="vmessage_{vb:raw message.vmid}">
<a href="#" class="username">Sponsored</a>
- <span class="postdate">03-08-2010 </span>- <a href="#" >permalink</a>
</label>
</div>
<div id="vmessage_message_{vb:raw message.vmid}">
<blockquote class="posttext restore" style="padding-left:90px">
//PUT YOUR GOOGLE ADSENSE OR ANY OTHER ADS YOU'RE USING
</blockquote>
</div>
<div class="postbitfoot floatcontainer">
<span class="postcontrols">
<a href="#" title="Sponserd links">{vb:rawphrase view_conversation}</a>
</span>
</div>
</li>
3-Do not forget to change the "//PUT YOUR GOOGLE ADSENSE OR ANY OTHER ADS YOU'RE USING" to match your desired adsense code ( or any other ).
DONE :)
thnx goes to Leo Brazil for this thread (https://vborg.vbsupport.ru/showthread.php?t=236313&highlight=adsense) , giving me this idea to have that option in profile pages also !
archet1337
04-06-2010, 08:15 PM
Great mod. Thanks for sharing :)
Is there any way to have the sponsored links show even when a member does not have any visitor messages on the members page?
I'm not sure if the TOS has changed since I received an email warning against this but.. disguising your Adsense ads to appear to be anything other than ads (ie: a Post from a member of the site) is something they frown upon, and can result in your account and all its earnings being killed off.
*edit* The way around it, from memory, was to totally strip back the postbit that you are using for the Google post, so it looks nothing like all the rest. To hide it like you are suggesting is totally against the TOU.
Just checked https://www.google.com/support/adsense/bin/answer.py?hl=en&answer=48182 :
Encouraging Clicks
Publishers may not ask others to click their ads or use deceptive implementation methods to obtain clicks. This includes, but is not limited to, offering compensation to users for viewing ads or performing searches, promising to raise money for third parties for such behavior or placing images next to individual ads.
In order to ensure a good experience for users and advertisers, publishers participating in the AdSense program may not:
* Compensate users for viewing ads or performing searches, or promise compensation to a third party for such behavior.
* Encourage users to click the Google ads using phrases such as "click the ads", "support us", "visit these links" or other similar language.
* Direct user attention to the ads using arrows or other graphical gimmicks.
* Place misleading images alongside individual ads.
* Place ads in a floating box script.
* Format ads so that they become indistinguishable from other content on that page.
* Format site content so that it is difficult to distinguish it from ads.
* Place misleading labels above Google ad units. For instance, ads may be labelled "Sponsored Links" or "Advertisements", but not "Favourite Sites" or "Today's Top Offers".
YankForum
04-06-2010, 09:03 PM
Just checked https://www.google.com/support/adsense/bin/answer.py?hl=en&answer=48182 :
thnx kall for reminding such an important rule ,but if we are supposed to stick to TOS this much , we are not allowed to change the color of ads to the same color of other links in the page in a way that it's not recognizable .
as you can see we are not trying to mislead visitors , we have mentioned following phrase : SPONSORED ADS that tells visitors it's not a normal link
also the avatar we are using should confirm that google is the owner of links next to it , not the website owner & we are not trying to change the format of ads , we are not changing adsense codes . :p
YankForum
04-06-2010, 09:13 PM
Great mod. Thanks for sharing :)
Is there any way to have the sponsored links show even when a member does not have any visitor messages on the members page?
i'm glad u liked it :)
yes , in same template find line below :
<vb:if condition="$block_data['messagebits']">
and erase it
and find line below :
</vb:if>
<vb:if condition="$show['quickcomment']">
change it to :
<vb:if condition="$show['quickcomment']">
tafreeh
04-06-2010, 09:29 PM
The idea and mod, both of them are pretty sick. But I wish it wouldn break any adsense TOS or TAC(Terms and Conditions).
archet1337
04-07-2010, 02:20 AM
I have added a google avatar, and I can't possibly see how this should break any adsense TOS / TAC
https://vborg.vbsupport.ru/
I've attached the avatar if anyone else wants to use it
tafreeh
04-07-2010, 03:27 AM
Why dont you confirm with Adsense, and then let us know. so everyone can use it.
ps2wiz
04-07-2010, 05:22 AM
Thanks for this.
By the way, I believe by mistake you left a link to your customized avatar in the code.
ps2wiz
04-07-2010, 05:25 AM
In addition is there anyway we can change the date to automatically state the current day?
YankForum
04-07-2010, 06:56 AM
Thanks for this.
By the way, I believe by mistake you left a link to your customized avatar in the code.
you have to upload the avatar too ( provided in zip file )
In addition is there anyway we can change the date to automatically state the current day?
easily !
change 03-08-2010 to any desired date or text (ie Today's Sponsored Links)
I have added a google avatar, and I can't possibly see how this should break any adsense TOS / TAC
http://www.digi-tech.org/images/diverse/google_tos.png
I've attached the avatar if anyone else wants to use it
thnx , if u don't mind i'll replace it with the other avatar in zip file ? :p
archet1337
04-07-2010, 10:55 AM
thnx , if u don't mind i'll replace it with the other avatar in zip file ? :p
No problem at all :)
khalled
04-07-2010, 11:02 PM
while i go to insert this code i replace some content of memberinfo_block_visitormessaging : template code so the victor massage not appear any more if any one can help by copy the content of template memberinfo_block_visitormessaging and past it here
vbulletin>Styles & Templates>Style Manager>edit templates>Member Info Templates>memberinfo_block_visitormessaging :
YankForum
04-08-2010, 06:39 AM
y don't u click on "[Show Default]" khalled?
btw if u r not able 2 do that here is the default code :
<vb:if condition="$show['quickcomment'] AND $show['post_visitor_message']">
{vb:raw block_data.clientscript}
<form name="vbform" id="message_form" method="post" action="visitormessage.php?{vb:raw session.sessionurl}do=message">
<vb:if condition="$show['view_conversation']">
<div class="subsectionhead">
<a href="converse.php?{vb:raw session.sessionurl}u={vb:raw userinfo.userid}&u2={vb:raw bbuserinfo.userid}" id="view_my_conversation_link" class="textcontrol">{vb:rawphrase view_your_conversation_with_x, {vb:raw userinfo.username}}</a>
</div>
</vb:if>
<a name="quickreply"></a>
<vb:if condition="THIS_SCRIPT == 'converse'"><h2 class="blockhead">{vb:rawphrase post_a_comment}</h2></vb:if>
<div class="errorblock hidden" id="qc_error_div">
<h3 id="qc_error_header" class="blocksubhead">{vb:rawphrase errors_occured_when_submitted}</h3>
<div id="qc_error_list" class="blockrow error"> </div>
<div id="qc_error_okay" class="blockrow"><input type="button" class="button" value="{vb:rawphrase okay}" id="qc_hide_errors" tabindex="1" /></div>
</div>
<vb:if condition="THIS_SCRIPT == 'converse'"><div class="wysiwyg_block"></vb:if>
<div class="<vb:if condition="THIS_SCRIPT == 'converse'">blockbody formcontrols<vb:else />formcontrols profile_editor_border</vb:if>">
<div<vb:if condition="THIS_SCRIPT == 'converse'"> class="blockrow"</vb:if>>
<vb:if condition="THIS_SCRIPT != 'converse'"><label for="{vb:raw block_data.editorid}" class="hidden">{vb:rawphrase message}:</label></vb:if>
<div class="editor">{vb:raw block_data.messagearea}</div>
</div>
</div>
<div class="<vb:if condition="THIS_SCRIPT == 'converse'">blockfoot </vb:if>actionbuttons">
<div class="group">
<input type="submit" id="qr_submit" class="button" value="{vb:rawphrase post_message}" name="sbutton" accesskey="s" onclick="clickedelm = this.value" tabindex="1" />
<input type="submit" id="qr_preview" class="button" value="{vb:rawphrase go_advanced}" name="preview" accesskey="x" onclick="clickedelm = this.value" tabindex="1" />
</div>
</div>
<vb:if condition="THIS_SCRIPT == 'converse'"></div></vb:if>
<input type="hidden" name="fromquickcomment" value="1" />
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="do" value="message" />
<input type="hidden" name="u" value="{vb:raw userinfo.userid}" />
<input type="hidden" name="u2" value="{vb:raw userinfo2.userid}" />
<input type="hidden" name="loggedinuser" value="{vb:raw bbuserinfo.userid}" />
<input type="hidden" name="parseurl" value="1" />
<input type="hidden" name="lastcomment" value="{vb:raw block_data.lastcomment}" />
<input type="hidden" name="allow_ajax_qc" value="{vb:raw show.allow_ajax_qc}" />
<input type="hidden" name="fromconverse" value="{vb:raw block_data.fromconverse}" />
</form>
</vb:if>
<vb:if condition="$block_data['messagebits']">
<div id="postlist">
<h3 class="subsectionhead"><label for="visitor_messages"><span class="comments_total">{vb:raw prepared.vm_total}</span> {vb:rawphrase visitor_messages}</label></h3>
<form action="member_inlinemod.php?u={vb:raw userinfo.userid}" method="post" id="visitor_message_inlinemod_form">
<!-- inline moderation form -->
<ol id="message_list">
{vb:raw block_data.messagebits}
</ol>
<div>
<vb:if condition="$show['inlinemod']">
<div id="inlinemod_formctrls" class="popupmenu">
<a href="javascript://" class="popupctrl"><span class="ctrlcontainer">{vb:rawphrase moderation_tools}(<span id="vmessage_inlinemod_count">0</span>)</span></a>
<ul class="popupbody popuphover">
<vb:if condition="$show['delete']">
<li><label><input type="radio" name="do" value="inlinedelete" checked="checked" /> {vb:rawphrase delete_messages}</label></li>
</vb:if>
<vb:if condition="$show['undelete']">
<li><label><input type="radio" name="do" value="inlineundelete" /> {vb:rawphrase undelete_messages}</label></li>
</vb:if>
<vb:if condition="$show['approve']">
<li><label><input type="radio" name="do" value="inlineapprove" /> {vb:rawphrase approve_messages}</label></li>
<li><label><input type="radio" name="do" value="inlineunapprove" /> {vb:rawphrase unapprove_messages}</label></li>
</vb:if>
<li> </li>
<li><label><input type="radio" name="do" value="clearmessage" /> {vb:rawphrase deselect_all_messages}</label></li>
<li class="formsubmit">
<input type="submit" class="button" value="{vb:rawphrase proceed_ellipsis}" />
</li>
</ul>
<script type="text/javascript" src="clientscript/vbulletin_inlinemod.js?v={vb:raw vboptions.simpleversion}"></script>
<script type="text/javascript">
<!--
vB_XHTML_Ready.subscribe(function() { register_inlinemod("visitor_message_inlinemod_form", "li", "postbit", "vmessage"); });
//-->
</script>
</div>
</vb:if>
<div id="postpagestats">{vb:rawphrase showing_vms_x_to_y_of_z, {vb:raw block_data.messagestart}, {vb:raw block_data.messageend}, {vb:raw prepared.vm_total}}</div>
</div>
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="u" value="{vb:raw userinfo.userid}" />
</form>
<div id="above_postlist">
<div id="pagination_top">
{vb:raw block_data.pagenav}
</div>
</div>
</div>
<div id="below_postlist">
<vb:if condition="$block_data['pagenav']">
<div id="pagination_bottom">
{vb:raw block_data.pagenav}
</div>
</vb:if>
</div>
</vb:if>
<vb:if condition="$show['quickcomment']">
<script type="text/javascript" src="clientscript/vbulletin_quick_comment.js?v={vb:raw vboptions.simpleversion}"></script>
<script type="text/javascript">
<!--
var quick_comment = new vB_QuickComment("message_form", {vb:raw vboptions.postminchars});
//-->
</script>
</vb:if>
<vb:if condition="$show['edit'] AND $show['popups']">
<!-- ajax errors table -->
<div id="ajax_post_errors" class="hidden">
<div class="block">
<div class="blockhead floatcontainer">
<span class="blockhead_info"><input type="button" class="button" value=" X " id="quick_edit_errors_hide" /></span>
<h2>{vb:rawphrase vbulletin_message}</h2>
</div>
<div class="blockbody">
<div id="ajax_post_errors_message" class="blockrow"> </div>
</div>
<div class="blockfoot">
<a href="#" id="quick_edit_errors_cancel" class="textcontrol">{vb:rawphrase cancel_changes}</a>
</div>
</div>
</div>
<!-- / ajax errors table -->
</vb:if>
khalled
04-08-2010, 11:17 PM
y don't u click on "[Show Default]" khalled?
btw if u r not able 2 do that here is the default code :
<vb:if condition="$show['quickcomment'] AND $show['post_visitor_message']">
{vb:raw block_data.clientscript}
<form name="vbform" id="message_form" method="post" action="visitormessage.php?{vb:raw session.sessionurl}do=message">
<vb:if condition="$show['view_conversation']">
<div class="subsectionhead">
<a href="converse.php?{vb:raw session.sessionurl}u={vb:raw userinfo.userid}&u2={vb:raw bbuserinfo.userid}" id="view_my_conversation_link" class="textcontrol">{vb:rawphrase view_your_conversation_with_x, {vb:raw userinfo.username}}</a>
</div>
</vb:if>
<a name="quickreply"></a>
<vb:if condition="THIS_SCRIPT == 'converse'"><h2 class="blockhead">{vb:rawphrase post_a_comment}</h2></vb:if>
<div class="errorblock hidden" id="qc_error_div">
<h3 id="qc_error_header" class="blocksubhead">{vb:rawphrase errors_occured_when_submitted}</h3>
<div id="qc_error_list" class="blockrow error"> </div>
<div id="qc_error_okay" class="blockrow"><input type="button" class="button" value="{vb:rawphrase okay}" id="qc_hide_errors" tabindex="1" /></div>
</div>
<vb:if condition="THIS_SCRIPT == 'converse'"><div class="wysiwyg_block"></vb:if>
<div class="<vb:if condition="THIS_SCRIPT == 'converse'">blockbody formcontrols<vb:else />formcontrols profile_editor_border</vb:if>">
<div<vb:if condition="THIS_SCRIPT == 'converse'"> class="blockrow"</vb:if>>
<vb:if condition="THIS_SCRIPT != 'converse'"><label for="{vb:raw block_data.editorid}" class="hidden">{vb:rawphrase message}:</label></vb:if>
<div class="editor">{vb:raw block_data.messagearea}</div>
</div>
</div>
<div class="<vb:if condition="THIS_SCRIPT == 'converse'">blockfoot </vb:if>actionbuttons">
<div class="group">
<input type="submit" id="qr_submit" class="button" value="{vb:rawphrase post_message}" name="sbutton" accesskey="s" onclick="clickedelm = this.value" tabindex="1" />
<input type="submit" id="qr_preview" class="button" value="{vb:rawphrase go_advanced}" name="preview" accesskey="x" onclick="clickedelm = this.value" tabindex="1" />
</div>
</div>
<vb:if condition="THIS_SCRIPT == 'converse'"></div></vb:if>
<input type="hidden" name="fromquickcomment" value="1" />
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="do" value="message" />
<input type="hidden" name="u" value="{vb:raw userinfo.userid}" />
<input type="hidden" name="u2" value="{vb:raw userinfo2.userid}" />
<input type="hidden" name="loggedinuser" value="{vb:raw bbuserinfo.userid}" />
<input type="hidden" name="parseurl" value="1" />
<input type="hidden" name="lastcomment" value="{vb:raw block_data.lastcomment}" />
<input type="hidden" name="allow_ajax_qc" value="{vb:raw show.allow_ajax_qc}" />
<input type="hidden" name="fromconverse" value="{vb:raw block_data.fromconverse}" />
</form>
</vb:if>
<vb:if condition="$block_data['messagebits']">
<div id="postlist">
<h3 class="subsectionhead"><label for="visitor_messages"><span class="comments_total">{vb:raw prepared.vm_total}</span> {vb:rawphrase visitor_messages}</label></h3>
<form action="member_inlinemod.php?u={vb:raw userinfo.userid}" method="post" id="visitor_message_inlinemod_form">
<!-- inline moderation form -->
<ol id="message_list">
{vb:raw block_data.messagebits}
</ol>
<div>
<vb:if condition="$show['inlinemod']">
<div id="inlinemod_formctrls" class="popupmenu">
<a href="javascript://" class="popupctrl"><span class="ctrlcontainer">{vb:rawphrase moderation_tools}(<span id="vmessage_inlinemod_count">0</span>)</span></a>
<ul class="popupbody popuphover">
<vb:if condition="$show['delete']">
<li><label><input type="radio" name="do" value="inlinedelete" checked="checked" /> {vb:rawphrase delete_messages}</label></li>
</vb:if>
<vb:if condition="$show['undelete']">
<li><label><input type="radio" name="do" value="inlineundelete" /> {vb:rawphrase undelete_messages}</label></li>
</vb:if>
<vb:if condition="$show['approve']">
<li><label><input type="radio" name="do" value="inlineapprove" /> {vb:rawphrase approve_messages}</label></li>
<li><label><input type="radio" name="do" value="inlineunapprove" /> {vb:rawphrase unapprove_messages}</label></li>
</vb:if>
<li> </li>
<li><label><input type="radio" name="do" value="clearmessage" /> {vb:rawphrase deselect_all_messages}</label></li>
<li class="formsubmit">
<input type="submit" class="button" value="{vb:rawphrase proceed_ellipsis}" />
</li>
</ul>
<script type="text/javascript" src="clientscript/vbulletin_inlinemod.js?v={vb:raw vboptions.simpleversion}"></script>
<script type="text/javascript">
<!--
vB_XHTML_Ready.subscribe(function() { register_inlinemod("visitor_message_inlinemod_form", "li", "postbit", "vmessage"); });
//-->
</script>
</div>
</vb:if>
<div id="postpagestats">{vb:rawphrase showing_vms_x_to_y_of_z, {vb:raw block_data.messagestart}, {vb:raw block_data.messageend}, {vb:raw prepared.vm_total}}</div>
</div>
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="u" value="{vb:raw userinfo.userid}" />
</form>
<div id="above_postlist">
<div id="pagination_top">
{vb:raw block_data.pagenav}
</div>
</div>
</div>
<div id="below_postlist">
<vb:if condition="$block_data['pagenav']">
<div id="pagination_bottom">
{vb:raw block_data.pagenav}
</div>
</vb:if>
</div>
</vb:if>
<vb:if condition="$show['quickcomment']">
<script type="text/javascript" src="clientscript/vbulletin_quick_comment.js?v={vb:raw vboptions.simpleversion}"></script>
<script type="text/javascript">
<!--
var quick_comment = new vB_QuickComment("message_form", {vb:raw vboptions.postminchars});
//-->
</script>
</vb:if>
<vb:if condition="$show['edit'] AND $show['popups']">
<!-- ajax errors table -->
<div id="ajax_post_errors" class="hidden">
<div class="block">
<div class="blockhead floatcontainer">
<span class="blockhead_info"><input type="button" class="button" value=" X " id="quick_edit_errors_hide" /></span>
<h2>{vb:rawphrase vbulletin_message}</h2>
</div>
<div class="blockbody">
<div id="ajax_post_errors_message" class="blockrow"> </div>
</div>
<div class="blockfoot">
<a href="#" id="quick_edit_errors_cancel" class="textcontrol">{vb:rawphrase cancel_changes}</a>
</div>
</div>
</div>
<!-- / ajax errors table -->
</vb:if>
very thanks for help
marshal_ramdev
04-22-2010, 12:38 PM
thanks nice one :)
alghzil
01-16-2012, 12:18 AM
cool i like it
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.