vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   VB Login & Info on Non-VB Page (https://vborg.vbsupport.ru/showthread.php?t=96013)

Exitilus 12-22-2005 03:11 AM

I'm using this and it works great. Though i'm wondering how would I set it to RE-Direct the person to my forums after logging in?

Though if the person is still logged in I want them to see this page. Basically just want the re-direction after they log in.

Snetty 12-22-2005 09:54 AM

Just thought i'd post a change I made to the chdir part of this code. It means you don't have to worry about putting in the folder structure of your host, the code will figure it out for you.

PHP Code:

//Change chdir to fit where your forum is.
$real_path realpath("index.php");
$real_path dirname($real_path);
chdir("$real_path/forum/");
require(
'./global.php');
require(
'./includes/functions_user.php');
chdir("$real_path/"); 

I've not been using php for terribly wrong so I don't know if there would be problems with this on some people's hosting. If so, let me know as I'd be interested to find out what they are.

sesmatik 12-22-2005 03:13 PM

Warning: chdir(): No such file or directory (errno 2) in /home/bauforum/public_html/forum/aa.php on line 3


Unable to add cookies, header already sent.
File: /home/bauforum/public_html/forum/aa.php
Line: 3


i see this error message what can i do please help me

already i am using vb 3.5.2

Snetty 12-22-2005 03:15 PM

sesmatik, are you using my chdir script there? if so, you need to adjust what your forum directory is called.

James B 12-23-2005 12:16 PM

Adam - this is perfect! Thanks very much...

All worked first time - just in a fairly plain page at the moment to try it out. This is going to be really handy. :)

Exitilus 12-24-2005 02:38 AM

Quote:

Originally Posted by Exitilus
I'm using this and it works great. Though i'm wondering how would I set it to RE-Direct the person to my forums after logging in?

Though if the person is still logged in I want them to see this page. Basically just want the re-direction after they log in.

Anyone know how I could do this?

gizmo4321 12-25-2005 03:04 PM

I have the basics of it working in 3.5.2. :up:

BTW, instead of all the if($vbulletin->userinfo['usergroupid']==xxx stuff, you could do a much simpler if(is_member_of($vbulletin->userinfo)) instead. You would have to include fuctions.php as well as the others, though.

Snoop-It 12-26-2005 12:39 AM

thats all good but how do you get the GUESTS on that 1 page to show up on the Who's Online bit on the forum.. I.E, Guests viewing Unknown Location - http://blah.com/etc

How does that go about?? same with the user once logged in..? because on my board, yes some 1 can log in on a non vb page BUT they will not be shown on who's online. i want that to be shown and any guests viewing that page aswell... what will i need to do??

please help. thanks in advance!

kirupa 12-26-2005 04:08 AM

Hi,
When I try out this code, it works perfectly in FF. When I test it out in the IE7 Beta, I am not seeing the log-in text fields. When I am already logged in though, both browsers displays the "Welcome...." message like they should.

EDIT: Nevermind - the issue was with the <style type=text/css> line. Removing that fixed it!

Thanks,
Kirupa =)

adamgessel 12-30-2005 02:54 PM

Sorry people I've had problems logging in to vBulletin.org the last month and a half or so... anyways, the demo site isn't up because they were charging me too much for it and I couldn't keep it up. Sorry about that.

I have hosting somewhere else now and I'll look into putting up another vBulletin forum and having the demo there.

ffevo 02-12-2006 06:44 AM

Alright. Im using PHP Includes. and When I add that Script ontop of my page. It changes the Directory. well.. when I add the Includes for the Global files it changes the directory for my Includes for the real directory obviously. :-/ Is thier anyway around this? can I use the script and Not have it screw up my Includes?

THis is my PHP code I have. I even tried using Smettys Code or whatevers..


PHP Code:

   <?php
 
//Change chdir to fit where your forum is.
$real_path realpath("index.php");
$real_path dirname($real_path);
chdir("$real_path/forums/");
require(
'./global.php');
require(
'./includes/functions_user.php');
chdir("$real_path/");
?>
 <?php
if(!isset($_GET['page'])) {
$page 'news';
} else {
$page $_GET['page'];
}
?>


Exitilus 02-28-2006 08:09 PM

For some odd reason this just "quit" working. Not sure really what happened but i'm getting a completely blank page now?? .... O.o

No changes were made what so ever *L* any ideas on this one?

Jordan17 04-11-2006 04:34 PM

I was getting the "Unable to add cookies" message, but now all that happens is that If the user is not logged in, it doesn't load all of the page.

I'm guessing theres some sort of kill or exit function somewhere in the code that is executed mid-way through the page.

Paprika 05-03-2006 12:22 PM

Does this work for 3.5.4, and/or is there a similar mod avalible which does not require modification of the original files?

nemmeh 06-05-2006 12:21 PM

I think $5 is quite reasonable to fix YOUR inability to read directions.
As for all these "Unable to add cookies" errors people are recieving, try adding the chdir at the TOP of the lot.. not below your index.php includes (which no doubt will include <html> ref and thus ending the header portion of the PHP code.)

This was clearly stated in the installation directions.

Apart from that I installed this and it worked from the get-go. That is until I disabled the forums.. In which case the page was taken over by global.php's $warning. Which states the forums are disabled.

removing the chdir will stop the login script from working.. at all.. If you want to change the dir back try:
PHP Code:

<?php
$curdir 
getcwd();
chdir("/..../..../..../..../..../forum"); 
require(
'./global.php'); 
include(
'./includes/functions_user.php'); 
chdir("$curdir");
?>


nemmeh 06-06-2006 03:00 PM

After having a bit of a toy around with it i solved the inactive board problem.
I havnt even bothered looking into the disabled user yet but i thought i would post what ive got in case anybody was interested or having a similar problem.

I created a file called forumcheck.php which i simply include at the top of my formatpage (header.php) like so.

PHP Code:

<?php include("forumcheck.php"); ?>

The contents of forumcheck.php (some details removed).
PHP Code:

<?
    $curdir = getcwd();
    chdir("/..../..../..../..../..../forum");  
    include("$curdir/blah.php"); //just my dbase login details etc.
    mysql_connect(localhost,yourdbase_username,yourdbase_password);
    @mysql_select_db(your_dbase) or die("Unable to select database");
    $query="select * from `vb3_setting` where `varname` like 'bbactive'";
    $result=mysql_query($query);
    $num=mysql_numrows($result);
    mysql_close();
    if(mysql_result($result,0,"value") == 1) {
        require('./global.php'); 
        include('./includes/functions_user.php'); 
        $config["forum"]["active"] = 1;
    }
    else { $config["forum"]["active"] = 0; }
    chdir("$curdir");
?>

and lastly the display.
PHP Code:

<? 
    if($config["forum"]["active"] == 1) { include("login_inc.php"); }
    elseif($config["forum"]["active"] == 0) { print("<font color=#666666><b>Forums are currently disabled.</b></font>"); }
?>

Hope that something here has helped somebody... =)


All times are GMT. The time now is 04:19 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.01151 seconds
  • Memory Usage 1,774KB
  • 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
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete