The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Custom page + conditionals
I am using the code below to create custom pages in my forum - I thought it was working great until I started testing for cross browser compatibility.
For the most part, the file works in IE, FF, and OPERA just fine, but when adding the conditional in red - OPERA will not display the page after logging in - it just redisplays the no permission/login page even though its logged me in. Any idea why OPERA does this? I know its <2% of users, but I like to work on all browsers. Code:
<?php // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'my-file'); // change this depending on your filename // ################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array( ); // get special data templates from the datastore $specialtemplates = array( ); // pre-cache templates used by all actions $globaltemplates = array( 'My_Template', ); // pre-cache templates used by specific actions $actiontemplates = array( ); // ######################### REQUIRE BACK-END ############################ require_once('global.php'); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### if (!in_array($vbulletin->userinfo[usergroupid], array(2,6,7))) { print_no_permission(); } $navbits = array(); $navbits[$parent] = 'My Page'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); eval('print_output("' . fetch_template('My_Template') . '");'); ?> |
#2
|
||||
|
||||
How about instead of:
PHP Code:
PHP Code:
|
#3
|
|||
|
|||
There is nothing in your PHP=code that is browser dependent. If there is a dependecy then it is in 1 of the templates used.
|
#4
|
|||
|
|||
Quote:
Code:
{ print_no_permission(); } |
#5
|
||||
|
||||
Try commenting those lines out and see what the result is. Maybe it's some other function in global.php that is causing the problem.
|
#6
|
|||
|
|||
Well its important to me that page only allow certain groups in - If it dont work in OPERA oh well - was just wanting to see if I could find out why it wasnt working.
|
#7
|
||||
|
||||
If that function didn't work in Opera, don't you think a lot of vbulletin owners would be a bit peeved? That code is used throughout vbulletin only the condition used is a bit different (and, of course, other lines are different). Take a look at the other scripts that have no permission in them and you will see. I'm thinking something else is causing the problem in your script.
|
#8
|
||||
|
||||
Quote:
Quote:
As an avid Opera user myself, I find that it's the other browsers that do funky things. After all, Firefox only just started passing the ACID 2 Browser Test (on the release build, FF has been passing for years on a few select nightly builds but they don't count). In fact, one thing that I absolutly detest about Firefox is that it makes assumptions about the code on the page - if a tag is not closed, Firefox will close it for you (this was a NIGHTMARE for some AJAX stuff). Needless to say, sometimes Firefox guessed where to close it incorrectly. I've had friends who abused the hell out of that feature, they would only write a quarter of the necessary code for a page to work properly and rely on Firefox to do everything else - when it didn't work for me they told me to switch to Firefox. I've come to loath the firefox subculture for that. But I digress... I think the problem is that your other browsers cache is interfering with the results of the script. Force a re-download of the page Firefox: Hold shift and press the refresh button Internet Explorer: Hold CTRL and press the refresh button If they don't come up with the same error that Opera does, then it's not what I think it is... However, if they do come up with errors then I think the problem is that you're missing this line from your PHP file: Code:
global $vbulletin; Try printing the valueof usergroupid instead of printing no permission... That might give you a clue as to what the real cause is. One time I had a very similar problem when it came to admin logins. After changing the subdomain on which vB was installed, vB couldn't find any of the cookie data. SessionIDs started appending to the ends of the URLs, and vB wouldn't even let me access the admin panel without a cookie login. I recommend that you upload the "tools.php" file from your "do_not_upload" folder and run the cookie repair utility just to rule out cookie settings errors. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|