PDA

View Full Version : Custom page + conditionals


manning
08 Jan 2009, 13:30
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Lynne
08 Jan 2009, 15:05
How about instead of:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



You use:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Marco van Herwaarden
08 Jan 2009, 15:10
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.

manning
09 Jan 2009, 18:04
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.

Only thing in template is basic html ... nothing that would cause OPERA to keep returning no permission screen... thats in this php file.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Lynne
09 Jan 2009, 18:09
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.

manning
10 Jan 2009, 02:38
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.

Lynne
10 Jan 2009, 02:56
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.

TigerC10
09 Feb 2009, 06:22
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.

He's right, manning. PHP is a server-side script - it doesn't care what browser you're using, it will always deliver the same HTML/Javascript/XML to your end user.


Only thing in template is basic html ... nothing that would cause OPERA to keep returning no permission screen... thats in this php file.

Just how basic? Because some people use browser-dependent CSS with their HTML without realizing it. Some styles unwittingly use browser-dependent CSS too.


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 (http://www.webstandards.org/action/acid2/) (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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


You can't use $vbulletin->userinfo[usergroupid] without knowing about $vbulletin in the first place (that it was defined in some other PHP file), and to do that you have to tell it that $vbulletin is defined globally.

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.