Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_karma
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18010/plugins/serendipity_event_karma
Modified Files:
serendipity_event_karma.php
Log Message:
do not track clicks when in preview mode
Index: serendipity_event_karma.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_karma/serendipity_event_karma.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- serendipity_event_karma.php 27 Oct 2004 11:03:06 -0000 1.19
+++ serendipity_event_karma.php 29 Oct 2004 11:37:23 -0000 1.20
@@ -520,17 +520,13 @@
if ($addData['extended']) {
$entryid = (int)serendipity_db_escape_string($eventData[0]['id']);
- if ($track_clicks) {
+ if ($track_clicks && !$addData['preview']) {
$sql = serendipity_db_query('UPDATE ' . $serendipity['dbPrefix'] . 'karma SET visits = visits + 1 WHERE entryid = ' . $entryid, true);
if (serendipity_db_affected_rows() < 1) {
serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}karma (entryid, points, votes, lastvote, visits) VALUES ('$entryid', 0, 0, 0, 1)");
}
}
- if ($eventData[0]['timestamp'] < ($now - $max_karmatime)) {
- return;
- }
-
$q = 'SELECT SUM(votes) AS votes, SUM(points) AS points, SUM(visits) AS visits
FROM ' . $serendipity['dbPrefix'] . 'karma AS k
WHERE k.entryid = ' . $entryid . ' GROUP BY k.entryid LIMIT 1';
|