Exemple #1
0
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$plugin_info = array(
	'pi_name'			=> 'ClassEE Body',
	'pi_version'		=> '2.0.2',
	'pi_author'			=> 'Derek Hogue',
	'pi_author_url'		=> 'http://github.com/amphibian/pi.classee_body.ee2_addon/',
	'pi_description'	=> 'Applies dynamic classes to your BODY tag.',
	'pi_usage'			=> Classee_body::usage()
);

class Classee_body
{

	function Classee_body()
	{
		$this->EE =& get_instance();
				
		$this->return_data = '';
		
		$attr = $this->EE->TMPL->fetch_param('attr', 'true');
		$browser = strtolower($_SERVER['HTTP_USER_AGENT']);		
		$cat_trigger = $this->EE->config->item('reserved_category_word');			
		$classes = array();
		$disable = ($this->EE->TMPL->fetch_param('disable')) ? 
			explode('|', $this->EE->TMPL->fetch_param('disable')) : 
			array();	
		$group = $this->EE->session->userdata['group_id'];		
		$segments = count($this->EE->uri->segments);
				
		if($segments > 0)
    Classee Body is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Classee Body is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    Read the terms of the GNU General Public License
    at <http://www.gnu.org/licenses/>.
    
    Copyright 2016 Derek Hogue - http://amphibian.info
*/
$plugin_info = array('pi_name' => 'ClassEE Body', 'pi_version' => '1.0.6', 'pi_author' => 'Derek Hogue', 'pi_author_url' => 'http://github.com/amphibian/classee_body.ee_addon/', 'pi_description' => 'Applies dynamic classes to your BODY tag.', 'pi_usage' => Classee_body::usage());
class Classee_body
{
    var $return_data = '';
    function Classee_body()
    {
        global $TMPL, $IN, $SESS, $PREFS;
        $attr = $TMPL->fetch_param('attr');
        $browser = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : 'unknown';
        $cat_trigger = $PREFS->ini('reserved_category_word');
        $classes = array();
        $disable = $TMPL->fetch_param('disable') ? explode('|', $TMPL->fetch_param('disable')) : array();
        $group = $SESS->userdata['group_id'];
        $segments = count($IN->SEGS);
        if ($segments > 0) {
            // One class per URI segment
    Classee Body is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Classee Body is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    Read the terms of the GNU General Public License
    at <http://www.gnu.org/licenses/>.
    
    Copyright 2016 Derek Hogue - http://amphibian.info
*/
$plugin_info = array('pi_name' => 'Classee Body', 'pi_version' => '2.0.4', 'pi_author' => 'Derek Hogue', 'pi_author_url' => 'http://amphibian.info', 'pi_description' => 'Applies dynamic classes to your BODY tag', 'pi_usage' => Classee_body::usage());
class Classee_body
{
    function __construct()
    {
        $this->EE =& get_instance();
        $this->return_data = '';
        $attr = $this->EE->TMPL->fetch_param('attr', 'true');
        $browser = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : 'unknown';
        $cat_trigger = $this->EE->config->item('reserved_category_word');
        $classes = array();
        $disable = $this->EE->TMPL->fetch_param('disable') ? explode('|', $this->EE->TMPL->fetch_param('disable')) : array();
        $group = $this->EE->session->userdata['group_id'];
        $segments = count($this->EE->uri->segments);
        if ($segments > 0) {
            // One class per URI segment