Global login for the site + forum

For support and discussion related to templates, themes, and imagesets in phpBB 3.0.
Get Involved
Goemans
Registered User
Posts: 116
Joined: Fri Feb 20, 2009 6:55 pm

Re: Global login for the site + forum

Post by Goemans »

Okay, actually I already got it. If I got any more questions on this subject concering PHP, should I start a new thread?
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51551
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Global login for the site + forum

Post by stevemaury »

Yes.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
Lumpy Burgertushie
Registered User
Posts: 68114
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Global login for the site + forum

Post by Lumpy Burgertushie »

Goemans wrote:Does this overall_header.php exist or should I create it? 'cause I can't find it.
just to be clear, it is not overall_header.php

it is overall_header.html in the template folder of whatever style you are talking about.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
Goemans
Registered User
Posts: 116
Joined: Fri Feb 20, 2009 6:55 pm

Re: Global login for the site + forum

Post by Goemans »

It's working properly on the forums, but not on the site itself. I think something related to the includes is failing, this is what I get.

Code: Select all

Warning: include(./common.php) [function.include]: failed to open stream: No such file or directory in C:\domains\skylinereviews.com\wwwroot\test\index.php on line 5

Warning: include(./common.php) [function.include]: failed to open stream: No such file or directory in C:\domains\skylinereviews.com\wwwroot\test\index.php on line 5

Warning: include() [function.include]: Failed opening './common.php' for inclusion (include_path='.;/PHP5/pear') in C:\domains\skylinereviews.com\wwwroot\test\index.php on line 5

Fatal error: Call to a member function session_begin() on a non-object in C:\domains\skylinereviews.com\wwwroot\test\index.php on line 8
(this is the code in the header, as in the tutorial)

Code: Select all

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
User avatar
Lumpy Burgertushie
Registered User
Posts: 68114
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Global login for the site + forum

Post by Lumpy Burgertushie »

you did not edit the root path in the code you put in your file.

right now it is set to ./

and you have to change that to point to where phpbb is in relation to where the file is.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
Goemans
Registered User
Posts: 116
Joined: Fri Feb 20, 2009 6:55 pm

Re: Global login for the site + forum

Post by Goemans »

So it should be 'forum/'? (where is this common.php located? :\)
Goemans
Registered User
Posts: 116
Joined: Fri Feb 20, 2009 6:55 pm

Re: Global login for the site + forum

Post by Goemans »

This is a part of the code of wwroot/test/index.php (the forum is located in wwroot/forum).

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : 'http://www.skylinereviews.com/forum/./';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$title = "Home";
require('header.php');
?>
(...)
    <!-- IF U_ACP -->
           <a href="login.php">
               <img alt="admin" src="images/tabs/admin.png" name="admin" onmouseover="adminOver()" onmouseout="adminOut()"/>
           </a>
	<!-- ENDIF -->
(...)
and this is the error

Code: Select all

Fatal error: Call to a member function session_begin() on a non-object in C:\domains\skylinereviews.com\wwwroot\test\index.php on line 8

Could it be because the <!-- IF U_ACP --><!-- ENDIF --> can only be used in .html files? If so, what's the PHP way of doing this?
User avatar
Josh
Former Team Member
Posts: 1882
Joined: Sun Jan 25, 2009 3:08 pm
Location: Melbourne, AUS
Name: Josh Simpson
Contact:

Re: Global login for the site + forum

Post by Josh »

try

Code: Select all

../forum/
Josh Simpson- Formerly known as "HardStyle"
Styles: Submission Policy | Database | Knowledge Base | Demo
Please do not PM me for personal support.
Image
Goemans
Registered User
Posts: 116
Joined: Fri Feb 20, 2009 6:55 pm

Re: Global login for the site + forum

Post by Goemans »

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$title = "Home";
require('header.php');
?>
(...)        
    <!-- IF U_ACP -->
               "You are an admin"
	<!-- ENDIF -->
This doesn't return any errors, but it simply always shows 'You are an admin".
Locked

Return to “[3.0.x] Styles Support & Discussion”