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)
-   -   Simple vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=100992)

Snatch 03-22-2006 10:36 AM

I get this Error

Code:

Notice: Undefined index: HTTP_REFERER in /var/www/web1/html/vb3/includes/class_core.php on line 1574
And this ist my index.php
PHP Code:

<?php
chdir
('/var/www/web1/html/vb3');  
require_once(
'/var/www/web1/html/vb3/global.php');  
?>
<html>  
<body>  
<?php
/************************************************\
 * File Uploader
 * **********************************************
 * File Name    : index.php
 * Author       : Tuan Do @ [url]www.celerondude.com[/url]
 * Email        : [email]dork@celerondude.com[/email]
 * Purpose      : load actions
\************************************************/

 
require_once('/var/www/web1/html/test/login_inc.php');
   
//-----------------------------------------------
// Initialize some stuff
//-----------------------------------------------
ob_start('ob_gzhandler');
error_reporting(E_ALL);
define('UPLOADER'1);

//-----------------------------------------------
// Require neccessary files and initialize objects
//-----------------------------------------------
require_once('includes/common.inc.php');
require_once(
'includes/template.class.php');
require_once(
'includes/functions.inc.php');
$Template = new Template('templates');
$Template->_cache 1;
$Template->_cache_dir 'cache/';
$start timer();


  
//-----------------------------------------------
// Load the settings file
//-----------------------------------------------
$Settings load_file($settings_file);


//-----------------------------------------------
// Files to include and the action
//-----------------------------------------------
$includes = array(
                    
'default'               => 'uploader.php',
                    
'login'                 => 'login.php',
                    
'logout'                => 'logout.php',
                    
'register'              => 'register.php',
                    
'lostpassword'          => 'lostpassword.php',
                    
'browse'                => 'browse.php',
                    
'viewfiles'             => 'viewfiles.php',
                    
'changepassword'        => 'changepassword.php',
                );
if( !isset(
$_GET['action']) || empty($_GET['action']) || !isset($includes[$_GET['action']]) )
{
    
$action 'default';
}
else
{
    
$action =& $_GET['action'];
}

//-----------------------------------------------
// Authenticate user
//----------------------------------------------- 
$banned [] = 'x.x.x.x';
$banned [] = 'x.x.x.x';
$banned [] = 'x.x.x';

if ( 
in_array $_SERVER['REMOTE_ADDR'], $banned ) )
{
    
show_message('Access Denied''Your IP address has been restricted from accessing this uploader.'1);

    
$Template->display('index.tpl');
    
    exit;
}
$logged_in 0;
if(
$Settings['password_required'] && $action != 'register' && $action != 'lostpassword' && $action != 'login' && $action != 'lostpassword')
{
    
session_start();
    if(!isset(
$_SESSION['uploader_username']))
    {
        if(isset(
$_COOKIE['uploader_userid']) && isset($_COOKIE['uploader_password']))
        {
            
$user authenticate_by_id($_COOKIE['uploader_userid'], $_COOKIE['uploader_password']);
            if(!
$user)
            {
                
$action 'login';
            }
            else
            {
                
$logged_in 1;
                
$current_user $user['username'];
                
$Template->assign('logged_in'1);
            }
        }
        else
        {
            
$action 'login';
        }
    }
    else
    {
        
$current_user $_SESSION['uploader_username'];
        
$logged_in 1;
        
$Template->assign('logged_in'1);
    }
}


//-----------------------------------------------
// Load action file.
//-----------------------------------------------
require( 'includes/' $includes[$action]);

//-----------------------------------------------
// Included files made changes to the template
// Now print everything
//-----------------------------------------------
if($Settings['password_required'] && !$logged_in)
{
    
$Template->assign('noheader'1);
}

$Template->assign('runtime'timer($start) );
$Template->display('index.tpl');
?>
</body>  
</html>

GreeTz
Snatch

nestoras 04-06-2006 01:15 AM

i have just install this!
1 problem!
i have this too
i have done everything you say but no fix!

Billspaintball 04-14-2006 01:26 PM

Sorry about the lack of support.
We have just had a new addition to the family 3 weeks ago and Ive been kinda busy.

Billspaintball 04-14-2006 01:32 PM

Quote:

Originally Posted by Snatch
I get this Error

I think its almost certainly a conflict because of something else you have on the page.

Have you tried section 5 of the troubleshooting guide to rule out other scripts interfearing?

Spinball 04-21-2006 11:13 PM

I'm having the same problems.
PHP Code:

<?php
   chdir
("/home/sites/avforums/public_html/forums");
   require_once(
'../forums/global.php');  
require_once(
'/home/sites/avplay/public_html/login_inc.php');
$allowed_userids "1";
$allowed_users explode(",",$allowed_userids);
if (!(
in_array($vbulletin->userinfo['userid'],$allowed_users))) {
   echo (
"<P align='center'>Sorry but you do not have permission to access this page.</P>");
   include (
"/home/sites/avplay/public_html/footer.php");
   exit();
}

chdir("/home/sites/avplay/public_html");

...avforums.com and avplay.com are both on the same server and AV Forrums has been set up with the cookie path being / and cookie domain being .avforums.com.

Keeps saying I'm not allowed in, and when I print_r $vbulletin->userinfo is returns a userd of 0.
Help!

Billspaintball 04-22-2006 04:56 AM

Have you tried just the sample code in "Troubleshooting - step 5" yet?
(refer to this post https://vborg.vbsupport.ru/showpost....98&postcount=2 )

If so, what happened?

Spinball 04-22-2006 07:38 AM

Quote:

Originally Posted by Billspaintball
Have you tried just the sample code in "Troubleshooting - step 5" yet?
(refer to this post https://vborg.vbsupport.ru/showpost....98&postcount=2 )

If so, what happened?

Yep - the same happened. Using vB 3.5.4
PHP Code:

<?php 
chdir
('/home/sites/avforums/public_html/forums'); 
require_once(
'/home/sites/avforums/public_html/forums/global.php'); 
?> 
<html> 
<body> 
This is a heading<br /> 
This is some more stuff <br /> 
And another line<br /> 
You get the idea<br /> 
Just place stuff as you normally would with HTML<br /> 
I use CSS to style and position on my site fwiw<br /> 
<br /> 
How about we put the login box right under here?<br /> 
<br /> 
<?php 
    
require_once('/home/sites/avforums/public_html/login_inc.php'); 
print_r($vbulletin->userinfo);

?> 
</body> 
</html>

Uploaded to www.avforums.com it works perfectly. Uploaded to www.avplay.com it does not. I get the 'Thanks for loggin in' message followed by the login request.
The contents of $vbulletin->userinfo are not being filled when the script is on avplay.com.

Billspaintball 04-23-2006 11:11 AM

Im pretty sure its related to cookies somehow.

Do both your forums use the same cookie prefix?

Spinball 04-23-2006 11:21 AM

Quote:

Originally Posted by Billspaintball
Im pretty sure its related to cookies somehow.

Do both your forums use the same cookie prefix?

I agree with you Bill. AVPplay.com is not a forum and there is no cookie manipulation on the website.

Spinball 04-27-2006 06:39 PM

Anyone got any ideas on this one? Can this hack work on a website on the same server but with a different domain?

Billspaintball 05-02-2006 10:46 PM

Did you try the edit at the end of step 4 in troubleshooting?

Weirdwolf 05-15-2006 03:52 PM

I'm trying to restrict access to pages based on Usergroups, but I can't figure out what I shoud do with the code you provided. I have tried it in different locations on the page, but whether I'm logged in or not it always shows me the page. Any help? (The user login works perfectly for me, btw.)

Billspaintball 05-16-2006 12:15 AM

Quote:

Originally Posted by Weirdwolf
I'm trying to restrict access to pages based on Usergroups, but I can't figure out what I shoud do with the code you provided. I have tried it in different locations on the page, but whether I'm logged in or not it always shows me the page. Any help? (The user login works perfectly for me, btw.)

post a sample of your page and what you are trying to do, so we can have a look at it.

Weirdwolf 05-16-2006 01:23 AM

Right now I have it at the top of the page, and I'd like to restrict this page's access to those who attend here only. I've also tried replacing the 'Have stuff for here' with the content of the page, and that didn't work either. I realize I must be missing the obvious, but I'm just stumped at this point. Thanks for any help. :)

PHP Code:

<?php
   chdir
('forums'); 
   require_once(
'forums/global.php');  
?>
<?php
if ($vbulletin->userinfo['usergroupid'] == '9' )
    {
    echo 
"Have stuff for here";
             } else {
             echo 
"You do not have permission for this page"; }
    
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Richmond church of Christ Member Services</title>
<style type="text/css">
<!--
body,td,th {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
}
body {
    background-color: #0066FF;
}
#Layer1 {
    position:absolute;
    left:11px;
    top:8px;
    width:25px;
    height:70%;
    z-index:1;
    background-color: #0000FF;
}
#Layer2 {
    position:absolute;
    left:52px;
    top:19px;
    width:8px;
    height:90%;
    z-index:2;
    background-color: #0000FF;
}
.style1 {
    font-size: 14px;
    font-weight: bold;
}
.style3 {font-size: 10px}
-->
</style>
<link href="siteCSS.css" rel="stylesheet" type="text/css" />
</head>

