Browse Source

Les liens mis en avant sur l’accueil dirigent maintenant vers le début des discussions

pull/17/head
vv221 10 months ago
parent
commit
62b56c73c4
  1. 20
      asso_news.php

20
asso_news.php

@ -1,8 +1,8 @@
<?php
$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), "News");
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), "News");
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
function pun_news($fid='', $show=15, $truncate=1)
{
@ -16,7 +16,7 @@ function pun_news($fid='', $show=15, $truncate=1)
if ( $fid ) $forum_sql = 'f.id='.$fid.' AND ';
$show = intval($show);
if ($show < 1 || $show > $show_max_topics)
$show = 15;
$show = 15;
$saveddate="";
// Fetch $show topics
$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, f.id AS fid, f.forum_name FROM '.$db_prefix.'topics AS t INNER JOIN '.$db_prefix.'forums AS f ON t.forum_id=f.id WHERE f.id='.$fid.' AND t.moved_to IS NULL ORDER BY '.$order_by.' DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
@ -30,11 +30,11 @@ function pun_news($fid='', $show=15, $truncate=1)
$subject_truncated = trim(substr($cur_topic['subject'], 0, ($max_subject_length-5))).' ...';
else
$subject_truncated = $cur_topic['subject'];
$newsheading = '<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.pun_htmlspecialchars($subject_truncated).'</a> - <em>Posté par '.$cur_topic['poster'].' à '.date('H:i:s', $cur_topic['posted']).'</em><br>';
$newsheading = '<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.pun_htmlspecialchars($subject_truncated).'</a> - <em>Posté par '.$cur_topic['poster'].' à '.date('H:i:s', $cur_topic['posted']).'</em><br>';
// Group posts by
$thisdate = date('d n Y', $cur_topic['posted']);
$thisdate = date('d n Y', $cur_topic['posted']);
if ($thisdate != $saveddate)
{
if ($saveddate)
{
@ -49,12 +49,12 @@ $thisdate = date('d n Y', $cur_topic['posted']);
$temp .= $newsheading.'</p><p>';
$id = $cur_topic['id'];
$msg = $db->query('SELECT id, poster, poster_id, poster_ip, poster_email, message, posted, edited, edited_by FROM '.$db_prefix.'posts WHERE topic_id='.$id.' LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
if ( !$db->num_rows($msg) ) continue;
if ( !$db->num_rows($msg) ) continue;
$cur_post = $db->fetch_assoc($msg);
// Display first paragraph only (comment out next four lines to turn off)
if ($truncate == 1)
{
$paragraph = preg_split("/s*n+/", $cur_post['message']);
$paragraph = preg_split("/s*n+/", $cur_post['message']);
if (isset($paragraph[1])) {
$cur_post['message'] = $paragraph[0] . "...";
}

Loading…
Cancel
Save