Admin Addon: now configurable

Small mod, that makes locked topics go to the end of the forum view

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Admin Addon: now configurable

Postby MJ on Thu 16. Oct, 2003 01:26

Code: Select all
$sql[] = 'INSERT INTO '. $table_prefix .'config (config_name, config_value) VALUES ("locked_last", "0")';

-----[ OPEN ]-----
viewforum.php

-----[ FIND ]-----
   ORDER BY t.topic_type DESC, t.topic_status ASC, t.topic_last_post_id DESC
   LIMIT $start, ".$board_config['topics_per_page'];

-----[ REPLACE WITH ]-----
";
if ($board_config['locked_last']==0) {
   $sql .= "ORDER BY t.topic_type DESC, t.topic_last_post_id DESC ";
}
elseif ($board_config['locked_last']==1) {
   $sql .= "ORDER BY t.topic_type DESC, t.topic_status ASC, t.topic_last_post_id DESC ";
}
$sql .= "LIMIT $start, ".$board_config['topics_per_page'];

-----[ OPEN ]-----
admin/admin_board.php

-----[ FIND ]-----
$prune_yes = ( $new['prune_enable'] ) ? "checked=\"checked\"" : "";
$prune_no = ( !$new['prune_enable'] ) ? "checked=\"checked\"" : "";

-----[ ADD, AFTER ]-----
$locked_last_yes = ( $new['locked_last'] ) ? "checked=\"checked\"" : "";
$locked_last_no = ( !$new['locked_last'] ) ? "checked=\"checked\"" : "";


-----[ FIND ]-----
   "L_ENABLE_PRUNE" => $lang['Enable_prune'],

-----[ ADD, AFTER ]-----
   "L_LOCKED_LAST" => $lang['Locked_last'],

-----[ FIND ]-----
   "PRUNE_YES" => $prune_yes,
   "PRUNE_NO" => $prune_no,

-----[ ADD, AFTER ]-----
   "LOCKED_LAST_YES" => $locked_last_yes,
   "LOCKED_LAST_NO" => $locked_last_no,

-----[ OPEN ]-----
templates/*/admin/board_config_body.tpl

-----[ FIND ]-----
   <tr>
      <td class="row1">{L_ENABLE_PRUNE}</td>
      <td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="prune_enable" value="0" {PRUNE_NO} /> {L_NO}</td>
   </tr>

-----[ ADD, AFTER ]-----
   <tr>
      <td class="row1">{L_LOCKED_LAST}</td>
      <td class="row2"><input type="radio" name="locked_last" value="1" {LOCKED_LAST_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="locked_last" value="0" {LOCKED_LAST_NO} /> {L_NO}</td>
   </tr>

-----[ OPEN ]-----
lang_admin.php

-----[ FIND ]-----
$lang['Enable_prune'] = 'Enable Forum Pruning';

-----[ ADD, AFTER ]-----
$lang['Locked_last'] = 'Locked posts move to end of topics list';

-----[ OPEN ]-----
search.php

-----[ FIND ]-----
      // makes locked go to button in search
      $sql .= ' t.topic_status ASC, t.topic_type DESC,';

-----[ REPLACE WITH ]-----
      if ($board_config['locked_last'] == 1) {
      // makes locked go to button in search
      $sql .= ' t.topic_status ASC, t.topic_type DESC,';
      }


-----[ OPEN ]-----
modcp.php

-----[ FIND ]------
ORDER BY t.topic_type DESC, t.topic_status ASC, p.post_time DESC
LIMIT $start, " . $board_config['topics_per_page'];

-----[ REPLACE WITH ]-----
";
      if ($board_config['locked_last']==1) {
         $sql .= "ORDER BY t.topic_type DESC, t.topic_status ASC, p.post_time DESC ";
      }
      elseif ($board_config['locked_last']==0) {
         $sql .= "ORDER BY t.topic_type DESC, p.post_time DESC ";
      }
      $sql .= "LIMIT $start, " . $board_config['topics_per_page'];
MJ
Poster
Poster
 
Posts: 90
Joined: Fri 19. Apr, 2002 13:46

Return to Locked at the end [2.0.6/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron