Fossil SCM

Try again to provide better "(more context)" hyperlinks on the /thisdayinhistory page.

drh 2019-05-10 16:33 trunk
Commit 273974a2e63c497e11412a9b10b697dade6d9dfad84601a6b5b489ffc4f814ba
1 file changed +4 -1
+4 -1
--- src/timeline.c
+++ src/timeline.c
@@ -2825,10 +2825,11 @@
28252825
db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/");
28262826
for(i=0; i<sizeof(aYearsAgo)/sizeof(aYearsAgo[0]); i++){
28272827
int iAgo = aYearsAgo[i];
28282828
char *zThis = db_text(0, "SELECT date(%Q,'-%d years')", zToday, iAgo);
28292829
Blob sql;
2830
+ char *zId;
28302831
if( strcmp(zThis, zStartOfProject)<0 ) break;
28312832
blob_init(&sql, 0, 0);
28322833
blob_append(&sql, "INSERT OR IGNORE INTO timeline ", -1);
28332834
blob_append(&sql, timeline_query_for_www(), -1);
28342835
blob_append_sql(&sql,
@@ -2840,12 +2841,14 @@
28402841
db_multi_exec("DELETE FROM timeline; %s;", blob_sql_text(&sql));
28412842
blob_reset(&sql);
28422843
if( db_int(0, "SELECT count(*) FROM timeline")==0 ){
28432844
continue;
28442845
}
2846
+ zId = db_text(0, "SELECT timestamp FROM timeline"
2847
+ " ORDER BY sortby DESC LIMIT 1");
28452848
@ <h2>%d(iAgo) Year%s(iAgo>1?"s":"") Ago
2846
- @ <small>%z(href("%R/timeline?c=%s+23:59:59",zThis))(more context)</a>\
2849
+ @ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\
28472850
@ </small></h2>
28482851
www_print_timeline(&q, TIMELINE_GRAPH|TIMELINE_DISJOINT, 0, 0, 0, 0);
28492852
}
28502853
db_finalize(&q);
28512854
style_footer();
28522855
--- src/timeline.c
+++ src/timeline.c
@@ -2825,10 +2825,11 @@
2825 db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/");
2826 for(i=0; i<sizeof(aYearsAgo)/sizeof(aYearsAgo[0]); i++){
2827 int iAgo = aYearsAgo[i];
2828 char *zThis = db_text(0, "SELECT date(%Q,'-%d years')", zToday, iAgo);
2829 Blob sql;
 
2830 if( strcmp(zThis, zStartOfProject)<0 ) break;
2831 blob_init(&sql, 0, 0);
2832 blob_append(&sql, "INSERT OR IGNORE INTO timeline ", -1);
2833 blob_append(&sql, timeline_query_for_www(), -1);
2834 blob_append_sql(&sql,
@@ -2840,12 +2841,14 @@
2840 db_multi_exec("DELETE FROM timeline; %s;", blob_sql_text(&sql));
2841 blob_reset(&sql);
2842 if( db_int(0, "SELECT count(*) FROM timeline")==0 ){
2843 continue;
2844 }
 
 
2845 @ <h2>%d(iAgo) Year%s(iAgo>1?"s":"") Ago
2846 @ <small>%z(href("%R/timeline?c=%s+23:59:59",zThis))(more context)</a>\
2847 @ </small></h2>
2848 www_print_timeline(&q, TIMELINE_GRAPH|TIMELINE_DISJOINT, 0, 0, 0, 0);
2849 }
2850 db_finalize(&q);
2851 style_footer();
2852
--- src/timeline.c
+++ src/timeline.c
@@ -2825,10 +2825,11 @@
2825 db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/");
2826 for(i=0; i<sizeof(aYearsAgo)/sizeof(aYearsAgo[0]); i++){
2827 int iAgo = aYearsAgo[i];
2828 char *zThis = db_text(0, "SELECT date(%Q,'-%d years')", zToday, iAgo);
2829 Blob sql;
2830 char *zId;
2831 if( strcmp(zThis, zStartOfProject)<0 ) break;
2832 blob_init(&sql, 0, 0);
2833 blob_append(&sql, "INSERT OR IGNORE INTO timeline ", -1);
2834 blob_append(&sql, timeline_query_for_www(), -1);
2835 blob_append_sql(&sql,
@@ -2840,12 +2841,14 @@
2841 db_multi_exec("DELETE FROM timeline; %s;", blob_sql_text(&sql));
2842 blob_reset(&sql);
2843 if( db_int(0, "SELECT count(*) FROM timeline")==0 ){
2844 continue;
2845 }
2846 zId = db_text(0, "SELECT timestamp FROM timeline"
2847 " ORDER BY sortby DESC LIMIT 1");
2848 @ <h2>%d(iAgo) Year%s(iAgo>1?"s":"") Ago
2849 @ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\
2850 @ </small></h2>
2851 www_print_timeline(&q, TIMELINE_GRAPH|TIMELINE_DISJOINT, 0, 0, 0, 0);
2852 }
2853 db_finalize(&q);
2854 style_footer();
2855

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button