Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1836 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  message le plus récent en premier page 1 mon forum

 



 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

message le plus récent en premier page 1 mon forum

n°1930852
alex2603
Posté le 10-10-2009 à 14:45:08  profilanswer
 

Bonjour à tous. :hello: Je suis en train de créer un site avec un forum fluxbb. Bref je voudrai que le message le plus récent apparaisse au début page1. Le premier message a avoir été posté depuis le debut sera donc le dernier message à la dernière page. J'aurai vraiment besoin d'aide. Si ce n'est pas compliqué ça serait sympa de m'aider mais si ça n'est pas réalisable ditent le moi. Merci d'avance. :jap: Voici le code de "viewtopic" :
 

Code :
  1. <?php
  2. /***********************************************************************
  3. Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org)
  4. This file is part of PunBB.
  5. PunBB is free software; you can redistribute it and/or modify it
  6. under the terms of the GNU General Public License as published
  7. by the Free Software Foundation; either version 2 of the License,
  8. or (at your option) any later version.
  9. PunBB is distributed in the hope that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  16. MA 02111-1307 USA
  17. ************************************************************************/
  18. define('PUN_ROOT', './');
  19. require PUN_ROOT.'include/common.php';
  20. if ($pun_user['g_read_board'] == '0')
  21. message($lang_common['No view']);
  22. $action = isset($_GET['action']) ? $_GET['action'] : null;
  23. $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
  24. $pid = isset($_GET['pid']) ? intval($_GET['pid']) : 0;
  25. if ($id < 1 && $pid < 1)
  26. message($lang_common['Bad request']);
  27. // Load the viewtopic.php language file
  28. require PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';
  29. // If a post ID is specified we determine topic ID and page number so we can redirect to the correct message
  30. if ($pid)
  31. {
  32. $result = $db->query('SELECT topic_id FROM '.$db->prefix.'posts WHERE id='.$pid) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
  33. if (!$db->num_rows($result))
  34. message($lang_common['Bad request']);
  35. $id = $db->result($result);
  36. // Determine on what page the post is located (depending on $pun_user['disp_posts'])
  37. $result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$id.' ORDER BY posted') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
  38. $num_posts = $db->num_rows($result);
  39. for ($i = 0; $i < $num_posts; ++$i)
  40. {
  41. $cur_id = $db->result($result, $i);
  42. if ($cur_id == $pid)
  43. break;
  44. }
  45. ++$i; // we started at 0
  46. $_GET['p'] = ceil($i / $pun_user['disp_posts']);
  47. }
  48. // If action=new, we redirect to the first new post (if any)
  49. else if ($action == 'new' && !$pun_user['is_guest'])
  50. {
  51. $result = $db->query('SELECT MIN(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id.' AND posted>'.$pun_user['last_visit']) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
  52. $first_new_post_id = $db->result($result);
  53. if ($first_new_post_id)
  54. header('Location: viewtopic.php?pid='.$first_new_post_id.'#p'.$first_new_post_id);
  55. else // If there is no new post, we go to the last post
  56. header('Location: viewtopic.php?id='.$id.'&action=last');
  57. exit;
  58. }
  59. // If action=last, we redirect to the last post
  60. else if ($action == 'last')
  61. {
  62. $result = $db->query('SELECT MAX(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
  63. $last_post_id = $db->result($result);
  64. if ($last_post_id)
  65. {
  66. header('Location: viewtopic.php?pid='.$last_post_id.'#p'.$last_post_id);
  67. exit;
  68. }
  69. }
  70. // Fetch some info about the topic
  71. if (!$pun_user['is_guest'])
  72. $result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.evaluate_active, f.moderators, fp.post_replies, s.user_id AS is_subscribed, e.voters, e.votes FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'evaluate AS e ON t.id=e.t_id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['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.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
  73. else
  74. $result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.evaluate_active, f.moderators, fp.post_replies, e.voters, e.votes FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'evaluate AS e ON t.id=e.t_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.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
  75. if (!$db->num_rows($result))
  76. message($lang_common['Bad request']);
  77. $cur_topic = $db->fetch_assoc($result);
  78. // Sort out who the moderators are and if we are currently a moderator (or an admin)
  79. $mods_array = ($cur_topic['moderators'] != '') ? unserialize($cur_topic['moderators']) : array();
  80. $is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
  81. $evaluate_is_active = ($cur_topic['evaluate_active'] == '1') ? true : false;
  82. if($evaluate_is_active)
  83. {
  84. if ((!empty($cur_topic['votes'])) && (!empty($cur_topic['voters'])))
  85. {
  86. $votes = unserialize($cur_topic['votes']);
  87. $voters = unserialize($cur_topic['voters']);
  88. }
  89. else
  90. {
  91. $votes = array();
  92. $voters = array();
  93. }
  94. $can_evaluate = ((!$pun_user['is_guest']) && ($evaluate_is_active) && (($pun_user['g_evaluate_topics'] == '1') || ($is_admmod)) && (!in_array($pun_user['id'], $voters)) && ($cur_topic['closed'] == '0')) ? true : false; // et (n'a pas déjà voté) à rajouter
  95. $total=0;
  96. $somme_notes=0;
  97. while($voters[$total])
  98. {
  99. $total++;
  100. }
  101. for($i=1;$i<=10;$i++)
  102. if($votes[$i]!=null)
  103. $somme_notes+=$i*$votes[$i];
  104. if($total!=0)
  105. $moyenne=round($somme_notes/$total,2);
  106. else
  107. $moyenne=0;
  108. $evaplus='<img src="img/plus.gif" alt="'.$total.' évaluations, moyenne '.$moyenne.'" title="'.$total.' évaluations - Moyenne : '.$moyenne.'" />';
  109. $evamoins='<img src="img/moins.gif" alt="'.$total.' évaluations, moyenne '.$moyenne.'" title="'.$total.' évaluations - Moyenne : '.$moyenne.'" />';
  110. if($moyenne==0)
  111. $eval='';
  112. else if($moyenne>=5)
  113. {
  114. $eval=$evaplus;
  115. if($moyenne>=6)
  116. $eval.=$evaplus;
  117. if($moyenne>=7)
  118. $eval.=$evaplus;
  119. if($moyenne>=8)
  120. $eval.=$evaplus;
  121. if($moyenne>=9)
  122. $eval.=$evaplus;
  123. }
  124. else
  125. {
  126. $eval=$evamoins;
  127. if($moyenne<4)
  128. $eval.=$evamoins;
  129. if($moyenne<3)
  130. $eval.=$evamoins;
  131. if($moyenne<2)
  132. $eval.=$evamoins;
  133. }
  134. }
  135. // Can we or can we not post replies?
  136. if ($cur_topic['closed'] == '0')
  137. {
  138. if (($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1') || $cur_topic['post_replies'] == '1' || $is_admmod)
  139. $post_link = '<a href="post.php?tid='.$id.'">'.$lang_topic['Post reply'].'</a>';
  140. else
  141. $post_link = '&nbsp;';
  142. }
  143. else
  144. {
  145. $post_link = $lang_topic['Topic closed'];
  146. if ($is_admmod)
  147. $post_link .= ' / <a href="post.php?tid='.$id.'">'.$lang_topic['Post reply'].'</a>';
  148. }
  149. // Determine the post offset (based on $_GET['p'])
  150. $num_pages = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
  151. $p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
  152. $start_from = $pun_user['disp_posts'] * ($p - 1);
  153. // Generate paging links
  154. $paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'viewtopic.php?id='.$id);
  155. if ($pun_config['o_censoring'] == '1')
  156. $cur_topic['subject'] = censor_words($cur_topic['subject']);
  157. $quickpost = false;
  158. if ($pun_config['o_quickpost'] == '1' &&
  159. !$pun_user['is_guest'] &&
  160. ($cur_topic['post_replies'] == '1' || ($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1')) &&
  161. ($cur_topic['closed'] == '0' || $is_admmod))
  162. {
  163. $required_fields = array('req_message' => $lang_common['Message']);
  164. $quickpost = true;
  165. }
  166. if (!$pun_user['is_guest'] && $pun_config['o_subscriptions'] == '1')
  167. {
  168. if ($cur_topic['is_subscribed'])
  169. // I apologize for the variable naming here. It's a mix of subscription and action I guess :-)
  170. $subscraction = '<p class="subscribelink clearb">'.$lang_topic['Is subscribed'].' - <a href="misc.php?unsubscribe='.$id.'">'.$lang_topic['Unsubscribe'].'</a></p>'."\n";
  171. else
  172. $subscraction = '<p class="subscribelink clearb"><a href="misc.php?subscribe='.$id.'">'.$lang_topic['Subscribe'].'</a></p>'."\n";
  173. }
  174. else
  175. $subscraction = '<div class="clearer"></div>'."\n";
  176. $page_title = pun_htmlspecialchars($pun_config['o_board_title'].' / '.$cur_topic['subject']);
  177. define('PUN_ALLOW_INDEX', 1);
  178. require PUN_ROOT.'header.php';
  179. ?>
  180. <div class="linkst">
  181. <div class="inbox">
  182. <p class="pagelink conl"><?php echo $paging_links ?></p>
  183. <p class="postlink conr"><?php echo $post_link ?></p>
  184. <ul><li><a href="forum.php"><?php echo $lang_common['Forum'] ?></a></li>
  185. <li>&nbsp;&raquo;&nbsp;<a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li>
  186. <li>&nbsp;&raquo;&nbsp;<?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li>
  187. <?php
  188. if($evaluate_is_active)
  189. echo '<li>'.$eval.'</li>';
  190. ?>
  191. </ul>
  192. <div class="clearer"></div>
  193. </div>
  194. </div>
  195. <div class="blockform">
  196. <h2><span>Advertisement</span></h2>
  197. <div class="box" align="center">
  198. <div class="inbox">
  199. <div class="infldset">
  200. <?php include('pubg.php'); ?>
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205. <?php
  206. require PUN_ROOT.'include/parser.php';
  207. $bg_switch = true; // Used for switching background color in posts
  208. $post_count = 0; // Keep track of post numbers
  209. // Retrieve the posts (and their respective poster/online status)
  210. $result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
  211. while ($cur_post = $db->fetch_assoc($result))
  212. {
  213. $post_count++;
  214. $user_avatar = '';
  215. $user_info = array();
  216. $user_contacts = array();
  217. $post_actions = array();
  218. $is_online = '';
  219. $signature = '';
  220. // If the poster is a registered user.
  221. if ($cur_post['poster_id'] > 1)
  222. {
  223. $username = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['username']).'</a>';
  224. $user_title = get_title($cur_post);
  225. if ($pun_config['o_censoring'] == '1')
  226. $user_title = censor_words($user_title);
  227. // Format the online indicator
  228. $is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong>'.$lang_topic['Online'].'</strong>' : $lang_topic['Offline'];
  229. if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
  230. {
  231. if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
  232. $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' alt="" />';
  233. else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
  234. $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' alt="" />';
  235. else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
  236. $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' alt="" />';
  237. }
  238. else
  239. $user_avatar = '';
  240. // We only show location, register date, post count and the contact links if "Show user info" is enabled
  241. if ($pun_config['o_show_user_info'] == '1')
  242. {
  243. if ($cur_post['location'] != '')
  244. {
  245. if ($pun_config['o_censoring'] == '1')
  246. $cur_post['location'] = censor_words($cur_post['location']);
  247. $user_info[] = '<dd>'.$lang_topic['From'].': '.pun_htmlspecialchars($cur_post['location']);
  248. }
  249. $user_info[] = '<dd>'.$lang_common['Registered'].': '.date($pun_config['o_date_format'], $cur_post['registered']);
  250. if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST)
  251. $user_info[] = '<dd>'.$lang_common['Posts'].': '.$cur_post['num_posts'];
  252. // Now let's deal with the contact links (E-mail and URL)
  253. if (($cur_post['email_setting'] == '0' && !$pun_user['is_guest']) || $pun_user['g_id'] < PUN_GUEST)
  254. $user_contacts[] = '<a href="mailto:'.$cur_post['email'].'">'.$lang_common['E-mail'].'</a>';
  255. else if ($cur_post['email_setting'] == '1' && !$pun_user['is_guest'])
  256. $user_contacts[] = '<a href="misc.php?email='.$cur_post['poster_id'].'">'.$lang_common['E-mail'].'</a>';
  257. if ($cur_post['url'] != '')
  258. $user_contacts[] = '<a href="'.pun_htmlspecialchars($cur_post['url']).'">'.$lang_topic['Website'].'</a>';
  259. }
  260. if ($pun_user['g_id'] < PUN_GUEST)
  261. {
  262. $user_info[] = '<dd>IP: <a href="moderate.php?get_host='.$cur_post['id'].'">'.$cur_post['poster_ip'].'</a>';
  263. if ($cur_post['admin_note'] != '')
  264. $user_info[] = '<dd>'.$lang_topic['Note'].': <strong>'.pun_htmlspecialchars($cur_post['admin_note']).'</strong>';
  265. }
  266. }
  267. // If the poster is a guest (or a user that has been deleted)
  268. else
  269. {
  270. $username = pun_htmlspecialchars($cur_post['username']);
  271. $user_title = get_title($cur_post);
  272. if ($pun_user['g_id'] < PUN_GUEST)
  273. $user_info[] = '<dd>IP: <a href="moderate.php?get_host='.$cur_post['id'].'">'.$cur_post['poster_ip'].'</a>';
  274. if ($pun_config['o_show_user_info'] == '1' && $cur_post['poster_email'] != '' && !$pun_user['is_guest'])
  275. $user_contacts[] = '<a href="mailto:'.$cur_post['poster_email'].'">'.$lang_common['E-mail'].'</a>';
  276. }
  277. // Generation post action array (quote, edit, delete etc.)
  278. if (!$is_admmod)
  279. {
  280. if (!$pun_user['is_guest'])
  281. $post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>';
  282. if ($cur_topic['closed'] == '0')
  283. {
  284. if ($cur_post['poster_id'] == $pun_user['id'])
  285. {
  286. if ((($start_from + $post_count) == 1 && $pun_user['g_delete_topics'] == '1') || (($start_from + $post_count) > 1 && $pun_user['g_delete_posts'] == '1'))
  287. $post_actions[] = '<li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>';
  288. if ($pun_user['g_edit_posts'] == '1')
  289. $post_actions[] = '<li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>';
  290. }
  291. if (($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1') || $cur_topic['post_replies'] == '1')
  292. $post_actions[] = '<li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>';
  293. }
  294. }
  295. else
  296. $post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>';
  297. // Switch the background color for every message.
  298. $bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
  299. $vtbg = ($bg_switch) ? ' roweven' : ' rowodd';
  300. // Perform the main parsing of the message (BBCode, smilies, censor words etc)
  301. $cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
  302. // Do signature parsing/caching
  303. if ($cur_post['signature'] != '' && $pun_user['show_sig'] != '0')
  304. {
  305. if (isset($signature_cache[$cur_post['poster_id']]))
  306. $signature = $signature_cache[$cur_post['poster_id']];
  307. else
  308. {
  309. $signature = parse_signature($cur_post['signature']);
  310. $signature_cache[$cur_post['poster_id']] = $signature;
  311. }
  312. }
  313. ?>
  314. <div id="p<?php echo $cur_post['id'] ?>" class="blockpost<?php echo $vtbg ?><?php if (($post_count + $start_from) == 1) echo ' firstpost'; ?>">
  315. <h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?>&nbsp;</span><a href="viewtopic.php?pid=<?php echo $cur_post['id'].'#p'.$cur_post['id'] ?>"><?php echo format_time($cur_post['posted']) ?></a></span></h2>
  316. <div class="box">
  317. <div class="inbox">
  318. <div class="postleft">
  319. <dl>
  320. <dt><strong><?php echo $username ?></strong></dt>
  321. <dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>
  322. <dd class="postavatar"><?php echo $user_avatar ?></dd>
  323. <?php if (count($user_info)) echo "\t\t\t\t\t".implode('</dd>'."\n\t\t\t\t\t", $user_info).'</dd>'."\n"; ?>
  324. <?php if (count($user_contacts)) echo "\t\t\t\t\t".'<dd class="usercontacts">'.implode('&nbsp;&nbsp;', $user_contacts).'</dd>'."\n"; ?>
  325. </dl>
  326. </div>
  327. <div class="postright">
  328. <h3><?php if (($post_count + $start_from) > 1) echo ' Re: '; ?><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></h3>
  329. <div class="postmsg">
  330. <?php echo $cur_post['message']."\n" ?>
  331. <?php if ($cur_post['edited'] != '') echo "\t\t\t\t\t".'<p class="postedit"><em>'.$lang_topic['Last edit'].' '.pun_htmlspecialchars($cur_post['edited_by']).' ('.format_time($cur_post['edited']).')</em></p>'."\n"; ?>
  332. </div>
  333. <?php if ($signature != '') echo "\t\t\t\t".'<div class="postsignature"><hr />'.$signature.'</div>'."\n"; ?>
  334. </div>
  335. <div class="clearer"></div>
  336. <div class="postfootleft"><?php if ($cur_post['poster_id'] > 1) echo '<p>'.$is_online.'</p>'; ?></div>
  337. <div class="postfootright"><?php echo (count($post_actions)) ? '<ul>'.implode($lang_topic['Link separator'].'</li>', $post_actions).'</li></ul></div>'."\n" : '<div>&nbsp;</div></div>'."\n" ?>
  338. </div>
  339. </div>
  340. </div>
  341. <?php
  342. }
  343. ?>
  344. <div class="blockform">
  345. <h2><span>Advertisement</span></h2>
  346. <div class="box" align="center">
  347. <div class="inbox">
  348. <div class="infldset">
  349. <?php include('pub.php'); ?>
  350. </div>
  351. </div>
  352. </div>
  353. </div>
  354. <div class="postlinksb">
  355. <div class="inbox">
  356. <p class="postlink conr"><?php echo $post_link ?></p>
  357. <p class="pagelink conl"><?php echo $paging_links ?></p>
  358. <ul><li><a href="forum.php"><?php echo $lang_common['Forum'] ?></a></li>
  359. <li>&nbsp;&raquo;&nbsp;<a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li>
  360. <li>&nbsp;&raquo;&nbsp;<?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li>
  361. <?php
  362. if($evaluate_is_active)
  363. echo '<li>'.$eval.'</li>';
  364. ?>
  365. </ul>
  366. <?php echo $subscraction ?>
  367. </div>
  368. </div>
  369. <?php
  370. if(($evaluate_is_active) && ($can_evaluate))
  371. {
  372. ?>
  373. <div class="blockform">
  374. <h2><span>Rate the debate</span></h2>
  375. <div class="box">
  376. <form method="post" action="evaluate.php">
  377. <div class="inform">
  378. <div class="rbox">
  379. <fieldset>
  380. <legend>How great is this debate?
  381. <input type="hidden" name="form_sent" value="1" />
  382. <input type="hidden" name="topic_id" value="<?php echo $id; ?>" />
  383. <input type="hidden" name="form_user" value="<?php echo pun_htmlspecialchars($pun_user['username']); ?>" />
  384. <label class="labinline"><br />
  385. <br />
  386. </label>
  387. </legend>
  388. <label class="labinline"> It sucks balls&nbsp; <img src="/images/poucebaiss.gif" width="19" height="19" /></label>
  389. <label class="labinline"></label>
  390. <label class="labinline"></label>
  391. <label class="labinline">
  392. <input name="rating" type="radio" value="5" />
  393. <input type="radio" name="rating" value="5" />
  394. </label>
  395. <label class="labinline">
  396. <input type="radio" name="rating" value="6" checked="checked" />
  397. </label>
  398. <label class="labinline">
  399. <input type="radio" name="rating" value="6" />
  400. </label>
  401. <label class="labinline">
  402. <input type="radio" name="rating" value="7" />
  403. <input type="radio" name="rating" value="7" />
  404. </label>
  405. <label class="labinline"></label>
  406. <label class="labinline"></label>
  407. <label class="labinline"></label>
  408. <img src="/images/plus.gif" width="19" height="19" /> Exelent debate
  409. <p>&nbsp; </p>
  410. </fieldset>
  411. </div>
  412. </div>
  413. <p style="text-align: center"><input type="submit" name="submit" tabindex="2" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
  414. </form>
  415. </div>
  416. </div>
  417. <?php
  418. }
  419. // Display quick post if enabled
  420. if ($quickpost)
  421. {
  422. ?>
  423. <div class="blockform">
  424. <h2><span><?php echo $lang_topic['Quick post'] ?></span></h2>
  425. <div class="box">
  426. <form method="post" action="post.php?tid=<?php echo $id ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">
  427. <div class="inform">
  428. <fieldset>
  429. <legend><?php echo $lang_common['Write message legend'] ?></legend>
  430. <div class="infldset txtarea">
  431. <input type="hidden" name="form_sent" value="1" />
  432. <input type="hidden" name="form_user" value="<?php echo (!$pun_user['is_guest']) ? pun_htmlspecialchars($pun_user['username']) : 'Guest'; ?>" />
  433. <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function CountWords
  434. (this_field, show_word_count, show_char_count) { if (show_word_count == null) { show_word_count = true; } if (show_char_count == null) { show_char_count = false; } var char_count = this_field.value.length; var fullStr = this_field.value + " "; var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi; var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, "" ); var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi; var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " " ); var splitString = cleanedStr.split(" " ); var word_count = splitString.length -1; if (fullStr.length <2) { word_count = 0; } if (word_count == 1) { wordOrWords = " mot"; } else { wordOrWords = " mots"; } if (char_count == 1) { charOrChars = " caractère"; } else { charOrChars = " caractères"; } if (show_word_count & show_char_count) { alert ("Word Count:\n" + " " + word_count + wordOrWords + "\n" + " " + char_count + charOrChars); } else { if (show_word_count) { alert ("Word Count: " + word_count + wordOrWords); } else { if (show_char_count) { alert ("Character Count: " + char_count + charOrChars); } } } return word_count; } // End -->  
  435. </script>
  436. <label><textarea name="req_message" rows="7" cols="120" tabindex="1"></textarea>
  437. </label>
  438. <p>&nbsp;</p>
  439. <p><img src="/fluxbb-1.2.22/upload/img/helpbox2.png" width="755" height="284" /></p>
  440. </ul>
  441. </div>
  442. </fieldset>
  443. </div>
  444. <p><input type="submit" name="submit" tabindex="2" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
  445. </form>
  446. </div>
  447. </div>
  448. <?php
  449. }
  450. // Increment "num_views" for topic
  451. $low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
  452. $db->query('UPDATE '.$low_prio.$db->prefix.'topics SET num_views=num_views+1 WHERE id='.$id) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
  453. $forum_id = $cur_topic['forum_id'];
  454. $footer_style = 'viewtopic';
  455. require PUN_ROOT.'footer.php';

mood
Publicité
Posté le 10-10-2009 à 14:45:08  profilanswer
 

n°1930867
NewsletTux
&lt;Insérez ici votre vie /&gt;
Posté le 10-10-2009 à 16:13:21  profilanswer
 

de mémoire il y a ce qu'il faut dans le fichier "external.php" ou quelque chose du genre, qui sert entres autres à constuire des flux RSS.


---------------
NewsletTux - outil de mailing list en PHP MySQL
n°1930968
alex2603
Posté le 11-10-2009 à 13:48:22  profilanswer
 

oui il y a ce fichier mais qu'est ce que j'en fais? ^^

n°1931003
NewsletTux
&lt;Insérez ici votre vie /&gt;
Posté le 11-10-2009 à 21:45:03  profilanswer
 

ouvre-le, la doc est dedans ...
faut faire un lien du style external.php?fid=X


---------------
NewsletTux - outil de mailing list en PHP MySQL
n°1931686
frano9
Posté le 14-10-2009 à 10:34:05  profilanswer
 

Ligne 54 :
$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$id.' ORDER BY posted')
 
Essaye de remplacer par :
$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$id.' ORDER BY posted DESC')


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  message le plus récent en premier page 1 mon forum

 

Sujets relatifs
Carrousel jQuery : ne fonctionne qu'au 2e chargement de la pageprobleme installation de forum sur free
Ch Vbs permettant recherche web et save page txt / Horloge fuseauxLe transfert d'un forum phpBB2...
Copier un paragraphe sur une autre page Word si le tableau contien TOTComposants premier plan et PaintComponent en arrière plan
Créer un flux RSS d'une page web qui n'en propose pas.[JAVASRIPT] HELP ! Chargement page en fonction d'un test sur TEXTAREA
[JS] Pb avec un page de javascripts et module open flash chart 
Plus de sujets relatifs à : message le plus récent en premier page 1 mon forum


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR