Mesaj listesi FULL açılır kututa

Eklentiler ile ilgili gelişmeler. Yeni modlar, güncellemeler.

Mesaj listesi FULL açılır kututa

İleti mojo_jojo 13.01.2006, 18:25

Msj ların çok olduğu topiclerde arada kalan sayfalara ulaşmak bazen çok güç oluyor kullanıcılar için.1,2,3,5,6....345,346,347, gibi

bu sorunu çözecek mod bu.
Eğer ben bunu selected yerine textforumunu kullanarak yapabilirim diyen varsa! çokdaha güzel olur kanısındayım...

Kod: Tümünü seç
#################################################################
## Mod Title:   Goto specific page
## Mod Version: 1.0.0
## Author:      mkiefer <mkiefer@earthlink.net>
## Description: Adds a drop-down list to the pagination whenever more than 5 pages are available. This allows users to jump to page #s which may not otherwise be displayed (because "..." may be used instead.
##
## Installation Level:  Easy
## Installation Time:   1-2 Minutes
## Files To Edit:       includes/functions.php## Included Files:      N/A
#################################################################
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################

#
#-----[ EDİTLENECEK DOSYA ]------------------------------------------
#
includes/functions.php

#
#-----[ BUL ]------------------------------------------
$page_string = $lang['Goto_page'] . ' ' . $page_string;
#
#-----[ DEĞİŞTİR ]----------------------------------------------
#
   /// --- BEGIN MOD: Goto specific page
   if ( $total_pages > 5 )
   {   
      $select_page = ' <select name="generate_pagination" onChange="if(this.options[this.selectedIndex].value != -1){ window.location = this.options[this.selectedIndex].value; }">';
      for($i = 1; $i <= $total_pages; $i++)
      {
         $selected = ( $i == $on_page ) ? ' selected="selected"' : ''; // highlight current page by default
         $select_page .= '<option value="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) )  . '"' . $selected . '>' . $i . '</option>';
      }
      $select_page .= '</select>:';
   }
   else
      $select_page = '';
   /// --- END MOD: Goto specific page
   
   $page_string = $lang['Goto_page'] . $select_page . ' ' . $page_string;
#
#-----[ KAYDET ]------------------------------------------
#
#


Sonuç

Resim

Direk tüm sayfa linklerini vermek isteyen olursa.

Msj sayfası listesi 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,14,15,16,17,18,19,20 diyee gider.

Kod: Tümünü seç
#################################################################
## Mod Title:   Full Pagination
## Mod Version: 1.0.1
## Author:      Meik Sievertsen < acyd.burn@gmx.de >
##
## Description:
##      This Mod will generate Page Numbers in Viewtopic in this format:
##      Goto Page 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 and so on.
##
## Revision History:
##
##   2002-05-20 - made the mod phpBB 2.0.0 compatible
##      2002-03-23 - initial version 1.0.0
##
## Installation Level:  easy
## Installation Time:   5 Minutes
## Files To Edit:       functions.php, viewtopic.php
## Included Files:      0
##
#################################################################
## 
#################################################################
##
## Author Note:
##   I have tested this with a thread of 114 pages. After i have seen
##   the result, i have changed the function, so that the page numbers
##   will be generated in 20th blocks...
##   You can change this by altering the value of $break_page. a value
##   of 0 means 'no blocking'.
##
##   This Mod only gives an example for the viewtopic page. You can
##   enable the full pagination for every page where it occurs. Just
##   replace the occurrence of 'generate_pagination' with 'generate_full_pagination'.
##   For example, in memberlist.php, viewforum.php and so on.
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################

#
#-----[ EDİTLENECEK DOSYA]---------------------------------------------
#
/phpBB2/includes/functions.php

#
#-----[ BUL ]---------------------------------------------
#
//
// Pagination routine, generates
// page number sequence

#
#-----[ ÖNCESİNE EKLE ]---------------------------------------
#
//
// Full Pagination routine, generates
// page number sequence
//
function generate_full_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE)
{
   global $lang;

   //
   // You can change this value, see the Author Notes for details
   //
   $break_page = 20;

   $total_pages = ceil($num_items/$per_page);

   if ( $total_pages == 1 )
   {
      return '';
   }

   $on_page = floor($start_item / $per_page) + 1;
   $page_string = '';

   for ($i = 1; $i < $total_pages + 1; $i++)
   {
      if ($break_page > 0)
      {
         if ((($i-1) % $break_page) == 0)
         {
            $page_string .= '<br />';
         }
      }
      $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>';
      if ( $i <  $total_pages )
      {
         $page_string .= ', ';
      }
   }

   if ( $add_prevnext_text )
   {
      if ( $on_page > 1 )
      {
         $page_string = ' <a href="' . append_sid($base_url . "&amp;start=" . ( ( $on_page - 2 ) * $per_page ) ) . '">' . $lang['Previous'] . '</a>&nbsp;&nbsp;' . $page_string;
      }

      if ( $on_page < $total_pages )
      {
         $page_string .= '&nbsp;&nbsp;<a href="' . append_sid($base_url . "&amp;start=" . ( $on_page * $per_page ) ) . '">' . $lang['Next'] . '</a>';
      }
   }

   $page_string = $lang['Goto_page'] . ' ' . $page_string;

   return $page_string;
}

#
#-----[ EDİTLENECEK DOSYA ]---------------------------------------------
#
/phpBB2/viewtopic.php

#
#-----[ BUL ]---------------------------------------------
#
$pagination = ( $highlight_active ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order&amp;highlight=" . $HTTP_GET_VARS['highlight'], $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);

#
#-----[ DEĞİŞTİR ]---------------------------------------------------------------
#
$pagination = ( $highlight_active ) ? generate_full_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order&amp;highlight=" . $HTTP_GET_VARS['highlight'], $total_replies, $board_config['posts_per_page'], $start) : generate_full_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);

#
#-----[ HEPSİNİ KAYDET VE KAPA ]------------------------------------------
#

As you can see, the changes in viewtopic.php are only the replacement of generate_pagination to generate_full_pagination.
If you want the Full Pagination on ALL pages, it is easier to overwrite the function generate_pagination. ;)

# EoM
Kullanıcı avatarı
mojo_jojo
Üye
Üye
 
İleti: 30
Kayıt: 08.12.2005, 02:28
Konum: Adana

İleti RemoteMach 13.01.2006, 20:31

Cok Guzel bir ozellik. Bizler ile paylasitigin icin ellerin dert gormesin kardes..
RemoteMach
Üye
Üye
 
İleti: 8
Kayıt: 12.01.2006, 01:56


Duyurular & Güncellemeler



Kimler çevrimiçi

Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 0 misafir

cron