vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Use different postbit template depending on prefix (https://vborg.vbsupport.ru/showthread.php?t=230804)

tpearl5 12-22-2009 12:44 PM

Use different postbit template depending on prefix
 
I would like to use a different postbit template for the first post only depending on prefix. In my case, I have news that I would like to display differently in the first post. All news threads use the prefix 'news'.

Is there a way I could do this with a conditional in postbit?

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

I actually found a slightly simpler solution. I added an alternate layout to the postbit and can switch between the two using this conditional:
Code:

<if condition="THIS_SCRIPT == 'showthread' AND $post[postid] == $GLOBALS['qrfirstpostid'] AND $thread['prefixid'] == news">

ChopSuey 12-23-2009 12:51 PM

So does it work? Screenshot?

tpearl5 12-23-2009 01:16 PM

It's working great!

Here's an example of a news thread: http://cellphoneforums.net/att/t3063...mmercials.html

Here's a regular thread: http://cellphoneforums.net/lg-dare/t...s-my-dare.html

The template used in the news threads is a modified version of what is available for the article forum hack, which I also use here: http://cellphoneforums.net/cell-phone-reviews/

doopz 01-07-2010 02:04 PM

Hi! could you give an example of what your postbit looks like right now?
having some problems integrating the alternative postbit..

tpearl5 01-07-2010 02:15 PM

There's links above that illustrate news and regular postbits

doopz 01-07-2010 02:24 PM

Hi,

Thank you for your fast reply.
Indeed there is, but that does not really help me with the postbit thing.
I don't need your exact postbit codings, just wondering about the if /else statement inside the postbit template.

Understand you don't feel like sharing your whole postbit :)

tpearl5 01-07-2010 02:39 PM

Oh okay, I see what you mean...

Here's roughly how I have it laid out:
Code:

<if condition="THIS_SCRIPT == 'showthread' AND $post[postid] == $GLOBALS['qrfirstpostid'] AND $thread['prefixid'] == news">

MODIFIED POSTBIT

<else />

EXISTING POSTBIT

</if>

'news' is the id of my news prefix. This will have to be changed depending on what your ID is.

ChopSuey 01-07-2010 07:41 PM

Looks very nice! Good work..Release how to do it in the 3.8 temp mods forum :)

tpearl5 01-11-2010 03:44 PM

Quote:

Originally Posted by ChopSuey (Post 1949894)
Looks very nice! Good work..Release how to do it in the 3.8 temp mods forum :)

Done! https://vborg.vbsupport.ru/showthread.php?p=1952840


All times are GMT. The time now is 03:37 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.01194 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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