<body>
<p align="center"><img src="images/memserv.gif" width="484" height="37" align="middle" /></p>
<table width="80%" border="4" align="center" bordercolor="#999999" bgcolor="#FFFFFF">
  <tr>
    <td><table width="100%" align="center">
      <tr>
        <td width="50%" align="left" valign="top"><p>Welcome to the Richmond church of Christ Member Services area. Here you will find special areas and information specifically <em>for</em> members attending here in Richmond</p>
          
          <p><?php include('login_inc.php'); ?>&nbsp;</p></td>
          
        <td width="50%" align="left" valign="top"><p align="center" class="style1">Church News &amp; Announcements </p>
          <p>
            <?php include('news/index.php'); ?>
          &nbsp;</p></td>
      </tr>
    </table>
      <p align="center"><span class="style3">&copy;2006 Richmond church of Christ, Richmond, Kentucky, United States 40475 </span></p>
    </td>
  </tr>
</table>
</body>
</html>


Billspaintball 05-16-2006 04:21 AM

Ok, I see whats gone wrong.
The "have stuff here" line is where you put your page contents.
For example;

PHP Code:

<?php
   chdir
('forums'); 
   require_once(
'forums/global.php');  
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Richmond church of Christ Member Services</title>
<style type="text/css">
<!--
body,td,th {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
}
body {
    background-color: #0066FF;
}
#Layer1 {
    position:absolute;
    left:11px;
    top:8px;
    width:25px;
    height:70%;
    z-index:1;
    background-color: #0000FF;
}
#Layer2 {
    position:absolute;
    left:52px;
    top:19px;
    width:8px;
    height:90%;
    z-index:2;
    background-color: #0000FF;
}
.style1 {
    font-size: 14px;
    font-weight: bold;
}
.style3 {font-size: 10px}
-->
</style>
<link href="siteCSS.css" rel="stylesheet" type="text/css" />
</head>

<body>


<?php include('login_inc.php'); ?>

<?php
if ($vbulletin->userinfo['usergroupid'] == '9' )
    {
    echo 
"
             <p align=\"center\"><img src=\"images/memserv.gif\" width=\"484\" height=\"37\" align=\"middle\" /></p>
<table width=\"80%\" border=\"4\" align=\"center\" bordercolor=\"#999999\" bgcolor=\"#FFFFFF\">
  <tr>
    <td><table width=\"100%\" align=\"center\">
      <tr>
        <td width=\"50%\" align=\"left\" valign=\"top\"><p>Welcome to the Richmond church of Christ Member Services area. Here you will find special areas and information specifically <em>for</em> members attending here in Richmond</p>
          
          <p>nbsp;</p></td>
          
        <td width=\"50%\" align=\"left\" valign=\"top\"><p align=\"center\" class=\"style1\">Church News &amp; Announcements </p>
          <p>"
;
            
include(
'news/index.php'
         
echo 
" &nbsp;</p></td>
      </tr>
    </table>
      <p align=\"center\"><span class=\"style3\">&copy;2006 Richmond church of Christ, Richmond, Kentucky, United States 40475 </span></p>
    </td>
  </tr>
</table>"
;

} else {
             echo 
"You do not have permission for this page"; }
    
?>

</body>
</html>

I havent tested the code cos Im at work.
I may have missed escaping a " somewhere (I have a habit of doing that) but you should get the idea of how it works.

Weirdwolf 05-16-2006 10:51 AM

That works great, but is there a way to set it for access from multiple usergroups? ie, Members are usergroup 9 and Admins are usergroup 6. I've tried it as

PHP Code:

if ($vbulletin->userinfo['usergroupid'] == '9' 

and

PHP Code:

if ($vbulletin->userinfo['usergroupid'] == '9,6' 

and

PHP Code:

if ($vbulletin->userinfo['usergroupid'] == '9','6' 

None of those seemed to work.

Billspaintball 05-16-2006 11:01 AM

Try
something like
Code:

if ($vbulletin->userinfo['usergroupid'] == '9' 
    or $vbulletin->userinfo['usergroupid'] == '6' 
)


Weirdwolf 05-17-2006 12:00 PM

Quote:

Originally Posted by Billspaintball
Try
something like
Code:

if ($vbulletin->userinfo['usergroupid'] == '9' 
    or $vbulletin->userinfo['usergroupid'] == '6' 
)


Works great, thanks! :banana:

Billspaintball 05-24-2006 01:16 AM

Quote:

Originally Posted by Weirdwolf
Works great, thanks! :banana:

Added this info to the usage guide in the 2nd post.
Others may find it usefull as well.

pcwfreak 05-30-2006 08:26 PM

Is there a way of making it remember a user without the 'Remember me?' checkbox?

Thanks.

Billspaintball 05-31-2006 12:24 AM

Quote:

Originally Posted by pcwfreak
Is there a way of making it remember a user without the 'Remember me?' checkbox?

Thanks.

Im at work at present so I havent had a chance to try this yet.
It may or may not work, and make sure you back up your login_inc.php first.

Find
PHP Code:

// Display login boxes + button
// You can style this with html or CSS as normal if desired.
echo"
    <form action=\""
.$forumpath."/login.php\" method=post onsubmit=md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)>
    <script type=text/javascript src=\""
.$forumpath."/clientscript/vbulletin_md5.js\"></script>
    User Name:<br>
    <input name=vb_login_username type=text id=navbar_username onfocus=if (this.value == '
$vbphrase[username]') this.value = ''; size=10 />
            
    <br>Password:<br>
    <input name=vb_login_password type=password size=10 />
    </br>
        
    <label for=cb_cookieuser_navbar><input name=cookieuser type=checkbox id=cb_cookieuser_navbar value=1 checked=checked />
    Remember Me?<br /></label>
    
        
    <input type=submit title=
$vbphrase[enter_username_to_login_or_register] value=\"Log In\" />
        
    <input type=hidden name=s value=
$session[sessionhash] />
    <input type=hidden name=do value=login />        
    <input type=hidden name=vb_login_md5password />
    <input type=hidden name=vb_login_md5password_utf />

    </form>
"


And replace with
PHP Code:

// Display login boxes + button
// You can style this with html or CSS as normal if desired.
echo"
    <form action=\""
.$forumpath."/login.php\" method=post onsubmit=md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)>
    <script type=text/javascript src=\""
.$forumpath."/clientscript/vbulletin_md5.js\"></script>
    User Name:<br>
    <input name=vb_login_username type=text id=navbar_username onfocus=if (this.value == '
$vbphrase[username]') this.value = ''; size=10 />
            
    <br>Password:<br>
    <input name=vb_login_password type=password size=10 />
    </br>
        
    <input type=submit title=
$vbphrase[enter_username_to_login_or_register] value=\"Log In\" />
        
    <input type=hidden name=s value=
$session[sessionhash] />
    <input type=hidden name=do value=login />
    <input type=hidden name=cookieuser id=cb_cookieuser_navbar value=1 checked=checked />    
    <input type=hidden name=vb_login_md5password />
    <input type=hidden name=vb_login_md5password_utf />

    </form>
"



pcwfreak 05-31-2006 10:32 AM

It seems to be working properly right now. Thanks!

ThatsIt 05-31-2006 03:06 PM

This is my situation. I installed the Simple -version on my forum and it was working perfectly. No problems what-so-ever, things were going as smooth as I could hope.

Then I decided to setup a test forum, and proceeded by creating a testvb folder, protected it with htaccess and installed the test forum along with the Simple login extension. This is where the problems begun.

According to vB instructions, the 'Path to Save Cookies' setting (Cookies and HTTP Header options) must be set to the directory of individual forums, if one runs more than one forum on the same domain. In my case, this meant that I set the path on my live forum to '/forums/' and on my test forums to '/testvb/forums/'.

This, of course, meant that the Simple login extension stopped working on my live forums since the 'Path to Save Cookies' setting should be set to '/'. If, on the other hand, I leave the live forums setting to '/', then I am not able to log on to my test forums at all, while the extension works perfectly on the live forums.

Does anyone see a way around this problem, or am I just out of luck. Is it possible to use this extension simultaneously and successfully on test forum thats running on the same domain with the 'live forum'.

Rated 06-06-2006 12:24 AM

Really cool hack, but i can't use it because i have a random banner / header script going on, and the..
PHP Code:

<?php 
    chdir
('/path/to/your/forums');  
    require_once(
'/path/to/your/forums/global.php');   
    require_once(
'/path/to/login_inc.php'); 
?>

Makes it no longer work :(

Dammit, any fix ? :)

Billspaintball 06-06-2006 02:01 AM

Quote:

Originally Posted by Rated

Dammit, any fix ? :)

Maybe.
Can you post the first dozen lines or so of your page so we can have a look.

Billspaintball 06-08-2006 11:24 PM

Confirmed working on vB 3.6 Beta 1
:D

Rated 06-09-2006 03:20 AM

Hi bill,

Ive not got the error codes handy - but ill show you my random banner script, if this doesn't help i will add it again and show the error codes that are confliciting with this script.

PHP Code:

<?php 
// Random Picture v0.1 
// (c) Guido Faecke, GF-Data Inc. 

  
$pic_dir 'images/banners/'
   
  
$counter 0

  
$d dir($pic_dir); 
  while(
$entry=$d->read()) { 
    if (
$entry != "." && $entry != "..") { 
      
$array[] = $entry
      
$counter++; 
    } 
  } 
  
$d->close(); 
  
$counter--; 
  
$which rand(0$counter); 
?>
<? echo '<img src="'.$pic_dir.$array[$which].'" border="0">'; ?>

Thanks for the help :)

Billspaintball 06-09-2006 03:35 AM

Quote:

Originally Posted by Rated
Hi bill,

Ive not got the error codes handy - but ill show you my random banner script, if this doesn't help i will add it again and show the error codes that are confliciting with this script.

PHP Code:

<?php 
// Random Picture v0.1 
// (c) Guido Faecke, GF-Data Inc. 

  
$pic_dir 'images/banners/'
   
  
$counter 0

  
$d dir($pic_dir); 
  while(
$entry=$d->read()) { 
    if (
$entry != "." && $entry != "..") { 
      
$array[] = $entry
      
$counter++; 
    } 
  } 
  
$d->close(); 
  
$counter--; 
  
$which rand(0$counter); 
?>
<? echo '<img src="'.$pic_dir.$array[$which].'" border="0">'; ?>

Thanks for the help :)

Have you tried something like
PHP Code:

<?php
chdir
('/path/to/your/forums');   
require_once(
'/path/to/your/forums/global.php');    
// Random Picture v0.1 
// (c) Guido Faecke, GF-Data Inc. 

  
$pic_dir 'images/banners/'
   
  
$counter 0

  
$d dir($pic_dir); 
while(
$entry=$d->read()) { 
    if (
$entry != "." && $entry != "..") { 
      
$array[] = $entry
      
$counter++; 
    } 
  } 
  
$d->close(); 
  
$counter--; 
  
$which rand(0$counter); 
?>
<? echo '<img src="'.$pic_dir.$array[$which].'" border="0">'; ?>

//whatever stuff you like goes here.
<?php  
// And we put this where we want the login box
    
require_once('/path/to/your/login_inc.php');  
?>


Rated 06-09-2006 01:02 PM

I don't really understand that, the random image script goes inside a table, and the php code your supposed to put at the top of the page won't work if it's in the table too, right? :s

Billspaintball 06-10-2006 02:58 AM

Quote:

Originally Posted by Rated
I don't really understand that, the random image script goes inside a table, and the php code your supposed to put at the top of the page won't work if it's in the table too, right? :s

Ok, I thought that what you posted was at the top of the page.

Correct, my code wont work if its not at the very top of the page (before any output anyhow).

I suspect that your banner script may be broken because of the directory change in my script.
What was the exact error message you got?
You can change back to current directory after my script if you like.
I will post the code to do that as soon as I remember how...

Billspaintball 06-10-2006 03:32 AM

Ok, try this.
Right at the top of the page put
PHP Code:

<?php 
$curdir 
getcwd ();
chdir('/path/to/your/forums');    
require_once(
'/path/to/your/forums/global.php'); 
chdir ($curdir);
?>

and put the login box where ever with
PHP Code:

<?php   
// And we put this where we want the login box 
    
require_once('/path/to/your/login_inc.php');   
?>

let us know if this works, If not, I will need the exact error message before I can look any further.

Munnday 06-10-2006 09:42 AM

I receive the following error:
Quote:

Warning: array_keys(): The first argument should be an array in /includes/functions.php on line 3277

Warning: Invalid argument supplied for foreach() in /includes/functions.php on line 3277

Fatal error: Call to a member function on a non-object in /home/.katona/wisemonkeys/www.4wisemonkeys.com/community/includes/functions.php on line 2502

evenmonkeys 06-14-2006 02:25 AM

I am not able to run this and I have gone through the troubleshooting steps that you have provided. I am running my main site on http://website.com and I am running my forum on http://forums.website.com. I've tried using website.com/forums as well, but that is not working either. Other than the steps you have provided, do you have any other recommendations?

The reason I'm still curious is because I had the vBadvanced CMPS working on my website before, and I had it set up the exact same way. However, I am unable to figure out what made what tick. Let me know please.

nonstop 06-14-2006 08:12 AM

Quote:

Originally Posted by Yarub
I am not able to run this and I have gone through the troubleshooting steps that you have provided. I am running my main site on http://website.com and I am running my forum on http://forums.website.com. I've tried using website.com/forums as well, but that is not working either. Other than the steps you have provided, do you have any other recommendations?

The reason I'm still curious is because I had the vBadvanced CMPS working on my website before, and I had it set up the exact same way. However, I am unable to figure out what made what tick. Let me know please.

I would suggest looking at the error log file for the site in question and see if it gives some errors to point were the problem. I had a similar problem as I just recently setup the forums on something like forum.mydomain.com and the site with the loging on www.mydomain.com (these are examples). Since the location of the files for each of these domains are in totally different directory structures the php configuration open_basedir refused to all the include for security reasons (value open_basedir was set to null which means that I can include anything below the directoy of the script calling). Not sure if this may be your problem with the installation with the forums in a separate directory or not. Its all based on physical file location. If this is the problem you might have the option of having your admin set the open_basedir configuration specific to your domain such that you can include the files needed from the forums. Here is the link on php site relating to the open_basedir http://us2.php.net/features.safe-mode. Hope this helps.

s.blair 06-15-2006 04:18 PM

Great looking hack!

I've got the basics of it working on my site.

However I need to control access based on secondary 'additional' user groups rather than the primary usergroup id.

How can I have it check to see if the user is in the array of membergroup id's instead of a single usergroup?

Thanks.
Scott

Majava 06-17-2006 02:11 PM

Hi, i need help please.. i added the login box on the index page, works great. but when i try and access the other pages. i get the following error.

Code:

Warning: main(includes/0.php) [function.main]: failed to open stream: No such file or directory in /usr/home/web/wse90457/index.php on line 180

Warning: main() [function.include]: Failed opening 'includes/0.php' for inclusion (include_path='.:/usr/local/share/pear') in /usr/home/web/wse90457/index.php on line 180

I think its because my index page includes other files from /includes/ for the other pages. so basically everything is run through the index page. If you want to view it go here. www.silkroad-oasis.com.


also, if you go to http://www.silkroad-oasis.com and login on the box, it logs in and works fine, but if you go to http://silkroad-oasis.com and try and login, it logs you in, but still shows the login boxes. how to fix?

Please help. Thanks

Billspaintball 06-19-2006 10:27 AM

Quote:

Originally Posted by Majava
I think its because my index page includes other files from /includes/ for the other pages. so basically everything is run through the index page. If you want to view it go here. www.silkroad-oasis.com.


also, if you go to http://www.silkroad-oasis.com and login on the box, it logs in and works fine, but if you go to http://silkroad-oasis.com and try and login, it logs you in, but still shows the login boxes. how to fix?

Please help. Thanks

Have you tried steps 3 and 4 in the troubleshooting guide yet?

Majava 06-20-2006 04:04 PM

Quote:

Originally Posted by Billspaintball
Have you tried steps 3 and 4 in the troubleshooting guide yet?


ok, Step 3 had already been done. by default? i dont know.

I dont both things in step 4, but still i get the following errors on every other page, but it did sort out the login box problem,

Code:

Warning: main(includes/0.php) [function.main]: failed to open stream: No such file or directory in /usr/home/web/wse90457/index.php on line 180

Warning: main() [function.include]: Failed opening 'includes/0.php' for inclusion (include_path='.:/usr/local/share/pear') in /usr/home/web/wse90457/index.php on line 180

my index file is used as the main page.. when someone clicks a new page on the site the index file finds the included file and uses it. eg. index.php ---> index.php?page=status

Is there anyway to fix this warning?

Billspaintball 06-20-2006 11:07 PM

Quote:

Originally Posted by Majava
ok, Step 3 had already been done. by default? i dont know.

I dont both things in step 4, but still i get the following errors on every other page, but it did sort out the login box problem,

Yes, those steps in the troubleshooting guide will only fix the login box, not your other path problems, its two seperate issues.

Quote:

Is there anyway to fix this warning?
It looks like its a path problem, could well be caused because the path is set to your forums directory for global.php.
Try changing
Code:

<?php 
chdir('/path/to/your/forums');   
require_once('/path/to/your/forums/global.php'); 
?>

to
Code:

<?php 
$curdir = getcwd ();
chdir('/path/to/your/forums');   
require_once('/path/to/your/forums/global.php'); 
chdir ($curdir);
?>


Majava 06-21-2006 08:46 AM

Nope, still same error.

Do i need to put that still in everypage? or just the index page?

and if you need me to, i can post the index page php code.


All times are GMT. The time now is 09: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.01897 seconds
  • Memory Usage 1,995KB
  • 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
  • (7)bbcode_code_printable
  • (16)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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