← phpBB

ezportal news

Lida 2925 vezes

kidmetralha 
Visitante

keria perguntar ao Admin. do Aposta Ganha ou alguem k saiba komo meto no ezportal akilo nas noticias de varias paginas ou seja por exemplo a pagina 1 leva 5noticias no fim de ter as 5noticias mete na dois e assim por diante komo faço isso dá jeito para ñ ter uma pagina muito comprida http://www.apostaganha.com/ tá no fim :wink:
Offline

Flash005 
Membro
Mensagens 1360 Gostos 0
Troféus totais: 33
Trófeus: (Ver todos)
Quick Poster Windows User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

Não costumo vir a esta secção, só vi isto por sorte, mas ainda bem ;)


Código: [Seleccione]
##############################################################
## MOD Title: News Pagination for EzPortal
## MOD Original Author: JRSweets < JRSweets@gmail.com > http://www.jeffrusso.net
## MOD Description: This mod will display a pagination link to view more news on the EZ.
## MOD Version: BETA 0.2
##
##
## Installation Level: easy
## Installation Time: 5 minutes.
## Files To Edit:
##              portal.php
##              fetchposts.php
##              language/lang_english/lang_main.php
##              templates/subSilver/portal_body.tpl
##
## Included Files:
##              none
##
##############################################################
## For Security Purposes, Please Check: http://www.jeffrusso.net/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum.
##############################################################
## OFFICIAL SUPPORT SITE:
## Official support forums are at: http://www.jeffrusso.net/
##############################################################
## Author Notes:
## You must have the EZPortal by Smator http://smartor.is-root.com
##############################################################
## MOD History:
##
##   2005-06-07 - Version 0.2
##      - Removed "View All News" link.
##      - Fixed some bugs.
##      - Cleaned up install.
##   2005-05-23 - Version 0.1
##      - Initial BETA release.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
portal.php

#
#-----[ FIND ]------------------------------------------
#
//
// Fetch Posts from Announcements Forum
//

#
#-----[ AFTER, ADD ]------------------------------------------
#
####--News Pagination on EZPortal BEGIN--####
$count_sql = "SELECT topic_id FROM " . TOPICS_TABLE . " WHERE forum_id IN (" . $CFG['news_forum'] . ")";
if ( !($result_count = $db->sql_query($count_sql)) )
{
     // Error if it fails...
     message_die(GENERAL_ERROR, "Couldn't obtain news count.", "", __LINE__, __FILE__, $sql);
}

$news_total = $db->sql_numrows($result_count);
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
####--News Pagination on EZPortal END--####

#
#-----[ FIND ]------------------------------------------
#
}
//
// END: Fetch Announcements
//

#
#-----[ AFTER, ADD ]------------------------------------------
#
####--News Pagination on EZPortal BEGIN--####
if( ( $news_total > $CFG['number_of_news'] ) AND (!isset($HTTP_GET_VARS['article'])) )
{
        $template->assign_block_vars('pagination', array(
                'PAGINATION' => generate_pagination("portal.$phpEx?mode=news", $news_total, $CFG['number_of_news'], $start),
                'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $CFG['number_of_news']) + 1 ), ceil( $news_total / $CFG['number_of_news'] )))
        );
}
elseif( isset($HTTP_GET_VARS['article']) )
{
        $template->assign_block_vars('news_back', array(
                'U_PORTAL_NEWS_BACK' => append_sid("portal.$phpEx?mode=news&start=$start"),
                'L_PORTAL_NEWS_BACK' => $lang['News_back'])
        );
}
####--News Pagination on EZPortal END--####

#
#-----[ OPEN ]------------------------------------------
#
fetchposts.php

#
#-----[ FIND ]------------------------------------------
#
global $db, $board_config;

#
#-----[ REPLACE ]------------------------------------------
#
global $db, $board_config, $start;

#
#-----[ FIND ]------------------------------------------
#
0,' . $number_of_posts;

#
#-----[ REPLACE ]------------------------------------------
#
' . $start . ',' . $number_of_posts;
//Removed for News Pagination on EZPortal
//0,' . $number_of_posts;

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

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['News_back'] = 'Go Back';

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/portal_body.tpl
#
#-----[ FIND ]------------------------------------------
#
                <!-- END fetch_post_row -->

#
#-----[ AFTER, ADD ]------------------------------------------
#
      <!-- BEGIN pagination -->
                <table border="0" cellpadding="3" cellspacing="1" width="100%">
                <td align="left"><span class="gensmall">{pagination.PAGE_NUMBER}</span></td>
                <td align="right"><span class="gensmall"><b>{pagination.PAGINATION}</b></span></td>
                </table>
                <br />
                <!-- END pagination -->
                <!-- BEGIN news_back -->
                <table border="0" cellpadding="3" cellspacing="1" width="100%">
                <td align="center"><span class="gensmall">
                     <b>[<a href="{news_back.U_PORTAL_NEWS_BACK}">{news_back.L_PORTAL_NEWS_BACK}</a>]</b>
                </span></td>
                </table>
                <br />
                <!-- END news_back -->

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



Abraço

kidmetralha 
Visitante

muito obrigado Flash005 :wink:  :)
Offline

OFFICER 
Membro
Mensagens 2076 Gostos 0
Troféus totais: 29
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

Acrescento uma actualização muito importante que tens que fazer para não teres problemas:

in portal.php, find:
Código: [Seleccione]
'U_READ_FULL' => append_sid('portal.' . $phpEx . '?article=' . $i),

replace with:
Código: [Seleccione]
'U_READ_FULL' => append_sid('portal.' . $phpEx . '?article=' . ($i + $start)),

find:
Código: [Seleccione]
'CLOSE' => $close_bracket)
);
}
}
else
{


after, add:
Código: [Seleccione]
 $CFG['number_of_news'] = 100;

find:
Código: [Seleccione]
elseif( isset($HTTP_GET_VARS['article']) )
{


after, add:
Código: [Seleccione]
$gobackstart = $i + $start;

find:
Código: [Seleccione]
               'U_PORTAL_NEWS_BACK' => append_sid("portal.$phpEx?mode=news&start=$start"),

replace with:
Código: [Seleccione]
               'U_PORTAL_NEWS_BACK' => append_sid("portal.$phpEx?mode=news&start=$gobackstart"),

Depois para não teres problemas na paginação aconselho a instalção do MOD DB Maintenance (podes encontrá-lo no phpbbhacks.com).