Mercurial > hgrepos > hgweb.cgi > s4
comparison y4-blog.sh @ 16:636df1c1bdf2
Track group by rowid in URLs
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Tue, 21 Jul 2015 14:38:21 +0900 |
parents | f2204bd941d5 |
children |
comparison
equal
deleted
inserted
replaced
15:5e75802f2f0b | 16:636df1c1bdf2 |
---|---|
282 dumptable html blog 'ctime title heading' "$cond" | 282 dumptable html blog 'ctime title heading' "$cond" |
283 ) | 283 ) |
284 | 284 |
285 blog_addentry() { | 285 blog_addentry() { |
286 # $1=GRPname(if it is a group) | 286 # $1=GRPname(if it is a group) |
287 grp=$1 | 287 grprowid=$1 |
288 rowid=`getpar rowid` | 288 rowid=`getpar rowid` |
289 err ba: rowid=$rowid | 289 err ba: rowid=$rowid |
290 #if [ -z "$rowid" ]; then | 290 #if [ -z "$rowid" ]; then |
291 # When rowid is SET, it is updation of existing entry | 291 # When rowid is SET, it is updation of existing entry |
292 if [ -z "$1" ]; then | 292 if [ -z "$1" ]; then |
293 listing=$user guide="[個人]" | 293 listing=$user guide="[個人]" |
294 #listing代入は rowid 時でもするべき | 294 #listing代入は rowid 時でもするべき |
295 else | 295 else |
296 if isgroup $1; then | 296 grp=`getgroupbyid $grprowid` |
297 listing=$1 guide="[${1}]" GF_OWNER=$1 | 297 if [ -n "$grp" ]; then |
298 listing=$1 guide="[${grp}]" GF_OWNER=$grp | |
298 else | 299 else |
299 echo "<p>無効なグループ指定です。</p>" | 300 echo "<p>無効なグループ指定です。</p>" |
300 return | 301 return |
301 fi | 302 fi |
302 fi | 303 fi |
353 title=`getvalbyid blog title $rowid` | 354 title=`getvalbyid blog title $rowid` |
354 owner=`getvalbyid blog owner $rowid` | 355 owner=`getvalbyid blog owner $rowid` |
355 if isuser "$owner"; then | 356 if isuser "$owner"; then |
356 subtitle="`gecos $owner` さんの話題" | 357 subtitle="`gecos $owner` さんの話題" |
357 else | 358 else |
358 subtitle="<a href=\"?grp+$owner\">`gecos $owner`</a> での話題" | 359 grprowid=`query "select rowid from grp where gname=\"$owner\";"` |
360 subtitle="<a href=\"?grp+$grprowid\">`gecos $owner`</a> での話題" | |
359 fi | 361 fi |
360 if [ -z "$title" ]; then | 362 if [ -z "$title" ]; then |
361 echo "<p>日記番号指定が無効です。</p>" | 363 echo "<p>日記番号指定が無効です。</p>" |
362 return | 364 return |
363 fi | 365 fi |