| Zobrazit předchozí téma :: Zobrazit následující téma |
| Autor |
Zpráva |
Tomiiikk
Založen: 2.7.2007 Příspěvky: 2
|
Zaslal: 01 listopad 2007 20:52 Předmět: Řazení v abeceda modu |
|
|
Abeceda
Prosím vás nevíte někdo náhodou jak to udělat, aby výsledky hledání v abecedě nebyly řazeny podle datumu a času přidání, ale podle hlevičky tématu?
| kód: |
#
#-----[ OPEN ]------------------------------------------
#
viewforum.php
#
#-----[ FIND ]------------------------------------------
#
else
{
$mark_read = '';
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start Sort Topics Alphabetically MOD
$letters_array = array('0','1','2','3','4','5','6','7','8','9','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
#
#-----[ FIND ]------------------------------------------
#
$topics_count = ( $forum_row['forum_topics'] ) ? $forum_row['forum_topics'] : 1;
$limit_topics_time = '';
$topic_days = 0;
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// 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
#
#-----[ AFTER, ADD ]------------------------------------------
#
# Note: add the following after the code in the FIND statement above.
#
// Start Sort Topics Alphabetically MOD
}
// End Sort Topics Alphabetically MOD
#
#-----[ FIND ]------------------------------------------
#
# Note: this is part of a large SQL query but this part is on its own line.
#
AND t.topic_type <> " . POST_ANNOUNCE . "
#
#-----[ AFTER, ADD ]------------------------------------------
#
AND t.topic_title LIKE '$start_letter%'
#
#-----[ FIND ]------------------------------------------
#
# Note: the full line to find 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' =>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
start=$start
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
&start_letter=$start_letter
#
#-----[ FIND ]------------------------------------------
#
# Note: the full line to find 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' =>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$topic_days
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
&start_letter=$start_letter
#
#-----[ FIND ]------------------------------------------
#
$template->pparse('body');
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// 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
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
# Note: the full line to find on a fresh phpBB installation is: $lang['Display_topics'] = 'Display topics from previous';
#
$lang['Display_topics']
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start Sort Topics Alphabetically MOD
$lang['Sort_alphabetically'] = 'Sort topics alphabetically';
// End Sort Topics Alphabetically MOD
#
#-----[ FIND ]------------------------------------------
#
# Note: the full line to find on a fresh phpBB installation is: $lang['No_topics_post_one'] = 'There are no posts in this forum.<br />Click on the <b>Post New Topic</b> link on this page to post one.';
#
$lang['No_topics_post_one']
#
#-----[ REPLACE WITH ]------------------------------------------
#
// Variable changed by the Sort Topics Alphabetically MOD
$lang['No_topics_post_one'] = 'Either there are no posts in this forum, or there are no matches for the letter you selected.<br />Click on the <b>Post New Topic</b> link on this page to start a new post or select another letter.';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<th align="center" class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<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>
#
#-----[ FIND ]------------------------------------------
#
<input type="submit" class="liteoption" value="{L_GO}" name="submit" />
</span></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<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>
|
|
|
| Návrat nahoru |
|
 |
Webhosting C4 - 2 GB, PHP, MySQL, administrační systém, 1.200 Kč na rok s doménou v ceně. Srubové domy, dřevostavby a víkendové sruby.
Bezproblémová instalace phpBB, Joomla, Drupal. Návody pro C4 - užitečné rady pro zákazníky. Nafukovací balonky s potiskem.
Výhodné sázkové kanceláře. značkové oblečení z USA, luxusní kabelky a také peněženky nabízí eshop usaboutique.cz.
Apartment in Prague - accommodation in Prag, prague apartments, luxusní anglické dýmky a kvalitní doutníky, značkové spodní prádlo a podprsenky
|  |
AVAST Častý přispěvatel

Založen: 24.9.2006 Příspěvky: 127
|
|
| Návrat nahoru |
|
 |
|
|
|
|
Nemůžete odesílat nové téma do tohoto fóra. Nemůžete odpovídat na témata v tomto fóru. Nemůžete upravovat své příspěvky v tomto fóru. Nemůžete mazat své příspěvky v tomto fóru. Nemůžete hlasovat v tomto fóru. Nemůžete připojovat soubory k příspěvkům Nemůžete stahovat ani prohlížet přiložené soubory
|
Powered by phpBB & phpBB SEO © 2001, 2005 phpBB Group Český překlad phpBB Czech - www.phpbbcz.com Optimalizoval JanoF - PCforum.sk
|