vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   What is wrong with this code? (https://vborg.vbsupport.ru/showthread.php?t=64016)

Christine 04-17-2004 09:07 PM

What is wrong with this code?
 
I am trying to set up subscriptions, and need to block style selections for free members. I can't do an is IN (x,y) in the modifyoptions and footer templates as it gives me an error saying that IN isn't one of the options I can use for conditional functions.

I tried this in phpinclude_start, but it isn't working either:
PHP Code:

if ($bbuserinfo['membergroupids'IN (20,21))
}
$vboptions['allowchangestyles'] = 1;
} else { 
$vboptions['allowchangestyles'] = 0


I know I am missing something simple here, but I don't know what.

Can anyone help?

assassingod 04-17-2004 09:11 PM

The second line is } instead of {

TouchingVirus 04-17-2004 09:22 PM

Why not try this..


PHP Code:

if (($bbuserinfo['membergroupids']=='20') || ($bbuserinfo['membergroupids']=='21'))
}
$vboptions['allowchangestyles'] = 1;
} else { 
$vboptions['allowchangestyles'] = 0


or if that fails (it might or mightn't work..i never used that varaible..)..this should work

PHP Code:

if (($bbuserinfo[usergroupid]=='20') || ($bbuserinfo[usergroupid]=='21'))
}
$vboptions['allowchangestyles'] = 1;
} else { 
$vboptions['allowchangestyles'] = 0



TouchingVirus 04-17-2004 09:24 PM

And what assassingod said is true too ..i forgot to post that in my message :P..but it that was the actual code, it should give a PARSE error somewhere along the line...

Boofo 04-17-2004 09:58 PM

PHP Code:

if (in_array($bbuserinfo['membergroupids'], array(20,21)))

$vboptions['allowchangestyles'] = 1
}
else

$vboptions['allowchangestyles'] = 0



Christine 04-17-2004 10:40 PM

Very odd -- I wonder why it didn't give me any parse errors? It just seemed to ignore that section of the code all together.

Let me try to fix it...

Boofo 04-17-2004 11:29 PM

Why don't you use the is_member_of condition? ;)

Christine 04-18-2004 12:04 AM

It is fixed -- thanks!

Bob -- I am not familiar with that, is it a better way?

I am still confuzzled as to why I didn't get a parse error with that { in there wrong. Oh well.

Boofo 04-18-2004 12:49 AM

What code did you end up using?

TouchingVirus 04-18-2004 01:08 PM

Indeed, say who won :P:P

Christine 04-18-2004 06:37 PM

Since I am trying to learn how to work with arrays, I kept Bob's, but all three methods worked.

:D

TouchingVirus 04-18-2004 07:05 PM

[high]* TouchingVirus pays Boofo
[/high]

damnit, i will get you again :D

Boofo 04-18-2004 09:01 PM

Quote:

Originally Posted by TouchingVirus
[high]* TouchingVirus pays Boofo
[/high]

damnit, i will get you again :D

And no checks! Cash only! ;)


All times are GMT. The time now is 08:07 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.01249 seconds
  • Memory Usage 1,741KB
  • 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
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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