# HG changeset patch # User HIROSE Yuuji # Date 1592120002 -32400 # Node ID 45322d035c12c6e0fb8dd975b212f004e9bc0ad9 # Parent d368b937956ec8b12c51ab1db7cd2a6be29ef479 Link to "ShowAll" moved into blog_replies table diff -r d368b937956e -r 45322d035c12 s4-blog.sh --- a/s4-blog.sh Sun Jun 14 12:41:31 2020 +0900 +++ b/s4-blog.sh Sun Jun 14 16:33:22 2020 +0900 @@ -390,16 +390,26 @@ echo "時間をおいてください(Visit later please)." | html p return fi - if [ -n "$nlimit" -a `wc -l < $midfile` -gt "$nlimit" ]; then + echo '' + narts=`wc -l < $midfile` + if [ -n "$nlimit" -a "$narts" -gt "$nlimit" ]; then + newtop=`cat -n $midfile | grep "|new|" | head -1 | cut -f1` + if [ -n "$newtop" ]; then + afternew=$((narts-newtop+1)) + [ $afternew -gt $nlimit ] && nlimit=$((afternew+0)) + err Newtop=$newtop lines=$narts afternew=$afternew nlim=$nilmit + fi CAT="tail -n $nlimit" - limitedmsg="※最新${nlimit}件のみの表示" + limitedmsg="※最新${nlimit}件のみの表示※" showalllink="全件表示" - echo $limitedmsg$showalllink | html p + cat<<-EOF + + + EOF else CAT=cat fi # Start blog_replies table - echo '
$limitedmsg
($((narts-$nlimit))件省略)
$showalllink
' $CAT $midfile | while IFS='|' read id edit notify uid author uname icon aid \ tm reki new hte fa imgids