Code: Select all
<!-- BEGIN globalrow -->
<!-- IF globalrow.S_FIRST_UNREAD --><a id="unread"></a><!-- ENDIF -->
<div id="p{globalrow.POST_ID}" class="post bg2<!-- IF globalrow.S_UNREAD == 1 --> unreadpost<!-- ENDIF --><!-- IF globalrow.S_POST_REPORTED --> reported<!-- ENDIF -->">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="postbody">
<!-- IF globalrow.S_IGNORE_POST -->
<div class="ignore">{L_IGNORE_POST}</div>
<!-- ELSE -->
<h3 <!-- IF globalrow.S_FIRST_ROW -->class="first"<!-- ENDIF -->><!-- IF globalrow.POST_ICON_IMG --><img src="{T_ICONS_PATH}{globalrow.POST_ICON_IMG}" width="{globalrow.POST_ICON_IMG_WIDTH}" height="{globalrow.POST_ICON_IMG_HEIGHT}" alt="" /> <!-- ENDIF --><a href="{globalrow.U_MINI_POST}">{globalrow.POST_SUBJECT}</a></h3>
<p class="author"><a href="{globalrow.U_MINI_POST}">{globalrow.MINI_POST_IMG}</a>{L_POST_BY_AUTHOR} <strong>{globalrow.POST_AUTHOR_FULL}</strong> {L_POSTED_ON_DATE} {globalrow.POST_DATE} </p>
<!-- IF globalrow.S_POST_UNAPPROVED or globalrow.S_POST_REPORTED -->
<p class="rules">
<!-- IF globalrow.S_POST_UNAPPROVED -->{globalrow.UNAPPROVED_IMG} <a href="{globalrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><!-- ENDIF -->
<!-- IF globalrow.S_POST_REPORTED -->{globalrow.REPORTED_IMG} <a href="{globalrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a><!-- ENDIF -->
</p>
<!-- ENDIF -->
<div class="content">{globalrow.MESSAGE}</div>
<!-- IF globalrow.EDITED_MESSAGE or globalrow.EDIT_REASON -->
<div class="notice">{globalrow.EDITED_MESSAGE}
<!-- IF globalrow.EDIT_REASON --><br /><strong>{L_REASON}:</strong> <em>{globalrow.EDIT_REASON}</em><!-- ENDIF -->
</div>
<!-- ENDIF -->
<!-- IF globalrow.BUMPED_MESSAGE --><div class="notice">{globalrow.BUMPED_MESSAGE}</div><!-- ENDIF -->
<!-- IF globalrow.SIGNATURE --><div id="sig{globalrow.POST_ID}" class="signature">{globalrow.SIGNATURE}</div><!-- ENDIF -->
<!-- ENDIF -->
</div>
<!-- IF not globalrow.S_IGNORE_POST -->
<dl class="postprofile" id="profile{globalrow.POST_ID}">
<dt><!-- IF globalrow.POSTER_AVATAR --><a href="{globalrow.U_POST_AUTHOR}">{globalrow.POSTER_AVATAR}</a><br /><!-- ENDIF -->{globalrow.POST_AUTHOR_FULL}</dt>
<!-- IF globalrow.RANK_TITLE or globalrow.RANK_IMG --><dd>{globalrow.RANK_TITLE}<!-- IF globalrow.RANK_TITLE and globalrow.RANK_IMG --><br /><!-- ENDIF -->{globalrow.RANK_IMG}</dd><!-- ENDIF -->
<dd> </dd>
<!-- IF globalrow.POSTER_POSTS != '' --><dd><strong>{L_POSTS}:</strong> {globalrow.POSTER_POSTS}</dd><!-- ENDIF -->
<!-- IF globalrow.POSTER_JOINED --><dd><strong>{L_JOINED}:</strong> {globalrow.POSTER_JOINED}</dd><!-- ENDIF -->
<!-- IF globalrow.POSTER_FROM --><dd><strong>{L_LOCATION}:</strong> {globalrow.POSTER_FROM}</dd><!-- ENDIF -->
<!-- IF globalrow.S_PROFILE_FIELD1 -->
<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
<dd><strong>{globalrow.PROFILE_FIELD1_NAME}:</strong> {globalrow.PROFILE_FIELD1_VALUE}</dd>
<!-- ENDIF -->
<!-- BEGIN custom_fields -->
<dd><strong>{globalrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {globalrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
<!-- END custom_fields -->
</dl>
<!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div>
</div>
<div style="float: right;">{globalrow.U_VIEW_COMMENTS} • <!-- IF S_USER_LOGGED_IN -->{globalrow.U_POST_COMMENT}<!-- ENDIF --></div>
<br />
<!-- END globalrow -->
<br /><br />
^^ The HTML I'm using
It seems that the while loop doesn't end the HTML segment soon enough. I'm ending up, after all of my useful chunks of data, with another chunk of the pattern that is missing all of the while loop's variables.
Here's my test of it, and the problem is obvious to me (logged in at least):
http://infernalarcade.ej.am/test/home.php
Also, this is the function I'm using (PHP)
Code: Select all
/****\
*
* @function grab_global_contents
* @description Grabs the first global announcement and prepares to display the post in its entire form.
* @globals $db for queries, $user for permissions checking, $config if needed, $auth for permissions check, __
* $phpbb_root_path for filepath, $phpEx for PHP extension, $template for template file prep
*
* @param integer $limit_amt (Number of topics to grab)
* @param boolean $query_global (Which query type to use? Do we go for global announcements or do we go for newest topics in a certain forum?)
* @param integer $forum_scan (Which forum to look in for the topics )
*
* @credit (c) evil<3 ( http://www.phpbbmodders.net/ )
* ( A lot of code reused from the View Single Post MOD, legal under the GNU GPL v2 )
* @function-license http://opensource.org/licenses/gpl-license.php ( GNU Public License )
*
* @usage-example grab_global_contents();
*
\****/
function grab_global_contents($limit_amt = 1, $query_global = true, $forum_scan = 0)
{
global $db, $auth, $user, $template;
global $phpbb_root_path, $phpEx, $config, $cache;
//Grab the newest global announcement
if ($query_global == true)
{
$sql = 'SELECT *
FROM ' . TOPICS_TABLE . "
WHERE forum_id = 0
AND topic_type = " . POST_GLOBAL . "
ORDER BY topic_time DESC
LIMIT $limit_amt";//order by topic creation, use topic_last_post_time for last commented
}
else
{
$sql = 'SELECT *
FROM ' . TOPICS_TABLE . "
WHERE forum_id = $forum_scan
ORDER BY topic_time DESC
LIMIT $limit_amt";//order by topic creation, use topic_last_post_time for last commented
}
$result = $db->sql_query($sql); //Got the data, let's go!
while ($row = $db->sql_fetchrow($result))
{
//$mode = ''; //Don't think we need the mode, do we?
if ($query_global == true)
{
$forum_id = request_var('sf', ANNOUNCEMENT_FORUM);
}
else
{
$forum_id = $forum_scan;
}
$post_id = $row['topic_first_post_id'];
$topic_id = $row['topic_id'];
$sql_array = array(
'SELECT' => 'p.post_id, p.post_approved, f.forum_id',
'FROM' => array(
POSTS_TABLE => 'p',
),
'LEFT_JOIN' => array(
array(
'FROM' => array(FORUMS_TABLE => 'f'),
'ON' => 'f.forum_id = p.forum_id',
),
),
'WHERE' => 'p.post_id = ' . $post_id,
);
$result = $db->sql_query($db->sql_build_query('SELECT', $sql_array));
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$post_approved = $row['post_approved'];
if ($forum_id && !isset($row['forum_id']))
{
// Make sure the forum (from given id) exists
//Unnecessary?
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $forum_id;
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
/*if (isset($row['forum_style']) && $auth->acl_get('f_list', $row['forum_id']))
{
$forum_style = $row['forum_style'];
}
else
{
// Display error
$post_id = $forum_style = 0;
}*/
}
else
{
$forum_id = $row['forum_id'];
//$forum_style = $row['forum_style'];
}
if (!$forum_id)
{
// If no forum_id is given, and the user cannot view any forums, he can't view this.
$forum_ary = $auth->acl_getf('f_read', true);
$forum_ary = array_unique(array_keys($forum_ary));
if (sizeof($forum_ary))
{
$post_id = 0;
}
}
if (!$post_id)
{
trigger_error('NO_POST');
}
$display_notice = $first_unread = $post_unread = false;
$sql_array = array(
'SELECT' => 'p.*, t.topic_id, t.topic_title, t.topic_replies, t.topic_status, t.topic_type, t.topic_first_post_id, t.topic_last_post_id, t.topic_bumped, f.enable_icons, u.*',
'FROM' => array(
FORUMS_TABLE => 'f',
TOPICS_TABLE => 't',
POSTS_TABLE => 'p',
USERS_TABLE => 'u',
),
'WHERE' => "p.post_id = $post_id
AND t.topic_id = p.topic_id
" . ((!$auth->acl_get('m_approve', $forum_id)) ? ' AND p.post_approved = 1' : '') . '
AND t.topic_poster = u.user_id',
);
$sql_array['WHERE'] .= ' AND (f.forum_id = t.forum_id';
/*if (!$forum_id)
{
// If it is a global announcement make sure to set the forum id to a postable forum
$sql_array['WHERE'] .= ' OR (t.topic_type = ' . POST_GLOBAL . '
AND f.forum_type = ' . FORUM_POST . ')';
}
else
{*/
$sql_array['WHERE'] .= ' OR (t.topic_type = ' . POST_GLOBAL . "
AND f.forum_id = $forum_id)";
//}
$sql_array['WHERE'] .= ')';
// Join to forum table on topic forum_id unless topic forum_id is zero
// whereupon we join on the forum_id passed as a parameter ... this
// is done so navigation, forum name, etc. remain consistent with where
// user clicked to view a global topic
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);
$post_data = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$topic_id = (int) $post_data['topic_id'];
// Grab icons
$icons = $cache->obtain_icons();
$poster_id = $post_data['user_id'];
// End signature parsing, only if needed
if ($post_data['user_sig'] && $post_data['enable_sig'])
{
$post_data['user_sig'] = censor_text($post_data['user_sig']);
$post_data['user_sig'] = str_replace("\n", '<br />', $post_data['user_sig']);
$post_data['user_sig'] = generate_text_for_display($post_data['user_sig'], $post_data['user_sig_bbcode_uid'], $post_data['user_sig_bbcode_bitfield'], $post_data['user_options']);
$post_data['user_sig'] = smiley_text($post_data['user_sig']);
}
// Parse the message and subject
$message = censor_text($post_data['post_text']);
// Second parse bbcode here
$post_data['bbcode_options'] = (($post_data['enable_bbcode']) ? OPTION_FLAG_BBCODE : 0) + (($post_data['enable_smilies']) ? OPTION_FLAG_SMILIES : 0) + (($post_data['enable_magic_url']) ? OPTION_FLAG_LINKS : 0);
$message = generate_text_for_display($message, $post_data['bbcode_uid'], $post_data['bbcode_bitfield'], $post_data['bbcode_options']);
$message = str_replace("\n", '<br />', $message);
// Always process smilies after parsing bbcodes
$message = smiley_text($message);
// Replace naughty words such as farty pants
$post_data['post_subject'] = censor_text($post_data['post_subject']);
// Editing information
if (($post_data['post_edit_count'] && $config['display_last_edited']) || $post_data['post_edit_reason'])
{
$l_edit_time_total = ($post_data['post_edit_count'] == 1) ? $user->lang['EDITED_TIME_TOTAL'] : $user->lang['EDITED_TIMES_TOTAL'];
if ($post_data['post_edit_reason'])
{
// User having edited the post also being the post author?
if (!$post_data['post_edit_user'] || $post_data['post_edit_user'] == $poster_id)
{
$display_username = get_username_string('full', $poster_id, $post_data['username'], $post_data['user_colour'], $post_data['post_username']);
}
else
{
$display_username = get_username_string('full', $post_data['post_edit_user'], $post_edit_list[$post_data['post_edit_user']]['username'], $post_edit_list[$post_data['post_edit_user']]['user_colour']);
}
$l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($post_data['post_edit_time']), $post_data['post_edit_count']);
}
else
{
// User having edited the post also being the post author?
if (!$post_data['post_edit_user'] || $post_data['post_edit_user'] == $poster_id)
{
$display_username = get_username_string('full', $poster_id, $post_data['username'], $post_data['user_colour'], $post_data['post_username']);
}
else
{
$display_username = get_username_string('full', $post_data['post_edit_user'], $post_edit_list[$post_data['post_edit_user']]['username'], $post_edit_list[$post_data['post_edit_user']]['user_colour']);
}
$l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($post_data['post_edit_time']), $post_data['post_edit_count']);
}
}
else
{
$l_edited_by = '';
}
$cp_row = array();
if ($config['load_cpf_viewtopic'])
{
$cp_row = (isset($profile_fields_cache[$poster_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields_cache[$poster_id]) : array();
}
$post_unread = (isset($topic_tracking_info[$topic_id]) && $post_data['post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$s_first_unread = false;
if (!$first_unread && $post_unread)
{
$s_first_unread = $first_unread = true;
}
// Emulate user cache (we don't really need caching, since we only have one user)
if ($poster_id == ANONYMOUS)
{
$post_data = array_merge($post_data, array(
'joined' => '',
'posts' => '',
'from' => '',
'sig' => '',
'sig_bbcode_uid' => '',
'sig_bbcode_bitfield' => '',
//'online' => false,
'avatar' => '',
'rank_title' => '',
'rank_image' => '',
'rank_image_src' => '',
'sig' => '',
'posts' => '',
'profile' => '',
'pm' => '',
'email' => '',
'www' => '',
'icq_status_img' => '',
'icq' => '',
'aim' => '',
'msn' => '',
'yim' => '',
'jabber' => '',
'search' => '',
'age' => '',
'username' => $post_data['username'],
'user_colour' => $post_data['user_colour'],
'warnings' => 0,
'allow_pm' => 0,
));
}
else
{
$post_data = array_merge($post_data, array(
'joined' => $user->format_date($post_data['user_regdate']),
'posts' => $post_data['user_posts'],
'warnings' => (isset($post_data['user_warnings'])) ? $post_data['user_warnings'] : 0,
'from' => (!empty($post_data['user_from'])) ? $post_data['user_from'] : '',
'sig' => ($post_data['user_sig'] && $config['allow_sig'] && $user->optionget('viewsigs')) ? $post_data['user_sig'] : '',
'sig_bbcode_uid' => (!empty($post_data['user_sig_bbcode_uid'])) ? $post_data['user_sig_bbcode_uid'] : '',
'sig_bbcode_bitfield' => (!empty($post_data['user_sig_bbcode_bitfield'])) ? $post_data['user_sig_bbcode_bitfield'] : '',
'allow_pm' => $post_data['user_allow_pm'],
'avatar' => ($user->optionget('viewavatars')) ? get_user_avatar($post_data['user_avatar'], $post_data['user_avatar_type'], $post_data['user_avatar_width'], $post_data['user_avatar_height']) : '',
'age' => '',
'rank_title' => '',
'rank_image' => '',
'rank_image_src' => '',
'username' => $post_data['username'],
'user_colour' => $post_data['user_colour'],
//'online' => false,
'profile' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$poster_id"),
'www' => $post_data['user_website'],
'aim' => ($post_data['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=aim&u=$poster_id") : '',
'msn' => ($post_data['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=msnm&u=$poster_id") : '',
'yim' => ($post_data['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . $post_data['user_yim'] . '&.src=pg' : '',
'jabber' => ($post_data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=jabber&u=$poster_id") : '',
'search' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", 'search_author=' . urlencode($post_data['username']) .'&showresults=posts') : '',
));
$post_data['joined'] = $user->format_date($post_data['user_regdate']);
get_user_rank($post_data['user_rank'], $post_data['user_posts'], $post_data['rank_title'], $post_data['rank_image'], $post_data['rank_image_src']);
if (!empty($post_data['user_allow_viewemail']) || $auth->acl_get('a_email'))
{
$post_data['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&u=$poster_id") : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $post_data['user_email']);
}
else
{
$post_data['email'] = '';
}
if (!empty($post_data['user_icq']))
{
$post_data['icq'] = 'http://www.icq.com/people/webmsg.php?to=' . $post_data['user_icq'];
$post_data['icq_status_img'] = '<img src="http://web.icq.com/whitepages/online?icq=' . $post_data['user_icq'] . '&img=5" width="18" height="18" alt="" />';
}
else
{
$post_data['icq_status_img'] = '';
$post_data['icq'] = '';
}
if (!empty($post_data['user_birthday']))
{
list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $post_data['user_birthday']));
if ($bday_year)
{
$diff = $now['mon'] - $bday_month;
if ($diff == 0)
{
$diff = ($now['mday'] - $bday_day < 0) ? 1 : 0;
}
else
{
$diff = ($diff < 0) ? 1 : 0;
}
$post_data['age'] = (int) ($now['year'] - $bday_year - $diff);
}
}
else
{
$post_data['age'] = false;
}
}
$postrow = array(
'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $post_data['username'], $post_data['user_colour'], $post_data['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $post_data['username'], $post_data['user_colour'], $post_data['post_username']),
'POST_AUTHOR' => get_username_string('username', $poster_id, $post_data['username'], $post_data['user_colour'], $post_data['post_username']),
'U_POST_AUTHOR' => get_username_string('profile', $poster_id, $post_data['username'], $post_data['user_colour'], $post_data['post_username']),
'RANK_TITLE' => $post_data['rank_title'],
'RANK_IMG' => $post_data['rank_image'],
'RANK_IMG_SRC' => $post_data['rank_image_src'],
'POSTER_JOINED' => $post_data['joined'],
'POSTER_POSTS' => $post_data['posts'],
'POSTER_FROM' => $post_data['from'],
'POSTER_AVATAR' => $post_data['avatar'],
'POSTER_WARNINGS' => $post_data['warnings'],
'POSTER_AGE' => $post_data['age'],
'POST_DATE' => $user->format_date($post_data['post_time']),
'POST_SUBJECT' => $post_data['post_subject'],
'MESSAGE' => $message,
'SIGNATURE' => ($post_data['enable_sig']) ? $post_data['sig'] : '',
'EDITED_MESSAGE' => $l_edited_by,
'EDIT_REASON' => $post_data['post_edit_reason'],
'BUMPED_MESSAGE' => $l_bumped_by,
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
'POST_ICON_IMG' => ($post_data['enable_icons'] && !empty($post_data['icon_id'])) ? $icons[$post_data['icon_id']]['img'] : '',
'POST_ICON_IMG_WIDTH' => ($post_data['enable_icons'] && !empty($post_data['icon_id'])) ? $icons[$post_data['icon_id']]['width'] : '',
'POST_ICON_IMG_HEIGHT' => ($post_data['enable_icons'] && !empty($post_data['icon_id'])) ? $icons[$post_data['icon_id']]['height'] : '',
'ICQ_STATUS_IMG' => $post_data['icq_status_img'],
//'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($post_data['online']) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')),
//'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($post_data['online']) ? true : false),
'U_EDIT' => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$post_id}") : ''),
'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$post_id}") : '',
'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&f=$forum_id&p=" . $post_id, true, $user->session_id) : '',
'U_DELETE' => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $post_data['topic_last_post_id'] == $post_id && ($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$post_id}") : ''),
'U_PROFILE' => $post_data['profile'],
'U_SEARCH' => $post_data['search'],
'U_PM' => ($poster_id != ANONYMOUS && $config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($post_data['allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&action=quotepost&p=' . $post_id) : '',
'U_EMAIL' => $post_data['email'],
'U_WWW' => $post_data['www'],
'U_ICQ' => $post_data['icq'],
'U_AIM' => $post_data['aim'],
'U_MSN' => $post_data['msn'],
'U_YIM' => $post_data['yim'],
'U_JABBER' => $post_data['jabber'],
'U_VIEW_COMMENTS' => '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $topic_id) . '">' . sprintf($user->lang['VIEW_COMMENTS'], $post_data['topic_replies']) . '</a>',
'U_VIEW_COMMENT' => '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $topic_id) . '">' . $user->lang['VIEW_COMMENT'] . '</a>',
'U_POST_COMMENT' => '<a href="' . append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $forum_id . '&t=' . $topic_id) . '">' . $user->lang['POST_COMMENT'] . '</a>',
'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&p=' . $post_id) : '',
'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $forum_id . '&p=' . $post_id, true, $user->session_id) : '',
'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $forum_id . '&p=' . $post_id, true, $user->session_id) : '',
'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $topic_id),
'U_NOTES' => ($auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $poster_id, true, $user->session_id) : '',
'U_WARN' => ($auth->acl_get('m_warn') && $poster_id != $user->data['user_id'] && $poster_id != ANONYMOUS) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_post&f=' . $forum_id . '&p=' . $post_id, true, $user->session_id) : '',
'POST_ID' => $post_id,
'POSTER_ID' => $poster_id,
//'S_HAS_ATTACHMENTS' => (!empty($attachments)) ? true : false,
'S_POST_UNAPPROVED' => ($post_data['post_approved']) ? false : true,
'S_POST_REPORTED' => ($post_data['post_reported'] && $auth->acl_get('m_report', $forum_id)) ? true : false,
'S_DISPLAY_NOTICE' => $display_notice && $post_data['post_attachment'],
'S_UNREAD_POST' => $post_unread,
'S_FIRST_UNREAD' => $s_first_unread,
'S_CUSTOM_FIELDS' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false,
);
if (isset($cp_row['row']) && sizeof($cp_row['row']))
{
$postrow = array_merge($postrow, $cp_row['row']);
}
$template->assign_block_vars('globalrow', $postrow);
// Post data template variables
if (!empty($cp_row['blockrow']))
{
foreach ($cp_row['blockrow'] as $field_data)
{
$template->assign_block_vars('globalrow.postrow.custom_fields', $field_data);
}
}
// Send vars to template
$template->assign_block_vars('globalrow', array(
'FORUM_ID' => $forum_id,
'TOPIC_ID' => $topic_id,
'TOPIC_TITLE' => censor_text($post_data['topic_title']),
'QUOTE_IMG' => $user->img('icon_post_quote', 'REPLY_WITH_QUOTE'),
'EDIT_IMG' => $user->img('icon_post_edit', 'EDIT_POST'),
'DELETE_IMG' => $user->img('icon_post_delete', 'DELETE_POST'),
'INFO_IMG' => $user->img('icon_post_info', 'VIEW_INFO'),
'PROFILE_IMG' => $user->img('icon_user_profile', 'READ_PROFILE'),
'SEARCH_IMG' => $user->img('icon_user_search', 'SEARCH_USER_POSTS'),
'PM_IMG' => $user->img('icon_contact_pm', 'SEND_PRIVATE_MESSAGE'),
'EMAIL_IMG' => $user->img('icon_contact_email', 'SEND_EMAIL'),
'WWW_IMG' => $user->img('icon_contact_www', 'VISIT_WEBSITE'),
'ICQ_IMG' => $user->img('icon_contact_icq', 'ICQ'),
'AIM_IMG' => $user->img('icon_contact_aim', 'AIM'),
'MSN_IMG' => $user->img('icon_contact_msnm', 'MSNM'),
'YIM_IMG' => $user->img('icon_contact_yahoo', 'YIM'),
'JABBER_IMG' => $user->img('icon_contact_jabber', 'JABBER') ,
'REPORT_IMG' => $user->img('icon_post_report', 'REPORT_POST'),
'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'),
'WARN_IMG' => $user->img('icon_user_warn', 'WARN_USER'),
'U_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id",
));
}
$db->sql_freeresult($result);
}
Soooo...yeah. I'm totally stuck.