vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   making an if statment in postbit (https://vborg.vbsupport.ru/showthread.php?t=74739)

ranger2kxlt 01-20-2005 03:54 PM

making an if statment in postbit
 
I need to make this

$post['postcount'] == 1 equal more then the first post

$post['postcount'] ==1,2,3 doesn't work, how do i require more then one postcount besides creating a whole new IF statment for each postcount?

Thanks

sabret00the 01-20-2005 04:09 PM

<if condition="$post[postcount] >= 1">

ranger2kxlt 01-20-2005 04:39 PM

Sorry my example may be off a bit need something that i can choose each postbit

$post['postcount'] == 1,6,10,50

Not all of them ;-)

I guess it has to be

$post['postcount'] == 1 | $post['postcount'] == 6 | etc.....

is that correct?

Marco van Herwaarden 01-20-2005 06:00 PM

why not set something in your php script.

if ($var == 1 OR $var == 6 ......)
{
$postcountspecial = 1;
}

then in template just test this 1 var.

ranger2kxlt 01-20-2005 06:20 PM

Well this is in a template thats why.

Zachery 01-20-2005 06:40 PM

Quote:

Originally Posted by ranger2kxlt
Well this is in a template thats why.

<if condition="in_array($post[postcount], array(X,Y,Z))"> special post <else /> not special post </if>

Marco van Herwaarden 01-20-2005 06:42 PM

Yes but you could make the if statement in the script that loads the template, then just a single if statement in the template, based on a var set in the php.

Think i have seen OR like if's in templates once, but i don't remember in which one anymore

Zachery 01-20-2005 06:43 PM

Quote:

Originally Posted by MarcoH64
Yes but you could make the if statement in the script that loads the template, then just a single if statement in the template, based on a var set in the php.

Think i have seen OR like if's in templates once, but i don't remember in which one anymore

or works as well

<if condition="$var OR $var2">

basicly conditions let you do some real basic php, nothing fancy.

Marco van Herwaarden 01-20-2005 06:55 PM

Thanks for the explanation Zachery


All times are GMT. The time now is 07:06 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.00924 seconds
  • Memory Usage 1,724KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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