vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Banner after First Post (https://vborg.vbsupport.ru/showthread.php?t=240756)

mikeinjersey 04-18-2010 07:30 PM

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 ?

Lynne 04-18-2010 08:13 PM

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.

mikeinjersey 04-18-2010 08:54 PM

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

Quote:

Originally Posted by Lynne (Post 2023433)
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.

Lynne 04-19-2010 03:03 AM

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>

mikeinjersey 04-19-2010 01:24 PM

Quote:

Originally Posted by Lynne (Post 2023584)
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 ?

Lynne 04-19-2010 06:45 PM

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.

mikeinjersey 04-19-2010 08:57 PM

Quote:

Originally Posted by Lynne (Post 2023997)
<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.


All times are GMT. The time now is 02:26 PM.

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.02106 seconds
  • Memory Usage 1,730KB
  • 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
  • (1)bbcode_html_printable
  • (5)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