1, 2, 3 ... 15, 16, 17 Next
Page 1 of 28
Bu şekilde çıkacaktır ;
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 NEXT
Kod: Tümünü seç
#################################################################
## Mod İsmi : Full Pagination
## Mod Versiyonu: 1.0.1
## MOD YAPIMCISI: Meik Sievertsen < acyd.burn@gmx.de >
##
##MOD AÇIKLAMASI:
## 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
##
## KURULUM SEVİYESİ : BASİT
## KURULUM SÜRESİ : 5 DK
## EDİTLENECEK DOSYALAR: 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
#################################################################
#
#-----[ AÇ ]---------------------------------------------
#
/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 . "&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 . "&start=" . ( ( $on_page - 2 ) * $per_page ) ) . '">' . $lang['Previous'] . '</a> ' . $page_string;
}
if ( $on_page < $total_pages )
{
$page_string .= ' <a href="' . append_sid($base_url . "&start=" . ( $on_page * $per_page ) ) . '">' . $lang['Next'] . '</a>';
}
}
$page_string = $lang['Goto_page'] . ' ' . $page_string;
return $page_string;
}
#
#-----[ AÇ ]---------------------------------------------
#
/phpBB2/viewtopic.php
#
#-----[ BUL ]---------------------------------------------
#
$pagination = ( $highlight_active ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=" . $HTTP_GET_VARS['highlight'], $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&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&postdays=$post_days&postorder=$post_order&highlight=" . $HTTP_GET_VARS['highlight'], $total_replies, $board_config['posts_per_page'], $start) : generate_full_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);
#
#-----[ KAYDET VE KAPAT ]------------------------------------------
#
# EoM