Differences From:
File
src/timeline.c
part of check-in
[4e683ef07b]
- Add the ability to modify global settings (such as the proxy setting)
even when there are no repositories defined.
by
drh on
2008-05-05 17:24:38.
[view]
To:
File
src/timeline.c
part of check-in
[2b0d4519dc]
- Work toward making the "h" permission mean "hyperlink". Without "h",
many pages will display, but there are few hyperlinks. A message
invites users to login as anonymous.
by
drh on
2008-05-05 20:18:32.
[view]
@@ -251,15 +251,9 @@
login_check_credentials();
if( !g.okRead ){ login_needed(); return; }
style_header("Timeline");
- if( !g.okHistory &&
- db_exists("SELECT 1 FROM user"
- " WHERE login='anonymous'"
- " AND cap LIKE '%%h%%'") ){
- @ <p><b>Note:</b> You will be able to access <u>much</u> more
- @ historical information if you <a href="%s(g.zTop)/login">login</a>.</p>
- }
+ login_anonymous_available();
timeline_temp_table();
blob_zero(&sql);
blob_zero(&desc);
blob_append(&sql, "INSERT OR IGNORE INTO timeline ", -1);
@@ -294,10 +288,14 @@
blob_appendf(&desc, "%d ancestors", np);
db_multi_exec("%s", blob_str(&sql));
}
}
- blob_appendf(&desc, " of <a href='%s/info/%s'>[%.10s]</a>",
- g.zBaseURL, zUuid, zUuid);
+ if( g.okHistory ){
+ blob_appendf(&desc, " of <a href='%s/info/%s'>[%.10s]</a>",
+ g.zBaseURL, zUuid, zUuid);
+ }else{
+ blob_appendf(&desc, " of [%.10s]", zUuid);
+ }
db_prepare(&q, "SELECT * FROM timeline ORDER BY timestamp DESC");
}else{
int n;
Blob url;
@@ -358,15 +356,17 @@
blob_appendf(&desc, " occurring on or after %h.<br>", zAfter);
}else if( zBefore ){
blob_appendf(&desc, " occurring on or before %h.<br>", zBefore);
}
- if( zAfter || n==nEntry ){
- zDate = db_text(0, "SELECT min(timestamp) FROM timeline");
- blob_appendf(&desc, " <a href='%b&b=%s'>[older]</a>", &url, zDate);
- }
- if( zBefore || (zAfter && n==nEntry) ){
- zDate = db_text(0, "SELECT max(timestamp) FROM timeline");
- blob_appendf(&desc, " <a href='%b&a=%s'>[more recent]</a>", &url, zDate);
+ if( g.okHistory ){
+ if( zAfter || n==nEntry ){
+ zDate = db_text(0, "SELECT min(timestamp) FROM timeline");
+ blob_appendf(&desc, " <a href='%b&b=%s'>[older]</a>", &url, zDate);
+ }
+ if( zBefore || (zAfter && n==nEntry) ){
+ zDate = db_text(0, "SELECT max(timestamp) FROM timeline");
+ blob_appendf(&desc, " <a href='%b&a=%s'>[more recent]</a>", &url,zDate);
+ }
}
}
blob_zero(&sql);
db_prepare(&q, "SELECT * FROM timeline ORDER BY timestamp DESC");