fix perm and admin link for < 2.0
This commit is contained in:
parent
ab5f2cecd0
commit
b8a82b8f0f
|
@ -1,8 +1,10 @@
|
||||||
1.54:
|
1.60:
|
||||||
-----
|
-----
|
||||||
- 2.0 markup ready (YL)
|
- 2.0 markup ready (YL)
|
||||||
- fix spectrum image height with 2.0
|
- fix spectrum image height with 2.0
|
||||||
- slightly reworked last visitors
|
- slightly reworked last visitors
|
||||||
|
- fix for S9y version < 2.0 upgraders
|
||||||
|
- fix a permission issue
|
||||||
|
|
||||||
1.53:
|
1.53:
|
||||||
-----
|
-----
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
if (IN_serendipity !== true) { die ("Don't hack!"); }
|
||||||
|
|
||||||
@serendipity_plugin_api::load_language(dirname(__FILE__));
|
@serendipity_plugin_api::load_language(dirname(__FILE__));
|
||||||
|
|
||||||
class serendipity_event_statistics extends serendipity_event
|
class serendipity_event_statistics extends serendipity_event
|
||||||
|
@ -13,15 +15,16 @@ class serendipity_event_statistics extends serendipity_event
|
||||||
$propbag->add('name', PLUGIN_EVENT_STATISTICS_NAME);
|
$propbag->add('name', PLUGIN_EVENT_STATISTICS_NAME);
|
||||||
$propbag->add('description', PLUGIN_EVENT_STATISTICS_DESC);
|
$propbag->add('description', PLUGIN_EVENT_STATISTICS_DESC);
|
||||||
$propbag->add('stackable', false);
|
$propbag->add('stackable', false);
|
||||||
$propbag->add('author', 'Arnan de Gans, Garvin Hicking, Fredrik Sandberg, kalkin');
|
$propbag->add('author', 'Arnan de Gans, Garvin Hicking, Fredrik Sandberg, kalkin, Matthias Mees, Ian');
|
||||||
$propbag->add('version', '1.54');
|
$propbag->add('version', '1.60');
|
||||||
$propbag->add('requirements', array(
|
$propbag->add('requirements', array(
|
||||||
'serendipity' => '0.8',
|
'serendipity' => '1.7',
|
||||||
'smarty' => '2.6.7',
|
'smarty' => '2.6.7',
|
||||||
'php' => '4.1.0'
|
'php' => '4.1.0'
|
||||||
));
|
));
|
||||||
$propbag->add('groups', array('STATISTICS'));
|
$propbag->add('groups', array('STATISTICS'));
|
||||||
$propbag->add('event_hooks', array(
|
$propbag->add('event_hooks', array(
|
||||||
|
'backend_sidebar_entries' => true,
|
||||||
'backend_sidebar_admin_appearance' => true,
|
'backend_sidebar_admin_appearance' => true,
|
||||||
'backend_sidebar_entries_event_display_statistics' => true,
|
'backend_sidebar_entries_event_display_statistics' => true,
|
||||||
'frontend_configure' => true,
|
'frontend_configure' => true,
|
||||||
|
@ -231,6 +234,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||||
.serendipity_statistics .wide_box dl {
|
.serendipity_statistics .wide_box dl {
|
||||||
clear: left;
|
clear: left;
|
||||||
display: table;
|
display: table;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.serendipity_statistics .wide_box dt {
|
.serendipity_statistics .wide_box dt {
|
||||||
display: table-row;
|
display: table-row;
|
||||||
|
@ -242,6 +246,8 @@ class serendipity_event_statistics extends serendipity_event
|
||||||
<?php
|
<?php
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'backend_sidebar_entries':
|
||||||
|
if ($serendipity['version'][0] > 1) break;
|
||||||
case 'backend_sidebar_admin_appearance':
|
case 'backend_sidebar_admin_appearance':
|
||||||
?>
|
?>
|
||||||
<li><a href="?serendipity[adminModule]=event_display&serendipity[adminAction]=statistics"><?php echo PLUGIN_EVENT_STATISTICS_NAME; ?></a></li>
|
<li><a href="?serendipity[adminModule]=event_display&serendipity[adminAction]=statistics"><?php echo PLUGIN_EVENT_STATISTICS_NAME; ?></a></li>
|
||||||
|
@ -609,7 +615,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||||
$sql = serendipity_db_query("SELECT COUNT(year) AS result FROM {$serendipity['dbPrefix']}visitors_count WHERE year='$year' AND month='$month' AND day='$day'", true);
|
$sql = serendipity_db_query("SELECT COUNT(year) AS result FROM {$serendipity['dbPrefix']}visitors_count WHERE year='$year' AND month='$month' AND day='$day'", true);
|
||||||
|
|
||||||
$sql_hit_update = "UPDATE {$serendipity['dbPrefix']}visitors_count SET hits = hits+1 WHERE year='$year' AND month='$month' AND day='$day'";
|
$sql_hit_update = "UPDATE {$serendipity['dbPrefix']}visitors_count SET hits = hits+1 WHERE year='$year' AND month='$month' AND day='$day'";
|
||||||
$sql_day_new = "INSERT INTO {$serendipity['dbPrefix']}visitors_count (year, month, day, visits, hits) VALUES ('$year','$month','$day',1,1)";
|
$sql_day_new = "INSERT INTO {$serendipity['dbPrefix']}visitors_count (year, month, day, visits, hits) VALUES ('$year','$month','$day',1,1)";
|
||||||
$sql_day_update = "UPDATE {$serendipity['dbPrefix']}visitors_count SET visits = visits+1, hits = hits+1 WHERE year='$year' AND month='$month' AND day='$day'";
|
$sql_day_update = "UPDATE {$serendipity['dbPrefix']}visitors_count SET visits = visits+1, hits = hits+1 WHERE year='$year' AND month='$month' AND day='$day'";
|
||||||
switch($action) {
|
switch($action) {
|
||||||
case "update":
|
case "update":
|
||||||
|
@ -641,8 +647,9 @@ class serendipity_event_statistics extends serendipity_event
|
||||||
|
|
||||||
function countVisitor($useragent, $remoteaddr, $referer){
|
function countVisitor($useragent, $remoteaddr, $referer){
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
|
|
||||||
$thedate = date('Y-m-d');
|
$thedate = date('Y-m-d');
|
||||||
$ip=strip_tags($remoteaddr);
|
$ip = strip_tags($remoteaddr);
|
||||||
$ip_how_often = serendipity_db_query("SELECT COUNT(ip) AS result FROM {$serendipity['dbPrefix']}visitors WHERE ip ='$ip' and day='$thedate'", true);
|
$ip_how_often = serendipity_db_query("SELECT COUNT(ip) AS result FROM {$serendipity['dbPrefix']}visitors WHERE ip ='$ip' and day='$thedate'", true);
|
||||||
|
|
||||||
if($ip_how_often['result'] >=1){
|
if($ip_how_often['result'] >=1){
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php # $Id: serendipity_plugin_comments.php 691 2005-11-13 06:58:40Z elf2000 $
|
<?php
|
||||||
|
|
||||||
|
if (IN_serendipity !== true) { die ("Don't hack!"); }
|
||||||
|
|
||||||
@serendipity_plugin_api::load_language(dirname(__FILE__));
|
@serendipity_plugin_api::load_language(dirname(__FILE__));
|
||||||
|
|
||||||
|
@ -16,9 +18,9 @@ class serendipity_plugin_statistics extends serendipity_plugin
|
||||||
$propbag->add('description', PLUGIN_EVENT_STATISTICS_NAME);
|
$propbag->add('description', PLUGIN_EVENT_STATISTICS_NAME);
|
||||||
$propbag->add('stackable', true);
|
$propbag->add('stackable', true);
|
||||||
$propbag->add('author', 'Arnan de Gans, Garvin Hicking');
|
$propbag->add('author', 'Arnan de Gans, Garvin Hicking');
|
||||||
$propbag->add('version', '1.5');
|
$propbag->add('version', '1.6');
|
||||||
$propbag->add('requirements', array(
|
$propbag->add('requirements', array(
|
||||||
'serendipity' => '0.8',
|
'serendipity' => '1.7',
|
||||||
'smarty' => '2.6.7',
|
'smarty' => '2.6.7',
|
||||||
'php' => '4.1.0'
|
'php' => '4.1.0'
|
||||||
));
|
));
|
||||||
|
@ -186,7 +188,7 @@ class serendipity_plugin_statistics extends serendipity_plugin
|
||||||
$lastmonday = date('Ynj', strtotime('today'));
|
$lastmonday = date('Ynj', strtotime('today'));
|
||||||
} else if (date('w', strtotime('today') ) == "0" ) { // now it is sunday
|
} else if (date('w', strtotime('today') ) == "0" ) { // now it is sunday
|
||||||
$nextsunday = date('Ynj', strtotime('today'));
|
$nextsunday = date('Ynj', strtotime('today'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$content = '';
|
$content = '';
|
||||||
if (serendipity_db_bool($this->get_config('show_lastentry'))) {
|
if (serendipity_db_bool($this->get_config('show_lastentry'))) {
|
||||||
|
|
Loading…
Reference in a new issue