Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2015, 01:18 PM
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
Posts: 728
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 10-31-2015, 01:31 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

That double quote has to be removed.
Reply With Quote
Благодарность от:
TheLastSuperman
  #3  
Old 10-31-2015, 02:23 PM
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
Posts: 728
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 10-31-2015, 04:47 PM
Scandal's Avatar
Scandal Scandal is offline
 
Join Date: Dec 2005
Location: Athens / Greece
Posts: 409
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Triky View Post
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]
Reply With Quote
2 благодарности(ей) от:
TheLastSuperman, Triky
  #5  
Old 10-31-2015, 05:27 PM
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
Posts: 728
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, now it works perfectly!
Reply With Quote
Благодарность от:
TheLastSuperman
  #6  
Old 11-01-2015, 04:47 PM
darnoldy darnoldy is offline
 
Join Date: Dec 2004
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>">
Reply With Quote
Благодарность от:
Triky
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:40 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09708 seconds
  • Memory Usage 2,224KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (2)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (5)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete