Make plugins bail out if called directly
This commit is contained in:
parent
1c71f7032d
commit
9b67bdd517
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -19,7 +24,7 @@ class serendipity_event_bbcode extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_BBCODE_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Jez Hancock, Garvin Hicking');
|
||||
$propbag->add('version', '2.06');
|
||||
$propbag->add('version', '2.07');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
@ -162,7 +167,7 @@ class serendipity_event_bbcode extends serendipity_event
|
||||
static $pattern_query = '([^"\'\(\);]+?)';
|
||||
|
||||
static $target = null;
|
||||
|
||||
|
||||
if ($target === null) {
|
||||
$target = serendipity_db_bool($this->get_config('target'));
|
||||
}
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -25,7 +30,7 @@ class serendipity_event_browsercompatibility extends serendipity_event
|
||||
'smarty' => '2.6.7',
|
||||
'php' => '4.1.0'
|
||||
));
|
||||
$propbag->add('version', '1.0');
|
||||
$propbag->add('version', '1.1');
|
||||
$propbag->add('event_hooks', array(
|
||||
'css' => true,
|
||||
'css_backend' => true,
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -30,7 +35,7 @@ class serendipity_event_contentrewrite extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_CONTENTREWRITE_DESCRIPTION);
|
||||
$propbag->add('stackable', true);
|
||||
$propbag->add('author', 'Garvin Hicking');
|
||||
$propbag->add('version', '1.2');
|
||||
$propbag->add('version', '1.3');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -18,7 +23,7 @@ class serendipity_event_creativecommons extends serendipity_event {
|
||||
$propbag->add('description', PLUGIN_CREATIVECOMMONS_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Evan Nemerson');
|
||||
$propbag->add('version', '1.1');
|
||||
$propbag->add('version', '1.2');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -20,7 +25,7 @@ class serendipity_event_emoticate extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_EMOTICATE_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Serendipity Team');
|
||||
$propbag->add('version', '1.3');
|
||||
$propbag->add('version', '1.4');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -21,7 +26,7 @@ class serendipity_event_entryproperties extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_ENTRYPROPERTIES_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Garvin Hicking');
|
||||
$propbag->add('version', '1.12');
|
||||
$propbag->add('version', '1.13');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -26,7 +31,7 @@ class serendipity_event_karma extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_KARMA_BLAHBLAH);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Garvin Hicking');
|
||||
$propbag->add('version', '1.8');
|
||||
$propbag->add('version', '1.9');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
@ -1,10 +1,15 @@
|
||||
<?php # $Id$
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
include $probelang;
|
||||
}
|
||||
}
|
||||
|
||||
include dirname(__FILE__) . '/lang_en.inc.php';
|
||||
|
||||
@ -20,7 +25,7 @@ class serendipity_event_livesearch extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_LIVESEARCH_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Christian Stocker, Garvin Hicking');
|
||||
$propbag->add('version', '1.3');
|
||||
$propbag->add('version', '1.4');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -21,7 +26,7 @@ class serendipity_event_mailer extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_MAILER_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Sebastian Nohn, Kristian Koehntopp, Garvin Hicking');
|
||||
$propbag->add('version', '1.46');
|
||||
$propbag->add('version', '1.47');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
@ -194,7 +199,7 @@ class serendipity_event_mailer extends serendipity_event
|
||||
);
|
||||
|
||||
switch($this->get_config('what')) {
|
||||
case 'all':
|
||||
case 'all':
|
||||
$mail['body'] = $eventData['body'] . $eventData['extended'];
|
||||
case 'body':
|
||||
$mail['body'] = $eventData['body'];
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -20,7 +25,7 @@ class serendipity_event_nl2br extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_NL2BR_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Serendipity Team');
|
||||
$propbag->add('version', '1.6');
|
||||
$propbag->add('version', '1.7');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -20,7 +25,7 @@ class serendipity_event_s9ymarkup extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_S9YMARKUP_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Serendipity Team');
|
||||
$propbag->add('version', '1.2');
|
||||
$propbag->add('version', '1.3');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
@ -4,6 +4,11 @@
|
||||
/* Authored by Tom Sommer, 2004 */
|
||||
/**********************************/
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -24,7 +29,7 @@ class serendipity_event_searchhighlight extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_SEARCHHIGHLIGHT_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Tom Sommer');
|
||||
$propbag->add('version', '1.2');
|
||||
$propbag->add('version', '1.3');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
@ -196,7 +201,7 @@ class serendipity_event_searchhighlight extends serendipity_event
|
||||
isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$element = &$eventData[$temp['element']];
|
||||
|
||||
foreach ( $queries as $word ) {
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -34,7 +39,7 @@ var $filter_defaults;
|
||||
'smarty' => '2.6.7',
|
||||
'php' => '4.1.0'
|
||||
));
|
||||
$propbag->add('version', '1.60');
|
||||
$propbag->add('version', '1.61');
|
||||
$propbag->add('event_hooks', array(
|
||||
'frontend_saveComment' => true,
|
||||
'external_plugin' => true,
|
||||
@ -925,7 +930,7 @@ var $filter_defaults;
|
||||
if (serendipity_db_bool($this->get_config('csrf', true))) {
|
||||
echo serendipity_setFormToken('form');
|
||||
}
|
||||
|
||||
|
||||
// Check whether to allow comments from registered authors
|
||||
if (serendipity_userLoggedIn() && $this->inGroup()) {
|
||||
return true;
|
||||
|
@ -8,6 +8,11 @@
|
||||
|
||||
***********/
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -34,7 +39,7 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_SPARTACUS_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Garvin Hicking');
|
||||
$propbag->add('version', '2.8');
|
||||
$propbag->add('version', '2.9');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.9',
|
||||
'smarty' => '2.6.7',
|
||||
@ -46,7 +51,7 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
|
||||
'backend_templates_fetchlist' => true,
|
||||
'backend_templates_fetchtemplate' => true,
|
||||
|
||||
|
||||
'backend_pluginlisting_header' => true,
|
||||
'backend_pluginlisting_header_upgrade' => true
|
||||
));
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -7,7 +12,7 @@ if (file_exists($probelang)) {
|
||||
}
|
||||
|
||||
include dirname(__FILE__) . '/lang_en.inc.php';
|
||||
|
||||
|
||||
class serendipity_event_statistics extends serendipity_event
|
||||
{
|
||||
var $title = PLUGIN_EVENT_STATISTICS_NAME;
|
||||
@ -20,7 +25,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_STATISTICS_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Arnan de Gans, Garvin Hicking, Fredrik Sandberg');
|
||||
$propbag->add('version', '1.43');
|
||||
$propbag->add('version', '1.44');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
@ -45,11 +50,11 @@ class serendipity_event_statistics extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_STATISTICS_MAX_ITEMS_DESC);
|
||||
$propbag->add('default', 20);
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
case 'ext_vis_stat':
|
||||
$select = array('no' => PLUGIN_EVENT_STATISTICS_EXT_OPT1,
|
||||
'yesBot' => PLUGIN_EVENT_STATISTICS_EXT_OPT2,
|
||||
$select = array('no' => PLUGIN_EVENT_STATISTICS_EXT_OPT1,
|
||||
'yesBot' => PLUGIN_EVENT_STATISTICS_EXT_OPT2,
|
||||
'yesTop' => PLUGIN_EVENT_STATISTICS_EXT_OPT3);
|
||||
|
||||
$propbag->add('type', 'select');
|
||||
@ -59,9 +64,9 @@ class serendipity_event_statistics extends serendipity_event
|
||||
$propbag->add('default', 'no');
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'stat_all':
|
||||
$select = array('no' => PLUGIN_EVENT_STATISTICS_EXT_ALL1,
|
||||
$select = array('no' => PLUGIN_EVENT_STATISTICS_EXT_ALL1,
|
||||
'yes' => PLUGIN_EVENT_STATISTICS_EXT_ALL2);
|
||||
|
||||
$propbag->add('type', 'select');
|
||||
@ -71,9 +76,9 @@ class serendipity_event_statistics extends serendipity_event
|
||||
$propbag->add('default', 'yes');
|
||||
|
||||
break;
|
||||
|
||||
case 'banned_bots':
|
||||
$select = array('yes' => PLUGIN_EVENT_STATISTICS_BANNED_HOSTS1,
|
||||
|
||||
case 'banned_bots':
|
||||
$select = array('yes' => PLUGIN_EVENT_STATISTICS_BANNED_HOSTS1,
|
||||
'no' => PLUGIN_EVENT_STATISTICS_BANNED_HOSTS2);
|
||||
|
||||
$propbag->add('type', 'select');
|
||||
@ -99,7 +104,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||
|
||||
if (isset($hooks[$event])) {
|
||||
switch($event) {
|
||||
|
||||
|
||||
case 'frontend_configure':
|
||||
if ($this->get_config('ext_vis_stat') == 'no') {
|
||||
return;
|
||||
@ -114,13 +119,13 @@ class serendipity_event_statistics extends serendipity_event
|
||||
if ($this->get_config('db_indices_created', 'false') !== '1') {
|
||||
$this->updateTables();
|
||||
}
|
||||
|
||||
|
||||
//Unique visitors are beeing registered and counted here. Calling function below.
|
||||
$sessionChecker = serendipity_db_query("SELECT count(sessID) FROM {$serendipity['dbPrefix']}visitors WHERE '".serendipity_db_escape_string(session_id())."' = sessID GROUP BY sessID", true);
|
||||
if (!is_array($sessionChecker) || (is_array($sessionChecker)) && ($sessionChecker[0] == 0)) {
|
||||
|
||||
|
||||
$referer = $useragent = $remoteaddr = 'unknown';
|
||||
|
||||
|
||||
// gathering intel
|
||||
if ($_SERVER['REMOTE_ADDR']) {
|
||||
$remoteaddr = $_SERVER['REMOTE_ADDR'];
|
||||
@ -131,9 +136,9 @@ class serendipity_event_statistics extends serendipity_event
|
||||
if ($_SERVER['HTTP_REFERER']) {
|
||||
$referer = $_SERVER['HTTP_REFERER'];
|
||||
}
|
||||
|
||||
|
||||
$found = 0;
|
||||
|
||||
|
||||
// avoiding banned browsers
|
||||
if ($this->get_config('banned_bots') == 'yes') {
|
||||
// excludelist botagents
|
||||
@ -166,23 +171,23 @@ class serendipity_event_statistics extends serendipity_event
|
||||
'26' => "GeoBot",
|
||||
'27' => "DigExt"
|
||||
);
|
||||
|
||||
|
||||
foreach($banned_array AS $ban) {
|
||||
if (stristr($useragent, $ban)) {
|
||||
$found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($found == 0){
|
||||
if ($found == 0){
|
||||
$this->countVisitor($useragent, $remoteaddr, $referer);
|
||||
}
|
||||
} else {
|
||||
// Update visitor timestamp
|
||||
$this->updateVisitor();
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case 'backend_sidebar_entries':
|
||||
?>
|
||||
@ -198,12 +203,12 @@ class serendipity_event_statistics extends serendipity_event
|
||||
if (!$max_items || !is_numeric($max_items) || $max_items < 1) {
|
||||
$max_items = 20;
|
||||
}
|
||||
|
||||
|
||||
if ($ext_vis_stat == 'yesTop') {
|
||||
$this->extendedVisitorStatistics($max_items);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($this->get_config('stat_all') == 'yes') {
|
||||
$first_entry = serendipity_db_query("SELECT timestamp FROM {$serendipity['dbPrefix']}entries ORDER BY timestamp ASC limit 1", true);
|
||||
$last_entry = serendipity_db_query("SELECT timestamp FROM {$serendipity['dbPrefix']}entries ORDER BY timestamp DESC limit 1", true);
|
||||
@ -220,10 +225,10 @@ class serendipity_event_statistics extends serendipity_event
|
||||
GROUP BY ec.categoryid, c.category_name
|
||||
ORDER BY postings DESC";
|
||||
$category_rows = serendipity_db_query($cat_sql);
|
||||
|
||||
|
||||
$image_count = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}images", true);
|
||||
$image_rows = serendipity_db_query("SELECT extension, count(id) AS images FROM {$serendipity['dbPrefix']}images GROUP BY extension ORDER BY images DESC");
|
||||
|
||||
|
||||
$subscriber_count = count(serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}comments WHERE type = 'NORMAL' AND subscribed = 'true' GROUP BY email"));
|
||||
$subscriber_rows = serendipity_db_query("SELECT e.timestamp, e.id, e.title, count(c.id) as postings
|
||||
FROM {$serendipity['dbPrefix']}comments c,
|
||||
@ -232,7 +237,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||
GROUP BY e.id, c.email, e.title, e.timestamp
|
||||
ORDER BY postings DESC
|
||||
LIMIT $max_items");
|
||||
|
||||
|
||||
$comment_count = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}comments WHERE type = 'NORMAL'", true);
|
||||
$comment_rows = serendipity_db_query("SELECT e.timestamp, e.id, e.title, count(c.id) as postings
|
||||
FROM {$serendipity['dbPrefix']}comments c,
|
||||
@ -241,14 +246,14 @@ class serendipity_event_statistics extends serendipity_event
|
||||
GROUP BY e.id, e.title, e.timestamp
|
||||
ORDER BY postings DESC
|
||||
LIMIT $max_items");
|
||||
|
||||
|
||||
$commentor_rows = serendipity_db_query("SELECT author, max(email) as email, max(url) as url, count(id) as postings
|
||||
FROM {$serendipity['dbPrefix']}comments c
|
||||
WHERE type = 'NORMAL'
|
||||
GROUP BY author
|
||||
ORDER BY postings DESC
|
||||
LIMIT $max_items");
|
||||
|
||||
|
||||
$tb_count = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}comments WHERE type = 'TRACKBACK'", true);
|
||||
$tb_rows = serendipity_db_query("SELECT e.timestamp, e.id, e.title, count(c.id) as postings
|
||||
FROM {$serendipity['dbPrefix']}comments c,
|
||||
@ -257,14 +262,14 @@ class serendipity_event_statistics extends serendipity_event
|
||||
GROUP BY e.timestamp, e.id, e.title
|
||||
ORDER BY postings DESC
|
||||
LIMIT $max_items");
|
||||
|
||||
|
||||
$tbr_rows = serendipity_db_query("SELECT author, max(email) as email, max(url) as url, count(id) as postings
|
||||
FROM {$serendipity['dbPrefix']}comments c
|
||||
WHERE type = 'TRACKBACK'
|
||||
GROUP BY author
|
||||
ORDER BY postings DESC
|
||||
LIMIT $max_items");
|
||||
|
||||
|
||||
$length = serendipity_db_query("SELECT SUM(LENGTH(body) + LENGTH(extended)) FROM {$serendipity['dbPrefix']}entries", true);
|
||||
$length_rows = serendipity_db_query("SELECT id, title, (LENGTH(body) + LENGTH(extended)) as full_length FROM {$serendipity['dbPrefix']}entries ORDER BY full_length DESC LIMIT $max_items");
|
||||
?>
|
||||
@ -522,7 +527,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||
<hr />
|
||||
<?php serendipity_plugin_api::hook_event('event_additional_statistics', $eventData, array('maxitems' => $max_items)); ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
@ -541,14 +546,14 @@ class serendipity_event_statistics extends serendipity_event
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Statistics
|
||||
function updatestats($action) {
|
||||
global $serendipity;
|
||||
|
||||
list($year, $month, $day) = split('-', date('Y-m-d'));
|
||||
|
||||
list($year, $month, $day) = split('-', date('Y-m-d'));
|
||||
$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_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'";
|
||||
@ -565,12 +570,12 @@ class serendipity_event_statistics extends serendipity_event
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function updateVisitor() {
|
||||
global $serendipity;
|
||||
|
||||
$this->updatestats('update');
|
||||
|
||||
|
||||
$time = date('H:i');
|
||||
$day = date('Y-m-d');
|
||||
return serendipity_db_query("UPDATE {$serendipity['dbPrefix']}visitors SET time = '$time', day = '$day' WHERE sessID = '" . serendipity_db_escape_string(strip_tags(session_id())) . "'");
|
||||
@ -580,7 +585,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||
global $serendipity;
|
||||
|
||||
$this->updatestats('new');
|
||||
|
||||
|
||||
$thedate = date('Y-m-d');
|
||||
$values = array(
|
||||
'sessID' => strip_tags(session_id()),
|
||||
@ -590,29 +595,29 @@ class serendipity_event_statistics extends serendipity_event
|
||||
'browser'=> strip_tags($useragent),
|
||||
'ip' => strip_tags($remoteaddr)
|
||||
);
|
||||
|
||||
serendipity_db_insert('visitors', $values);
|
||||
|
||||
|
||||
serendipity_db_insert('visitors', $values);
|
||||
|
||||
// updating the referrer-table
|
||||
if (strlen($referer) >= 1) {
|
||||
|
||||
//retrieving the referrer base URL
|
||||
$temp_array = explode('?', $referer);
|
||||
$urlA = $temp_array[0];
|
||||
|
||||
$temp_array = explode('?', $referer);
|
||||
$urlA = $temp_array[0];
|
||||
|
||||
//removing "http://" & trailing subdirectories
|
||||
$temp_array3 = explode('//', $urlA);
|
||||
$urlB = $temp_array3[1];
|
||||
$temp_array4 = explode('/', $urlB);
|
||||
$urlB = $temp_array4[0];
|
||||
|
||||
|
||||
//removing www
|
||||
$urlC = serendipity_db_escape_string(str_replace('www.', '', $urlB));
|
||||
|
||||
|
||||
if(strlen($urlC) < 1) {
|
||||
$urlC = 'unknown';
|
||||
}
|
||||
|
||||
|
||||
//updating db
|
||||
$q = serendipity_db_query("SELECT count(refs) AS referrer FROM {$serendipity['dbPrefix']}refs WHERE refs = '$urlC' GROUP BY refs", true);
|
||||
if ($q['referrer'] >= 1){
|
||||
@ -621,13 +626,13 @@ class serendipity_event_statistics extends serendipity_event
|
||||
serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}refs (refs, count) VALUES ('$urlC', 1)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} //end of function countVisitor
|
||||
|
||||
|
||||
// Calculate daily stats
|
||||
function statistics_getdailystats($day, $amount) {
|
||||
global $serendipity;
|
||||
|
||||
|
||||
list($year, $month) = split('[-]', date("Y-m"));
|
||||
if ($day > 0 && $day <32) {
|
||||
$sql = "SELECT SUM(visits) AS dailyvisit FROM {$serendipity['dbPrefix']}visitors_count WHERE day";
|
||||
@ -644,19 +649,19 @@ class serendipity_event_statistics extends serendipity_event
|
||||
echo "Daycount failed - Days only go from 1 to 31";
|
||||
return "failure";
|
||||
}
|
||||
|
||||
if (! isset($container)) {
|
||||
|
||||
if (! isset($container)) {
|
||||
$sql = "SELECT SUM(visits) FROM {$serendipity['dbPrefix']}visitors_count WHERE day = '$day' AND month = '$month' AND year = '$year'";
|
||||
$res = serendipity_db_query($sql, true);
|
||||
return $res;
|
||||
}
|
||||
$res = serendipity_db_query($sql, true);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Calculate monthly stats
|
||||
function statistics_getmonthlystats($month, $amount) {
|
||||
function statistics_getmonthlystats($month, $amount) {
|
||||
global $serendipity;
|
||||
|
||||
$year = date("Y");
|
||||
$year = date("Y");
|
||||
if ($month > 0 && $month < 13) {
|
||||
$sql = "SELECT SUM(visits) AS monthlyvisit FROM {$serendipity['dbPrefix']}visitors_count WHERE month";
|
||||
for ($i=1; $i<13; $i++) {
|
||||
@ -672,22 +677,22 @@ class serendipity_event_statistics extends serendipity_event
|
||||
echo "Monthcount failed - Months only go from 1 to 12";
|
||||
return "failure";
|
||||
}
|
||||
|
||||
if (!isset($container)) {
|
||||
|
||||
if (!isset($container)) {
|
||||
$sql = "SELECT SUM(visits) FROM {$serendipity['dbPrefix']}visitors_count WHERE month = '$month' AND year = '$year'";
|
||||
$res = serendipity_db_query($sql, true);
|
||||
return $res;
|
||||
$res = serendipity_db_query($sql, true);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function extendedVisitorStatistics($max_items){
|
||||
|
||||
|
||||
global $serendipity;
|
||||
|
||||
|
||||
// ---------------QUERIES for Viewing statistics ----------------------------------------------
|
||||
$day = date('Y-m-d');
|
||||
list($year, $month, $day) = split('-', $day);
|
||||
|
||||
list($year, $month, $day) = split('-', $day);
|
||||
|
||||
$visitors_count_firstday = serendipity_db_query("SELECT day FROM {$serendipity['dbPrefix']}visitors ORDER BY counter_id ASC LIMIT 1", true);
|
||||
$visitors_count_today = serendipity_db_query("SELECT visits FROM {$serendipity['dbPrefix']}visitors_count WHERE year = '".$year."' AND month = '".$month."' AND day = '".$day."'", true);
|
||||
$visitors_count = serendipity_db_query("SELECT SUM(visits) FROM {$serendipity['dbPrefix']}visitors_count", true);
|
||||
@ -695,7 +700,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||
$hits_count = serendipity_db_query("SELECT SUM(hits) FROM {$serendipity['dbPrefix']}visitors_count", true);
|
||||
$visitors_latest = serendipity_db_query("SELECT counter_id, day, time, ref, browser, ip FROM {$serendipity['dbPrefix']}visitors ORDER BY counter_id DESC LIMIT ".$max_items."");
|
||||
$top_refs = serendipity_db_query("SELECT refs, count FROM {$serendipity['dbPrefix']}refs ORDER BY count DESC LIMIT 20");
|
||||
|
||||
|
||||
// ---------------STYLES for Viewing statistics ----------------------------------------------
|
||||
echo "<style type='text/css'>";
|
||||
echo ".colVis {text-align: center; width:600px; font-size: 10px; background-color:#dddddd;} ";
|
||||
@ -739,10 +744,10 @@ class serendipity_event_statistics extends serendipity_event
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<!-- Visitor graphs -->
|
||||
|
||||
<!-- Visitor graphs -->
|
||||
<dt><strong><?php echo PLUGIN_EVENT_STATISTICS_EXT_MONTHGRAPH;?></strong></dt>
|
||||
<?php if ($visitors_count[0] > 0) { ?>
|
||||
<?php if ($visitors_count[0] > 0) { ?>
|
||||
<table width="100%" cellpadding="0" cellspacing="0"><tr>
|
||||
<?php
|
||||
$color = "col2";
|
||||
@ -756,7 +761,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||
$num = $this->statistics_getmonthlystats($i, $visitors_count[0]);
|
||||
echo '<td class="'.$color.'" width="8%" align="center" valign="bottom"><small>' . $num[$i];
|
||||
$num[$i] = ($num[$i] / 100) * 20 + 1;
|
||||
echo '<br /><img src="plugins/serendipity_event_statistics/';
|
||||
echo '<br /><img src="plugins/serendipity_event_statistics/';
|
||||
if ($num[$i] < 10) {
|
||||
echo 'red.png';
|
||||
} else if ($num[$i] >= 11 && $num[$i] < 30) {
|
||||
@ -769,7 +774,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||
} ?>
|
||||
</tr><tr>
|
||||
<?php
|
||||
$mon = array('1' => 'Jan', '2' => 'Feb', '3' => 'Mar', '4' => 'Apr', '5' => 'May', '6' => 'Jun',
|
||||
$mon = array('1' => 'Jan', '2' => 'Feb', '3' => 'Mar', '4' => 'Apr', '5' => 'May', '6' => 'Jun',
|
||||
'7' => 'Jul', '8' => 'Aug', '9' => 'Sep', '10' => 'Oct', '11' => 'Nov', '12' => 'Dec');
|
||||
$color = "col2";
|
||||
for ($i = 1; $i < 13; $i++) {
|
||||
@ -779,13 +784,13 @@ class serendipity_event_statistics extends serendipity_event
|
||||
$color ="col1";
|
||||
}
|
||||
echo '<td class="'.$color.'" width="8%" align="center"><small><b>'. serendipity_strftime('%b', mktime(0, 0, 0, $i, 1, 2000)) .'</b></small></td>';
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
</tr></table>
|
||||
<?php } ?>
|
||||
|
||||
<dt><strong><?php echo PLUGIN_EVENT_STATISTICS_EXT_DAYGRAPH;?></strong></dt>
|
||||
<?php if ($visitors_count[0] > 0) { ?>
|
||||
<?php if ($visitors_count[0] > 0) { ?>
|
||||
<table width="100%" cellpadding="0" cellspacing="0"><tr>
|
||||
<?php
|
||||
$color = "col2";
|
||||
@ -797,7 +802,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||
}
|
||||
|
||||
$num = $this->statistics_getdailystats($i, $visitors_count[0]);
|
||||
echo '<td class="'.$color.'" width="3%" align="center" valign="bottom"><small>' . $num[$i];
|
||||
echo '<td class="'.$color.'" width="3%" align="center" valign="bottom"><small>' . $num[$i];
|
||||
$num[$i] = ($num[$i] / 100) * 40 + 1;
|
||||
echo '<br /><img src="plugins/serendipity_event_statistics/';
|
||||
if ($num[$i] < 20) {
|
||||
@ -821,15 +826,15 @@ class serendipity_event_statistics extends serendipity_event
|
||||
$color ="col1";
|
||||
}
|
||||
echo '<td class="'.$color.'" width="3%" align="center"><small><b>'. $i .'</b></small></td>';
|
||||
} ?>
|
||||
} ?>
|
||||
</tr></table>
|
||||
<?php } ?>
|
||||
<!-- End visitor graphs -->
|
||||
|
||||
<!-- End visitor graphs -->
|
||||
|
||||
<br /><br />
|
||||
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
<dt><strong><?php echo PLUGIN_EVENT_STATISTICS_EXT_VISLATEST;?></strong></dt>
|
||||
<dd>
|
||||
<table width="100%" cellpadding="0" cellspacing="0">
|
||||
@ -879,13 +884,13 @@ class serendipity_event_statistics extends serendipity_event
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
<?php
|
||||
} //end of function extendedVisitorStatistics()
|
||||
|
||||
|
||||
function createTables() {
|
||||
global $serendipity;
|
||||
|
||||
|
||||
//create table xxxx_visitors
|
||||
$q = "CREATE TABLE {$serendipity['dbPrefix']}visitors (
|
||||
counter_id {AUTOINCREMENT} {PRIMARY},
|
||||
@ -917,7 +922,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||
count int(11) not null default '0'
|
||||
)";
|
||||
serendipity_db_schema_import($q);
|
||||
|
||||
|
||||
$this->updateTables();
|
||||
} //end of function createTables()
|
||||
|
||||
@ -936,9 +941,9 @@ class serendipity_event_statistics extends serendipity_event
|
||||
|
||||
|
||||
function dropTables() {
|
||||
|
||||
|
||||
global $serendipity;
|
||||
|
||||
|
||||
// Drop tables
|
||||
$q = "DROP TABLE ".$serendipity['dbPrefix']."visitors";
|
||||
$sql = serendipity_db_schema_import($q);
|
||||
@ -946,21 +951,21 @@ class serendipity_event_statistics extends serendipity_event
|
||||
$sql = serendipity_db_schema_import($q);
|
||||
$q = "DROP TABLE ".$serendipity['dbPrefix']."refs";
|
||||
$sql = serendipity_db_schema_import($q);
|
||||
|
||||
|
||||
} //end of function dropTables
|
||||
|
||||
|
||||
function install(){
|
||||
|
||||
|
||||
$this->createTables();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function uninstall(){
|
||||
|
||||
|
||||
$this->dropTables();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id: serendipity_plugin_comments.php 691 2005-11-13 06:58:40Z elf2000 $
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -22,7 +27,7 @@ class serendipity_plugin_statistics extends serendipity_plugin
|
||||
$propbag->add('description', PLUGIN_EVENT_STATISTICS_NAME);
|
||||
$propbag->add('stackable', true);
|
||||
$propbag->add('author', 'Arnan de Gans, Garvin Hicking');
|
||||
$propbag->add('version', '1.2');
|
||||
$propbag->add('version', '1.3');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
@ -150,11 +155,11 @@ class serendipity_plugin_statistics extends serendipity_plugin
|
||||
$title = $this->get_config('title', $this->title);
|
||||
$cachetime = $this->get_config('cachetimeout', 60) * 60; // turn to seconds
|
||||
$cachef = $serendipity['serendipityPath'] . 'templates_c/statistics_cache.html';
|
||||
|
||||
|
||||
if (!file_exists($cachef) || filesize($cachef) == 0 || filemtime($cachef) < (time() - $cachetime)) {
|
||||
// Create statistics
|
||||
list($year, $month, $day) = split('-', date('Y-m-d'));
|
||||
|
||||
list($year, $month, $day) = split('-', date('Y-m-d'));
|
||||
|
||||
$content = '';
|
||||
if (serendipity_db_bool($this->get_config('show_lastentry'))) {
|
||||
$res = serendipity_db_query("SELECT timestamp FROM {$serendipity['dbPrefix']}entries WHERE isdraft = 'false' AND timestamp <= " . time() . " ORDER BY timestamp DESC LIMIT 1", true, 'assoc');
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -21,7 +26,7 @@ class serendipity_event_templatechooser extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_TEMPLATECHOOSER_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Evan Nemerson');
|
||||
$propbag->add('version', '1.3');
|
||||
$propbag->add('version', '1.4');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
@ -2,6 +2,11 @@
|
||||
|
||||
require_once S9Y_INCLUDE_PATH . 'plugins/serendipity_event_textile/textile.php';
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -22,7 +27,7 @@ class serendipity_event_textile extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_TEXTILE_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Serendipity Team');
|
||||
$propbag->add('version', '1.3');
|
||||
$propbag->add('version', '1.4');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -461,7 +466,7 @@ class serendipity_event_textwiki extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_TEXTWIKI_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Tobias Schlitt');
|
||||
$propbag->add('version', '1.3');
|
||||
$propbag->add('version', '1.4');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php # $Id$
|
||||
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
@ -21,7 +26,7 @@ class serendipity_event_trackexits extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_TRACKBACK_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Serendipity Team');
|
||||
$propbag->add('version', '1.7');
|
||||
$propbag->add('version', '1.8');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
Loading…
x
Reference in New Issue
Block a user