Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // How Many Topics you want to display?
- $topicnumber = 7;
- // Change this to your phpBB path
- $urlPath = "/forums";
- define( 'IN_PHPBB', TRUE );
- $phpbb_root_path= defined( 'PHPBB_ROOT_PATH' )? PHPBB_ROOT_PATH: 'forums/';
- $phpEx= substr( strrchr( __FILE__, '.' ), 1 );
- include( $phpbb_root_path. 'common.'. $phpEx );
- include( $phpbb_root_path. 'includes/functions_display.'. $phpEx );
- include( $phpbb_root_path. 'includes/bbcode.'. $phpEx );
- // Database Configuration (Where your phpBB config.php file is located)
- include 'forums/config.php';
- // Start session management
- $user-> session_begin();
- $auth-> acl( $user-> data );
- $table_topics = $table_prefix. "topics";
- $table_forums = $table_prefix. "forums";
- $table_posts = $table_prefix. "posts";
- $table_users = $table_prefix. "users";
- $link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");
- mysql_select_db("$dbname") or die("Could not select database");
- $query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.topic_replies, t.forum_id, p.bbcode_uid, p.bbcode_bitfield, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_id, p.post_text, p.icon_id, p.poster_id, p.post_time, u.group_id, u.user_id, u.username
- FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
- WHERE t.topic_id = p.topic_id AND
- f.forum_id = t.forum_id AND
- t.forum_id = 1 AND
- u.group_id = 4 AND
- p.icon_id = 8 AND
- t.topic_status <> 2 AND
- p.poster_id = u.user_id
- ORDER BY p.post_id DESC LIMIT $topicnumber";
- $result = mysql_query($query) or die("Query failed");
- while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
- $post = censor_text(substr($row[post_text], 0, 400));
- /* // Second parse bbcode
- if( $row['bbcode_bitfield'] ) $bbcode-> bbcode_second_pass( $post, $row['bbcode_uid'], $row['bbcode_bitfield'] );
- // Parse smileys and convert linebreaks to HTML
- $post= smiley_text( bbcode_nl2br( $post ) );
- */
- echo "<div style=\"margin-bottom:30px;\">";
- echo "<h1>" . $row["topic_title"] . "</h1>
- <div class=\"box\">
- <div style=\"text-align:left; padding:3px; margin-top:3px; margin-bottom:5px;\"><em>Posted on " .
- date('F j, Y, g:i a', $row["post_time"]) ." by <a href=\"$urlPath/memberlist.php?mode=viewprofile&u=$row[user_id]\" TARGET=\"_blank\">" . $row["username"] . "</a></em><br />" . $post . "</div><br /><a href=\"$urlPath/viewtopic.php?f=$row[forum_id]&t=$row[topic_id]&p=$row[post_id]#p$row[post_id]\" TARGET=\"_blank\">Read More •</a> " . $row["topic_replies"] . " Comments</div></div>";
- }
- mysql_free_result($result);
- mysql_close($link);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement