[RFC] hook_style_id

These requests for events in core phpBB have been merged into 3.1/Ascraeus and will be available with the next release.
Post Reply
YukataNinja
Registered User
Posts: 1
Joined: Fri Jan 14, 2011 2:00 am

[RFC] hook_style_id

Post by YukataNinja »

  • Name: hook_style_id
  • Rationale: The mod could select a style for given scenarios. The specific scenario I'm interested in is changing the style when the user is at a specific url (m.mysite.com) to switch to a mobile friendly style. I can easily think of other scenarios, like changing the style on the user's birthday.
  • Placement: I did a writeup of how to do this for phpbb3 here: http://www.phpbb.com/community/viewtopi ... #p12879306. Basically there are two spots where the style is set:

    style.php

    Code: Select all

    	if (!$user)
    	{
    		[u]$id			= ($id) ? $id : $config['default_style'];[/u]
    //		Commented out because calls do not always include the SID anymore
    //		$recompile	= false;
    		$user		= array('user_id' => ANONYMOUS);
    	}
    
    includes/session.php

    Code: Select all

    		else
    		{
    			// Set up style
    			[u]$style = ($style) ? $style : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']);[/u]
    		}
    
  • Input arguments: style id number
  • Output format: none
  • Output semantics: n/a
  • Infrastructure: n/a
  • Related: n/a

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: hook_style_id

Post by Arty »

That would be very useful for styles demo mod too.

Post Reply