alfabetik sıralama

phpBB 2.0.x kurulum ve çalıştırılmasında meydana gelen sorun ve problemler için buradan yardım alabilirsiniz.
Kilitli
ea85
Kayıtlı Kullanıcı
Mesajlar: 13
Kayıt: 30.04.2007, 02:06
İletişim:

alfabetik sıralama

Mesaj gönderen ea85 »

forumun içindeki bir kategorinin içindeki başlıkları alfabetik olarak sıralamak istiyorum.nasıl yapabilirim çok fazla başlık var ?
emre86
Kayıtlı Kullanıcı
Mesajlar: 95
Kayıt: 30.09.2006, 13:53
İletişim:

Re: alfabetik sıralama

Mesaj gönderen emre86 »

Kod: Tümünü seç

## MOD Version: 0.2.0
##
## Kurulum : Kolay
## Süre : 5 - 10 Dk
##
##  Değiştirelecek Dosyalar: 3
## viewforum.php
## langauge/lang_english/lang_main.php
## templates/subSilver/viewforum_body.tpl
##
## Eklenecek Dosya : Yok
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
#
#-----[ Aç ]------------------------------------------
#
viewforum.php


#
#-----[ Bul ]------------------------------------------
#
else
{
   $mark_read = '';
}


#
#-----[ Sonrasına Ekle ]------------------------------------------
#

// Start Sort Topics Alphabetically MOD
$letters_array = array('A', 'B', 'C', 'Ç', 'D', 'E', 'F', 'G', 'Ğ', 'H', 'I', 'İ', 'J', 'K', 'L', 'M', 'N', 'O', 'Ö', 'P', 'Q', 'R', 'S', 'Ş', 'T', 'U', 'Ü', 'V', 'W', 'X', 'Y', 'Z');
$start_letter = ( isset($HTTP_GET_VARS['start_letter']) ) ? htmlspecialchars($HTTP_GET_VARS['start_letter']) : '';
$start_letter = str_replace("\'", "''", $start_letter);

if ( !in_array($start_letter, $letters_array) )
{
   $start_letter = '';
}
// End Sort Topics Alphabetically MOD


#
#-----[ Bul ]------------------------------------------
#
   $topics_count = ( $forum_row['forum_topics'] ) ? $forum_row['forum_topics'] : 1;

   $limit_topics_time = '';
   $topic_days = 0;


#
#-----[ Öncesine ekle ]------------------------------------------
#

   // Start Sort Topics Alphabetically MOD
   if ( $start_letter )
   {
      $sql = 'SELECT COUNT(topic_id) AS forum_topics
         FROM ' . TOPICS_TABLE . "
         WHERE forum_id = $forum_id
            AND topic_title LIKE '$start_letter%'";
         
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not get topic counts for letter search', '', __LINE__, __FILE__, $sql);
      }
       
      $row = $db->sql_fetchrow($result);
       
      $topics_count = ( $row['forum_topics'] ) ? $row['forum_topics'] : 1;
       
      $db->sql_freeresult($result);
   }
   
   else
   {
   // End Sort Topics Alphabetically MOD


#
#-----[ Sonrasına Ekle ]------------------------------------------
#
# Note: add the following after the code in the Bul statement above.
#

   // Start Sort Topics Alphabetically MOD
   }
   // End Sort Topics Alphabetically MOD


#
#-----[ Bul ]------------------------------------------
#
# Note: this is part of a large SQL query but this part is on its own line.
#
      AND t.topic_type <> " . POST_ANNOUNCE . "


#
#-----[ Sonrasına Ekle ]------------------------------------------
#
      AND t.topic_title LIKE '$start_letter%'


#
#-----[ Bul ]------------------------------------------
#
# Note: the full line to Bul on a fresh phpBB installation is: 'S_POST_DAYS_ACTION' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_id . "&start=$start"))
#
   'S_POST_DAYS_ACTION' =>


#
#-----[ Satırın İçinde Bul ]------------------------------------------
#
start=$start


#
#-----[ Satırın İçinde Sonrasına Ekle ]------------------------------------------
#
&start_letter=$start_letter


#
#-----[ Bul ]------------------------------------------
#
# Note: the full line to Bul on a fresh phpBB installation is: 'PAGINATION' => generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start),
#
      'PAGINATION' =>


#
#-----[ Satırın İçinde Bul ]------------------------------------------
#
$topic_days


