Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-02-2005, 09:31 AM
Zelda-King's Avatar
Zelda-King Zelda-King is offline
 
Join Date: Nov 2002
Location: London, England
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 10-02-2005, 01:16 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Also check your board url in the vBulletion Options.
Reply With Quote
  #3  
Old 10-02-2005, 01:17 PM
Zelda-King's Avatar
Zelda-King Zelda-King is offline
 
Join Date: Nov 2002
Location: London, England
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 10-02-2005, 01:47 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

chdir is nothing but a php deal, it isn't effecting images or links, thats all your html.
Reply With Quote
  #5  
Old 10-02-2005, 01:48 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 10-02-2005, 01:53 PM
Zelda-King's Avatar
Zelda-King Zelda-King is offline
 
Join Date: Nov 2002
Location: London, England
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.)
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 10:06 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.04193 seconds
  • Memory Usage 2,210KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete