Les archives de FluxBB.fr
Vous n'êtes pas identifié(e).
Ah oui, exact. Peut etre faudrait-t-il faire un compte en PHP en fonction du nombre autorisé de posts par page pour générer le numéro de la page?
Hors ligne
M.., je viens de trouver comment faire.
Si cela t'intéresse, contacte moi par mail, sinon je vais le sortir dans la nouvelle version de FluxRewrite Essentials
.
Hors ligne
Bojour,
Je n'ai pas bien compris cela dans l'install :
[ 4. ADD AT THE BOTTOM OF THE FUNCTION (AFTER THE FINAL })]Je ne sais pas ou mettre le code.
Merci d'avance,
Max
Hors ligne
Salut,
tu as essayer cela http://fluxbb.fr/forums/viewtopic.php?pid=90223#p90223 ...
Hors ligne
bonjour
je viens de le mettre en place sur un forum en 1.4.2
certes il y a pas mal d'étapes mais ca se fait rapidement et ca marche très bien.
bravo
petites questions:
j'utilise le mod show-last-topics_v1.3 qui permet de mettre sur la page d'index, les x derniers sujets des forums.
du coup, le rewrite ne fonctionne pas sur les topics affichés via ce mod.
(mais fonctionne qd on va dessus depuis le sous forum correspondant)
quelqu'un a t'il déjà modifié ce qu'il fallait dans ce mod?
merci
Hors ligne
<?php
//
// Last Topics mod by adaur
//
// Make sure no one attempts to run this script "directly"... it would be bad
if (!defined('PUN'))
exit;
// Load the viewforum.php language file
if (file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php'))
require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';
else
require PUN_ROOT.'lang/English/forum.php';
$show = isset($show) ? $show : NULL;
if ($show < '1' || $show > '50' || $show == '') $show = '5'; // Don't mess up with the numbers :P
if ($pun_user['g_id'] == PUN_ADMIN)
{
$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.num_views, t.moved_to, t.forum_id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE t.moved_to IS NULL ORDER BY t.last_post DESC LIMIT '.$show) or error('Unable to get the admin\'s topic list', __FILE__, __LINE__, $db->error());
}
elseif ($pun_user['is_guest'])
{
$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.num_views, t.moved_to, t.forum_id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL ORDER BY t.last_post DESC LIMIT '.$show) or error('Unable to get the guest\'s topic list', __FILE__, __LINE__, $db->error());
}
else
{
$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.num_views, t.moved_to, t.forum_id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL ORDER BY t.last_post DESC LIMIT '.$show) or error('Unable to get the member\'s topic list', __FILE__, __LINE__, $db->error());
}
?>
<div id="idx1" class="blocktable">
<h2><span><?php echo $lang_common['Last topics'] ?></span></h2>
<div class="box">
<div class="inbox">
<table cellspacing="0">
<thead>
<tr>
<th class="tcl" scope="col"><?php echo $lang_common['Topic']; ?></th>
<th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
<?php if ($pun_config['o_topic_views'] == '1'): ?> <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th> <?php endif; ?>
<th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
</tr>
</thead>
<tbody>
<?php
while ($cur_topic = $db->fetch_assoc($result)) {
if ($pun_config['o_censoring'] == '1')
$cur_topic['subject'] = censor_words($cur_topic['subject']);
$date = format_time($cur_topic['posted']);
$subject = '<a href="'.makeurl("topic-", $cur_topic['id'], $cur_topic['subject']).'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
if (!$pun_user['is_guest'])
{
$tracked_topics = get_tracked_topics();
}
if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && (!isset($tracked_topics['topics'][$cur_topic['id']]) || $tracked_topics['topics'][$cur_topic['id']] < $cur_topic['last_post']) && (!isset($tracked_topics['forums'][$cur_topic['forum_id']]) || $tracked_topics['forums'][$cur_topic['forum_id']] < $cur_topic['last_post']) && $cur_topic['moved_to'] == null)
{
$item_status = ' inew';
$icon_type = 'icon icon-new';
$subject = '<strong>'.$subject.'</strong>';
}
else
{
$item_status = '';
$icon_type = 'icon';
}
?>
<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
<td class="tcl">
<div class="intd">
<div class="<?php echo $icon_type ?>"><div class="nosize"></div></div>
<div class="tclcon">
<?php echo $subject."\n\t\t" ?>
</div>
</div>
</td>
<td class="tc2"><?php echo $cur_topic['num_replies'] ?></td>
<?php if ($pun_config['o_topic_views'] == '1'): ?> <td class="tc3"><?php echo $cur_topic['num_views'] ?></td> <?php endif; ?>
<td class="tcr"><?php echo '<a href="message-'.$cur_topic['last_post_id'].'.html#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>'; ?></td>
</tr>
<?php
} // That's all folks!
?>
</tbody></table></div></div></div>Cela devrait fonctionner 
Hors ligne
tant de réactivité ! ;o)
merci, mais je rajoute ca où je fais une modif d'un code ?
<?php // // Last Topics mod by adaur // // Make sure no one attempts to run this script "directly"... it would be bad if (!defined('PUN')) exit; // Load the viewforum.php language file if (file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php')) require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php'; else require PUN_ROOT.'lang/English/forum.php'; $show = isset($show) ? $show : NULL; if ($show < '1' || $show > '50' || $show == '') $show = '5'; // Don't mess up with the numbers :P if ($pun_user['g_id'] == PUN_ADMIN) { $result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.num_views, t.moved_to, t.forum_id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE t.moved_to IS NULL ORDER BY t.last_post DESC LIMIT '.$show) or error('Unable to get the admin\'s topic list', __FILE__, __LINE__, $db->error()); } elseif ($pun_user['is_guest']) { $result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.num_views, t.moved_to, t.forum_id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL ORDER BY t.last_post DESC LIMIT '.$show) or error('Unable to get the guest\'s topic list', __FILE__, __LINE__, $db->error()); } else { $result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.num_views, t.moved_to, t.forum_id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL ORDER BY t.last_post DESC LIMIT '.$show) or error('Unable to get the member\'s topic list', __FILE__, __LINE__, $db->error()); } ?> <div id="idx1" class="blocktable"> <h2><span><?php echo $lang_common['Last topics'] ?></span></h2> <div class="box"> <div class="inbox"> <table cellspacing="0"> <thead> <tr> <th class="tcl" scope="col"><?php echo $lang_common['Topic']; ?></th> <th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th> <?php if ($pun_config['o_topic_views'] == '1'): ?> <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th> <?php endif; ?> <th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th> </tr> </thead> <tbody> <?php while ($cur_topic = $db->fetch_assoc($result)) { if ($pun_config['o_censoring'] == '1') $cur_topic['subject'] = censor_words($cur_topic['subject']); $date = format_time($cur_topic['posted']); $subject = '<a href="'.makeurl("topic-", $cur_topic['id'], $cur_topic['subject']).'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; if (!$pun_user['is_guest']) { $tracked_topics = get_tracked_topics(); } if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && (!isset($tracked_topics['topics'][$cur_topic['id']]) || $tracked_topics['topics'][$cur_topic['id']] < $cur_topic['last_post']) && (!isset($tracked_topics['forums'][$cur_topic['forum_id']]) || $tracked_topics['forums'][$cur_topic['forum_id']] < $cur_topic['last_post']) && $cur_topic['moved_to'] == null) { $item_status = ' inew'; $icon_type = 'icon icon-new'; $subject = '<strong>'.$subject.'</strong>'; } else { $item_status = ''; $icon_type = 'icon'; } ?> <tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>> <td class="tcl"> <div class="intd"> <div class="<?php echo $icon_type ?>"><div class="nosize"></div></div> <div class="tclcon"> <?php echo $subject."\n\t\t" ?> </div> </div> </td> <td class="tc2"><?php echo $cur_topic['num_replies'] ?></td> <?php if ($pun_config['o_topic_views'] == '1'): ?> <td class="tc3"><?php echo $cur_topic['num_views'] ?></td> <?php endif; ?> <td class="tcr"><?php echo '<a href="message-'.$cur_topic['last_post_id'].'.html#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>'; ?></td> </tr> <?php } // That's all folks! ?> </tbody></table></div></div></div>Cela devrait fonctionner
Hors ligne
Tu remplaces ton /include/last_topics.php par celui-ci et tu me dis
!
génial ca fonctionne ! bravo
dernière question de noob :
les caractères accentués sont supprimés dans les url
il me semblait qu'ils seraient remplacer par leur équivalent sans accent ?
ps : jai bien déployé le .htaccess à la racine des fichiers
Hors ligne
Hors ligne
Chez moi c'est bien le cas, vérifie que ton include/functions.php soit bien encodé en UTF-8 sans BOM.
merci beaucoup adaur
c'est bien cela !
Hors ligne
Bonjour,
Un read me adapté à la version 1.4.4 est disponible ? Parce qu'il y a pas mal de lignes différentes.
A+
Max
Hors ligne
Bonjour,
Un read me adapté à la version 1.4.4 est disponible ? Parce qu'il y a pas mal de lignes différentes.
A+
Max
Petit up pour appuyer la demande de Max 
Merci 
La vie d'un geek ne tient qu'à un fil : le cable internet.
Hors ligne
Voici les lignes différentes :
include/functions.php
//FluxRewrite:
//
// Make sure that HTTP_REFERER matches $pun_config['o_base_url']/$script
//
function confirm_referrer($script)
{
global $pun_config, $lang_common;
if (!preg_match('#^'.preg_quote(str_replace('www.', '', $pun_config['o_base_url']).'/'.$script, '#').'#i', str_replace('www.', '', (isset($_SERVER['HTTP_REFERER']) ? urldecode($_SERVER['HTTP_REFERER']) : ''))))
message($lang_common['Bad referrer']);
}//FluxBB 1.4.4 :
//
// Make sure that HTTP_REFERER matches base_url/script
//
function confirm_referrer($script, $error_msg = false)
{
global $pun_config, $lang_common;
// There is no referrer
if (empty($_SERVER['HTTP_REFERER']))
message($error_msg ? $error_msg : $lang_common['Bad referrer']);
$referrer = parse_url(strtolower($_SERVER['HTTP_REFERER']));
// Remove www subdomain if it exists
if (strpos($referrer['host'], 'www.') === 0)
$referrer['host'] = substr($referrer['host'], 4);
$valid = parse_url(strtolower(get_base_url().'/'.$script));
// Remove www subdomain if it exists
if (strpos($valid['host'], 'www.') === 0)
$valid['host'] = substr($valid['host'], 4);
// Check the host and path match. Ignore the scheme, port, etc.
if ($referrer['host'] != $valid['host'] || $referrer['path'] != $valid['path'])
message($error_msg ? $error_msg : $lang_common['Bad referrer']);
}search.php (y'a pas grandes différences ...)
//FluxRewrite :
<h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?></span> <span><?php if ($cur_search['pid'] != $cur_search['first_post_id']) echo $lang_topic['Re'].' ' ?><?php echo $forum ?></span> <span>» <a href="viewtopic.php?id=<?php echo $cur_search['tid'] ?>"><?php echo $cur_search['subject'] ?></a></span> <span>» <a href="viewtopic.php?pid=<?php echo $cur_search['pid'].'#p'.$cur_search['pid'] ?>"><?php echo format_time($cur_search['pposted']) ?></a></span></span></h2>//FluxBB 1.4.4
<h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?></span> <span><?php if ($cur_search['pid'] != $cur_search['first_post_id']) echo $lang_topic['Re'].' ' ?><?php echo $forum ?></span> <span>» <a href="viewtopic.php?id=<?php echo $cur_search['tid'] ?>"><?php echo pun_htmlspecialchars($cur_search['subject']) ?></a></span> <span>» <a href="viewtopic.php?pid=<?php echo $cur_search['pid'].'#p'.$cur_search['pid'] ?>"><?php echo format_time($cur_search['pposted']) ?></a></span></span></h2>post.php
// fluxrewrite :
$mail_message .= sprintf($lang_common['Post URL'], $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid)."\n";
$mail_message = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message);
$mail_message_full = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full);//fluxbb 1.4.4
$mail_message .= sprintf($lang_common['Post URL'], get_base_url().'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid)."\n";
$mail_message = str_replace('<post_url>', get_base_url().'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message);
$mail_message_full = str_replace('<post_url>', get_base_url().'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full);delete.php
//fluxRewrite :
redirect('viewtopic.php?id='.$cur_post['tid'], $lang_delete['Post del redirect']);// fluxBB 1.4.4
redirect('viewtopic.php?pid='.$post_id.'#p'.$post_id, $lang_delete['Post del redirect']);extern.php
// fluxRewrite
'link' => $pun_config['o_base_url'].'/viewtopic.php?id='.$tid,
'link' => $pun_config['o_base_url'].'/viewtopic.php?pid='.$cur_post['id'].'#p'.$cur_post['id'],
'link' => $pun_config['o_base_url'].($order_posted ? '/viewtopic.php?id='.$cur_topic['id'] : '/viewtopic.php?id='.$cur_topic['id'].'&action=new'),// fluxBB 1.4.4
'link' => get_base_url(true).'/viewtopic.php?id='.$tid,
'link' => get_base_url(true).'/viewtopic.php?pid='.$cur_post['id'].'#p'.$cur_post['id'],
'link' => get_base_url(true).'/viewtopic.php?id='.$cur_topic['id'].($order_posted ? '' : '&action=new'),Voilà il me semble que c'est tout !
La vie d'un geek ne tient qu'à un fil : le cable internet.
Hors ligne
Bonjour,
je viens aux nouvelles ...
La vie d'un geek ne tient qu'à un fil : le cable internet.
Hors ligne
Salut MPB, désolé pour le délai.
Pour le referer, on dirait que toute référence à un PHP ait disparu et que seul le nom de domaine soit vérifié, laisse le donc comme ça pour tester.
search.php
viewtopic.php?pid=<?php echo $cur_search['pid'].'#p'.$cur_search['pid'] ?>
=>
message-<?php echo $cur_search['pid'].'.html#p'.$cur_search['pid'] ?>
pareil pour delete.php
redirect('viewtopic.php?id='.$cur_post['tid'], $lang_delete['Post del redirect']);
=>
redirect('message-'.$post_id.'.html#p'.$post_id, $lang_delete['Post del redirect']);
même chose pour post... tu as compris le principe?
Sinon, as tu vraiment besoin de modifier extern? (des scripts externes?)
Hors ligne