vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How To Insert Adsense Between Threadbits for VB4 ? (https://vborg.vbsupport.ru/showthread.php?t=268212)

farhan2004 08-09-2011 02:37 AM

How To Insert Adsense Between Threadbits for VB4 ?
 
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/show...een-Threadbits

Best regards
Fadi

--------------- Added [DATE]1312941480[/DATE] at [TIME]1312941480[/TIME] ---------------

any advise?

farhan2004 08-10-2011 03:24 PM

please assist

Bonjax 11-16-2011 10:38 PM

If anybody has an answer to this gentleman's question it would be much appreciated.

kh99 11-18-2011 09:52 AM

Here's the "red code" from the thread linked above, changed for vb4 template syntax.

Code:

<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 07: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 07: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



Quote:

<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:
Quote:

{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 12: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:

Code:

<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.


All times are GMT. The time now is 01:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03513 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete