PDA

View Full Version : How To Insert Adsense Between Threadbits for VB4 ?


farhan2004
08-09-2011, 03:37 AM
Hi

I need your assistance to provide mod that allows to insert Adsense in between Threadbits for VB4

Below image as an example

https://vborg.vbsupport.ru/external/2011/08/63.jpg

Below link is a tutorial for VB3. If someone can optimize the code for VB4

https://www.vbulletin.com/forum/showthread.php/170480-How-To-Insert-Banners-Between-Threadbits

Best regards
Fadi

--------------- Added 1312941480 at 1312941480 ---------------

any advise?

farhan2004
08-10-2011, 04:24 PM
please assist

Bonjax
11-16-2011, 11:38 PM
If anybody has an answer to this gentleman's question it would be much appreciated.

kh99
11-18-2011, 10:52 AM
Here's the "red code" from the thread linked above, changed for vb4 template syntax.

<vb:if condition="$GLOBALS[threadcount] == X AND in_array(THIS_SCRIPT, array('forumdisplay', 'search'))">

<vb:if condition="$GLOBALS[threadcount] = 1"></vb:if>

<tr>
<td class="alt1">
&nbsp;
</td>
<vb:if condition="$show['threadicons']">
<td class="alt2">
&nbsp;
</td>
</vb:if>
<td class="alt1">
YOUR AD CODE HERE
</td>
<td class="alt2">
&nbsp;
</td>
<td class="alt1" align="center">
&nbsp;
</td>
<td class="alt2" align="center">
&nbsp;
</td>
<vb:if condition="$show['forumlink']">
<td class="alt1">
&nbsp;
</td>
</vb:if>
<vb:if condition="$show['inlinemod']">
<td class="alt1">
&nbsp;
</td>
</vb:if>
</tr>

<vb:else />

<vb:if condition="$GLOBALS[threadcount]++"></vb:if>

</vb:if>

The only chages were to add "vb:" to the if and else tags. But I haven't tried it so I'm not sure if these are the only changes that are needed to update the code for vb4:

khalled
11-22-2011, 08:21 PM
the idea of this code is very interesting, the following code have similar idea if any coder can help us by using the above code and also code in the below link to modify the one required by farhan2004


https://vborg.vbsupport.ru/showthread.php?t=237502

khalled
12-01-2011, 08:20 PM
If you'd like to have your adsense looking just like a thread use the code below:

https://vborg.vbsupport.ru/external/2011/12/80.jpg



<li class="threadbit dot hot">
<div class="rating0 sticky">
<div class="threadinfo">
<a class="threadstatus" rel="vB::AJAX" title="Sponsored Links"></a>
<div class="inner">
<span class="prefix understate">-----YOUR ADSENSE GOES HERE------</span>
</div>
</div>
<ul class="threadstats td">
<li>-</li>
</ul>
<dl class="threadlastpost td">
<dd><div class="popupmenu memberaction">-</div>
</dd>
</dl>
</div>
</li>

Find:

Code:
{vb:raw threadbits_sticky}
</ol>

Just place the code below it.


if any one can help to convert this code to the get the code required in the first post

hqarrse
06-25-2013, 01:27 AM
Just in case anyone still wants this, the exact code for VB4 is, for search results:

extract from the start of template search_threadbit:

<vb:if condition="$show['below_unread'] > 0">
<li class="threadbit">
<div class="icon0 rating0 nonsticky">
<div id="below_unread">
<vb:if condition="$show['below_unread'] == 1">
{vb:rawphrase all_threads_below_here_unread}
<vb:else />
{vb:rawphrase all_threads_below_here}
</vb:if>
</div>
</div>
</li>
</vb:if>

<!-- end of standard code, start of mod -->

<vb:if condition="$GLOBALS['sthreadcount'] == 25">

<vb:if condition="$GLOBALS['sthreadcount'] = 1"></vb:if>

<li class="threadbit">

<!-- MY AD -->

</li>

<vb:else />

<vb:if condition="$GLOBALS['sthreadcount']++"></vb:if>

</vb:if>


<!-- end of mod now back to the normal file -->

<li class="imodselector threadbit {vb:if !$thread['del_username'], $thread['statusstring']} <vb:if

<!-- and so on..... -->



I couldn't find a better way to do this than using the global and loop in the template. The search results code - vb/resultsview.php - that you need to add an index to doesn't have any suitable hooks.