vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help needed with some conditionals (forum/first post) (https://vborg.vbsupport.ru/showthread.php?t=320666)

Triky 10-31-2015 01:18 PM

Help needed with some conditionals (forum/first post)
 
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:

Code:

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

Code:

<if condition="!$GLOBALS['FIRSTPOSTID']"></if>
My question is: how should I use them in the best way?

Should I do something like this?

Code:

<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

Quote:

Originally Posted by Triky (Post 2558007)
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
HTML Code:

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

HTML Code:

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


All times are GMT. The time now is 12:24 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.01184 seconds
  • Memory Usage 1,722KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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