Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » IkonBoard и другие форумы » Ikonboard v.2 » Как сделать так, чтобы тема всегда была наверху?

Модерирует : Antuan

 Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

Открыть новую тему     Написать ответ в эту тему

fbender



Junior Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору

1. В postings.cgi
 
Код:
 

Код:
 
    my %Mode = (  
    'edit'                 =>    \&editform,
    'lock'                 =>    \&lockthread,
    'unlock'               =>    \&unlockthread,        
    'delete'               =>    \&deletethread,
    'movetopic'            =>    \&movetopic,
    'edittopic'   => \&edit_topic_title
    );
   
 
Меняем на:
 

Код:
 
    my %Mode = (  
    'edit'                 =>    \&editform,
    'lock'                 =>    \&lockthread,
    'unlock'               =>    \&unlockthread,        
    'delete'               =>    \&deletethread,
    'movetopic'            =>    \&movetopic,
    'edittopic'       => \&edit_topic_title,
   'stick'                =>    \&sticktopic,
    'unstick'              =>    \&unsticktopic

);

 
 
Код:
 

Код:
 
    my $file = "$ikondir" . "forum$inforum/$intopic.pl";
    open (ENT, $file);
      flock ENT, 1;
    $in = <ENT>;
    close (ENT);
 
    #          Old title        Old description
 
    ($topicid, $old_topictitle, $old_topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$in);

 
 
Меняем на:
 

Код:
 
    my $file = "$ikondir" . "forum$inforum/$intopic.pl";
    open (ENT, $file);
    flock ENT, 1;
    $in = <ENT>;
    close (ENT);
    #          Old title        Old description
($topicid, $old_topictitle, $old_topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate, $sticky) = split(/\|/,$in);
 
 
 
 
Код:
 

Код:
 
      open(FILE, ">$file");
        flock(FILE, 2);      # New Title    # New Description
        print FILE "$intopic|$intopictitle|$intopicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate";
        close(FILE);

 
 
Меняем на:
 

Код:
 
      open(FILE, ">$file");
        flock(FILE, 2);      # New Title    # New Description
        print FILE "$intopic|$intopictitle|$intopicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate|$sticky";
        close(FILE);

 
 
 
Код:
 

Код:
 
                   my $file = "$ikondir" . "forum$inforum/$intopic.pl";
                    open (ENT, $file);
                      flock ENT, 1;
                    $in = <ENT>;
                    close (ENT);
 
                    ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$in);
                 
                    open(FILE, ">$file");  
flock(FILE, 2);  
$threadposts++;  
print FILE "$intopic|$topictitle|$topicdescription|closed|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate";  
close (FILE);  
                     
            } # end if inleavemessage eq yes
 
        my $file = "$ikondir" . "forum$inforum/$intopic.pl";
        open (ENT, $file);
          flock ENT, 1;
        $in = <ENT>;
        close (ENT);
 
        ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$in);
         
         
        my $file = "$ikondir" . "forum$movetoid/$newthreadnumber.pl";  
open(FILE, ">$file");  
flock(FILE, 2);  
print FILE "$newthreadnumber|$topictitle|$topicdescription|open|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate";  
close(FILE);

 
 
Меняем на:
 

Код:
 
   my $file = "$ikondir" . "forum$inforum/$intopic.pl";  
      open (ENT, $file);  
      flock ENT, 1;  
      $in = <ENT>;  
      close (ENT);  
($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate, $sticky) = split(/\|/,$in);
 
     open(FILE, ">$file");  
     flock(FILE, 2);  
     $threadposts++;  
     print FILE "$intopic|$topictitle|$topicdescription|closed|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate|$sticky";  
     close(FILE);  
   } # end if inleavemessage eq yes  
 
        my $file = "$ikondir" . "forum$inforum/$intopic.pl";  
        open (ENT, $file);  
        flock ENT, 1;  
        $in = <ENT>;  
        close (ENT);  
($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate, $sticky) = split(/\|/,$in);  
 
  my $file = "$ikondir" . "forum$movetoid/$newthreadnumber.pl";  
  open(FILE, ">$file");  
  flock(FILE, 2);  
  print FILE "$newthreadnumber|$topictitle|$topicdescription|open|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate|$sticky";  
  close(FILE);

 
 
Далее в том же файле в sub lockthread
 
Код:
 

Код:
 
        ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$in);
         
        open(FILE, ">$file");
          flock(FILE, 2);
        print FILE "$intopic|$topictitle|$topicdescription|closed|$threadposts|$threadviews|$startedby|$startedpostdate|$inmembername|$currenttime";
        close(FILE);
 

 
Меняем на:  
 

Код:
 
        ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate, $sticky) = split(/\|/,$in);
         
        open(FILE, ">$file");
          flock(FILE, 2);
        print FILE "$intopic|$topictitle|$topicdescription|closed|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate|$sticky";
        close(FILE);
         
                             
## Переменные |$inmembername|$currenttime  можно заметить на |$lastposter|$lastpostdate хотя отношения к поднятой теме это не имеет.
 
В sub unlockthread  
 
Код:        
 

Код:
 
        my $file = "$ikondir" . "forum$inforum/$intopic.pl";
        open (ENT, $file);
          flock ENT, 1;
        $in = <ENT>;
        close (ENT);
 
        ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$in);
         
        open(FILE, ">$file");
          flock(FILE, 2);
        print FILE "$intopic|$topictitle|$topicdescription|open|$threadposts|$threadviews|$startedby|$startedpostdate|$inmembername|$currenttime";
        close(FILE);
 

 
Меняем на:        
 

Код:
 
        my $file = "$ikondir" . "forum$inforum/$intopic.pl";
        open (ENT, $file);
          flock ENT, 1;
        $in = <ENT>;
        close (ENT);
($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate, $sticky) = split(/\|/,$in);
         
        open(FILE, ">$file");
        flock(FILE, 2);
        print FILE "$intopic|$topictitle|$topicdescription|open|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate|$sticky";
        close(FILE);
 

 
В sub deletepost  
 
Код:
 

Код:
 
       foreach $newline (@alltopics) { #start foreach @threads
        chomp($newline);
            ($tempno, $trash) = split(/\|/,$newline);
            if ($intopic eq $tempno) {
            $processed_data .= "$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$postermembername2|$postdate2\n";
            }
         

 
Меняем на:
 

Код:
 
       foreach $newline (@alltopics) { #start foreach @threads
        chomp($newline);
            ($tempno, $trash) = split(/\|/,$newline);
            if ($intopic eq $tempno) {
            $processed_data .= "$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$postermembername2|$postdate2|$sticky\n";
            }
 
   
 
 
И далее в конец файл posting.cgi добавляем две подпрограммы - поднятия темы (sub sticktopic)и опускания темы (sub unsticktopic):
 

Код:
 
sub sticktopic {
 
 &getmember("$inmembername");
 &moderator;
 $cleartoedit = "no";
  &mischeader("Поднятие темы");
    if (($membercode eq "ad") && ($inpassword eq $password)) { $cleartoedit = "yes"; }
    if (($inmembmod eq "yes") && ($inpassword eq $password)) { $cleartoedit = "yes"; }
    unless ($cleartoedit eq "yes") { $cleartoedit = "no"; }
        if ($cleartoedit eq "no" && $checked eq "yes") { &error("$ibtxt{'1553'}&$ibtxt{'0504'}"); }  
if (($cleartoedit eq "yes") && ($checked eq "yes")) {  
  my $file = "$ikondir" . "forum$inforum/$intopic.pl";
        open (ENT, $file);
        flock (ENT,2);
        $in = <ENT>;
        flock (ENT,8);
        close (ENT);
        ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate, $sticky) = split(/\|/,$in);
        open(FILE, ">$file");
        flock(FILE, 2);
        print FILE "$intopic|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate|yes";
        flock(FILE, 8);
        close(FILE);
        rebuildLIST(-Forum=>"$inforum");
 
            $output .= qq~
            <table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
            <tr>
            <td>
            <table cellpadding=6 cellspacing=1 border=0 width=100%>
            <tr>
            <td bgcolor=$miscbacktwo valign=middle align=center><font face="$font" color=$fontcolormisc size=2><b>Поднятие темы</b></font></td></tr>
            <tr>
            <td bgcolor=$miscbackone valign=middle><font face="$font" color=$fontcolormisc size=1>
            <ul>
            <li><a href="$forumsprog?forum=$inforum">Вернуться в форум</a>
            <li><a href="$forumsummaryprog">Вернуться к списку форумов</a>
            </ul>
            </tr>
            </td>
            </table></td></tr></table>
            ~;
 
            } # end if clear to edit  
else {  
$inmembername =~ s/\_/ /g;  
$output .= qq~  
<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>  
<tr><td>  
<table cellpadding=6 cellspacing=1 border=0 width=100%>  
<form action="$thisprog" method="post">  
<input type=hidden name="action" value="stick">  
<input type=hidden name="checked" value="yes">  
<input type=hidden name="forum" value="$inforum">  
<input type=hidden name="topic" value="$intopic">  
<tr>  
<td bgcolor=$miscbacktwo valign=middle colspan=2 align=center><font face="$font" color=$fontcolormisc size=2><b>Введите данные, чтобы войти в режим модерации [ Поднятия темы ]</b></font></td></tr>  
<tr>  
<td bgcolor=$miscbackone valign=middle><font face="$font" color=$fontcolormisc size=1>$ibtxt{'0306'}</font></td>  
<td bgcolor=$miscbackone valign=middle><input type=text name="membername" value="$inmembername" size=20></td></tr>  
<tr>  
<td bgcolor=$miscbackone valign=middle><font face="$font" color=$fontcolormisc size=1>$ibtxt{'0307'}</font></td>  
<td bgcolor=$miscbackone valign=middle><input type=password name="password" value="$inpassword" size=20> </td></tr>  
<tr>  
<td bgcolor=$miscbacktwo valign=middle colspan=2 align=center><input type=submit name="submit" value="$ibtxt{'0104'}"></form></td></tr></table></td></tr></table>  
~;  
}  
 
} # end sticktopic
 
###########################
 
sub unsticktopic {
 
    &getmember("$inmembername");
    &moderator;
    $cleartoedit = "no";
    &mischeader("Освобождение темы");
    if (($membercode eq "ad") && ($inpassword eq $password)) { $cleartoedit = "yes"; }
    if (($inmembmod eq "yes") && ($inpassword eq $password)) { $cleartoedit = "yes"; }
    unless ($cleartoedit eq "yes") { $cleartoedit = "no"; }
        if ($cleartoedit eq "no" && $checked eq "yes") { &error("$ibtxt{'1554'}&$ibtxt{'0504'}"); }  
if (($cleartoedit eq "yes") && ($checked eq "yes")) {  
        my $file = "$ikondir" . "forum$inforum/$intopic.pl";
        open (ENT, $file);
        flock (ENT,2);
        $in = <ENT>;
        flock (ENT,8);
        close (ENT);
        ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate, $sticky) = split(/\|/,$in);
        open(FILE, ">$file");
        flock(FILE, 2);
        print FILE "$intopic|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate|no";
        flock(FILE, 8);
        close(FILE);
        rebuildLIST(-Forum=>"$inforum");
 
            $output .= qq~
            <table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
            <tr>
            <td>
            <table cellpadding=6 cellspacing=1 border=0 width=100%>
            <tr>
            <td bgcolor=$miscbacktwo valign=middle align=center><font face="$font" color=$fontcolormisc size=2><b>Освобождение темы</b></font></td></tr>
            <tr>
            <td bgcolor=$miscbackone valign=middle><font face="$font" color=$fontcolormisc size=1>
            <ul>
            <li><a href="$forumsprog?forum=$inforum">Вернуться в форум</a>
            <li><a href="$forumsummaryprog">Вернуться к списку форумов</a>
            </ul>
            </tr>
            </td>
            </table></td></tr></table>
            ~;
 
            } # end if clear to edit  
else {  
$inmembername =~ s/\_/ /g;  
$output .= qq~  
<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>  
<tr><td>  
<table cellpadding=6 cellspacing=1 border=0 width=100%>  
<form action="$thisprog" method="post">  
<input type=hidden name="action" value="unstick">  
<input type=hidden name="checked" value="yes">  
<input type=hidden name="forum" value="$inforum">  
<input type=hidden name="topic" value="$intopic">  
<tr>  
<td bgcolor=$miscbacktwo valign=middle colspan=2 align=center><font face="$font" color=$fontcolormisc size=2><b>Введите данные, чтобы войти в режим модерации [ Освобождение темы ]</b></font></td></tr>  
<tr>  
<td bgcolor=$miscbackone valign=middle><font face="$font" color=$fontcolormisc size=1>$ibtxt{'0306'}</font></td>  
<td bgcolor=$miscbackone valign=middle><input type=text name="membername" value="$inmembername" size=20></td></tr>  
<tr>  
<td bgcolor=$miscbackone valign=middle><font face="$font" color=$fontcolormisc size=1>$ibtxt{'0307'}</font></td>  
<td bgcolor=$miscbackone valign=middle><input type=password name="password" value="$inpassword" size=20> </td></tr>  
<tr>  
<td bgcolor=$miscbacktwo valign=middle colspan=2 align=center><input type=submit name="submit" value="$ibtxt{'0104'}"></form></td></tr></table></td></tr></table>  
~;  
}  
 
} # end unsticktopic
 
 
             
 
С файлом postings.cgi все.
 
2. Открываем файл forums.cgi
 
Код:
 

Код:
 
        foreach $topic (@topics[$startarray ... $endarray]) { # start topic foreach
                chomp $topic;
                ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$topic);
 

 
Меняем на:
 

Код:
 
       foreach $topic (@topics[$startarray ... $endarray]) { # start topic foreach
                chomp $topic;
 ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate, $sticky) = split(/\|/,$topic);
 

 
После:
 

Код:
 
                                if (($threadposts < $hottopicmark) && ($forumlastvisit > $lastpostdate) && ($inmembername ne "$ibtxt{'0043'}")) {
                                        $topicicon = "<img src=\"$imagesurl\/images\/$topicnonew\" border=\"0\">";}
 

 
Добавляем:
 

Код:
 
if (($sticky eq "yes")&& ($forumlastvisit < $lastpostdate)) {
 
$topicicon = "<img src=\"$imagesurl\/images\/stickyopen.gif\" border=\"0\">"; }
 if (($sticky eq "yes") && ($forumlastvisit > $lastpostdate)) {
 
$topicicon = "<img src=\"$imagesurl\/images\/stickynonew.gif\" border=\"0\">";
 
                        }
 

 
Код:
 

Код:
 
     if ($inmembername ne "$ibtxt{'0043'}") {
         
                $output .= qq~
                <tr>
                <td align=left><img src="$imagesurl/images/$topicnew" border="0"></td>
                <td align=left><font face="$font" color=$fontcolormisc size=$dfontsize1>$ibtxt{'0608'}</font></td>
                </tr>
                <tr>
                <td align=left valign=middle><img src="$imagesurl/images/$topichot" border="0">&nbsp;<img src="$imagesurl/images/$topichotnonew" border="0"></td>
                <td align=left><font face="$font" color=$fontcolormisc size=$dfontsize1>$ibtxt{'0609'} $hottopicmark $ibtxt{'0011'}</font></td>
                </tr>
                ~;
                }
                     if ($inmembername ne "$ibtxt{'0043'}") {
         
                $output .= qq~
                <tr>
                <td align=left><img src="$imagesurl/images/$topicnew" border="0"></td>
                <td align=left><font face="$font" color=$fontcolormisc size=$dfontsize1>$ibtxt{'0608'}</font></td>
                </tr>
                <tr>
                <td align=left valign=middle><img src="$imagesurl/images/$topichot" border="0">&nbsp;<img src="$imagesurl/images/$topichotnonew" border="0"></td>
                <td align=left><font face="$font" color=$fontcolormisc size=$dfontsize1>$ibtxt{'0609'} $hottopicmark $ibtxt{'0011'}</font></td>
                </tr>
                ~;
                }
 
                                                                     
 
Меняем на:
 

Код:
 
        if ($inmembername ne "$ibtxt{'0043'}") {
         
                $output .= qq~
                <tr>
                <td align=left><img src="$imagesurl/images/$topicnew" border="0"></td>
                <td align=left><font face="$font" color=$fontcolormisc size=$dfontsize1>$ibtxt{'0608'}</font></td>
                </tr>
                <tr>
                <td align=left valign=middle><img src="$imagesurl/images/$topichot" border="0">&nbsp;<img src="$imagesurl/images/$topichotnonew" border="0"></td>
                <td align=left><font face="$font" color=$fontcolormisc size=$dfontsize1>$ibtxt{'0609'} $hottopicmark $ibtxt{'0011'}</font></td>
                </tr>
               <tr>
                <td align=left valign=middle><img src="$imagesurl/images/stickyopen.gif" border="0">&nbsp;<img src="$imagesurl/images/stickynonew.gif" border="0"></td>
                <td align=left><font face="$font" color=$fontcolormisc size=$dfontsize1>поднятая тема есть новые сообщения / нет новых сообщений</font></td>
                </tr>

                ~;
                }
                 
                           
 
 
 
3. Вы должны нарисовать картинки:
stickyopen.gif - поднятая тема, есть новые собщения
stickynonew.gif - поднятая тема, нет новых сообщений.
А также, если вам необходимо (в данном примере не реализовано), то картинку  
stickylocked.gif  - поднятая и закрытая тема.
Подробнее смотрите в этом посте.
Картинки надо бросить в папку /ikonboard/images/
 
 
4. Теперь открываем файл ikon.lib
В sub rebuildLIST
 
Код:
 

Код:
 
    foreach (@entry) {
        ($id, $tr) = split(/\./,$_);
        my $file = "$ikondir" . "forum$IN{-Forum}/$id.pl";
        open (TMP, "$file");
          flock (TMP, 1);
        ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split (/\|/,<TMP>);
        close (TMP);
        $rr = "$lastpostdate|$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter";
        push (@dat, $rr);
        }
               my @sortdat = sort {$b <=> $a} @dat;  
       undef @dat;  
        $checkdat = @sortdat;
        foreach (@sortdat) {
            chomp $_;
            ($lastpostdate, $topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter) = split (/\|/,$_);
            $processed_data .= "$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate\n" if $topictitle;
 

 
Меняем на:
 

Код:
 
    foreach (@entry) {
        ($id, $tr) = split(/\./,$_);
        my $file = "$ikondir" . "forum$IN{-Forum}/$id.pl";
        open (TMP, "$file");
          flock (TMP, 1);
        ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate, $sticky) = split (/\|/,<TMP>);
        close (TMP);
        if ($sticky eq "yes") {
         $st = "$lastpostdate|$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$sticky";
          push (@stickposts, $st);
        }  
        else {
        $rr = "$lastpostdate|$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$sticky";
        push (@dat, $rr);
        }
        }
         
        ### New lines added for Sticky Topics - These next few lines were copied from SmilieMan's sticky topic hack.
       @stickydat = sort(@stickposts); undef @stickposts;
        @stickydat = reverse(@stickydat);

        my @sortdat = sort {$b <=> $a} @dat;
        undef @dat;
        $checkdat = @sortdat;
        foreach (@stickydat) {
            chomp $_;
            ($lastpostdate, $topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $sticky) = split (/\|/,$_);
            $processed_data .= "$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate|$sticky\n" if $lastpostdate;

        }
        foreach (@sortdat) {
            chomp $_;
            ($lastpostdate, $topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $sticky) = split (/\|/,$_);
    $processed_data .= "$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate|$sticky\n" if $topictitle;
 

 
 
5. Открываем файл post.cgi
 
В самом начале скрипта меняем:
 

Код:
 
for ('forum','topic','membername','password','action','postno','inshowsignature',
     'notify','inshowemoticons','previewfirst','intopictitle','intopicdescription',
     'inpost')
 

 
 
На:

Код:
 
for ('forum','topic','membername','password','action','postno','inshowsignature','notify','inshowemoticons','previewfirst','intopictitle','intopicdescription','inpost','instickytopic')  
 

 
Если установлен хак голосования, то меняем:
 

Код:
 
for ('forum','topic','membername','password','action','postno','inshowsignature','notify','inshowemoticons','previewfirst','intopictitle','intopicdescription','inpost','poll1',
'poll2','poll3','poll4','poll5','poll6','poll7','poll8','poll9','poll10','vote','topictitle','forumname')  
 

 
На:
 

Код:
 
for ('forum','topic','membername','password','action','postno','inshowsignature','notify','inshowemoticons','previewfirst','intopictitle','intopicdescription','inpost','instickytopic','poll1',
'poll2','poll3','poll4','poll5','poll6','poll7','poll8','poll9','poll10','vote','topictitle','forumname')  
 

 
После:
 

Код:
 
if ($inshowemoticons ne "yes") { $inshowemoticons eq "no"; }
if ($innotify ne "yes")        { $innotify eq "no"; }
 

 
Добавляем:
 

Код:
 
if ($instickytopic ne "yes") { $instickytopic eq "no"; }
 
                 
 
В sub newthread  
 
После:
 

Код:
 
    ### Lets sort out the flood control
 
    &getmember("$inmembername");
        if (($floodcontrol eq "on") && ($membercode ne "ad") && ($membercode ne "mo")) {
        $currenttime = time;
        ($lastpost, $posturl, $posttopic) = split(/\%\%\%/,$lastpostdate);
        $lastpost = ($lastpost + $floodcontrollimit);
            if ($lastpost > $currenttime)  {
                &error("$ibtxt{'1403'}&$ibtxt{'1404'} $floodcontrollimit $ibtxt{'1405'}");
                }
            }
 

 
Добавляем:
 

Код:
 
&moderator
&getmember("$inmembername");
if ($membercode eq "ad" || $inmembmod eq "yes")  
{
$stickopt = qq(<input type=checkbox name="instickytopic" value="yes">Поднять эту тему?<br>);
}
else
{
undef $stickopt
};
 

 
Код:
 

Код:
 
 <td bgcolor=$miscbacktwo valign=middle><font face="$font" color=$fontcolormisc size=$dfontsize1><input type=checkbox name="inshowsignature" value="yes" checked>$ibtxt{'1426'}<br>
                $requestnotify
                $emoticonsbutton
                 

                 
Заменить на:
 

Код:
 
 <td bgcolor=$miscbacktwo valign=middle><font face="$font" color=$fontcolormisc size=$dfontsize1><input type=checkbox name="inshowsignature" value="yes" checked>$ibtxt{'1426'}<br>
                $requestnotify
                $emoticonsbutton
                $stickopt
                 

 
 
В sub addnewthread
 
Код:
 

Код:
 
        $filetoopen = "$ikondir" . "forum$inforum/$newthreadnumber.pl";
        $filetoopen = &stripMETA($filetoopen);
        open(FILE, ">$filetoopen");
          flock (FILE, 2);
        print FILE "$newthreadnumber|$intopictitle|$intopicdescription|open|0|0|$inmembername|$currenttime|$inmembername|$currenttime";
        close(FILE);
 

 
Заменить на:                                        
 

Код:
 
        $filetoopen = "$ikondir" . "forum$inforum/$newthreadnumber.pl";
        $filetoopen = &stripMETA($filetoopen);
        open(FILE, ">$filetoopen");
          flock (FILE, 2);
        print FILE "$newthreadnumber|$intopictitle|$intopicdescription|open|0|0|$inmembername|$currenttime|$inmembername|$currenttime|$instickytopic";
        close(FILE);
 

 
В sub reply  
 
После:
 

Код:
 
$requestnotify
$emoticonsbutton
 

 
 Добавить:

Код:
 
$stickopt
 
 
 
 
В sub addreply  
 
Код:
 

Код:
 
        my $file = "$ikondir" . "forum$inforum/$intopic.pl";
        open (ENT, $file);
          flock ENT, 1;
        $in = <ENT>;
        close (ENT);
         
        ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$in);
 

 
Заменить на:
 

Код:
 
      my $file = "$ikondir" . "forum$inforum/$intopic.pl";
        open (ENT, $file);
        flock ENT, 1;
        $in = <ENT>;
        close (ENT);
 ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate,$lastposter,$lastpostdate,$sticky) = split(/\|/,$in);
 
               
 
В той же подпрограмме код:
 

Код:
 
        open(FILE, ">$file");
          flock(FILE, 2);
        print FILE "$intopic|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$inmembername|$currenttime";
        close(FILE);
 

 
Меняем на:
 

Код:
 
        open(FILE, ">$file");
          flock(FILE, 2);
        print FILE "$intopic|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$inmembername|$currenttime|$sticky";
        close(FILE);
 
               
 
 
