Log in

View Full Version : Use different postbit template depending on prefix


tpearl5
12-22-2009, 12:44 PM
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 1261501959 at 1261501959 ---------------

I actually found a slightly simpler solution. I added an alternate layout to the postbit and can switch between the two using this conditional:
<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/t306319-t-getting-raw-end-deal-commercials.html

Here's a regular thread: http://cellphoneforums.net/lg-dare/t290253-bitpim-cant-get-ringtones-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:

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