Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 04-18-2010, 08:30 PM
mikeinjersey mikeinjersey is offline
 
Join Date: Feb 2006
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Banner after First Post

Basically all I want to do is have the banner that appears after the first post in each thread (Ad Manager Templates > ad_showthread_firstpost) to go off of the visitor rules in Ad Manager.

Since there is no specific template specified for "ad_showthread_firstpost" in the Ad Manager, I have to use "Header 2" in its place.

Which means I should be able to use the

{vb:raw ad_location.global_header2}

variable somewhere in SHOWTHREAD...so that it only appears after the first post in each thread.

I tried a few places, but couldn't get it to appear after the first post in each thread.

Once again , i'm trying to place this variable in SHOWTHREAD so that it displays a banner after the 1st post in each thread. (and use Header 2 template in its place so that it goes off of the visitor rules from Ad Manager.)

Any idea where exactly to place it ?
Reply With Quote
  #2  
Old 04-18-2010, 09:13 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think what you are trying to do is going to be simple. Have you found the code that defines whether the global_header2 template gets rendered? Where is it (in which php file)? Now you will have to find the code where the ad_showthread_firstpost template is rendered (showthread.php) and replace that code with the other code. You could probably write a plugin using the showthread_postbit_create template to render it. But again, you need to find the other code that renders the ad template, see if you need to include other files to help run the code, and then place it in that plugin you create.
Reply With Quote
  #3  
Old 04-18-2010, 09:54 PM
mikeinjersey mikeinjersey is offline
 
Join Date: Feb 2006
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynn's the best. I've been driving her nuts today.

Quote:
Originally Posted by Lynne View Post
I don't think what you are trying to do is going to be simple. Have you found the code that defines whether the global_header2 template gets rendered?
I was able to test

{vb:raw ad_location.global_header2}

out and it worked when I added the banner code manually to the Header 2 template in Ad Manager....so that part works. I could stick

{vb:raw ad_location.global_header2}

in any template...and it WILL render / display the banner correctly.


Quote:
Where is it (in which php file)?
That I dont know...and don't really wanna mess with the pure .php files. Since i'm going to have to overwrite them eventually anyway whenever theres a new update. I'd like to try to keep everything Template based.

Quote:
You could probably write a plugin
arghh... I'd rather do without any other plugins. I'm surprised this can't be done just through the template. Hopefully VB will let us be 'more free' with choosing our Ad Templates in the next update or so.
Reply With Quote
  #4  
Old 04-19-2010, 04:03 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried adding it with a condition into the postbit_wrapper template? Or just at the end of the postbit template? <if post=1, then render this also>
Reply With Quote
  #5  
Old 04-19-2010, 02:24 PM
mikeinjersey mikeinjersey is offline
 
Join Date: Feb 2006
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Have you tried adding it with a condition into the postbit_wrapper template? Or just at the end of the postbit template? <if post=1, then render this also>
Thx for the suggestion. Seems like were kinda heading in the right direction.

I tried both -

<if post=1, then render this also>
{vb:raw ad_location.global_header2}

and

<if post=1 {vb:raw ad_location.global_header2}>

It displayed it after every post though...not just the first one.

Maybe using wrong code ?
Reply With Quote
  #6  
Old 04-19-2010, 07:45 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Um, no. I wasn't actually writing the condition, just verbalizing it. I think it's $post['count']? Not sure, double check it in the template.

HTML Code:
<vb:if condition="$post['count'] == 1">
do something
</vb:if>
Something along those lines maybe. You'll have to look up the variable name.
Reply With Quote
  #7  
Old 04-19-2010, 09:57 PM
mikeinjersey mikeinjersey is offline
 
Join Date: Feb 2006
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
<vb:if condition="$post['count'] == 1">
do something
</vb:if>

<vb:if condition="$post['postcount'] == 2">
do something
</vb:if>

Worked.

Thanks much, Lynn. You rock.
Reply With Quote
Reply

Thread Tools
Display Modes

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 03:57 PM.


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.04068 seconds
  • Memory Usage 2,215KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_html
  • (5)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_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