s4

changeset 34:77e2aeb2d7ad

autolink by "href=..."
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 22 Jul 2015 13:25:22 +0900
parents 54dba4c5e61d
children 894f93ef24fe
files s4-blog.sh
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/s4-blog.sh	Wed Jul 22 13:14:06 2015 +0900
     1.2 +++ b/s4-blog.sh	Wed Jul 22 13:25:22 2015 +0900
     1.3 @@ -119,7 +119,7 @@
     1.4  # LEFT JOIN (select name,val as gecos from user_s where key='gecos') b
     1.5  # on a.author=b.name where blogid='$id'";`
     1.6    arts=`query "select rowid,id,author from $at where blogid='$id';"`
     1.7 -err  arts="[$arts]"
     1.8 +# err  arts="[$arts]"
     1.9    number=0
    1.10    hrefhome0="<a href=\"?home"
    1.11    for a in $arts; do
    1.12 @@ -128,7 +128,7 @@
    1.13      # name=''	# Get gecos??
    1.14      td=$(echo $tmpd/`echo $a|md5`)
    1.15      val=`getvalbyid article image $arid $td`
    1.16 -err val="[$val]" and td as follows:
    1.17 +# err val="[$val]" and td as follows:
    1.18      
    1.19      if true; then
    1.20        if [ -n "$val" ]; then
    1.21 @@ -139,7 +139,7 @@
    1.22  		       #data=`percenthex $td/$fn`
    1.23  		       #ct=`cat $td/$fn.content-type`
    1.24  		       ri=`cat $td/$fn.rowid`
    1.25 -err fn=$fn ct=$ct ri=$ri; ls -lF $td/ 1>&3
    1.26 +### err fn=$fn ct=$ct ri=$ri; ls -lF $td/ 1>&3
    1.27  		       #case $ct in
    1.28  		#	 [Ii]mage*) anch="<img src=\"data:$ct,$data\">$fn" ;;
    1.29  		#	 *) anch=$fn ;;
    1.30 @@ -164,6 +164,7 @@
    1.31  	      -e 's|,\[/a\],|</a>|' \
    1.32  	      -e 's/,n,/<br>/g' -e "s|,i,|$imgs|" \
    1.33  	      -e "s|<TR>\(<TD>\)|<TR id=\"$aid\">\1|" \
    1.34 +	      -e "s|^href=\([-A-Za-z0-9,.:/~_%#&+?]*\)|<a &>\1</a>|g" \
    1.35  	      -e "s|\(<TR.*>\)\(<TD>\),e,|\1\2$link|"
    1.36  select
    1.37    coalesce((select ",e," from article where id='$aid' and author='$user'),"")