Mercurial > hgrepos > hgweb.cgi > s4
changeset 252:75dfaceac01f
Link to newest article of the blog in the recent writing place
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Sun, 17 Jul 2016 23:59:37 +0859 |
parents | 9e8e43ed3c11 |
children | a40d258cc5aa |
files | examples/common/default/default.css s4-funcs.sh |
diffstat | 2 files changed, 33 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/common/default/default.css Sun Jul 17 13:31:20 2016 +0859 +++ b/examples/common/default/default.css Sun Jul 17 23:59:37 2016 +0859 @@ -24,6 +24,7 @@ td {padding-left: 0.5ex; padding-right: 0.5ex;} table.td2r td:nth-child(2) {text-align: right;} table.td3r td:nth-child(3) {text-align: right;} + table.form, table.b, table.b tr, table.b td, table.b th { border: 1px solid black; border-collapse: collapse; } @@ -105,7 +106,15 @@ height: auto; opacity: 1.0; transition: 1s; } div.dumptable {max-height: 15em; overflow: auto;} - +table.td4fw td:nth-child(4) {max-width: 8em; white-space: nowrap; overflow: hidden;} +table.td67fw {max-width: 9%;} +table.dumpblogs td:nth-child(4) { + max-width: 7.6em; white-space: nowrap; overflow: hidden;} +table.dumpblogs td:nth-child(5), +table.dumpblogs td:nth-child(6) { + max-width: 12em; white-space: nowrap; overflow: hidden;} +table.dumpblogs td:nth-child(7) { + min-width: 5em; white-space: nowrap; overflow: hidden;} /********************* icon list *********************/ div.iconlist {
--- a/s4-funcs.sh Sun Jul 17 13:31:20 2016 +0859 +++ b/s4-funcs.sh Sun Jul 17 23:59:37 2016 +0859 @@ -22,7 +22,7 @@ msgdir=$templ/msg timeout="+2 days" memoplimitdays="7" -dumpcollen=17 +dumpcollen=22 #thumbxy=120x120 thumbxy=96x96 maximagexy=1600x1600 @@ -1495,20 +1495,25 @@ # Display Most Recent Entry shortval=${dumpcollen:+"substr(val, 0, $dumpcollen)"} shortval=${shortval:-val} - DT_SQL="SELECT b.rowid LINK, - ctime, - (SELECT $shortval FROM blog_s WHERE key='title' AND id=b.id) title, - (SELECT gecos FROM gecoses - WHERE name=(SELECT val FROM blog_s - WHERE key='owner' AND id=b.id)) owner - FROM blog b - JOIN - (SELECT distinct blogid, max(val) ctime - FROM article a, article_s s - ON a.id=s.id AND a.author='$user' AND s.key='ctime' - GROUP BY blogid ORDER BY val DESC LIMIT 50 - ) m - ON b.id=m.blogid;" + DT_SQL="WITH arts AS( + SELECT (SELECT rowid FROM blog WHERE id=a.blogid) brid, + a.blogid, a.id id, s.val ctime + FROM article a NATURAL JOIN article_s s + WHERE s.key = 'ctime' AND a.author='$user' + GROUP by s.id + ) + SELECT a1.brid || '#' || a1.id LINK, + a1.ctime, + (SELECT val FROM blog_s + WHERE key='title' AND id=a1.blogid) title, + (SELECT gecos + FROM gecoses + WHERE name=(SELECT val FROM blog_s + WHERE key='owner' AND id=a1.blogid)) owner + FROM arts a1 + WHERE a1.ctime = (SELECT max(ctime) FROM arts WHERE blogid=a1.blogid) + GROUP BY a1.brid ORDER by a1.ctime DESC LIMIT 50;" + cat<<-EOF <div class="fold"> `cgi_checkbox mrd yes id="mre"`<label @@ -2529,7 +2534,7 @@ ### elink="<a href=\"$myname?edittable+$2+\\2\">EDIT</a>" VIEW=${DT_VIEW-replyblog} if [ -n "$VIEW" ]; then - dvlink=" <a href=\"$myname?$VIEW+\\2\">VIE</a><a href=\"$myname?$VIEW+\\2#bottom\">W</a>" + dvlink=" <a href=\"$myname?$VIEW+\\2\\3\">VIE</a><a href=\"$myname?$VIEW+\\2#bottom\">W</a>" fi # $DT_CHLD=ChildTable:BindColumn if [ -n "$DT_CHLD" ]; then @@ -2541,7 +2546,7 @@ user='$user' and tbl='$2' and tblrowid=a.rowid),\ '1970-01-01'))" cnt="$cntnew as '新着', $cntall as '総数'," - dt_class=" td2r td3r" + dt_class=" td2r td3r dumpblogs" fi # Construct join expression eav="" scols="" @@ -2568,7 +2573,7 @@ then (SELECT gecos FROM gecoses WHERE name=val) END) as gecos from ${2}_s c group by $pk) b on a.$pk=b.$pk $4;"} err SQL=`echo "$sql"` - cat<<EOF | sed "s,\(<TR><TD>\)\([1-9][0-9]*\)</TD>,\1$elink$dvlink</TD>," + cat<<EOF | sed "s,\(<TR><TD>\)\([1-9][0-9]*\)\(#[0-9a-fxs]*\)*</TD>,\1$elink$dvlink</TD>," <div> <!-- for folding by check button (s4-funcs.sh:dumptable()) --> <div class="dumptable"> <table class="b$dt_class">