[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 » Fri Jan 14, 2011 2:10 am

  • 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
Registered User
Posts: 970
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: hook_style_id

Post by Arty » Wed Aug 24, 2011 8:17 pm

That would be very useful for styles demo mod too.
Formerly known as CyberAlien.

Free phpBB styles | Premium responsive XenForo styles

Post Reply