Welcome to MalwareRemoval.com,
What if we told you that you could get malware removal help from experts, and that it was 100% free? MalwareRemoval.com provides free support for people with infected computers. Our help, and the tools we use are always 100% free. No hidden catch. We simply enjoy helping others. You enjoy a clean, safe computer.

Malware Removal Instructions

Method of display of these pages to domain pages

Method of display of these pages to domain pages

Unread postby ChrisRLG » December 27th, 2007, 5:58 pm

This is the 'modification' to the forum software - to allow the posting of post messages to a outside page on the domain.

================

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&amp;f={$row['forum_id']}&amp;p={$row['post_id']}") : ''),
			'U_QUOTE'			=> ($auth->acl_get('f_reply', $row['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&amp;f={$row['forum_id']}&amp;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;
}
ChrisRLG
Administrator Emeritus
 
Posts: 17759
Joined: December 16th, 2004, 10:04 am
Location: Southend, Essex, UK
Advertisement
Register to Remove

Re: Method of display of these pages to domain pages

Unread postby ChrisRLG » December 27th, 2007, 8:49 pm

bump
ChrisRLG
Administrator Emeritus
 
Posts: 17759
Joined: December 16th, 2004, 10:04 am
Location: Southend, Essex, UK


Return to main pages



Who is online

Users browsing this forum: No registered users and 2 guests

Contact us:

Advertisements do not imply our endorsement of that product or service. Register to remove all ads. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk. All trademarks are the property of their respective owners.

Member site: UNITE Against Malware