Changeset 7445
- Timestamp:
- Oct 28, 2010, 12:19:44 AM (13 years ago)
- Location:
- extensions/Statistics
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Statistics/admin/stat_admin.php
r3438 r7445 4 4 load_language('plugin.lang', STAT_PATH); 5 5 6 7 8 $conf_statistics = explode("," , $conf['statistics']); 9 10 6 $conf_statistics = unserialize($conf['statistics']); 11 7 12 8 $template->assign( 9 array( 10 'statisticsCONTENT' => $conf_statistics['content'], 11 'STATITICS_HEADER' => $conf_statistics['header'] ? 'checked="checked"' : '' , 12 'STATISTICS_TAIL' => $conf_statistics['tail'] ? 'checked="checked"' : '' , 13 'STATISTICS_ADMIN' => $conf_statistics['exclude_admin'] ? 'checked="checked"' : '' , 14 'STATISTICS_GUEST' => $conf_statistics['exclude_guest'] ? 'checked="checked"' : '' , 15 ) 16 ); 13 17 14 array( 18 if (isset($_POST['submit'])) 19 { 20 $statistics_content = stripslashes($_POST['statistics_content']); 21 22 $conf_statistics = array( 23 'content' => $statistics_content, 24 'header' => isset($_POST['stat_header']), 25 'tail' => isset($_POST['stat_tail']), 26 'exclude_admin' => isset($_POST['stat_admin']), 27 'exclude_guest' => isset($_POST['stat_guest']), 28 ); 15 29 16 'STATITICS_HEADER' => $conf_statistics[0] == 'on' ? 'checked="checked"' : '' , 30 $query = ' 31 UPDATE '.CONFIG_TABLE.' 32 SET value = \''.pwg_db_real_escape_string(serialize($conf_statistics)).'\' 33 WHERE param = \'statistics\' 34 ;'; 35 pwg_query($query); 17 36 18 'STATISTICS_TAIL' => $conf_statistics[1] == 'on' ? 'checked="checked"' : '' , 19 20 'STATISTICS_ADMIN' => $conf_statistics[3] == 'on' ? 'checked="checked"' : '' , 21 22 'STATISTICS_GUEST' => $conf_statistics[4] == 'on' ? 'checked="checked"' : '' , 23 24 ) 25 26 ); 27 28 29 30 $template->assign(array('statisticsCONTENT' => $conf_statistics[2],)); 31 32 33 34 if ( isset($_POST['submit']) ) 35 36 { 37 38 $value_header = isset($_POST['stat_header']) ? $_POST['stat_header'] : '' ; 39 40 $value_tail = isset($_POST['stat_tail']) ? $_POST['stat_tail'] : '' ; 41 42 $value_content = isset($_POST['statistics_content']) ? $_POST['statistics_content'] : '' ; 43 44 $value_admin = isset($_POST['stat_admin']) ? $_POST['stat_admin'] : '' ; 45 46 $value_guest = isset($_POST['stat_guest']) ? $_POST['stat_guest'] : '' ; 47 48 49 50 $query = ' 51 52 UPDATE '.CONFIG_TABLE.' 53 54 SET value="'.$value_header. ',' .$value_tail. ',' .$value_content.',' .$value_admin. ',' .$value_guest. '" 55 56 WHERE param="statistics" 57 58 LIMIT 1'; 59 60 61 62 pwg_query($query); 63 64 65 array_push($page['infos'], l10n('statistics_save_config')); 66 67 68 $template->assign( 69 70 array( 71 72 'STATITICS_HEADER' => $value_header == 'on' ? 'checked="checked"' : '' , 73 74 'STATISTICS_TAIL' => $value_tail == 'on' ? 'checked="checked"' : '' , 75 76 'STATISTICS_ADMIN'=> $value_admin == 'on' ? 'checked="checked"' : '' , 77 78 'STATISTICS_GUEST'=> $value_guest == 'on' ? 'checked="checked"' : '' , 79 80 ) 81 82 ); 83 84 85 86 $template->assign(array('statisticsCONTENT' => stripslashes ($value_content))); 87 37 array_push($page['infos'], l10n('statistics_save_config')); 38 $template->assign( 39 array( 40 'statisticsCONTENT' => $statistics_content, 41 'STATITICS_HEADER' => isset($_POST['stat_header']) ? 'checked="checked"' : '' , 42 'STATISTICS_TAIL' => isset($_POST['stat_tail']) ? 'checked="checked"' : '' , 43 'STATISTICS_ADMIN' => isset($_POST['stat_admin']) ? 'checked="checked"' : '' , 44 'STATISTICS_GUEST' => isset($_POST['stat_guest']) ? 'checked="checked"' : '' , 45 ) 46 ); 88 47 } 89 48 90 91 92 49 $template->set_filenames(array('plugin_admin_content' => realpath(STAT_PATH . 'admin/stat_admin.tpl'))); 93 94 50 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 95 51 ?> -
extensions/Statistics/admin/stat_admin.tpl
r3438 r7445 1 1 <div class="titrePage"> 2 3 <h2>Statistics</h2> 4 2 <h2>Statistics</h2> 5 3 </div> 6 4 7 8 9 <span>{'Howto'|translate}</span> 10 11 5 <span>{'Howto'|translate}</span> 12 6 13 7 <form action="" method="post" name="form"> 14 15 <fieldset> 16 17 <legend>{'statistics_admin'|translate}</legend> 18 19 20 21 <p>{'statistics_admin_description'|translate}</p> 22 23 <table> 24 25 <tr> 26 27 <td><textarea name="statistics_content" id="statistics_content" rows="10" cols="80">{$statisticsCONTENT}</textarea></td> 28 29 </tr> 30 31 </table> 32 33 34 35 <table><tr> 36 37 <td><input type="checkbox" name="stat_header" value="on" {$STATITICS_HEADER} /> {'stat_header'|translate} 38 39 <input type="checkbox" name="stat_tail" value="on" {$STATISTICS_TAIL} /> {'stat_tail'|translate}</td></tr> 40 41 <tr><td> 42 43 <input type="checkbox" name="stat_admin" value="on" {$STATISTICS_ADMIN} /> {'stat_admin'|translate} 44 45 </td></tr> 46 47 <tr><td> 48 49 <input type="checkbox" name="stat_guest" value="on" {$STATISTICS_GUEST} /> {'stat_guest'|translate} 50 51 </td></tr> 52 53 </table> 54 55 <p><input class="submit" type="submit" name="submit" value="{'Submit'|translate}"/></p> 56 57 </fieldset> 58 8 <p style="margin-bottom:5px;">{'statistics_admin_description'|translate}</p> 9 <p style="margin:0;"><textarea name="statistics_content" id="statistics_content" rows="10" cols="80">{$statisticsCONTENT}</textarea></p> 10 <ul style="width:400px;margin:20px auto !important;list-style-type:none;"> 11 <li><label><input type="checkbox" name="stat_header" {$STATITICS_HEADER} /> {'stat_header'|translate}</label></li> 12 <li><label><input type="checkbox" name="stat_tail" {$STATISTICS_TAIL} /> {'stat_tail'|translate}<label></li> 13 <li><label><input type="checkbox" name="stat_admin" {$STATISTICS_ADMIN} /> {'stat_admin'|translate}<label></li> 14 <li><label><input type="checkbox" name="stat_guest" {$STATISTICS_GUEST} /> {'stat_guest'|translate}<label></li> 15 </ul> 16 <p><input class="submit" type="submit" name="submit" value="{'Submit'|translate}"/></p> 59 17 </form> 60 18 -
extensions/Statistics/language/en_UK/index.php
r3438 r7445 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 9 // | last modifier : $Author: rub $ 10 // | revision : $Revision: 1912 $ 11 // +-----------------------------------------------------------------------+ 12 // | This program is free software; you can redistribute it and/or modify | 13 // | it under the terms of the GNU General Public License as published by | 14 // | the Free Software Foundation | 15 // | | 16 // | This program is distributed in the hope that it will be useful, but | 17 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 18 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 19 // | General Public License for more details. | 20 // | | 21 // | You should have received a copy of the GNU General Public License | 22 // | along with this program; if not, write to the Free Software | 23 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 24 // | USA. | 3 25 // +-----------------------------------------------------------------------+ 4 26 5 // | PhpWebGallery - a PHP based picture gallery |6 7 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |8 9 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |10 11 // +-----------------------------------------------------------------------+12 13 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $14 15 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $16 17 // | last modifier : $Author: rub $18 19 // | revision : $Revision: 1912 $20 21 // +-----------------------------------------------------------------------+22 23 // | This program is free software; you can redistribute it and/or modify |24 25 // | it under the terms of the GNU General Public License as published by |26 27 // | the Free Software Foundation |28 29 // | |30 31 // | This program is distributed in the hope that it will be useful, but |32 33 // | WITHOUT ANY WARRANTY; without even the implied warranty of |34 35 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |36 37 // | General Public License for more details. |38 39 // | |40 41 // | You should have received a copy of the GNU General Public License |42 43 // | along with this program; if not, write to the Free Software |44 45 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |46 47 // | USA. |48 49 // +-----------------------------------------------------------------------+50 51 52 53 27 // Recursive call 54 55 28 $url = '../'; 56 57 29 header( 'Request-URI: '.$url ); 58 59 30 header( 'Content-Location: '.$url ); 60 61 31 header( 'Location: '.$url ); 62 63 32 exit(); 64 65 33 ?> 66 -
extensions/Statistics/language/en_UK/plugin.lang.php
r3438 r7445 1 1 <?php 2 $lang['Howto'] = 'This plugin allow you to insert code given by Google Analytics, P hpMyVisites and coin all pages of your gallery';2 $lang['Howto'] = 'This plugin allow you to insert code given by Google Analytics, Piwik and others in all pages of your gallery'; 3 3 $lang['statistics_admin'] = 'Statistics Adminstration'; 4 4 $lang['statistics_admin_description'] = 'Paste the code here. '; … … 6 6 $lang['stat_tail'] = 'Insert code in the footer'; 7 7 $lang['statistics_save_config'] = 'Data saved'; 8 $lang['stat_admin'] = 'Exclude admin strator ofstatistics.';9 $lang['stat_ admin'] = 'Exclude guest ofstatistics.';8 $lang['stat_admin'] = 'Exclude administrator from statistics.'; 9 $lang['stat_guest'] = 'Exclude guest from statistics.'; 10 10 ?> -
extensions/Statistics/language/es_ES/index.php
r3438 r7445 1 1 <?php 2 3 2 // +-----------------------------------------------------------------------+ 4 5 3 // | PhpWebGallery - a PHP based picture gallery | 6 7 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 8 9 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 10 11 6 // +-----------------------------------------------------------------------+ 12 13 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 14 15 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 16 17 9 // | last modifier : $Author: rub $ 18 19 10 // | revision : $Revision: 1912 $ 20 21 11 // +-----------------------------------------------------------------------+ 22 23 12 // | This program is free software; you can redistribute it and/or modify | 24 25 13 // | it under the terms of the GNU General Public License as published by | 26 27 14 // | the Free Software Foundation | 28 29 15 // | | 30 31 16 // | This program is distributed in the hope that it will be useful, but | 32 33 17 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 34 35 18 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 36 37 19 // | General Public License for more details. | 38 39 20 // | | 40 41 21 // | You should have received a copy of the GNU General Public License | 42 43 22 // | along with this program; if not, write to the Free Software | 44 45 23 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 46 47 24 // | USA. | 48 49 25 // +-----------------------------------------------------------------------+ 50 51 52 53 26 // Recursive call 54 55 27 $url = '../'; 56 57 28 header( 'Request-URI: '.$url ); 58 59 29 header( 'Content-Location: '.$url ); 60 61 30 header( 'Location: '.$url ); 62 63 31 exit(); 64 65 32 ?> 66 -
extensions/Statistics/language/fr_FR/index.php
r3438 r7445 1 1 <?php 2 3 2 // +-----------------------------------------------------------------------+ 4 5 3 // | PhpWebGallery - a PHP based picture gallery | 6 7 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 8 9 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 10 11 6 // +-----------------------------------------------------------------------+ 12 13 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 14 15 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 16 17 9 // | last modifier : $Author: rub $ 18 19 10 // | revision : $Revision: 1912 $ 20 21 11 // +-----------------------------------------------------------------------+ 22 23 12 // | This program is free software; you can redistribute it and/or modify | 24 25 13 // | it under the terms of the GNU General Public License as published by | 26 27 14 // | the Free Software Foundation | 28 29 15 // | | 30 31 16 // | This program is distributed in the hope that it will be useful, but | 32 33 17 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 34 35 18 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 36 37 19 // | General Public License for more details. | 38 39 20 // | | 40 41 21 // | You should have received a copy of the GNU General Public License | 42 43 22 // | along with this program; if not, write to the Free Software | 44 45 23 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 46 47 24 // | USA. | 48 49 25 // +-----------------------------------------------------------------------+ 50 51 52 53 26 // Recursive call 54 55 27 $url = '../'; 56 57 28 header( 'Request-URI: '.$url ); 58 59 29 header( 'Content-Location: '.$url ); 60 61 30 header( 'Location: '.$url ); 62 63 31 exit(); 64 65 32 ?> 66 -
extensions/Statistics/language/fr_FR/plugin.lang.php
r3438 r7445 1 1 <?php 2 $lang['Howto'] = 'Ce plugin permet d\'inserer le code fournie par Google Analytics, P hpMyVisites and codans toutes les pages de votre galerie';2 $lang['Howto'] = 'Ce plugin permet d\'inserer le code fournie par Google Analytics, Piwik ou autres dans toutes les pages de votre galerie'; 3 3 $lang['statistics_admin'] = 'Administration de Statistics'; 4 4 $lang['statistics_admin_description'] = 'Coller ci dessous le code fourni. '; … … 8 8 $lang['Link'] = 'Lien vers votre logiciel de statistiques et de mesure d\'audience.'; 9 9 $lang['stat_admin'] = 'Exclure l\'administrateur des statistiques.'; 10 $lang['stat_guest'] = 'Exclure l e guestdes statistiques.';10 $lang['stat_guest'] = 'Exclure l\'utilisateur non connecté des statistiques.'; 11 11 ?> -
extensions/Statistics/language/index.php
r3438 r7445 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 9 // | last modifier : $Author: rub $ 10 // | revision : $Revision: 1912 $ 11 // +-----------------------------------------------------------------------+ 12 // | This program is free software; you can redistribute it and/or modify | 13 // | it under the terms of the GNU General Public License as published by | 14 // | the Free Software Foundation | 15 // | | 16 // | This program is distributed in the hope that it will be useful, but | 17 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 18 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 19 // | General Public License for more details. | 20 // | | 21 // | You should have received a copy of the GNU General Public License | 22 // | along with this program; if not, write to the Free Software | 23 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 24 // | USA. | 3 25 // +-----------------------------------------------------------------------+ 4 26 5 // | PhpWebGallery - a PHP based picture gallery |6 7 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |8 9 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |10 11 // +-----------------------------------------------------------------------+12 13 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $14 15 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $16 17 // | last modifier : $Author: rub $18 19 // | revision : $Revision: 1912 $20 21 // +-----------------------------------------------------------------------+22 23 // | This program is free software; you can redistribute it and/or modify |24 25 // | it under the terms of the GNU General Public License as published by |26 27 // | the Free Software Foundation |28 29 // | |30 31 // | This program is distributed in the hope that it will be useful, but |32 33 // | WITHOUT ANY WARRANTY; without even the implied warranty of |34 35 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |36 37 // | General Public License for more details. |38 39 // | |40 41 // | You should have received a copy of the GNU General Public License |42 43 // | along with this program; if not, write to the Free Software |44 45 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |46 47 // | USA. |48 49 // +-----------------------------------------------------------------------+50 51 52 53 27 // Recursive call 54 55 28 $url = '../'; 56 57 29 header( 'Request-URI: '.$url ); 58 59 30 header( 'Content-Location: '.$url ); 60 61 31 header( 'Location: '.$url ); 62 63 32 exit(); 64 65 33 ?> 66 -
extensions/Statistics/language/it_IT/index.php
r3492 r7445 1 1 <?php 2 3 2 // +-----------------------------------------------------------------------+ 4 5 3 // | PhpWebGallery - a PHP based picture gallery | 6 7 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 8 9 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 10 11 6 // +-----------------------------------------------------------------------+ 12 13 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 14 15 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 16 17 9 // | last modifier : $Author: rub $ 18 19 10 // | revision : $Revision: 1912 $ 20 21 11 // +-----------------------------------------------------------------------+ 22 23 12 // | This program is free software; you can redistribute it and/or modify | 24 25 13 // | it under the terms of the GNU General Public License as published by | 26 27 14 // | the Free Software Foundation | 28 29 15 // | | 30 31 16 // | This program is distributed in the hope that it will be useful, but | 32 33 17 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 34 35 18 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 36 37 19 // | General Public License for more details. | 38 39 20 // | | 40 41 21 // | You should have received a copy of the GNU General Public License | 42 43 22 // | along with this program; if not, write to the Free Software | 44 45 23 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 46 47 24 // | USA. | 48 49 25 // +-----------------------------------------------------------------------+ 50 51 52 53 26 // Recursive call 54 55 27 $url = '../'; 56 57 28 header( 'Request-URI: '.$url ); 58 59 29 header( 'Content-Location: '.$url ); 60 61 30 header( 'Location: '.$url ); 62 63 31 exit(); 64 65 32 ?> 66 -
extensions/Statistics/main.inc.php
r3438 r7445 2 2 /* 3 3 Plugin Name: Statistics 4 Version: 2.0. b4 Version: 2.0.c 5 5 Description: Add source code like Google Analytics on each page. 6 6 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=174 … … 10 10 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 11 11 define('STAT_DIR' , basename(dirname(__FILE__))); 12 13 12 define('STAT_PATH' , PHPWG_PLUGINS_PATH . STAT_DIR . '/'); 14 13 15 14 function statistics_admin_menu($menu) 16 17 15 { 18 19 array_push($menu, array('NAME' => 'Statistics', 20 21 'URL' => get_admin_plugin_menu_link(STAT_PATH . 'admin/stat_admin.php'))); 22 23 return $menu; 24 16 array_push( 17 $menu, 18 array( 19 'NAME' => 'Statistics', 20 'URL' => get_admin_plugin_menu_link(STAT_PATH . 'admin/stat_admin.php') 21 ) 22 ); 23 return $menu; 25 24 } 26 25 26 function stat_candoit($type) 27 { 28 global $conf, $user; 29 30 $conf_statistics = unserialize($conf['statistics']); 31 32 if (is_admin() and $conf_statistics['exclude_admin']) 33 { 34 return false; 35 } 36 37 if (is_a_guest() and $conf_statistics['exclude_guest']) 38 { 39 return false; 40 } 27 41 28 42 29 function stat_candoit($type) 30 31 { 32 33 global $conf, $user; 34 35 36 37 $conf_statistics = explode("," , $conf['statistics']); 38 39 40 41 $is_guest = (function_exists('is_a_guest') ? is_a_guest() : $user['is_the_guest']); 42 43 44 45 if 46 47 ( 48 49 ( 50 51 (($conf_statistics[0] == 'on') and ($type == 'header')) or 52 53 (($conf_statistics[1] == 'on') and ($type == 'tail')) 54 55 ) and 56 57 (($conf_statistics[3] == 'on' and !is_admin()) or (empty($conf_statistics[3]))) and 58 59 (($conf_statistics[4] == 'on' and !$is_guest) or (empty($conf_statistics[4]))) 60 61 ) 62 43 $show_htmlcontent = false; 44 if ($conf_statistics['header'] and $type == 'header') 63 45 { 64 65 return ' 66 67 <!-- Plugin Statitics --> 68 69 '.$conf_statistics[2].' 70 71 <!-- Plugin Statitics -->'; 72 46 $show_htmlcontent = true; 47 } 48 if ($conf_statistics['tail'] and $type == 'tail') 49 { 50 $show_htmlcontent = true; 73 51 } 74 52 75 else 76 53 if (!$show_htmlcontent) 77 54 { 78 79 55 return false; 80 81 56 } 82 57 58 return ' 59 <!-- Plugin Statistics --> 60 '.$conf_statistics['content'].' 61 <!-- Plugin Statistics --> 62 '; 83 63 } 64 84 65 function stat_tail() 85 66 { 67 global $template; 86 68 87 global $template;88 69 if ($code_stat = stat_candoit('tail')) 89 90 70 { 91 92 71 $template->append('footer_elements', $code_stat); 93 94 72 } 95 96 73 } 97 74 98 99 100 75 function stat_header() 101 102 76 { 103 104 77 global $template; 105 78 79 if ($code_stat = stat_candoit('header')) 80 { 81 $template->append('head_elements', $code_stat); 82 } 83 } 106 84 107 108 if ($code_stat = stat_candoit('header'))109 110 {111 112 $template->append('head_elements', $code_stat);113 114 }115 116 }117 85 add_event_handler('get_admin_plugin_menu_links', 'statistics_admin_menu'); 118 86 add_event_handler('loc_end_page_tail', 'stat_tail'); 119 87 add_event_handler('loc_end_page_header', 'stat_header'); 120 121 88 ?> -
extensions/Statistics/maintain.inc.php
r3438 r7445 1 1 <?php 2 2 3 3 function plugin_activate() 4 { 5 $query = ' 6 SELECT 7 value 8 FROM '.CONFIG_TABLE.' 9 WHERE param=\'statistics\' 10 ;'; 11 $result = pwg_query($query); 12 if ($row = pwg_db_fetch_assoc($result)) 13 { 14 if (!preg_match('/^a:/', $row['value'])) 15 { 16 $old_conf = explode("," , $row['value']); 17 18 $conf_statistics = array( 19 'content' => $old_conf[2], 20 'header' => ($old_conf[0] == 'on'), 21 'tail' => ($old_conf[1] == 'on'), 22 'exclude_admin' => ($old_conf[3] == 'on'), 23 'exclude_guest' => ($old_conf[4] == 'on'), 24 ); 4 25 5 function plugin_install() 26 $query = ' 27 UPDATE '.CONFIG_TABLE.' 28 SET value = \''.pwg_db_real_escape_string(serialize($conf_statistics)).'\' 29 WHERE param=\'statistics\' 30 ;'; 31 pwg_query($query); 32 } 33 } 34 } 6 35 7 { 36 function plugin_install() 37 { 38 $conf_statistics = array( 39 'content' => '', 40 'header' => false, 41 'tail' => true, 42 'exclude_admin' => false, 43 'exclude_guest' => false, 44 ); 45 46 $query = ' 47 INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 48 VALUES ( 49 \'statistics\', 50 \''.pwg_db_real_escape_string(serialize($conf_statistics)).'\', 51 \'Parameters of Statistics plugin\' 52 ) 53 ;'; 54 pwg_query($query); 55 } 8 56 9 global $prefixeTable; 10 11 $q = ' 12 13 INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 14 15 VALUES ("statistics","off,on, ,off,off","Parameters of Statistics plugin"); 16 17 '; 18 19 20 21 pwg_query($q); 22 23 24 25 } 26 27 28 29 function plugin_uninstall() 30 31 { 32 33 global $prefixeTable; 34 35 $q = ' 36 37 DELETE FROM '.CONFIG_TABLE.' 38 39 WHERE param="statistics" LIMIT 1; 40 41 '; 42 43 44 45 pwg_query($q); 46 47 48 49 } 50 57 function plugin_uninstall() 58 { 59 $query = ' 60 DELETE FROM '.CONFIG_TABLE.' 61 WHERE param=\'statistics\' 62 ;'; 63 pwg_query($query); 64 } 51 65 ?>
Note: See TracChangeset
for help on using the changeset viewer.