merged changes done in branch "grob_message" into main trunk
This commit is contained in:
parent
5b63058c89
commit
49c623f75b
3 changed files with 15 additions and 16 deletions
|
@ -590,18 +590,17 @@ function listMostRead_macro() {
|
||||||
function listReferrers_macro() {
|
function listReferrers_macro() {
|
||||||
var str = "";
|
var str = "";
|
||||||
var c = getDBConnection("antville");
|
var c = getDBConnection("antville");
|
||||||
var error = c.getLastError();
|
var dbError = c.getLasterror();
|
||||||
if (error)
|
if (dbError)
|
||||||
return("Error establishing DB connection: " + error);
|
return("Error establishing DB connection: " + dbError);
|
||||||
|
|
||||||
// we're doing this with direct db access here
|
// we're doing this with direct db access here
|
||||||
// (there's no need to do it with prototypes):
|
// (there's no need to do it with prototypes):
|
||||||
var d = new Date(new Date() - 1000 * 60 * 60 * 24); // 24 hours ago
|
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 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);
|
var rows = c.executeRetrieval(query);
|
||||||
error = c.getLastError();
|
var dbError = c.getLasterror();
|
||||||
if (error)
|
if (dbError)
|
||||||
return("Error executing SQL query: " + error);
|
return("Error executing SQL query: " + dbError);
|
||||||
var param = new Object();
|
var param = new Object();
|
||||||
while (rows.next()) {
|
while (rows.next()) {
|
||||||
param.count = rows.getColumnItem("COUNT");
|
param.count = rows.getColumnItem("COUNT");
|
||||||
|
@ -630,4 +629,4 @@ function xmlbutton_macro(param) {
|
||||||
openLink(this.href("rss10"));
|
openLink(this.href("rss10"));
|
||||||
renderImage(img, param);
|
renderImage(img, param);
|
||||||
closeLink();
|
closeLink();
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3" class="small"><% this.author as="link" %>, <% this.createtime format="short" %><% this.online prefix=" (" %><% this.commentcounter prefix=", " suffix=")" %></td>
|
<td colspan="3" class="small"><% this.author as="link" %>, <% this.createtime format="short" %><% this.online prefix=" (" %><% this.commentcounter prefix=", " suffix=")" anchor="comments" %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<td><span class="storyTitle"><% this.title suffix="<br />" %></span><% this.text limit="200" suffix=" ..." %></td>
|
<td><span class="storyTitle"><% this.title suffix="<br />" %></span><% this.text limit="200" suffix=" ..." %></td>
|
||||||
|
|
|
@ -341,17 +341,17 @@ function backlinks_macro() {
|
||||||
// this is a clone of weblog.listReferrers_macro.
|
// this is a clone of weblog.listReferrers_macro.
|
||||||
var str = "";
|
var str = "";
|
||||||
var c = getDBConnection("antville");
|
var c = getDBConnection("antville");
|
||||||
error = c.getLastError();
|
var dbError = c.getLastError();
|
||||||
if (error)
|
if (dbError)
|
||||||
return("Error establishing DB connection: " + error);
|
return("Error establishing DB connection: " + dbError);
|
||||||
|
|
||||||
// we're doing this with direct db access here
|
// we're doing this with direct db access here
|
||||||
// (there's no need to do it with prototypes):
|
// (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 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);
|
var rows = c.executeRetrieval(query);
|
||||||
error = c.getLastError();
|
var dbError = c.getLastError();
|
||||||
if (error)
|
if (dbError)
|
||||||
return("Error executing SQL query: " + error);
|
return("Error executing SQL query: " + dbError);
|
||||||
|
|
||||||
var param = new Object();
|
var param = new Object();
|
||||||
while (rows.next()) {
|
while (rows.next()) {
|
||||||
|
@ -369,4 +369,4 @@ function backlinks_macro() {
|
||||||
if (str)
|
if (str)
|
||||||
str = this.renderSkinAsString("backlinks", param);
|
str = this.renderSkinAsString("backlinks", param);
|
||||||
return(str);
|
return(str);
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue