phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

[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.

[RFC|Implemented] viewonline hook

Postby nickvergessen » Sat Aug 21, 2010 1:47 pm

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.
cheers nickvergessen :geek:
Member of phpBB Development-Team
No Support via PM — My MODs for phpBB 3.0.x
User avatar
nickvergessen
Development Team
Development Team
 
Posts: 350
Joined: Sun Oct 07, 2007 11:54 am
Location: Esslingen, Germany

Re: [RFC] viewonline hook

Postby Sam » Sat Aug 21, 2010 3:42 pm

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
Sam
Website Team
Website Team
 
Posts: 31
Joined: Fri Jan 23, 2009 10:24 pm

Re: [RFC] viewonline hook

Postby ameeck » Sat Aug 21, 2010 5:53 pm

On top of this the code should actually be edited to allow matching files in subdirectories.
Please think before you post.
User avatar
ameeck
Registered User
 
Posts: 86
Joined: Sun Nov 13, 2005 6:43 pm
Location: Prague, Czech Republic

Re: [RFC] viewonline hook

Postby nickvergessen » Sat Aug 21, 2010 7:00 pm

it already should do that, because we match adm/index
cheers nickvergessen :geek:
Member of phpBB Development-Team
No Support via PM — My MODs for phpBB 3.0.x
User avatar
nickvergessen
Development Team
Development Team
 
Posts: 350
Joined: Sun Oct 07, 2007 11:54 am
Location: Esslingen, Germany

Re: [RFC] viewonline hook

Postby imkingdavid » Sat Aug 21, 2010 8:40 pm

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.
User avatar
imkingdavid
Development Team
Development Team
 
Posts: 902
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] viewonline hook

Postby keith10456 » Sun Aug 22, 2010 6:20 pm

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
keith10456
Registered User
 
Posts: 261
Joined: Sat Apr 22, 2006 10:29 pm

Re: [RFC] viewonline hook

Postby nickvergessen » Sun Aug 22, 2010 7:43 pm

They are viewed as on index.php which is the default.
cheers nickvergessen :geek:
Member of phpBB Development-Team
No Support via PM — My MODs for phpBB 3.0.x
User avatar
nickvergessen
Development Team
Development Team
 
Posts: 350
Joined: Sun Oct 07, 2007 11:54 am
Location: Esslingen, Germany

Re: [RFC] viewonline hook

Postby MartinTruckenbrodt » Sun Aug 29, 2010 8:17 pm

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
MartinTruckenbrodt
 
Posts: 171
Joined: Sun Jan 29, 2006 1:00 pm
Location: Germany

Re: [RFC] viewonline hook

Postby keith10456 » Wed Sep 01, 2010 2:24 am

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.
User avatar
keith10456
Registered User
 
Posts: 261
Joined: Sat Apr 22, 2006 10:29 pm

Re: [RFC] viewonline hook

Postby MartinTruckenbrodt » Wed Sep 01, 2010 6:07 pm

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
MartinTruckenbrodt
 
Posts: 171
Joined: Sun Jan 29, 2006 1:00 pm
Location: Germany

Next

Return to [3.1/Ascraeus] Merged Event Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron