[ Príspevkov: 3 ] 
AutorSpráva
Offline

Užívateľ
Užívateľ
Obrázok užívateľa

Registrovaný: 21.06.06
Prihlásený: 09.09.08
Príspevky: 345
Témy: 26 | 26

Kód:
##############################################################
## MOD Title: Sort Topics by number
## MOD Author: Leachim < Leachimster@gmail.com >
## MOD Description: Tento od povolí zoraďovanie tém podľa začiatočného čísla
## Based on Sort Topics Alphabetically MOD
## MOD Version: 1.0
##
## Installation Level: Easy
## Installation Time: 10 Minutes
##
## Files To Edit: 3
## viewforum.php
## langauge/lang_english/lang_main.php
## templates/subSilver/viewforum_body.tpl
##
## Included Files: 0
##


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


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


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Zoradit temy podla pismena
$numbers_array = array('1', '2', '3', '4', '5', '6', '7', '8', '9');
$start_number = ( isset($HTTP_GET_VARS['start_number']) ) ? htmlspecialchars($HTTP_GET_VARS['start_number']) : '';
$start_number = str_replace("\'", "''", $start_number);

if ( !in_array($start_number, $numbers_array) )
{
   $start_number = '';
}
// Zoradit temy podla pismena


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

   $limit_topics_time = '';
   $topic_days = 0;


#
#-----[ BEFORE, ADD ]------------------------------------------
#

   // Zaciatok zoradit temy podla pismena
   if ( $start_number )
   {
     $sql = 'SELECT COUNT(topic_id) AS forum_topics
         FROM ' . TOPICS_TABLE . "
         WHERE forum_id = $forum_id
            AND topic_title LIKE '$start_number%'";
         
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not get topic counts for number search', '', __LINE__, __FILE__, $sql);
      }
      
      $row = $db->sql_fetchrow($result);
      
      $topics_count = ( $row['forum_topics'] ) ? $row['forum_topics'] : 1;
      
      $db->sql_freeresult($result);
   }
   
   else
   {
   // Koniec zoradit temy podla pismena


#
#-----[ AFTER, ADD ]------------------------------------------
#
#

   // Zaciatok zoradit temy podla pismena
   }
   // Koniec zoradit temy podla pismena


#
#-----[ FIND ]------------------------------------------
#
# Poznamka: Cely riadok so SQL dopytom je dlhsi, toto je iba jeho cast
#
      AND t.topic_type <> " . POST_ANNOUNCE . "


#
#-----[ AFTER, ADD ]------------------------------------------
#
      AND t.topic_title LIKE '$start_number%'


#
#-----[ FIND ]------------------------------------------
#
#
   'S_POST_DAYS_ACTION' =>


#
#-----[ IN-LINE FIND ]------------------------------------------
#
start=$start


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
&amp;start_number=$start_number


#
#-----[ FIND ]------------------------------------------
#
#
      'PAGINATION' =>


#
#-----[ IN-LINE FIND ]------------------------------------------
#
$topic_days


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
&amp;start_number=$start_number


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


#
#-----[ BEFORE, ADD ]------------------------------------------
#

// Zaciatok zoradit temy podla pismena

$divider = ', ';

$total_numbers_count = count($numbers_array);
$this_number_number = 0;

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

foreach ( $numbers_array as $number )
{
   $this_number_number++;
   
   $template->assign_block_vars("by_number_sort", array(
      'NUMBER' => $number,
      'U_NUMBER' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&amp;start_number=$number&amp;topicdays=$topic_days"),
      'DIVIDER' => ( $this_number_number != $total_numbers_count ) ? $divider : '',
   ));
}
// Koniec zoradit temy podla pismena


#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php


#
#-----[ FIND ]------------------------------------------
#
# Poznamka: V anglickom jazyku vyzera riadok takto: $lang['Display_topics'] = 'Display topics from previous';
#
$lang['Display_topics']


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Zaciatok zoradit temy podla pismena
$lang['Sort_by_numbers'] = 'Zoradiť témy podľa písmena';
// Koniec zoradit temy podla pismena

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewforum_body.tpl


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


#
#-----[ AFTER, ADD ]------------------------------------------
#

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

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


Offline

Užívateľ
Užívateľ
Zoradiť témy podľa čísla a aj písmen

Registrovaný: 07.12.05
Prihlásený: 30.06.10
Príspevky: 135
Témy: 12 | 12
Bydlisko: Martin

fakt nic v zlom ale tento mod je len upraveny Sort Topics Alphabetically
popripade tu je cely mod ktory rozdeluje aj podla cisel aj pismen
Kód:
##############################################################
## MOD Title: Sort Topics Alphabetically
## MOD Author: pentapenguin < pentapenguin@bluebottle.com > (Jeremy Conley) http://www.pentapenguin.com
## MOD Description: This MOD allows you to sort topics alphabetically within a forum.
## MOD Version: 0.2.0
##
## Installation Level: Easy
## Installation Time: 10 Minutes
##
## Files To Edit: 3
## viewforum.php
## langauge/lang_english/lang_main.php
## templates/subSilver/viewforum_body.tpl
##
## Included Files: n/a
##
## 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/
##############################################################
## Author Notes:
## Optional step: if you have CyberAlien's eXtreme Styles MOD (http://www.phpbb.com/phpBB/viewtopic.php?t=125251),
## you can copy the file in contrib/admin/xs_sort_topics_alphabetically.cfg to admin/xs_sort_topics_alphabetically.cfg and you will
## be automatically notified if there's an update available when you use the "check for updates" function.
##
## This MOD is EasyMOD friendly! (http://area51.phpbb.com/phpBB/viewforum.php?sid=&f=17)
##
## For additional language and style downloads, please visit http://www.pentapenguin.com/forum/viewtopic.php?t=206
##
## To update to 0.2.0, see update_sort_topics_alphabetically_from_0.1.0_to_0.2.0.txt
##############################################################
## MOD History:
##   2005-11-15 - Version 0.2.0
##      - Fixed many bugs.
##      - Enabled better customization for more letters or letters in other non Latin based alphabets.
##
##   2004-11-10 - Version 0.1.0
##      - First Public Beta
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################


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


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


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Sort Topics Alphabetically MOD
$letters_array = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '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 . "&amp;start=$start"))
#
   'S_POST_DAYS_ACTION' =>


#
#-----[ IN-LINE FIND ]------------------------------------------
#
start=$start


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
&amp;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&amp;topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start),
#
      'PAGINATION' =>


#
#-----[ IN-LINE FIND ]------------------------------------------
#
$topic_days


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
&amp;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&amp;start_letter=&amp;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&amp;start_letter=$letter&amp;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">&nbsp;{L_LASTPOST}&nbsp;</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>


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


Offline

Užívateľ
Užívateľ
Obrázok užívateľa

Registrovaný: 21.06.06
Prihlásený: 09.09.08
Príspevky: 345
Témy: 26 | 26
Napísal autor témyOffline : 16.01.2007 19:46 | Zoradiť témy podľa čísla a aj písmen

fakt nič v zlom, ale nauč sa čítať, je to napísané v hlavičke toho módu :roll:
A nie kaž´dy môže chcieť aj podľa písmen a čísel.. Alebo to chce mať každé inde, tak ako ja ;)


 [ Príspevkov: 3 ] 


Zoradiť témy podľa čísla a aj písmen



Podobné témy

 Témy  Odpovede  Zobrazenia  Posledný príspevok 
V tomto fóre nie sú ďalšie neprečítané témy.

Sony Vaio cisla namiesto pismen (NumLock vypnuty)

v Notebooky a netbooky

6

114

27.07.2017 14:41

Gr4s5

V tomto fóre nie sú ďalšie neprečítané témy.

Strankovanie podla prvych pismen

v PHP, ASP

15

836

10.07.2008 20:15

pa3ck

Táto téma je zamknutá, nemôžete posielať nové príspevky alebo odpovedať na staršie.

Ako zisti meno podla cisla

v Krčma

6

2329

26.12.2009 16:10

ac.milan

V tomto fóre nie sú ďalšie neprečítané témy.

Na ukončenie témy nežiadajte LOCK témy, ale ...

v Vymením a darujem

0

171

01.07.2016 9:58

JanoF

V tomto fóre nie sú ďalšie neprečítané témy.

WIN7-usporiadanie podla typu a zaroven podla datumu

v Operačné systémy Microsoft

1

341

10.10.2011 17:16

Logik

V tomto fóre nie sú ďalšie neprečítané témy.

Zistenie majiteľa tel. čísla (potrebujem zistiť majitela tel. čísla)

v Ostatné

4

2556

02.11.2011 13:52

HGDS1

V tomto fóre nie sú ďalšie neprečítané témy.

vynechávanie písmen

v Ostatné programy

0

143

04.09.2012 21:36

frezi

V tomto fóre nie sú ďalšie neprečítané témy.

Obrazky namesto pismen

v Operačné systémy Microsoft

1

1209

19.12.2006 18:11

shiro

V tomto fóre nie sú ďalšie neprečítané témy.

Zmena písmen disku

v Pevné disky a radiče

11

1825

27.12.2011 20:06

jano101

V tomto fóre nie sú ďalšie neprečítané témy.

W7 blbnutie pismen...

v Operačné systémy Microsoft

8

432

31.05.2011 22:00

kefan77

V tomto fóre nie sú ďalšie neprečítané témy.

Doplňovač chýbajúcich písmen

v Ostatné programy

0

73

04.02.2013 22:22

BlackBoy

V tomto fóre nie sú ďalšie neprečítané témy.

php ->mysql ->php Help.zoradit

v PHP, ASP

4

322

20.06.2009 12:44

KViki

V tomto fóre nie sú ďalšie neprečítané témy.

Nahradenie medzery a zmensenie pismen

v PHP, ASP

18

952

15.03.2008 18:16

chrono

V tomto fóre nie sú ďalšie neprečítané témy.

piše mi čislice namiesto pismen

v Notebooky a netbooky

2

608

17.01.2010 12:12

RRRaaadddooo

V tomto fóre nie sú ďalšie neprečítané témy.

divne zobrazenie pismen na monitore

v Monitory, televízory a projektory

3

518

02.11.2009 21:01

Jaro

V tomto fóre nie sú ďalšie neprečítané témy.

Funkcia na jednoduchú zámenu písmen

v PHP, ASP

2

266

28.10.2008 18:01

Flety



© 2005 - 2017 PCforum, edited by JanoF