> ------------------------------------------------------------------------------ See main.inc.php for release information UserStat_AIM : classe to manage plugin integration into plugin menu --------------------------------------------------------------------------- */ if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php'); class UserStat_AIM extends CommonPlugin { protected $css = null; public function __construct($prefixeTable, $filelocation) { $this->setPluginName("UserStat"); $this->setPluginNameFiles("userstat"); parent::__construct($prefixeTable, $filelocation); $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css"); } public function __destruct() { unset($this->css); parent::__destruct(); } /* initialize events call for the plugin */ function initEvents() { add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') ); } /* initialization of config properties */ function initConfig() { $this->config=array( 'UserStat_MouseOverColor' => '303030', /*'AStat_BarColor_Pages' => '6666ff', 'AStat_BarColor_Img' => '66ff66', 'AStat_BarColor_IP' => 'ff6666', 'AStat_NpIPPerPages' => '25', 'AStat_NpCatPerPages' => '50', 'AStat_MaxBarWidth' => '400', 'AStat_default_period' => 'global', //global, all, year, month, day 'AStat_ShowThumbCat' => 'true', 'AStat_DefaultSortCat' => 'page', //page, picture, nbpicture 'AStat_ShowThumbImg' => 'true', 'AStat_DefaultSortImg' => 'picture', //picture, catname 'AStat_NbImgPerPages' => '100', 'AStat_BarColor_Cat' => 'fff966', 'AStat_DefaultSortIP' => 'page', //page, ip, picture 'AStat_SeeTimeRequests' => 'false', 'AStat_BlackListedIP' => '', // ip blacklisted (separator : ",") 'AStat_UseBlackList' => 'false' // if false, blacklist usage is disabled, if "invert" then result are inverted*/ ); } /* surchage of CommonPlugin->saveConfig function */ function loadConfig() { parent::loadConfig(); if(!$this->css->fileExists()) { $this->css->makeCSS($this->generate_CSS()); } } /* surchage of CommonPlugin->saveConfig function */ function saveConfig() { if(parent::saveConfig()) { $this->css->makeCSS($this->generate_CSS()); return(true); } return(false); } /* generate the css code */ function generate_CSS() { $text = " .StatTableRow:hover { background-color:#".$this->config['UserStat_MouseOverColor']."; } .formtable, .formtable P { text-align:left; display:block; } .formtable tr { vertical-align:top; } .invisible { visibility:hidden; display:none; } .littlefont { font-size:90%; } table.table2.littlefont td { text-align:center;padding:0px;padding-left:3px;padding-right:3px; } .throw { line-height:auto; font-size:100%; } table.table2 tr.throw { height:26px; } table.table2 td.toLeft { text-align:left; } div.table { margin-bottom:15px; } pointerHand { cursor:pointer; } "; return($text); } /* --------------------------------------------------------------------------- Function needed for plugin activation --------------------------------------------------------------------------- */ } // UserStat_Plugin class ?>