Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-23-2010, 07:11 PM
Kyojii Kyojii is offline
 
Join Date: Jun 2008
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default is_member_of gives mixed results?

Here's an easier example of my problem.
PHP Code:
<?php
require_once("./global.php");
echo is_member_of($vbulletin->userinfo, 6);
?>
Result: 1 (true)

PHP Code:
<?php
require_once('./global.php');

function allowaccess() {
if (is_member_of($vbulletin->userinfo, 6)){
    return 1;
}
else{
    return 0;
}
}
echo allowaccess();
?>
Result: 0 (false)

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

I got around this by instead of making my own function just making an array of users I wanted to be able to access the page and including the file on every page.
Reply With Quote
  #2  
Old 12-23-2010, 08:47 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$vbulletin isn't global in your function and you haven't passed the value $vbulletin, so it's false (empty).
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:43 PM.


Powered by vBulletin® Version 3.9.0
Copyright ©2000 - 2017, vBulletin Solutions Inc.