vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   Conditional help needed for postbit (https://vborg.vbsupport.ru/showthread.php?t=269619)

RedWingFan 09-03-2011 09:20 PM

Conditional help needed for postbit
 
I'm adding something to the postbit templates for our discussion board. Here's what I'm after: if the specific forum is visible to the public, whether or not a user is logged in, I want the item (an icon in an <img> tag) to display in the postbit. If it is a non-public forum, then I do not want anything to display. Also, I noticed that this item also shows up in the postbit for private messaging, which we also don't want.

I had thought of doing a conditional like this:

Code:

<if condition="$forum[forumid] == 28">
However, I would need to specify each forum number in this conditional somehow. This would work, but it seems cumbersome...and I no longer remember the syntax for it.

I cannot base it on usergroup, since the item will need to appear whether or not a user is logged in.

Is there a conditional I can use that would accomplish what I'm looking for? Hopefully I have described it well enough.

I did create a conditional for iTrader, so that it shows up only in our Classifieds forum (which is where I grabbed my conditional sample from, above). I also have a custom navigation system that changes whether or not a user is logged in, but the code I need cannot be based on the customer's logged-in status.

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

This might work:

Code:

<if condition="in_array($forum['forumid'], array(1,2,3,6))"></if>
I just have to list the forum IDs. But I am thinking there is a simpler way.

And, would this prevent it displaying in the private message postbit as well?

Lynne 09-03-2011 11:27 PM

I don't know if there is a condition regarding whether a forum is private or not. Perhaps someone else knows.

But, the condition for whether it shows in private messages would be:
HTML Code:

<if condition="THIS_SCRIPT != 'private'">
stuff to not show in private message postbit
</if>



All times are GMT. The time now is 08:47 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.00976 seconds
  • Memory Usage 1,712KB
  • 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_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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