vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   [SOLVED] Need condition to hide a code from forumid (https://vborg.vbsupport.ru/showthread.php?t=296394)

Divvy 03-22-2013 08:38 AM

[SOLVED] Need condition to hide a code from forumid
 
Hello guys,

Can someone please tell me how can I use a condition to hide a code in a specific forum id?

I have a custom code in postbit_legacy.

I already tried many codes but none is working:
Code:

<vb:if condition="$forum[forumid] != 6">
Code:

<vb:if condition="$thread[forumid] != 6">
etc...

Can someone please help me? Thanks! :)

If possible, I like to use this to work together with:
Code:

<vb:if condition="$post['isfirstshown']">
It is possible?

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

Ok, I found a code that works:
Code:

<vb:if condition="$post['isfirstshown'] AND in_array($thread[forumid], array(6))">
This will show the code ONLY in a specific forum.

Is almost what I want, but I need to HIDE in a specific forum... any ideas?

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

Fixed!

Just needed to place a ! before the in_array

Correct code:
Code:

<vb:if condition="$post['isfirstshown'] AND !in_array($thread[forumid], array(6))">
Thank you anyway guys :)

Lynne 03-22-2013 04:38 PM

I'm glad we could help. :D



(I'm glad you figured it out and thanks for posting what worked!)

Divvy 03-22-2013 07:15 PM

No problem :)

Could be useful to someone else with same idea.


All times are GMT. The time now is 06:02 PM.

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.01057 seconds
  • Memory Usage 1,710KB
  • 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
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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