#
#-----[ Satırın İçinde Sonrasına Ekle ]------------------------------------------
#
&start_letter=$start_letter


#
#-----[ Bul ]------------------------------------------
#
$template->pparse('body');


#
#-----[ Öncesine ekle ]------------------------------------------
#

// Start Sort Topics Alphabetically MOD

// Begin Configuration Section
// Change this to whatever you want the divider to be. Be sure to keep both apostrophies.
$divider = ', ';
// End Configuration Section

// Do not change anything below this line.
$total_letters_count = count($letters_array);
$this_letter_number = 0;

$template->assign_vars(array(
   'L_SORT_ALPHABETICALLY' => $lang['Sort_alphabetically'],
   'L_ALL_TOPICS' => $lang['All_Topics'],
   'DIVIDER' => $divider,
   'U_ALL_TOPICS' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&start_letter=&topicdays=$topic_days"),
));

foreach ( $letters_array as $letter )
{
   $this_letter_number++;
   
   $template->assign_block_vars("alphabetical_sort", array(
      'LETTER' => $letter,
      'U_LETTER' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&start_letter=$letter&topicdays=$topic_days"),
      'DIVIDER' => ( $this_letter_number != $total_letters_count ) ? $divider : '',
   ));
}
//End Sort Topics Alphabetically MOD


#
#-----[ Aç ]------------------------------------------
#
language/lang_english/lang_main.php


#
#-----[ Bul ]------------------------------------------
#
# Note: the full line to Bul on a fresh phpBB installation is: $lang['Display_topics'] = 'Display topics from previous';
#
$lang['Display_topics']


#
#-----[ Sonrasına Ekle ]------------------------------------------
#

// Start Sort Topics Alphabetically MOD
$lang['Sort_alphabetically'] = 'Alfabetik Sıralama';
// End Sort Topics Alphabetically MOD


#
#-----[ Aç ]------------------------------------------
#
templates/subSilver/viewforum_body.tpl


#
#-----[ Bul ]------------------------------------------
#
     <th align="center" class="thCornerR" nowrap="nowrap">&nbsp;{L_LASTPOST}&nbsp;</th>
   </tr>


#
#-----[ Sonrasına Ekle ]------------------------------------------
#

   <tr>
      <td class="catBottom" align="center" valign="middle" colspan="6" height="28">
      <span class="genmed">{L_SORT_ALPHABETICALLY}: <a href="{U_ALL_TOPICS}" style="font-weight: bold;">{L_ALL_TOPICS}</a>{DIVIDER}
         <!-- BEGIN alphabetical_sort -->
         <a href="{alphabetical_sort.U_LETTER}" style="font-weight: bold;">{alphabetical_sort.LETTER}</a>{alphabetical_sort.DIVIDER}
         <!-- END alphabetical_sort -->
      </span>
      </td>
   </tr>


#
#-----[ Bul ]------------------------------------------
#
      <input type="submit" class="liteoption" value="{L_GO}" name="submit" />
      </span></td>
   </tr>


#
#-----[ Sonrasına Ekle ]------------------------------------------
#
   <tr>
      <td class="catBottom" align="center" valign="middle" colspan="6" height="28">
      <span class="genmed">{L_SORT_ALPHABETICALLY}: <a href="{U_ALL_TOPICS}" style="font-weight: bold;">{L_ALL_TOPICS}</a>{DIVIDER}
         <!-- BEGIN alphabetical_sort -->
         <a href="{alphabetical_sort.U_LETTER}" style="font-weight: bold;">{alphabetical_sort.LETTER}</a>{alphabetical_sort.DIVIDER}
         <!-- END alphabetical_sort -->
      </span>
      </td>
   </tr>


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM 
:wink:
İnadına 2x
ea85
Kayıtlı Kullanıcı
Mesajlar: 13
Kayıt: 30.04.2007, 02:06
İletişim:

Re: alfabetik sıralama

Mesaj gönderen ea85 »

çok sağol hocam.ama bu benim istediğim şey mi acaba?ben tüm forumlardaki kategorileri değil sadece tek bi kategoriyi alfabetik sıralayacağım.atıyorum bu forumdaki 2.0.x destek bölümünü alfabetik sıralıycam diğerleri karışık kalacak.??
Kilitli

“2.0.x Destek Forumu” sayfasına dön

Kimler çevrimiçi

Bu forumu görüntüleyen kullanıcılar: Bing [Bot] ve 1 misafir