vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Forum if condition not working (https://vborg.vbsupport.ru/showthread.php?t=232192)

Mythotical 01-05-2010 02:56 PM

No worries, sleep was calling me too.

I am missing something here, I know I am. I just can't put my finger on it.

Maybe I should move the if condition to the plugin instead. I am searching all forums dealing with vB coding for that warning and I'm still reading threads.

Lynne 01-05-2010 03:06 PM

I am stumped. I mean, our code looks almost identical and yet mine works and I do not get that error. Try really shortening it just to see what happens...

HTML Code:

<if condition="in_array($foruminfo['forumid'], $pl9_quoteloc)">
And did you try spitting out those variables? And did you check you data type for the field?

Mythotical 01-05-2010 03:15 PM

Interesting, if I spit out $pl9_quoteloc it returns:
Code:

Array
And $vboptions[pl9_qloc] returns:
Code:

1,2,3,31,4,5,6,7,8,9,23,10,24,11,25,12,26,13,27,14,15,28,16,29,17,30,18,19,20,21,22
So this is very very interesting considering it works for you but not me.

Lynne 01-05-2010 04:58 PM

And $pl9_quoteloc *should* return an array and it *should* work in that condition. Did you try just using the one simple condition? If you get the error, have you tried just telling it to use it anyway and seeing what happens? (And yes, I get the same results you do - Array for the first variable and the string of forumids if I print out the other.)

Mythotical 01-05-2010 06:06 PM

Yep I tried the one simple condition. I have saved it and told it to use it anyway and it still works so I don't see the problem.

I have discovered something though. If I change it to include array() like so:
HTML Code:

in_array($foruminfo['forumid'], array($pl9_quoteloc))
It saves without that Warning but if I remove array() it gives the warning.

Lynne 01-05-2010 06:11 PM

But it doesn't work like that, right?

Try printing out $foruminfo['forumid'] also and see what prints out. Also, did you ever check the data type of the option and see if it is set to Free?

Mythotical 01-05-2010 06:23 PM

Right, it stops working as soon as I add array()

I tried printing $foruminfo['forumid'] and it caused my if condition to stop working so I had to move that inside the if condition and it prints out the forum id properly.

Lynne 01-05-2010 06:32 PM

Quote:

Originally Posted by Steve M (Post 1948094)
I tried printing $foruminfo['forumid'] and it caused my if condition to stop working so I had to move that inside the if condition and it prints out the forum id properly.

That is weird. It should print it out (as $foruminfo[forumid] <- no single quotes).

Quote:

Also, did you ever check the data type of the option and see if it is set to Free?
!!!!!

Seriously, please check that. I've said it a couple of times now.

Mythotical 01-05-2010 06:44 PM

Oh sorry, I keep forgetting to mention that, yeah I checked it and it is set to Free.

Also I am using $foruminfo[forumid] without single quotes as well. The warning is referring to $pl9_quoteloc portion.

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

You know what, let me try this on my fresh vb test site.

Lynne 01-05-2010 06:49 PM

When I set the option to Numeric on my site, I get the exact problem you get - it only works for the first forumid. That's why I emphasized you needing to verify that datatype.


All times are GMT. The time now is 05: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.01058 seconds
  • Memory Usage 1,740KB
  • 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
  • (2)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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