================
You need to repeat (with different names) the file pagemessage.html , but only require one each of pagemessage.php, postmessage.html & edit of functions.php
===========
This is the php file - as pagemessage.php it should be placed in the forum root folder.
You should name the file logically, edit the message number you are going to use, and place in the root of the forum to use.
- Code: Select all
<?php /** * * @package phpBB3 * @version $Id: posts_anywhere.xml 378 2007-03-01 23:08:14Z roadydude $ * @copyright (c) 2006 StarTrekGuide Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** * @ignore */ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.'.$phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup('memberlist'); //get_last_posts(post limit, (topic, forum or post_id), (topic, forum or post)); get_last_posts(1, 1076, 'post'); // Output the page page_header('this rocks'); $template->set_filenames(array( 'body' => 'pagemessage.html') ); page_footer(); ?>
Note the need to edit this line to reflect where you are placing this file - if outside the forum root.
$phpbb_root_path = './';
Note the need to edit this line (The number is the post to be used.)
get_last_posts(1, 1076, 'post');
This is pagemessage.html
A copy needs to be in each of the style/--stylename--/template/ folders - It does not require multi copies with differnet names.
- Code: Select all
<!-- INCLUDE overall_header.html --> <!-- INCLUDE postmessage.html --> <!-- INCLUDE overall_footer.html -->
This is postmessage.html
A copy needs to be in each of the style/--stylename--/template/ folders - It does not require multi copies with differnet names.
- Code: Select all
<!-- BEGIN postrow --> <table class="tablebg" width="100%" cellspacing="1"> <td valign="top"> <table width="100%" cellspacing="5"> <tr> <td> <div class="postbody" id="postdiv{postrow.POST_ID}">{postrow.MESSAGE}</div> </td> </tr> </table> </td> </tr> </table> <!-- END postrow -->
This is to be edited into functions.php and is in the includes folder.
- Code: Select all
Open: includes/functions.php # #Find ?> # - note : this is at the end of the file. # # Add : before function get_last_posts($limit, $extra_id = false, $type = false) { global $db, $phpbb_root_path, $phpEx, $template; global $cache, $user, $auth, $config, $user_cache; include($phpbb_root_path . 'includes/functions_display.' . $phpEx); $extra = false; if ($extra_id) { switch($type) { case 'post': $extra = "AND p.post_id IN ($extra_id)"; break; case 'topic': $extra = "AND p.topic_id IN ($extra_id)"; break; case 'forum': $extra = "AND p.forum_id IN ($extra_id)"; break; } } //find out which forums we have permission to view $auth_ary = $auth->acl_get_list($user->data['user_id'], 'f_read'); $forum_ary = array(); foreach ($auth_ary as $key => $var) { $forum_ary[] = $key; } $forums = implode(', ', $forum_ary); // Grab ranks $ranks = $cache->obtain_ranks(); // Grab icons $icons = $cache->obtain_icons(); //now we get the post infof $sql = 'SELECT p.*, u.* FROM ' . POSTS_TABLE . ' p LEFT JOIN ' . USERS_TABLE . " u ON (u.user_id = p.poster_id) WHERE p.forum_id IN ($forums) $extra ORDER BY post_time DESC LIMIT $limit"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { //load up the avatar $poster_avatar = ''; if (!empty($row['user_avatar'])) { switch ($row['user_avatar_type']) { case AVATAR_UPLOAD: $avatar_path = $phpbb_root_path . $config['avatar_path'] . '/'; break; case AVATAR_GALLERY: $avatar_path = $phpbb_root_path . $config['avatar_gallery_path'] . '/'; break; } $avatar_path .= $row['user_avatar']; $poster_avatar = '<img src="' . $avatar_path . '" height="' . $row['user_avatar_height'] . '" width="' . $row['user_avatar_width'] . '" alt="" />'; } //get user rank get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$row['poster_id']]['rank_title'], $user_cache[$row['poster_id']]['rank_image'], $user_cache[$row['poster_id']]['rank_image_src']); //parse message for display $flags = (($row['enable_bbcode']) ? 1 : 0) + (($row['enable_smilies']) ? 2 : 0) + (($row['enable_magic_url']) ? 4 : 0); $row['post_text'] = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $flags); $template->assign_block_vars('postrow', array( 'MESSAGE' => $row['post_text'], 'RANK_TITLE' => $user_cache[$row['poster_id']]['rank_title'], 'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'POST_AUTHOR_COLOUR'=> get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'POST_DATE' => $user->format_date($row['post_time']), 'POSTER_AVATAR' => $poster_avatar, 'POSTER_FROM' => $row['user_from'], 'POSTER_JOINED' => $user->format_date($row['user_regdate']), 'POSTER_POSTS' => $row['user_posts'], 'POST_SUBJECT' => $row['post_subject'], 'POST_ID' => $row['post_id'], 'SIGNATURE' => ($row['enable_sig']) ? $row['user_sig'] : '', //images 'MINI_POST_IMG' => $user->img('icon_post_target', 'POST'), 'POST_ICON_IMG' => (!empty($row['icon_id'])) ? $icons[$row['icon_id']]['img'] : '', 'POST_ICON_IMG_WIDTH' => (!empty($row['icon_id'])) ? $icons[$row['icon_id']]['width'] : '', 'POST_ICON_IMG_HEIGHT' => (!empty($row['icon_id'])) ? $icons[$row['icon_id']]['height'] : '', 'RANK_IMG' => $user_cache[$row['poster_id']]['rank_image'], 'RANK_IMG_SRC' => $user_cache[$row['poster_id']]['rank_image_src'], //links 'U_EDIT' => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $row['poster_id'] && $auth->acl_get('f_edit', $row['forum_id']) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $row['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$row['forum_id']}&p={$row['post_id']}") : ''), 'U_QUOTE' => ($auth->acl_get('f_reply', $row['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f={$row['forum_id']}&p={$row['post_id']}") : '', 'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p={$row['post_id']}&f={$row['forum_id']}#p{$row['post_id']}"), )); } $db->sql_freeresult($result); return; }