s4

changeset 803:45322d035c12

Link to "ShowAll" moved into blog_replies table
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 14 Jun 2020 16:33:22 +0900
parents d368b937956e
children 39e59b5b2131
files s4-blog.sh
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/s4-blog.sh	Sun Jun 14 12:41:31 2020 +0900
     1.2 +++ b/s4-blog.sh	Sun Jun 14 16:33:22 2020 +0900
     1.3 @@ -390,16 +390,26 @@
     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      CAT="tail -n $nlimit"
    1.18 -    limitedmsg="<small class=\"warn\">※最新${nlimit}件のみの表示</small>"
    1.19 +    limitedmsg="<span class=\"warn\">※最新${nlimit}件のみの表示※</span>"
    1.20      showalllink="<a title=\"Show All\" href=\"?replyblog+$rowid+n:all\">全件表示</a>"
    1.21 -    echo $limitedmsg$showalllink | html p
    1.22 +    cat<<-EOF
    1.23 +	<tr><td>$limitedmsg<br>($((narts-$nlimit))件省略)</td>
    1.24 +	    <th>$showalllink</th></tr>
    1.25 +	EOF
    1.26    else
    1.27      CAT=cat
    1.28    fi
    1.29    # Start blog_replies table
    1.30 -  echo '<table class="blog_replies"> <!-- blog:blog_showentry() main table -->'
    1.31    $CAT $midfile |
    1.32    while IFS='|' read id edit notify uid author uname icon aid \
    1.33  	   tm reki new hte fa imgids