|
From: mdw c. <myd...@li...> - 2001-10-31 11:56:59
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
comment.php news.php3
Log Message:
*** BEHAVIOR CHANGE ***
Topic : counting the news hits
Now we don't increase hits on the homepage of the news (news.php3).
We only upgrade the count number when people click on the "Read More" link.
This is much more persistant I think.
In the old way, clicking on the homepage of the news, I give +1 to all the news item...
Now I give +1 only if I look at this news particularly...
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/comment.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- comment.php 2001/10/31 10:55:58 1.10
+++ comment.php 2001/10/31 11:56:58 1.11
@@ -32,6 +32,13 @@
$rqt2->query($DBH, $sql);
$row2 = $rqt2->getrow();
+// here we can increase the hit number
+$row[nbhit]++;
+$sql = ("UPDATE news set nbhit=".$row[nbhit]." where num_news = $row[0]");
+$rqt2 = new query($DBH);
+$rqt2->query($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
+
+
$PAGE = get_piece_of_news($row[1], '<i>' . $row['texte'] . '</i><br><br>' .
$row['long_text'], $row[4], translate($row[5],$DBH), "news.php3?q=$row[6]", $row[nbhit], $row[0], $row2[0], strlen($row['long_text']) * 8, $DBH);
$PAGE .= "<P><a href='add_comment.php?num_news=$news'>".translate("COMMENT_NEWS",$DBH)."</a></P>";
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/news.php3,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- news.php3 2001/10/31 10:55:58 1.41
+++ news.php3 2001/10/31 11:56:58 1.42
@@ -174,8 +174,8 @@
$email = $row2[0];
}
- // to begin with, we update the hit count
- $new_nbhit = $row[8] + 1;
+ // CHANGE : we don't increase the hit nr here
+ $new_nbhit = $row[8];
$sql = "update news set nbhit = $new_nbhit
where num_news = $row[0]";
$rqt2 = new query($DBH);
|