CGI サポートフォーラム

コメント返信ツリー表示一括表示リスト表示検索

質問をする前に、過去ログに同じ質問がないか検索してください。

1階層でページ数を左フレームに表示する変更
投稿者:masaya さん  ( uid 21158, posts:55, since 2004/01/06 )
投稿日: 2004/05/03 (月) 20:32 No.527 | 編集 | 削除

記事No.517 へのコメントです。

とりあえず、作ってみました。

いつものごとく、動作検証をしっかりやっていないので、問題があったら教えてください。
# 適当に作っているともいう・・・。すんません。

exit.cgi の sub menu 以降、行頭に } があるところまでを変更します。
# 全部変える必要はないんですけど、説明が面倒なので…。

sub menu {

&head;

my ($tmp_catid, $tmp_subid, $catdata, $subdata, $linkdata, $cat_linkcnt, $sub_linkcnt, $tmp_html);
my (%tmp_list, %tmp_sublist) = ();
my ($cat_max) = &LoadCategory;
my ($scat_max) = &LoadSubCategory;
&LoadLink;
$html .= "<img src=\"$imgdir/$menu_image\"><br>\n";
$html .= "<img src=\"$imgdir/line2.$ext\" width=150 height=5><br>\n";

foreach $tmp_catid (keys %category) {
$catdata = &GetCategory ($tmp_catid);
$tmp_list{$catdata->{'group'}."_".$catdata->{'catname'}."_".$catid} = $tmp_catid;
}

foreach (sort keys %tmp_list) {
$catdata = &GetCategory ($tmp_list{$_});
$temp = $in->{'catid'};
$temp .= ":$catdata->{'catid'}";
my ($scat_max) = &LoadSubCategory;

foreach $tmp_subid (keys %subcategory) {
$subdata = &GetSubCategory ($tmp_subid);
$tmp_sublist{$subdata->{'group'}."_".$subdata->{'subname'}."_".$tmp_subid} = $tmp_subid;
}

foreach (sort keys %tmp_sublist) {
$subdata = &GetSubCategory ($tmp_sublist{$_});
if ($subdata->{'catid'} eq $catdata->{'catid'}) {
$sub_linkcnt = 0;
foreach $tmp_linkid (%link) {
$linkdata = &GetLink($tmp_linkid);
@tmp_sub = split (":", $linkdata->{'subid'});
foreach $tmp (@tmp_sub) {
if ($tmp eq $subdata->{'subid'}) { $sub_linkcnt++; $cat_linkcnt++;}
}
}
$html .= "<a href=\"$script?mode=vew&subid=$subdata->{'subid'}\" target=\"vew\" class=\"menu\"><img src=\"$imgdir/$dot_image\" border=0> $subdata->{'subname'}</a><br>\n";
my $maxpage = int (($sub_linkcnt / $onepage) + 1) ;
for (my $i = 1; $i <= $maxpage; $i++) {
$html .= " <a href=\"$script?mode=vew$t&subid=$subdata->{'subid'}&page=$i\" target=\"vew\">[$i]</a>";
}
$html .= "<br>";
}
}
$html .= "<img src=\"$imgdir/line2.$ext\" width=150 height=5><br>\n";
}

$html .= <<_HTML_;
<div><img src="image/line2.$ext" width=150 height=5></div>
<a href=$script?mode=text target="vew" class="menu"><img src=\"$imgdir/$dot_image\" border=0> テキスト表示</a><br>
<div><img src="image/line2.$ext" width=150 height=5></div>
<a href=$script?mode=list target="vew" class="menu"><img src=\"$imgdir/$dot_image\" border=0> リスト表示</a><br>
<div><img src="$imgdir/line2.$ext" width=150 height=5></div>
<a href=$script?mode=vew&cmd=newlist target="vew" class="menu"><img src=\"$imgdir/$dot_image\" border=0> NEWLIST</a><br>
<div><img src="$imgdir/line2.$ext" width=150 height=5></div>
<a href=$info target="vew" class="menu"><img src=\"$imgdir/$dot_image\" border=0> INFO</a><br>
<div><img src="$imgdir/line2.$ext" width=150 height=5></div>
<br>
<div><img src="$imgdir/line2.$ext" width=150 height=5></div>
<a href=$admscript class="menu" target="vew"><img src=\"$imgdir/$dot_image\" border=0> 管理用</a><br>
<div><img src="$imgdir/line2.$ext" width=150 height=5></div>
<a href=$home target="_top" class="menu"><img src=\"$imgdir/$dot_image\" border=0> HOME</a><br>
<div><img src="$imgdir/line2.$ext" width=150 height=5></div>
<form action="$script" method="post" target="vew">
<input type="hidden" name="mode" value="vew">
<input type="hidden" name="cmd" value="search">
<input type="text" name="word" value="" style="width:150px;"><br>
<div align="center"><input type="image" src="$imgdir/search.$ext" border=0 width=80 height=21 alt="search!"></div>
<br>
</form>
</body></html>

_HTML_
}

[ この記事にコメントを返信する ] [ 原文引用 ]

この記事に対するコメント返信

- TOP -

管理者:webmaster
NICOLE's - WWWForum 3.7c  Modified by masaya
Catch: Sat May 4 07:03:06 2024
[jcode.pl:679:warn] defined(%hash) is deprecated at lib/jcode.pl line 679.
[jcode.pl:679:warn] (Maybe you should just omit the defined()?)
[jcode.pl:688:warn] defined(%hash) is deprecated at lib/jcode.pl line 688.
[jcode.pl:688:warn] (Maybe you should just omit the defined()?)

/wwwforum/wwwforum.cgi?id=11&az=msg&number=527&page=2 with Perl 5.016003 for freebsd