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 wrap: on
line diff
--- a/s4-funcs.sh	Sat Apr 23 23:10:23 2016 +0859
+++ b/s4-funcs.sh	Sun Apr 24 16:38:59 2016 +0859
@@ -1449,6 +1449,26 @@
 	    $layout/html.m4.html $layout/home.m4.html
   
   if [ x"$user" = x"$uname" ]; then
+    # Display Most Recent Entry
+    DT_SQL="SELECT b.rowid, ctime,
+       (SELECT val FROM blog_s WHERE key='title' AND id=b.id) title,
+       (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 5
+     ) m
+     ON b.id=m.blogid;"
+    cat<<-EOF
+	<div class="fold">
+	`cgi_checkbox mrd yes id="mre"`<label for="mre">
+	最近書き込んだ場所一覧</label>
+	`DT_VIEW=replyblog dumptable html blog`
+	</div>
+	EOF
+    unset DT_SQL
     # Display NEWS
     if false; then
       cond="where 新着 > 0 order by 新着 desc,ctime desc limit 10"

yatex.org