vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   if condition problem (https://vborg.vbsupport.ru/showthread.php?t=224399)

Alexey? 10-02-2009 11:12 AM

if condition problem
 
Ok, i want to show some information in forum x y z and in the other forums i want to hide it.

Which conditions you think i should use?
By the way i'm editing the template forumhome_forumbit_level1_post.

I'm want that forum 9,10,11 will show hey
and the other forums will show nothing

By the way it is all an examples.

Lynne 10-02-2009 02:07 PM

If you look at the template, you'll see the variables used in it and one of them is $forum[forumid]. So, use that in your condition:
HTML Code:

<if condition="in_array($forum['forumid'], array(x, y, z))">
stuff only for forums x, y, and z
</if>


Alexey? 10-02-2009 03:10 PM

Its not working.
I'm trying to do this
<if condition="in_array($forum['forumid'], array(9, 132, 95, 72, 13, 288, 113, 124, 11, 12, 100, 62, 16, 421, 14, 10))">
My costume code.
</if>

and it is not change, i still staying the same as the main code

Digital Jedi 10-02-2009 03:30 PM

You ONLY put the forum IDs of the forums you WANT it to show in.

Alexey? 10-02-2009 03:31 PM

This is what i did, i put the id of the categories i want to show it there.

Maybi i need another condition to hide some COSTUME TEMPLATE in this forums

Digital Jedi 10-02-2009 03:34 PM

So your saying your custom code is still showing everywhere on the forum?

Alexey? 10-02-2009 03:38 PM

My costume code isn't showing any where, But i think i need another code that make the opposite of this code.

I want to hide some information in a few forums that i choose

Digital Jedi 10-02-2009 04:57 PM

Did you test the code first to make sure it was showing at all, by itself?

Alexey? 10-02-2009 05:03 PM

of course, i tried to replace it with the original code and it worked good.
but the problem was that i want to show it only in categories and not in the all forums.
And the code Lynne gave me above doesn't work

Lynne 10-02-2009 05:05 PM

You can try the opposite:
HTML Code:

<if condition="!in_array($forum['forumid'], array(x, y, z))">
stuff only if NOT in forums x, y, and z
</if>



All times are GMT. The time now is 04:10 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.01142 seconds
  • Memory Usage 1,725KB
  • 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_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete