merged changes done in branch "grob_message" into main trunk

This commit is contained in:
Robert Gaggl 2002-06-12 17:19:05 +00:00
parent 5b63058c89
commit 49c623f75b
3 changed files with 15 additions and 16 deletions

View file

@ -590,18 +590,17 @@ function listMostRead_macro() {
function listReferrers_macro() {
var str = "";
var c = getDBConnection("antville");
var error = c.getLastError();
if (error)
return("Error establishing DB connection: " + error);
var dbError = c.getLasterror();
if (dbError)
return("Error establishing DB connection: " + dbError);
// we're doing this with direct db access here
// (there's no need to do it with prototypes):
var d = new Date(new Date() - 1000 * 60 * 60 * 24); // 24 hours ago
var query = "select *, count(*) as \"COUNT\" from ACCESS where WEBLOG_ID = " + this._id + " and DATE > '" + d.format("yyyy-MM-dd HH:mm:ss") + "' group by REFERRER order by \"COUNT\" desc, REFERRER asc;";
var rows = c.executeRetrieval(query);
error = c.getLastError();
if (error)
return("Error executing SQL query: " + error);
var dbError = c.getLasterror();
if (dbError)
return("Error executing SQL query: " + dbError);
var param = new Object();
while (rows.next()) {
param.count = rows.getColumnItem("COUNT");

View file

@ -1,6 +1,6 @@
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td colspan="3" class="small"><% this.author as="link" %>, <% this.createtime format="short" %><% this.online prefix="&nbsp;(" %><% this.commentcounter prefix=",&nbsp;" suffix=")" %></td>
<td colspan="3" class="small"><% this.author as="link" %>, <% this.createtime format="short" %><% this.online prefix="&nbsp;(" %><% this.commentcounter prefix=",&nbsp;" suffix=")" anchor="comments" %></td>
</tr>
<tr valign="top">
<td><span class="storyTitle"><% this.title suffix="<br />" %></span><% this.text limit="200" suffix="&nbsp;..." %></td>

View file

@ -341,17 +341,17 @@ function backlinks_macro() {
// this is a clone of weblog.listReferrers_macro.
var str = "";
var c = getDBConnection("antville");
error = c.getLastError();
if (error)
return("Error establishing DB connection: " + error);
var dbError = c.getLastError();
if (dbError)
return("Error establishing DB connection: " + dbError);
// we're doing this with direct db access here
// (there's no need to do it with prototypes):
var query = "select *, count(*) as \"COUNT\" from ACCESS where STORY_ID = " + this._id + " group by REFERRER order by \"COUNT\" desc, REFERRER asc;";
var rows = c.executeRetrieval(query);
error = c.getLastError();
if (error)
return("Error executing SQL query: " + error);
var dbError = c.getLastError();
if (dbError)
return("Error executing SQL query: " + dbError);
var param = new Object();
while (rows.next()) {