All pastes #967986 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-04-02 19:31 UTC
rendered paste body
<?php

   define('IN_PHPBB', true);
   $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../forum/';
   $phpEx = substr(strrchr(__FILE__, '.'), 1);
   include($phpbb_root_path . 'common.' . $phpEx);
   
   // Start session management
   $user->session_begin();
   
   $sql = 'SELECT p.*, t.*, u.user_id, u.username FROM ' . POSTS_TABLE . ' p JOIN ' . TOPICS_TABLE . ' t JOIN ' . USERS_TABLE . ' u
      ON p.topic_id = t.topic_id
      AND u.user_id = p.poster_id
      ORDER BY p.post_id DESC LIMIT 9';
   $result = $db->sql_query($sql); 
   $texte_forum = "";
   while ($row = $db->sql_fetchrow($result))
   {
      $texte_forum .= '<b><a target=_blank href="' . $phpbb_root_path . './viewtopic.php?t=' . $row['topic_id'] . '">' . substr(utf8_decode($row['topic_title']), 0, 28) . '</a>... </b>';
      $texte_forum .= '<font size=1>Par : <a target=_blank href="' . $phpbb_root_path . './memberlist.php?mode=viewprofile&u=' . $row['user_id'] . '">' . substr(utf8_decode($row['username']), 0, 15) . '</a></font><br />';
   }
?>