s4

changeset 194:b1847cc3912a

Display Most Recent Entry of user's
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 24 Apr 2016 16:38:59 +0859
parents 5d83ff0bbd40
children 40bef4883664
files s4-funcs.sh
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/s4-funcs.sh	Sat Apr 23 23:10:23 2016 +0859
     1.2 +++ b/s4-funcs.sh	Sun Apr 24 16:38:59 2016 +0859
     1.3 @@ -1449,6 +1449,26 @@
     1.4  	    $layout/html.m4.html $layout/home.m4.html
     1.5    
     1.6    if [ x"$user" = x"$uname" ]; then
     1.7 +    # Display Most Recent Entry
     1.8 +    DT_SQL="SELECT b.rowid, ctime,
     1.9 +       (SELECT val FROM blog_s WHERE key='title' AND id=b.id) title,
    1.10 +       (SELECT val FROM blog_s WHERE key='owner' AND id=b.id) owner
    1.11 +    FROM blog b
    1.12 +     JOIN
    1.13 +     (SELECT distinct blogid, max(val) ctime
    1.14 +      FROM article a, article_s s
    1.15 +      ON a.id=s.id AND a.author='$user' AND s.key='ctime'
    1.16 +      GROUP BY blogid ORDER BY val DESC LIMIT 5
    1.17 +     ) m
    1.18 +     ON b.id=m.blogid;"
    1.19 +    cat<<-EOF
    1.20 +	<div class="fold">
    1.21 +	`cgi_checkbox mrd yes id="mre"`<label for="mre">
    1.22 +	最近書き込んだ場所一覧</label>
    1.23 +	`DT_VIEW=replyblog dumptable html blog`
    1.24 +	</div>
    1.25 +	EOF
    1.26 +    unset DT_SQL
    1.27      # Display NEWS
    1.28      if false; then
    1.29        cond="where 新着 > 0 order by 新着 desc,ctime desc limit 10"