s4
changeset 806:fc271965bd56 feature-world
merged
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Sun, 14 Jun 2020 17:10:48 +0900 |
parents | 1de1319dce99 f84cf537b5fb |
children | a842dc106ce3 |
files | s4-blog.sh |
diffstat | 1 files changed, 16 insertions(+), 4 deletions(-) [+] |
line diff
1.1 --- a/s4-blog.sh Sun Jun 14 12:48:43 2020 +0900 1.2 +++ b/s4-blog.sh Sun Jun 14 17:10:48 2020 +0900 1.3 @@ -390,16 +390,28 @@ 1.4 echo "時間をおいてください(Visit later please)." | html p 1.5 return 1.6 fi 1.7 - if [ -n "$nlimit" -a `wc -l < $midfile` -gt "$nlimit" ]; then 1.8 + echo '<table class="blog_replies"> <!-- blog:blog_showentry() main table -->' 1.9 + narts=`wc -l < $midfile` 1.10 + if [ -n "$nlimit" -a "$narts" -gt "$nlimit" ]; then 1.11 + newtop=`cat -n $midfile | grep "|new|" | head -1 | cut -f1` 1.12 + if [ -n "$newtop" ]; then 1.13 + afternew=$((narts-newtop+1)) 1.14 + [ $afternew -gt $nlimit ] && nlimit=$((afternew+0)) 1.15 + err Newtop=$newtop lines=$narts afternew=$afternew nlim=$nilmit 1.16 + fi 1.17 + fi 1.18 + if [ $nlimit -lt $narts ]; then 1.19 CAT="tail -n $nlimit" 1.20 - limitedmsg="<small class=\"warn\">※最新${nlimit}件のみの表示</small>" 1.21 + limitedmsg="<span class=\"warn\">※最新${nlimit}件のみの表示※</span>" 1.22 showalllink="<a title=\"Show All\" href=\"?replyblog+$rowid+n:all\">全件表示</a>" 1.23 - echo $limitedmsg$showalllink | html p 1.24 + cat<<-EOF 1.25 + <tr><td>$limitedmsg<br>($((narts-$nlimit))件省略)</td> 1.26 + <th>$showalllink</th></tr> 1.27 + EOF 1.28 else 1.29 CAT=cat 1.30 fi 1.31 # Start blog_replies table 1.32 - echo '<table class="blog_replies"> <!-- blog:blog_showentry() main table -->' 1.33 $CAT $midfile | 1.34 while IFS='|' read id edit notify uid author uname icon aid \ 1.35 tm reki new hte fa imgids