[RFC|Implemented] viewonline hook

These requests for events in core phpBB have been merged into 3.1/Ascraeus and will be available with the next release.
User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

[RFC|Implemented] viewonline hook

Post by nickvergessen »

Name: hook_viewonline
Rationale: Most of the MODs that add a new page to the forum (gallery, arcade, ...) also need to edit the viewonline.php, so that users are viewed as being online in there and not just viewed as "index.php"
Placement: viewonline.php best would be after the

Code: Select all

	switch ($on_page[1])
	{
Input arguments: $on_page
Output format: array($location, $location_url)
Output semantics: Use the two elements and override the default ($user->lang['INDEX'], append_sid("{$phpbb_root_path}index.$phpEx")) which is used when the page is not in the switch.
Member of the Development-TeamNo Support via PM

Sam
Registered User
Posts: 31
Joined: Fri Jan 23, 2009 10:24 pm

Re: [RFC] viewonline hook

Post by Sam »

I really like this idea, I find myself making new cases for the viewonline quite often when making MODs or even custom pages for phpBB.

User avatar
ameeck
Registered User
Posts: 86
Joined: Sun Nov 13, 2005 6:43 pm
Location: Prague, Czech Republic
Contact:

Re: [RFC] viewonline hook

Post by ameeck »

On top of this the code should actually be edited to allow matching files in subdirectories.
Please think before you post.

User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: [RFC] viewonline hook

Post by nickvergessen »

it already should do that, because we match adm/index
Member of the Development-TeamNo Support via PM

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] viewonline hook

Post by imkingdavid »

It could also be made easier to match pages outside of the forum directory. I current have a hackish fix for my own site, where I have an index.php site homepage page and then the forum is in the board/ directory next to it. The way I am doing it, iirc, is with a if(is_defined('IN_HOME')) check in viewonline at the default area of the switch and then I just define it in the home page. It works, but it would be nice to be able to do this more easily. While it might not be practical for all admin, it could be helpful for people who are trying to integrate sessions across their site.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

keith10456
Registered User
Posts: 523
Joined: Sat Apr 22, 2006 10:29 pm
Contact:

Re: [RFC] viewonline hook

Post by keith10456 »

Question:

Does viewonline currently work with phpbb v3 custom pages? I currently use the custom pages but have no idea if the visitors/members are on my custom pages or not.

User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: [RFC] viewonline hook

Post by nickvergessen »

They are viewed as on index.php which is the default.
Member of the Development-TeamNo Support via PM

MartinTruckenbrodt
Posts: 171
Joined: Sun Jan 29, 2006 1:00 pm
Location: Germany
Contact:

Re: [RFC] viewonline hook

Post by MartinTruckenbrodt »

Hello,
the request is a good one.

BTW: If you have custom pages then you just have to edit viewonline.php and language/en/common.php and it's working for the custom pages, too. Just look at the Blank Template MOD.

Bye Martin
Advanced Block MOD 1.1.1 has been released! - Prevent spam on your phpBB3 board with Stop Forum Spam, BotScout, Akismet, Project Honey Pot and several IP-RBL and Domain-RBL DNS blacklists! - My MODs

keith10456
Registered User
Posts: 523
Joined: Sat Apr 22, 2006 10:29 pm
Contact:

Re: [RFC] viewonline hook

Post by keith10456 »

MartinTruckenbrodt wrote:Hello,
the request is a good one.

BTW: If you have custom pages then you just have to edit viewonline.php and language/en/common.php and it's working for the custom pages, too. Just look at the Blank Template MOD.

Bye Martin
Do you have a link to the Blank Template Mod... My search for it was unsuccessful. I would like to see which changes to viewonline.php and common.php I need to make.

MartinTruckenbrodt
Posts: 171
Joined: Sun Jan 29, 2006 1:00 pm
Location: Germany
Contact:

Re: [RFC] viewonline hook

Post by MartinTruckenbrodt »

Hello KEith,
http://www.phpbb.com/kb/article/add-a-n ... -to-phpbb/
I could not find it Titania, but here's the old entry: http://www.phpbb.com/community/viewtopi ... &t=1187205

Bye Martin
Advanced Block MOD 1.1.1 has been released! - Prevent spam on your phpBB3 board with Stop Forum Spam, BotScout, Akismet, Project Honey Pot and several IP-RBL and Domain-RBL DNS blacklists! - My MODs

Post Reply