Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-09-2011, 03:37 AM
farhan2004 farhan2004 is offline
 
Join Date: Aug 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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



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?
Reply With Quote
  #2  
Old 08-10-2011, 04:24 PM
farhan2004 farhan2004 is offline
 
Join Date: Aug 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

please assist
Reply With Quote
  #3  
Old 11-16-2011, 11:38 PM
Bonjax Bonjax is offline
 
Join Date: Jul 2011
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If anybody has an answer to this gentleman's question it would be much appreciated.
Reply With Quote
  #4  
Old 11-18-2011, 10:52 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Reply With Quote
  #5  
Old 11-22-2011, 08:21 PM
khalled khalled is offline
 
Join Date: Apr 2007
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 12-01-2011, 08:20 PM
khalled khalled is offline
 
Join Date: Apr 2007
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you'd like to have your adsense looking just like a thread use the code below:





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
Reply With Quote
  #7  
Old 06-25-2013, 01:27 AM
hqarrse hqarrse is offline
 
Join Date: Mar 2010
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:00 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06582 seconds
  • Memory Usage 2,227KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete