Page 1 of 2

Who is Online - Page Problem - FIXED

Posted: Mon Jun 12, 2006 9:48 am
by Leon
At the page viewonline.php i can see where people is in the forum.

But i have implanted some mods and i have never seen in the
viewonline.php page that users visit those pages, so i suppose
those mods are missing some code to create it on the Who is Online - Page


Like now for example:
Guest Mon Jun 12, 2006 11:30 am Viewing member list
Guest Mon Jun 12, 2006 11:23 am Feedbacks (Idéer)
Guest Mon Jun 12, 2006 11:28 am Forum index
Guest Mon Jun 12, 2006 11:29 am
As you can see one is empty, that could be that he is on any of the
General pages or another mod page that isent "a part" of the normal forum..

But how should i be able to know that for sure ?
How do i add in the mod files so i see if a person is on that page ?

Posted: Mon Jun 12, 2006 11:06 am
by battye
I have no idea, it would all depend on the MOD installed. Have you double checked to make sure you didn't miss something when installing?

Posted: Mon Jun 12, 2006 11:17 am
by Leon
Well i did make all the "General Pages" myself =P

(Whit only one help for the first code)

A standard hack prevent

Code: Select all

General.php (Root file)

<?php 

// standard hack prevent 
define('IN_PHPBB', true); 
$phpbb_root_path = './'; 
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 

// standard session management 
$userdata = session_pagestart($user_ip, PAGE_TEMPLATE); 
init_userprefs($userdata); 

// set page title 
$page_title = 'General Content - Volunteer Related Materials'; 

// standard page header 
include($phpbb_root_path . 'includes/page_header.'.$phpEx); 

// assign template 
$template->set_filenames(array( 
        'body' => 'general.tpl') 
); 

$template->pparse('body'); 

// standard page footer 
include($phpbb_root_path . 'includes/page_tail.'.$phpEx); 

?>

Posted: Mon Jun 12, 2006 1:48 pm
by battye
Leon wrote:Well i did make all the "General Pages" myself =P

(Whit only one help for the first code)

A standard hack prevent

Code: Select all

General.php (Root file)

<?php 

// standard hack prevent 
define('IN_PHPBB', true); 
$phpbb_root_path = './'; 
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 

// standard session management 
$userdata = session_pagestart($user_ip, PAGE_TEMPLATE); 
init_userprefs($userdata); 

// set page title 
$page_title = 'General Content - Volunteer Related Materials'; 

// standard page header 
include($phpbb_root_path . 'includes/page_header.'.$phpEx); 

// assign template 
$template->set_filenames(array( 
        'body' => 'general.tpl') 
); 

$template->pparse('body'); 

// standard page footer 
include($phpbb_root_path . 'includes/page_tail.'.$phpEx); 

?>
Looks okay to me. I don't see how it can affect your who is online section though.

Posted: Mon Jun 12, 2006 2:18 pm
by Leon
But thats the problem it dosent affect that page

I want to see if someone is on my created general page

Posted: Wed Jun 14, 2006 1:28 am
by Burian
Leon wrote:Well i did make all the "General Pages" myself =P

(Whit only one help for the first code)

A standard hack prevent

Code: Select all

General.php (Root file)

<?php 

// standard hack prevent 
define('IN_PHPBB', true); 
$phpbb_root_path = './'; 
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 

// standard session management 
$userdata = session_pagestart($user_ip, [b]PAGE_TEMPLATE[/b]); 
init_userprefs($userdata); 

// set page title 
$page_title = 'General Content - Volunteer Related Materials'; 

// standard page header 
include($phpbb_root_path . 'includes/page_header.'.$phpEx); 

// assign template 
$template->set_filenames(array( 
        'body' => 'general.tpl') 
); 

$template->pparse('body'); 

// standard page footer 
include($phpbb_root_path . 'includes/page_tail.'.$phpEx); 

?>
The PAGE_TEMPLATE is the problem.....You need to have it set in (correct me if I am wrong battye) constants.php, then have a corresponding language variable for it. I had a problem with this in my first mod and thats what I did to fix it.

Posted: Wed Jun 14, 2006 7:53 am
by battye
Ah I see what you mean. Yes, Burian is correct.

Posted: Fri Jun 16, 2006 9:37 pm
by Leon
Burian wrote:
The PAGE_TEMPLATE is the problem.....You need to have it set in (correct me if I am wrong battye) constants.php, then have a corresponding language variable for it. I had a problem with this in my first mod and thats what I did to fix it.
Aha, so how do i fix it ?
(More details for a noob plixor)

Posted: Sat Jun 17, 2006 4:21 am
by battye
Open viewonline.php and find

Code: Select all

				case PAGE_VIEWMEMBERS:
					$location = $lang['Viewing_member_list'];
					$location_url = "memberlist.$phpEx";
					break;
After that, add

Code: Select all

				case PAGE_TEMPLATE:
					$location = 'my page';
					$location_url = "mypage.$phpEx";
					break;

Of course, replace 'my page' and 'mypage' with the real page names.

Posted: Sat Jun 17, 2006 12:12 pm
by Leon
Can i also change the "case PAGE_TEMPLATE"
(PAGE_TEMPLATE) to the real page name ?

Posted: Sat Jun 17, 2006 1:05 pm
by battye
As long as you change $userdata = session_pagestart($user_ip, PAGE_TEMPLATE); as well

Posted: Sat Jun 17, 2006 1:06 pm
by Leon
That was what i ment =P

Thanks for the info.. updated and implanted, just wait and see if i see
if someone visits those pages now then :)

Posted: Sat Jun 17, 2006 1:18 pm
by Leon
I tested whit a friend of mine just now, this is ALL i have done:

Code: Select all

viewonline.php
						case PAGE_GENERAL: 
							$location = 'General Content'; 
							$location_url = "general.$phpEx"; 
							break;
						case PAGE_GENERALENG: 
							$location = 'General Content English'; 
							$location_url = "general_eng.$phpEx"; 
							break;
						case PAGE_GENERALSWE: 
							$location = 'General Content Swedish'; 
							$location_url = "general_swe.$phpEx"; 
							break;

Code: Select all

admin/index.php
						case PAGE_GENERAL: 
							$location = 'General Content'; 
							$location_url = "general.$phpEx"; 
							break;
						case PAGE_GENERALENG: 
							$location = 'General Content English'; 
							$location_url = "general_eng.$phpEx"; 
							break;
						case PAGE_GENERALSWE: 
							$location = 'General Content Swedish'; 
							$location_url = "general_swe.$phpEx"; 
							break;

Code: Select all

General.php
$userdata = session_pagestart($user_ip, PAGE_GENERAL); 

Code: Select all

General_eng.php
$userdata = session_pagestart($user_ip, PAGE_GENERALENG); 

Code: Select all

General_swe.php
$userdata = session_pagestart($user_ip, PAGE_GENERALSWE);
And when he is on ANY of those tree pages it says in "Who is online"
that he is on Forum index :?

Is there any other file i have to change in ?
Burian talked about constants.php for example

UPDATE:
Wait i forgot about the url thing

Coming back soon

Done and it still not working

Posted: Sat Jun 17, 2006 1:31 pm
by battye
Yes, admin/index.php

Posted: Sat Jun 17, 2006 1:37 pm
by Leon
What should i add in admin/index.php ?

Update:
Aha i see now