vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Problem with forced vB login box when using chdir("./forums"); on site index (https://vborg.vbsupport.ru/showthread.php?t=97359)

Zelda-King 10-02-2005 09:31 AM

Problem with forced vB login box when using chdir("./forums"); on site index
 
I'm trying to have a conditional link to my forums on the site index so logged in members have a direct link but guests get there via my rules page. I initially have it working but I've noticed if the forums aren't viewable by certain usergroups they are given a forced "You are not logged in" vBulletin login box which overrides the site code. Here's the code I'm using;
PHP Code:

<?php
chdir
("./forums");
require_once(
'./global.php');
?>

and
PHP Code:

<?php
if ($vbulletin->userinfo['userid'])
{
echo 
"<a href=http://www.mysite.com/forums/><font size=1>&nbsp<b>Forums</b></font></a>";
}
else
{
echo 
"<a href=http://www.mysite.com/rules.php><font size=1>&nbsp<b>Forums</b></font></a>";
}
?>

The main problem with this box at the moment is if they try to login they are taken to mysite.com/login.php (which doesn't exist) instead of mysite.com/forums/login.php.

It's actually the call to global.php that is doing this. What I need is some way to move all the URLs on that page forward to the forums directory. eg: login.php and the header/gradient URLs used for the form images.

Any suggestions?

Marco van Herwaarden 10-02-2005 01:16 PM

You are doing a chdir to ./bb, but you say your forum is in ./forums?

Also check your board url in the vBulletion Options.

Zelda-King 10-02-2005 01:17 PM

No it's all /bb. I simply edited the URLs a bit for this thread so you don't have my actual site shoved in your face. :)

I neglected to change the /bb here. Sorry about that. (Fixed)

The chdir command is working because it is calling global.php properly. It's just the URLs to everything on the forced login screen are looking for forum files from outside the forums directory (as stated). eg;

mysite.com/images/gradients/gradient_panel.gif instead of mysite.com/forums/images/gradients/gradient_panel.gif

and;

mysite.com/login.php instead of mysite.com/forums/login.php so logging in doesn't work. That's all I need to fix. I've already worked around the images by simply uploading the required ones where they're needed until I find a better method.

Zachery 10-02-2005 01:47 PM

chdir is nothing but a php deal, it isn't effecting images or links, thats all your html.

Marco van Herwaarden 10-02-2005 01:48 PM

For the links it should be enough to set the correct board url in your vB options, like i mentioned above.

For image, use full image paths in your style settings.

Zelda-King 10-02-2005 01:53 PM

It just occured to me about the images. Thanks for mentioning it. It made me get on with the job and that fixed the images issue. As for the vB options, the correct URL is set. http://www.mydomain.com/forums <-- That format. I've always had it like that but I still get the login problem.

Update;

Better (any other O_O) solutions welcomed but for the time being I dealt with the issue this way;

Made a login.php for the main site to redirect back to the main page. eg:
PHP Code:

<?php
header
("Location: http://www.mysite.com/");
?>

Crude but does the job. :)

Update 2: I figured out where I can fix the link. The full URL was needed in the STANDARD_ERROR template, though I reckon my solution is better for my purposes than template editing. Why divert people on the site to the forums, eh? Thanks for the tips, people. :)

(Of course, when I open the forums again to public view, this issue will be trivial.)


All times are GMT. The time now is 05:26 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.01006 seconds
  • Memory Usage 1,729KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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