From 8e2bfbe6b491b438207607998d2e935d9f8ca2fd Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Fri, 1 Dec 2006 09:07:52 +0000 Subject: [PATCH] Fix plugins, too --- .../serendipity_event_bbcode.php | 7 +- ...serendipity_event_browsercompatibility.php | 7 +- .../serendipity_event_contentrewrite.php | 7 +- .../serendipity_event_creativecommons.php | 7 +- .../serendipity_event_emoticate.php | 7 +- .../serendipity_event_entryproperties.php | 7 +- .../serendipity_event_karma.php | 7 +- .../serendipity_event_livesearch.php | 9 +- .../serendipity_event_mailer.php | 15 ++- .../serendipity_event_nl2br.php | 7 +- .../serendipity_event_s9ymarkup.php | 7 +- .../serendipity_event_searchhighlight.php | 7 +- .../serendipity_event_spamblock.php | 7 +- .../serendipity_event_spartacus.php | 7 +- .../serendipity_event_statistics.php | 103 +++++++++--------- .../serendipity_plugin_statistics.php | 11 +- .../serendipity_event_templatechooser.php | 7 +- .../serendipity_event_textile.php | 7 +- .../serendipity_event_textwiki.php | 7 +- .../serendipity_event_trackexits.php | 9 +- .../serendipity_event_weblogping.php | 9 +- .../serendipity_event_xhtmlcleanup.php | 9 +- .../serendipity_plugin_comments.php | 7 +- .../serendipity_plugin_creativecommons.php | 7 +- .../serendipity_plugin_entrylinks.php | 7 +- .../serendipity_plugin_eventwrapper.php | 7 +- .../serendipity_plugin_history.php | 7 +- .../serendipity_plugin_recententries.php | 13 ++- .../serendipity_plugin_remoterss.php | 17 ++- .../serendipity_plugin_shoutbox.php | 7 +- .../serendipity_plugin_templatedropdown.php | 7 +- 31 files changed, 252 insertions(+), 97 deletions(-) diff --git a/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php b/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php index c8a7cf9..9dcc0ac 100644 --- a/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php +++ b/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php @@ -1,5 +1,10 @@ add('description', PLUGIN_EVENT_BBCODE_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Jez Hancock, Garvin Hicking'); - $propbag->add('version', '2.01'); + $propbag->add('version', '2.02'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', diff --git a/plugins/serendipity_event_browsercompatibility/serendipity_event_browsercompatibility.php b/plugins/serendipity_event_browsercompatibility/serendipity_event_browsercompatibility.php index 47a512b..456e011 100644 --- a/plugins/serendipity_event_browsercompatibility/serendipity_event_browsercompatibility.php +++ b/plugins/serendipity_event_browsercompatibility/serendipity_event_browsercompatibility.php @@ -1,5 +1,10 @@ '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, diff --git a/plugins/serendipity_event_contentrewrite/serendipity_event_contentrewrite.php b/plugins/serendipity_event_contentrewrite/serendipity_event_contentrewrite.php index 9db6f4c..4392fb3 100644 --- a/plugins/serendipity_event_contentrewrite/serendipity_event_contentrewrite.php +++ b/plugins/serendipity_event_contentrewrite/serendipity_event_contentrewrite.php @@ -1,5 +1,10 @@ add('description', PLUGIN_EVENT_CONTENTREWRITE_DESCRIPTION); $propbag->add('stackable', true); $propbag->add('author', 'Garvin Hicking'); - $propbag->add('version', '1.1'); + $propbag->add('version', '1.2'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', diff --git a/plugins/serendipity_event_creativecommons/serendipity_event_creativecommons.php b/plugins/serendipity_event_creativecommons/serendipity_event_creativecommons.php index 257db0a..729ff9a 100644 --- a/plugins/serendipity_event_creativecommons/serendipity_event_creativecommons.php +++ b/plugins/serendipity_event_creativecommons/serendipity_event_creativecommons.php @@ -1,5 +1,10 @@ add('description', PLUGIN_CREATIVECOMMONS_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Evan Nemerson'); - $propbag->add('version', '1.0'); + $propbag->add('version', '1.1'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', diff --git a/plugins/serendipity_event_emoticate/serendipity_event_emoticate.php b/plugins/serendipity_event_emoticate/serendipity_event_emoticate.php index 80d1b4a..2855642 100644 --- a/plugins/serendipity_event_emoticate/serendipity_event_emoticate.php +++ b/plugins/serendipity_event_emoticate/serendipity_event_emoticate.php @@ -1,5 +1,10 @@ add('description', PLUGIN_EVENT_EMOTICATE_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', diff --git a/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php b/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php index 83687c1..a7ddfe1 100644 --- a/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php +++ b/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php @@ -1,5 +1,10 @@ add('description', PLUGIN_EVENT_ENTRYPROPERTIES_DESC); $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', diff --git a/plugins/serendipity_event_karma/serendipity_event_karma.php b/plugins/serendipity_event_karma/serendipity_event_karma.php index 11a5dd1..75071ab 100644 --- a/plugins/serendipity_event_karma/serendipity_event_karma.php +++ b/plugins/serendipity_event_karma/serendipity_event_karma.php @@ -1,5 +1,10 @@ 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', diff --git a/plugins/serendipity_event_livesearch/serendipity_event_livesearch.php b/plugins/serendipity_event_livesearch/serendipity_event_livesearch.php index f866e9c..0f62361 100644 --- a/plugins/serendipity_event_livesearch/serendipity_event_livesearch.php +++ b/plugins/serendipity_event_livesearch/serendipity_event_livesearch.php @@ -1,10 +1,15 @@ 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', diff --git a/plugins/serendipity_event_mailer/serendipity_event_mailer.php b/plugins/serendipity_event_mailer/serendipity_event_mailer.php index d497299..992453a 100644 --- a/plugins/serendipity_event_mailer/serendipity_event_mailer.php +++ b/plugins/serendipity_event_mailer/serendipity_event_mailer.php @@ -1,5 +1,10 @@ add('description', PLUGIN_EVENT_MAILER_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Sebastian Nohn, Kristian Koehntopp, Garvin Hicking'); - $propbag->add('version', '1.43'); + $propbag->add('version', '1.44'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -46,12 +51,12 @@ class serendipity_event_mailer extends serendipity_event if (!is_array($this->data['categories'])) { return false; } - + foreach($this->data['categories'] AS $cat) { $conf[] = 'category_' . $cat['categoryid']; $this->data['cat'][$cat['categoryid']] = $cat; } - + if (is_object($bag)) { $bag->add('configuration', $conf); } @@ -144,7 +149,7 @@ class serendipity_event_mailer extends serendipity_event $to[] = $mailto; } } - + $this->performConfig($to); if (is_array($this->data['cat'])) { $selected = array(); @@ -156,7 +161,7 @@ class serendipity_event_mailer extends serendipity_event foreach($this->data['cat'] AS $cid => $cat) { $mailto = trim($this->get_config('category_' . $cid)); - + if (!empty($mailto) && isset($selected[$cid])) { $tos = explode(' ', $mailto); foreach($tos AS $mailtopart) { diff --git a/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php b/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php index 60db21e..349d73c 100644 --- a/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php +++ b/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php @@ -1,5 +1,10 @@ add('description', PLUGIN_EVENT_NL2BR_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', diff --git a/plugins/serendipity_event_s9ymarkup/serendipity_event_s9ymarkup.php b/plugins/serendipity_event_s9ymarkup/serendipity_event_s9ymarkup.php index 971d414..26ec59a 100644 --- a/plugins/serendipity_event_s9ymarkup/serendipity_event_s9ymarkup.php +++ b/plugins/serendipity_event_s9ymarkup/serendipity_event_s9ymarkup.php @@ -1,5 +1,10 @@ add('description', PLUGIN_EVENT_S9YMARKUP_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Serendipity Team'); - $propbag->add('version', '1.1'); + $propbag->add('version', '1.2'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', diff --git a/plugins/serendipity_event_searchhighlight/serendipity_event_searchhighlight.php b/plugins/serendipity_event_searchhighlight/serendipity_event_searchhighlight.php index 5adb101..d770f14 100644 --- a/plugins/serendipity_event_searchhighlight/serendipity_event_searchhighlight.php +++ b/plugins/serendipity_event_searchhighlight/serendipity_event_searchhighlight.php @@ -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.1'); + $propbag->add('version', '1.2'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', diff --git a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php index 6f859b6..0ab1788 100644 --- a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php +++ b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php @@ -1,5 +1,10 @@ '2.6.7', 'php' => '4.1.0' )); - $propbag->add('version', '1.51'); + $propbag->add('version', '1.52'); $propbag->add('event_hooks', array( 'frontend_saveComment' => true, 'external_plugin' => true, diff --git a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php index 96be9fc..75eed4e 100644 --- a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php +++ b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php @@ -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', diff --git a/plugins/serendipity_event_statistics/serendipity_event_statistics.php b/plugins/serendipity_event_statistics/serendipity_event_statistics.php index 69a8703..1aa1d02 100644 --- a/plugins/serendipity_event_statistics/serendipity_event_statistics.php +++ b/plugins/serendipity_event_statistics/serendipity_event_statistics.php @@ -1,5 +1,10 @@ add('description', PLUGIN_EVENT_STATISTICS_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Garvin Hicking, Fredrik Sandberg'); - $propbag->add('version', '1.24'); + $propbag->add('version', '1.25'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -45,8 +50,8 @@ 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, 'yesTop' => PLUGIN_EVENT_STATISTICS_EXT_OPT3); $propbag->add('type', 'select'); @@ -56,7 +61,7 @@ class serendipity_event_statistics extends serendipity_event $propbag->add('default', 'no'); break; - + case 'banned_bots': $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_EVENT_STATISTICS_BANNED_HOSTS); @@ -79,7 +84,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; @@ -93,11 +98,11 @@ 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)) { - + // avoiding banned browsers $banned_bots = $this->get_config('banned_bots'); $tmp_array = explode('|', $banned_bots); @@ -106,15 +111,15 @@ class serendipity_event_statistics extends serendipity_event if (trim($tmp_array[$i]) == trim($_SERVER['HTTP_USER_AGENT'])){ $found = 'yes'; } - } - if ($found == 'no'){ + } + if ($found == 'no'){ $this->countVisitor(); } } else { // Update visitor timestamp $this->updateVisitor(); } - + break; case 'backend_sidebar_entries': ?> @@ -130,12 +135,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); } - + $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); $total_count = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}entries", true); @@ -454,7 +459,7 @@ class serendipity_event_statistics extends serendipity_event
$max_items)); ?> - + strip_tags($_SERVER['HTTP_USER_AGENT']), 'ip' => strip_tags($_SERVER['REMOTE_ADDR']) ); - + 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)); - + //updating db $q = serendipity_db_query("SELECT count(refs) FROM {$serendipity['dbPrefix']}refs WHERE refs = '$urlC' GROUP BY refs", true); if (!is_array($q) || $q[0] >= 1){ @@ -523,14 +528,14 @@ class serendipity_event_statistics extends serendipity_event serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}refs (refs, count) VALUES ('$urlC', 1)"); } } - + } //end of function countVisitor - - + + function extendedVisitorStatistics($max_items){ - + global $serendipity; - + // ---------------QUERIES for Viewing statistics ---------------------------------------------- $day = date('Y-m-d'); $visitors_count_today = serendipity_db_query("SELECT count(counter_id) FROM {$serendipity['dbPrefix']}visitors WHERE day = '".$day."'", true); @@ -538,7 +543,7 @@ class serendipity_event_statistics extends serendipity_event $visitors_count = serendipity_db_query("SELECT count(counter_id) FROM {$serendipity['dbPrefix']}visitors", 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 ".$max_items.""); - + // ---------------STYLES for Viewing statistics ---------------------------------------------- echo "