6. Последний редактируемый файл - topic.cgi
 
Код:
 

Код:
 
        foreach $line (@allthreads) { #start foreach @threads
            ($tempno, $trash) = split(/\|/, $line);
            chomp $line;
            push (@numbercounter, $tempno);
            if ($intopic eq $tempno) {
                ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$line);
                $threadviews++; $keepcounter = $count;
                $linetokeep = "$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate";
                 

 
Меняем на:
 

Код:
 
        foreach $line (@allthreads) { #start foreach @threads
            ($tempno, $trash) = split(/\|/, $line);
            chomp $line;
            push (@numbercounter, $tempno);
            if ($intopic eq $tempno) {
                ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate, $sticky) = split(/\|/,$line);
                $threadviews++; $keepcounter = $count;
                $linetokeep = "$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate|$sticky";
                 
               
 
И после формы ответа в опциях модератирования:
 
Код:
 

Код:
 
&getmember($inmembername);
if ($membercode eq "ad" || $membercode eq "mo") {  
$output .= qq~
        <table cellspacing=3 cellpadding=0 width=$tablewidth align=center>
        <tr><td>
        <td valign=middle nowrap align=right><font face="$font" color=$menufontcolor size=$dfontsize1>
            $ibtxt{'3014'} <a href="$postingsprog?action=lock&forum=$inforum&topic=$intopic">$ibtxt{'3015'}</a> |  
            <a href="$postingsprog?action=edittopic&forum=$inforum&topic=$intopic">$ibtxt{'9999'}</a> |  
            <a href="$postingsprog?action=unlock&forum=$inforum&topic=$intopic">$ibtxt{'3016'}</a> |  
            <a href="$postingsprog?action=delete&forum=$inforum&topic=$intopic">$ibtxt{'3017'}</a> |  
            <a href="$postingsprog?action=movetopic&forum=$inforum&topic=$intopic">$ibtxt{'3018'}</a>
        </td>
    </tr>
    </table>
     

     
Меняем на:
 

Код:
 
&getmember($inmembername);
if ($membercode eq "ad" || $membercode eq "mo") {  
if ($sticky eq "yes") { $stickoption =qq~ <a href="$postingsprog?action=unstick&forum=$inforum&topic=$intopic">$ibtxt{'6035'}</a> ~;}
 
else { $stickoption =qq~ <a href="$postingsprog?action=stick&forum=$inforum&topic=$intopic">$ibtxt{'6036'}</a> ~;}
if ($membercode eq "ad" || $membercode eq "mo") {  
if ($threadstate eq "closed"){$block = qq~ <a href="$postingsprog?action=unlock&forum=$inforum&topic=$intopic">$ibtxt{'3016'}</a> |~;}
else {$block = qq~<a href="$postingsprog?action=lock&forum=$inforum&topic=$intopic">$ibtxt{'3015'}</a> |~;}
}
$output .= qq~
        <table cellspacing=3 cellpadding=0 width=$tablewidth align=center>
        <tr><td>
        <td valign=middle nowrap align=right><font face="$font" color=$menufontcolor size=$dfontsize1>
            $ibtxt{'3014'}  
            $block  
<a href="$postingsprog?action=edittopic&forum=$inforum&topic=$intopic">$ibtxt{'9999'}</a> |  
<a href="$postingsprog?action=delete&forum=$inforum&topic=$intopic">$ibtxt{'3017'}</a> |  
<a href="$postingsprog?action=movetopic&forum=$inforum&topic=$intopic">$ibtxt{'3018'}</a> |
$stickoption  
        </td>
    </tr>
    </table>
 
   
 
 
6. В файле IkonRussain.lib  
 
перед кодом:  
 

Код:
 
#########################  
# End of language file  #  
#########################  
 

 
Добавить:
 

Код:
 
$ibtxt{'6035'} = "Отпустить топик";  
$ibtxt{'6036'} = "Поднять топик";  
 


Всего записей: 101 | Зарегистр. 04-07-2001 | Отправлено: 09:16 24-09-2001 | Исправлено: Net_man, 16:51 30-04-2005
Открыть новую тему     Написать ответ в эту тему

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » IkonBoard и другие форумы » Ikonboard v.2 » Как сделать так, чтобы тема всегда была наверху?


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru