Changeset 10264 for extensions/AStat/astat_aim.class.inc.php
- Timestamp:
- Apr 10, 2011, 10:07:47 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AStat/astat_aim.class.inc.php
r5546 r10264 16 16 if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } 17 17 18 include_once( PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');18 include_once('astat_root.class.inc.php'); 19 19 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php'); 20 20 21 class AStat_AIM extends CommonPlugin21 class AStat_AIM extends AStat_root 22 22 { 23 23 protected $css = null; 24 24 25 function AStat_AIM($prefixeTable, $filelocation)25 function __construct($prefixeTable, $filelocation) 26 26 { 27 $this->setPluginName("AStat.2");28 $this->setPluginNameFiles("astat");29 27 parent::__construct($prefixeTable, $filelocation); 30 $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");31 28 } 32 29 … … 39 36 } 40 37 41 42 /*43 initialization of config properties44 */45 function initConfig()46 {47 $this->config=array(48 'AStat_BarColor_Pages' => '6666ff',49 'AStat_BarColor_Img' => '66ff66',50 'AStat_BarColor_IP' => 'ff6666',51 'AStat_MouseOverColor' => '303030',52 'AStat_NpIPPerPages' => '25',53 'AStat_NpCatPerPages' => '50',54 'AStat_MaxBarWidth' => '400',55 'AStat_default_period' => 'global', //global, all, year, month, day56 'AStat_ShowThumbCat' => 'true',57 'AStat_DefaultSortCat' => 'page', //page, picture, nbpicture58 'AStat_ShowThumbImg' => 'true',59 'AStat_DefaultSortImg' => 'picture', //picture, catname60 'AStat_NbImgPerPages' => '100',61 'AStat_BarColor_Cat' => 'fff966',62 'AStat_DefaultSortIP' => 'page', //page, ip, picture63 'AStat_SeeTimeRequests' => 'false',64 'AStat_BlackListedIP' => '', // ip blacklisted (separator : ",")65 'AStat_UseBlackList' => 'false' // if false, blacklist usage is disabled, if "invert" then result are inverted66 );67 68 }69 70 /*71 surchage of CommonPlugin->saveConfig function72 */73 function loadConfig()74 {75 parent::loadConfig();76 if(!$this->css->fileExists())77 {78 $this->css->makeCSS($this->generate_CSS());79 }80 }81 82 /*83 surchage of CommonPlugin->saveConfig function84 */85 function saveConfig()86 {87 if(parent::saveConfig())88 {89 $this->css->makeCSS($this->generate_CSS());90 return(true);91 }92 return(false);93 }94 95 /*96 generate the css code97 */98 function generate_CSS()99 {100 $text = ".AStatBar1, .AStatBar2, .AStatBar3, .AStatBar4, .AStatBarX {101 border:0px;102 height:8px;103 display: block;104 margin:0px;105 padding:0px;106 left:0;107 position:relative;108 }109 .MiniSquare1, .MiniSquare2, .MiniSquare3, .MiniSquare4 {110 border:0px;111 height:8px;112 width:8px;113 margin:0px;114 padding:0px;115 }116 .AStatBar1 { background-color:#".$this->config['AStat_BarColor_Pages']."; top:5px; }117 .AStatBar2 { background-color:#".$this->config['AStat_BarColor_Img']."; top:-3px; }118 .AStatBar3 { background-color:#".$this->config['AStat_BarColor_IP']."; top:-3px;}119 .AStatBar4 { background-color:#".$this->config['AStat_BarColor_Cat']."; top:-3px;}120 .AStatBarX { background-color:transparent; top:-3px; height:1px; }121 .MiniSquare1 { color:#".$this->config['AStat_BarColor_Pages']."; }122 .MiniSquare2 { color:#".$this->config['AStat_BarColor_Img']."; }123 .MiniSquare3 { color:#".$this->config['AStat_BarColor_IP']."; }124 .MiniSquare4 { color:#".$this->config['AStat_BarColor_Cat']."; }125 .StatTableRow:hover { background-color:#".$this->config['AStat_MouseOverColor']."; }126 .formtable, .formtable P { text-align:left; display:block; }127 .formtable tr { vertical-align:top; }128 .window_thumb {129 position:absolute;130 border: none;131 background: none;132 left:0;133 top:0;134 margin:0px;135 padding:0px;136 z-index:100;137 overflow:hidden;138 visibility:hidden; }139 .img_thumb {140 border: solid 3px #ffffff;141 background: #000000;142 margin:0px;143 padding:0px; }144 .time_request {145 font-size:83%;146 text-align:right; }147 .invisible { visibility:hidden; display:none; }148 .littlefont { font-size:90%; }149 table.littlefont th { padding:3px; }150 table.littlefont td { padding:0px;padding-left:3px;padding-right:3px; }151 #iplist { visibility:hidden; position:absolute; width:200px; z-index:1000; }152 .iipsellistitem { float:right; }153 #iipsellist { width:100%; font-family:monospace; }154 ";155 156 return($text);157 }158 159 /* ---------------------------------------------------------------------------160 Function needed for plugin activation161 --------------------------------------------------------------------------- */162 163 /*164 get 'section' enumeration from HISTORY_TABLE165 */166 function get_section_enum($add)167 {168 $returned=array('', false);169 $sql = 'SHOW COLUMNS FROM '.HISTORY_TABLE.' LIKE "section"';170 $result=pwg_query($sql);171 if($result)172 {173 $row = pwg_db_fetch_assoc($result);174 $list=substr($row['Type'], 5, strlen($row['Type'])-6);175 $returned[0]=explode(',', $list);176 if((strpos($list, "'$add'")===false)&&($add!=''))177 { array_push($returned[0], "'$add'"); }178 else179 { $returned[1]=true; }180 return($returned);181 }182 }183 184 function alter_history_section_enum($section)185 {186 $sections=$this->get_section_enum('deleted_cat');187 if(!$sections[1])188 {189 $enums=implode(',', $sections[0]);190 $sql="ALTER TABLE ".HISTORY_TABLE."191 CHANGE `section` `section`192 ENUM (".$enums.") ;";193 $result=pwg_query($sql);194 if(!$result)195 {196 return(false);197 }198 }199 return(true);200 }201 202 38 } // AStat_Plugin class 203 39
Note: See TracChangeset
for help on using the changeset viewer.