ludo345
Inscrit le: 03 Fév 2008 Messages: 6
|
Posté le: Sam Mar 22, 2008 5:36 pm Sujet du message: (réglé) rewriter un portail sur lien vers viewtopics.php |
|
|
Déjà bonjour pour ce premier post ,
( Je tient à féliciter tout d'abord DCZ et Seo pour leur magnifique travail sur ce forum et la pertinence de leurs réponses ... )
Voilà mon soucis, j'ai installé PHPBBSEO avec un portail (phpBB3 Portal) et c'est ce portail qui me pose pblm ....
J'ai des liens vers viewtopics.php que j'aimerais rewrité mais malheureusement je n'y arrive pas ...
J'ai tenter de modifier le .htaccess et le fichier en question sur le portail mais rien n'y fais ...
Voilà le code du lien vers viewtopics qui fait défaut :
| Code: | | 'U_VIEW_COMMENTS' => append_sid($phpbb_root_path . 'viewtopic.' . $phpEx . '?t=' . $fetch_news[$i]['topic_id'] . '&f=' . $fetch_news[$i]['forum_id']), |
Quelle procédure éventuellement me conseillez vous ? je ne sait pas ou chercher ? faut t'il créer une fonction supplémentaire et/ou juste modifier le .htaccess ? Bref si vous avez une info pour pouvoir l'adapter cela m'aiderais à avancer .... merci par avance ...!
A++
Dur dur de plonger dans un autre Open Source ... |
Dernière édition par ludo345 le Dim Mar 23, 2008 10:30 pm; édité 1 fois |
|
ludo345
Inscrit le: 03 Fév 2008 Messages: 6
|
Posté le: Dim Mar 23, 2008 9:59 pm Sujet du message: Re: (réglé) rewriter un portail sur lien vers viewtopics.php |
|
|
Donc je m'auto répond
j'ai trouvé comment adapter PHPBBSEO avec PHPBB3PORTAL <== enfin pas en complet ...
En fait à la base j'ai installé ce portail pour avoir un portail de NEWS et juste de NEWS ... donc je n'ai modifié que le fichier portal/block/news.php ...
Le voici ça peut peut être servir un jour à quelqu'un :
| Code: | <?php
/*
*
* @package phpBB3 Portal a.k.a canverPortal ( www.phpbb3portal.com )
* @version $Id: news.php,v 1.3 2007/08/05 09:39:57 angelside Exp $
* @copyright (c) Canver Software - www.canversoft.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB') or !defined('IN_PORTAL'))
{
die('Hacking attempt');
exit;
}
/**
*/
//
// Fetch Posts for news from portal/includes/functions.php
//
if (!isset($HTTP_GET_VARS['article']))
{
$fetch_news = phpbb_fetch_posts($config['portal_news_forum'], $config['portal_number_of_news'], $config['portal_news_length'], 0, ($config['portal_show_all_news']) ? 'news_all' : 'news');
if (count($fetch_news) == 0)
{
$template->assign_block_vars('news_row', array(
'S_NO_TOPICS' => true,
'S_NOT_LAST' => false
));
}
else
{
for ($i = 0; $i < count($fetch_news); $i++)
{
if( isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true )
{
$open_bracket = '[ ';
$close_bracket = ' ]';
$read_full = $user->lang['READ_FULL'];
}
else
{
$open_bracket = '';
$close_bracket = '';
$read_full = '';
}
// ################# ADAPTATION "PHPBB3PORTAL" POUR "PHPBBBSEO" #######################
$forum_id = (int) $fetch_news[$i]['forum_id'];
$topic_id = (int) $fetch_news[$i]['topic_id'];
if ( empty($phpbb_seo->seo_url['topic'][$topic_id]) ) {
if ($fetch_news[$i]['topic_type'] == POST_GLOBAL) {
$phpbb_seo->seo_opt['topic_type'][$topic_id] = POST_GLOBAL;
}
$phpbb_seo->seo_censored[$topic_id] = censor_text($fetch_news[$i]['topic_title']);
$phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($phpbb_seo->seo_censored[$topic_id]);
}
if ( empty($phpbb_seo->seo_url['forum'][$fetch_news[$i]['forum_id']]) ) {
$phpbb_seo->seo_url['forum'][$fetch_news[$i]['forum_id']] = $phpbb_seo->set_url($fetch_news[$i]['forum_name'],$fetch_news[$i]['forum_id'], $phpbb_seo->seo_static['forum']);
}
###############################################################
$template->assign_block_vars('news_row', array(
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'TITLE' => $fetch_news[$i]['topic_title'],
'POSTER' => $fetch_news[$i]['username'],
'U_USER_PROFILE' => (($fetch_news[$i]['user_type'] == USER_NORMAL || $fetch_news[$i]['user_type'] == USER_FOUNDER) && $fetch_news[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news[$i]['user_id']) : '',
'TIME' => $fetch_news[$i]['topic_time'],
'TEXT' => $fetch_news[$i]['post_text'],
'REPLIES' => $fetch_news[$i]['topic_replies'],
'TOPIC_VIEWS' => $fetch_news[$i]['topic_views'],
'U_LAST_COMMENTS' => $phpbb_root_path . 'viewtopic.' . $phpEx . '?t=' . $fetch_news[$i]['topic_id'] . '&p=' . $fetch_news[$i]['topic_last_post_id'] . '#p' . $fetch_news[$i]['topic_last_post_id'],
//ici
'U_VIEW_COMMENTS' => append_sid($phpbb_root_path . 'viewtopic.' . $phpEx . '?t=' . $fetch_news[$i]['topic_id'] . '&f=' . $fetch_news[$i]['forum_id']),
'U_POST_COMMENT' => append_sid($phpbb_root_path . 'posting.' . $phpEx . '?mode=reply&t=' . $fetch_news[$i]['topic_id'] . '&f=' . $fetch_news[$i]['forum_id']),
'U_READ_FULL' => append_sid($_SERVER['PHP_SELF'] . '?article=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'S_NOT_LAST' => ($i < count($fetch_news) - 1) ? true : false,
'S_POLL' => $fetch_news[$i]['poll'],
'MINI_POST_IMG' => $user->img('icon_post_target', 'POST'),
));
}
}
}
else
{
$fetch_news = phpbb_fetch_posts($config['portal_news_forum'], $config['portal_number_of_news'], 0, 0, ($config['portal_show_all_news']) ? 'news_all' : 'news');
$i = intval($HTTP_GET_VARS['article']);
$template->assign_block_vars('news_row', array(
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'TITLE' => $fetch_news[$i]['topic_title'],
'POSTER' => $fetch_news[$i]['username'],
'TIME' => $fetch_news[$i]['topic_time'],
'TEXT' => $fetch_news[$i]['post_text'],
'REPLIES' => $fetch_news[$i]['topic_replies'],
'TOPIC_VIEWS' => $fetch_news[$i]['topic_views'],
'U_LAST_COMMENTS' => $phpbb_root_path . 'viewtopic.' . $phpEx . '?t=' . $fetch_news[$i]['topic_id'] . '&p=' . $fetch_news[$i]['topic_last_post_id'] . '#p' . $fetch_news[$i]['topic_last_post_id'],
'U_VIEW_COMMENTS' => append_sid($phpbb_root_path . 'viewtopic.' . $phpEx . '?t=' . $fetch_news[$i]['topic_id'] . '&f=' . $fetch_news[$i]['forum_id']),
'U_POST_COMMENT' => append_sid($phpbb_root_path . 'posting.' . $phpEx . '?mode=reply&t=' . $fetch_news[$i]['topic_id'] . '&f=' . $fetch_news[$i]['forum_id']),
'S_POLL' => $fetch_news[$i]['poll']
));
}
// Assign specific vars
$template->assign_vars(array(
'S_DISPLAY_NEWS' => true,
));
?> |
Voilà donc les liens des news du portail PHPBB3PORTAL rewrité ...!
IPBOARD n'as qu'a bien se tenir
A++
Dslé au modo, je n'est peut être pas posté dans la bonne catégorie ?  |
|
|