lynx
Advanced lynx | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Net_man Так. Вот этот кусок: Код: #################--- Begin the program ---################### $thisprog = "forums.cgi"; $query = new CGI; $cookiepath = $query->url(-absolute=>1); $cookiepath =~ s/$thisprog//sg; $bypass = $query -> param('bypass'); $inforum = $query -> param('forum'); $intopic = $query -> param('topic'); $action = $query -> param('action'); $inshow = $query -> param('show'); $jumpto = $query -> param('jumpto'); ###### ХАК. Фильтр тем. by ivank $filterby = $query -> param( 'filterby' ); $filterstring = $query -> param( 'filterstring' ); chomp $filterstring; if( $filterby ne '' ) { $filterpart = "&filterby=$filterby&filterstring=$filterstring"; } ###### Конец ХАКА die "Hack attempt!" unless $inforum =~ m!\A\d{1,3}\Z!; die "Hack attempt!" if $intopic && $intopic !~ m!\A\d{1,7}\Z!; $inmembername = cookie("amembernamecookie"); $inpassword = cookie("apasswordcookie"); $bypass = &stripMETA("$bypass"); $inforum = &stripMETA("$inforum"); $intopic = &stripMETA("$intopic"); $action = &stripMETA("$action"); $inshow = &stripMETA("$inshow"); $jumpto = &stripMETA("$jumpto"); | Меняй на этот кусок: Код: #################--- Begin the program ---################### $thisprog = "forums.cgi"; $query = new CGI; $cookiepath = $query->url(-absolute=>1); $cookiepath =~ s/$thisprog//sg; $bypass = $query -> param('bypass'); $inforum = $query -> param('forum'); $intopic = $query -> param('topic'); $action = $query -> param('action'); $inshow = $query -> param('show'); $jumpto = $query -> param('jumpto'); die "Hack attempt!" unless $inforum =~ m!\A\d{1,3}\Z!; die "Hack attempt!" if $intopic && $intopic !~ m!\A\d{1,7}\Z!; $inmembername = cookie("amembernamecookie"); $inpassword = cookie("apasswordcookie"); $bypass = &stripMETA("$bypass"); $inforum = &stripMETA("$inforum"); $intopic = &stripMETA("$intopic"); $action = &stripMETA("$action"); $inshow = &stripMETA("$inshow"); $jumpto = &stripMETA("$jumpto"); ###### ХАК. Фильтр тем. by ivank $filterby = $query -> param( 'filterby' ); $filterstring = $query -> param( 'filterstring' ); chomp $filterstring; if( $filterby ne '' ) { $filterpart = "&filterby=$filterby&filterstring=$filterstring"; } ###### Конец ХАКА | Далее. К фильтру отношения не имеет, но все-таки. Кусок: Код: if ($forumgraphic) { $forumgraphic = qq~<a href="$forumsprog?forum=$inforum"><img src="$imagesurl/images/$forumgraphic" border=0></a>~; } else {} ##Это что такое то? | Меняй на: Код: $forumgraphic = qq~<a href="$forumsprog?forum=$inforum"><img src="$imagesurl/images/$forumgraphic" border=0></a>~ if ($forumgraphic); | Это: Код: ##### ХАК. Фильр топиков. by ivank. if( $filterby eq 'title' ) { @filtered_topics = (); foreach $topic ( @topics ) { ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$topic); if( $topictitle =~ /$filterstring/i ) { push @filtered_topics, $topic; } } @topics = @filtered_topics; } elsif( $filterby eq 'author' ) { @filtered_topics = (); foreach $topic ( @topics ) { ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$topic); if( $startedby =~ /$filterstring/i ) { push @filtered_topics, $topic; } } @topics = @filtered_topics; } ##### Конец хака. | Меняй на: Код: ##### Фильр топиков. by ivank start if( $filterby eq 'title' ) { @filtered_topics = (); $lc_filterstring = $filterstring; $lc_filterstring =~ tr/А-ЯЁЧ/а-яёч/; foreach $topic ( @topics ) { ($topicid, $lc_topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$topic); $lc_topictitle =~ tr/А-ЯЁЧ/а-яёч/; if( $lc_topictitle =~ /$lc_filterstring/i ) { push @filtered_topics, $topic; } } @topics = @filtered_topics; } elsif($filterby eq 'author') { @filtered_topics = (); foreach $topic ( @topics ) { ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$topic); if( $startedby =~ /$filterstring/i ) { push @filtered_topics, $topic; } } @topics = @filtered_topics; } elsif( $filterby eq 'description' ) { @filtered_topics = (); $lc_filterstring = $filterstring; $lc_filterstring =~ tr/А-ЯЁЧ/а-яёч/; foreach $topic ( @topics ) { ($topicid, $topictitle, $lc_topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$topic); $lc_topicdescription =~ tr/А-ЯЁЧ/а-яёч/; if( $lc_topicdescription =~ /$lc_filterstring/i ) { push @filtered_topics, $topic; } } @topics = @filtered_topics; } ##### filter end | Это делает фильтр регистронезависимым. Попробуй. Добавлено Выложила все в первый пост. Протестировано на дефолтной конфе. |