PDA

View Full Version : Help needed with some conditionals (forum/first post)


Triky
10-31-2015, 01:18 PM
I need to show a customized postibit_lagacy template in some forums. And this should apply only to the first post of the threads.

So, I founded these conditionals:

<if condition="in_array($thread['forumid'], array(1,2,3,6))"></if>... and:

<if condition="!$GLOBALS['FIRSTPOSTID']"></if>

My question is: how should I use them in the best way?

Should I do something like this?


<if condition="!$GLOBALS['FIRSTPOSTID']" AND in_array($thread['forumid'], array(1,2,3,6))">

My custom postbit_legacy code.

<else />

Original postbit_legacy code.

</if>

Is this correct?

Dave
10-31-2015, 01:31 PM
<if condition="!$GLOBALS['FIRSTPOSTID']" AND in_array($thread['forumid'], array(1,2,3,6))">

That double quote has to be removed.

Triky
10-31-2015, 02:23 PM
Yes, I already founded it! Thanks!

--------------- Added 31 Oct 2015 at 17:35 ---------------

I have a problem: using those conditionals, when I add another message, it first show me the new postbit_legacy that I edited. I have to reload the page in order to see the reply using the old postbit_legacy code. Some suggestions? edit: SOLVED.

--------------- Added 31 Oct 2015 at 18:44 ---------------

I have another question. Is there a variable to show the Forum(Section) Title in postbit_legacy? I tried this: $foruminfo[title] and this: $foruminfo[title_clean] but it doesn't work.

Scandal
10-31-2015, 04:47 PM
I have another question. Is there a variable to show the Forum(Section) Title in postbit_legacy? I tried this: $foruminfo[title] and this: $foruminfo[title_clean] but it doesn't work.
Try
$forum[title]

:)

Triky
10-31-2015, 05:27 PM
Thank you, now it works perfectly!

darnoldy
11-01-2015, 04:47 PM
You may be able to accomplish your customization using CSS. Here is some code that I put in the postbit to change the class of first posts:

<table id="post$post[postid]" class="<if condition="$post[parentid]==0 AND $forum[forumid] != 4">postbit_first<else />postbit</if>">