Merci de vous pencher sur mon problème,
Voila je suis un peux coincer sur une fonction, en utilisant les fichiers: block_attachments.php & block_attachments.html
je voudrais faire afficher les dernières image poster, en fichier joint, (j ai un forum photo) mais je ni arrive pas
je vous joint les codes que j utilise, dans l'espoire que l un d'entre vous puisse me dépanner !
pour le fichier block_attachmentsattachments.html
- Code: Tout sélectionner
<br />
<table class="tablebg" width="100%" cellspacing="1">
<tr align="center">
<th class="cat_block">{ATTACH_TITRE}</th>
</tr>
<tr align="left">
<td>
<table width="100%" class="row2">
<tr align="center">
<td width="29%" class="block_center">
<span class="gensmall"><b>{L_TOP_FILENAME}</b></span></td>
<td width="37%" class="block_center"><span class="gensmall"><b> {L_RECENT_AUTEUR}</b></span></td>
<td width="22%" class="block_center"><span class="gensmall"><b> {L_TOP_FILESIZE}</b></span></td>
<td width="12%" class="block_center"> </td>
</tr>
<!-- BEGIN attach -->
<!-- IF attach.S_ROW_COUNT is even -->
<tr align="left" class="row1">
<!-- ENDIF -->
<td class="block_left">
<i>{L_FORUM}:</i> <a href="{attach.S_FORUM}"><span style="color:#{attach.FORUM_NAME_COLOR}" class="genmed">{attach.FORUM_NAME}</span></a><br />
<i>{L_RECENT_SUJET}:</i> <a href="{attach.U_FILE}">{attach.TOPIC_TITLE}</a><br />
<i>{L_TOP_FILENAME} :</i> <a href="{attach.U_FILE_POSTE}"><span class="gensmall">{attach.REAL_FILENAME}</span></a>
</span></a></td>
<td class="block_center"><a href="{attach.U_FILE}"><span class="gensmall">
<!-- IF attach.EXTENSION == "gif" -->
<img border="0" src="download/file.php?id={attach.ATTACH_ID}"width="80px"alt=""/>
<!-- ENDIF -->
<!-- IF attach.EXTENSION == "jpg" -->
<img border="0" src="download/file.php?id={attach.ATTACH_ID}"width="80px"alt=""/>
<!-- ENDIF -->
<!-- IF attach.EXTENSION == "png" -->
<img border="0" src="download/file.php?id={attach.ATTACH_ID}"width="80px"alt=""/></span></a><br />
<span class="gensmall"><br /></span></td>
<td class="block_center"><!-- ENDIF -->
<a href="{attach.U_POSTER}"><br />
<span class="gensmall">{attach.ATTACH_POSTER}<br /></span></a>
<span class="gensmall">{attach.ATTACH_DATE}</span></td>
<td class="block_center"><span class="gensmall">{attach.FILESIZE} vue: {attach.ATTACH_COUNT} {L_TOP_X}</span></td>
</tr>
<!-- END attach -->
</table>
</td>
</tr>
</table>
Pour le fichier block_attachmentsattachments.php
- Code: Tout sélectionner
<?php
if (!defined('IN_PHPBB'))
{
exit;
}
$user->add_lang('portal/block_attachments_lang');
$sql = 'SELECT *
FROM ' . PORTAL_ATTACH_TABLE . '
WHERE 1';
$results = $db->sql_query($sql);
if( $result = $db->sql_query($sql) )
{
$row = $db->sql_fetchrow($result);
$attachments_number = $row['attachments_number'];
$attachments_title_block = $row['attachments_title_block'];
}
$sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . ' a, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . ' u
WHERE a.topic_id = t.topic_id
AND t.forum_id = f.forum_id
AND a.poster_id = u.user_id
GROUP BY filetime
ORDER BY download_count ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC';
$result = $db->sql_query_limit($sql, $attachments_number = $row['attachments_number']);
while ($row = $db->sql_fetchrow($result))
{
$size_lang = ($row['filesize'] >= 1048576) ? $user->lang['MB'] : (($row['filesize'] >= 1024) ? $user->lang['KB'] : $user->lang['BYTES']);
$row['filesize'] = ($row['filesize'] >= 1048576) ? round((round($row['filesize'] / 1048576 * 100) / 100), 2) : (($row['filesize'] >= 1024) ? round((round($row['filesize'] / 1024 * 100) / 100), 2) : $row['filesize']);
$replace = str_replace(array('_','-'), ' ', $row['real_filename']);
$post_msg_id = $row['post_id'];
$forum_id = $row['forum_id'];
$topic_id = $row['topic_id'];
$topic_title = $row['topic_Title'];
$user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] . '" class="username-coloured"' : '';
$usernam = ($row['user_type'] != USER_IGNORE) ? get_username_string('full', $row['topic_poster'], $row['username'], $row['user_colour']) : '<span' . $user_colour . '>' . $row['username'] . '</span>';
$template->assign_vars(array(
'ATTACH_TITRE' => $attachments_title_block ));
$template->assign_block_vars('attach', array(
'FILESIZE' => $row['filesize'] . ' ' . $size_lang,
'FORUM_NAME' => $row['forum_name'],
'FORUM-ID' => $row['forum_id'],
'S_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx?", 'f=' . $forum_id),
'FORUM_NAME_COLOR' => $row['forum_name_color'],
'TOPIC_TITLE' => smilies_pass($row['topic_title']),
'FILETIME' => $user->format_date($row['filetime']),
'REAL_FILENAME' => $replace,
'ATTACH_DATE' => $user->format_date($row['filetime'], $format = 'd M Y'),
'PHYSICAL_FILENAME' => basename($row['physical_filename']),
'ATTACH_ID' => $row['attach_id'],
'ATTACH_COUNT' => $row['download_count'],
'ATTACH_POSTER' => $usernam,
'ATTACH_POSTER_FLAG'=> $row['user_country_flag'],
'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '',
'U_FILE_POSTE' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_msg_id'] .'#p'.$row['post_msg_id']),
'U_POSTER' => append_sid("memberlist.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']),
'EXTENSION' => $row['extension'],
'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '',
'U_FILE_POSTE' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_msg_id'] .'#p'.$row['post_msg_id']),
'U_FILE' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $topic_id))
);
}
$db->sql_freeresult($result);
?>
Merci pour les réponses éventuel.



