vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need help with, if condition (https://vborg.vbsupport.ru/showthread.php?t=249700)

kh99 09-02-2010 11:37 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2092841)
$post[userid] is just a number, right? so it's like

!$vboptions['shownlinks'][999] AND $vboptions['shownlinks'][999] = true

Maybe I'm not getting how $vboptions['shownlinks'] works?

'shownlinks' is just an arbitrary string, it could be anything as long as other code isn't trying to use the same variable. In fact you probably don't even need to use $vboptions. In any case, $vboptions['shownlinks'] is an array used to store whether or not a user's links have been shown. When the code starts generating the page, $vboptions['shownlinks'] doesn't exist so it works just like an array where every value is false, so the first time the code checks user 999 it will be false and !$vboptions['shownlinks'][999] will be true. The part after the AND assigns "true" to a user's slot in the array, and since an assignment has a value (the value being assigned), it will always be "true". So it doesn't affect the logic if the if statement, it just gets the assignment done.

Does that make any sense? I'm not so good with the explaining.

ETA: Oh, well...I just noticed that the above code was missing "condition=" because I messed up when editing. Maybe that's what was confusing. :D

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

Quote:

Originally Posted by DamasGate (Post 2093038)
Helo,

I use this code

So you know where "$favo" comes from? I don't know what that is.

You could try surrounding the above with:

Code:

     
<if condition="$favo">


</if>


BirdOPrey5 09-03-2010 12:07 AM

Quote:

Originally Posted by kh99 (Post 2093039)
'
Does that make any sense? I'm not so good with the explaining.

ETA: Oh, well...I just noticed that the above code was missing "condition=" because I messed up when editing. Maybe that's what was confusing. :D

I think I got it now, thanks!

Quote:

You could try surrounding the above with:

Code:

     
<if condition="$favo">


</endif>


I think the last line is :"</if>" not "</endif>"

kh99 09-03-2010 12:41 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2093048)
I think the last line is :"</if>" not "</endif>"

Heh...yeah, thanks.

DamasGate 09-03-2010 11:17 AM

Quote:

Originally Posted by kh99 (Post 2093039)

So you know where "$favo" comes from? I don't know what that is.

You could try surrounding the above with:

Code:

     
<if condition="$favo">


</if>



Its work very good.

You are great kh99, Thanks Million


All times are GMT. The time now is 09:27 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.01085 seconds
  • Memory Usage 1,727KB
  • 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
  • (3)bbcode_code_printable
  • (6)bbcode_quote_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
  • (4)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