[2.0.6] Post icons

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
34
60%
Very Good
12
21%
Good
3
5%
Fair
3
5%
Poor
5
9%
 
Total votes: 57

Nefrit
Registered User
Posts: 25
Joined: Tue Aug 29, 2006 1:07 pm
Contact:

Heyyy

Post by Nefrit »

Heyy post icons on İNDEX.PHP ?
NMSportster
Registered User
Posts: 9
Joined: Fri Sep 01, 2006 9:44 pm

Re: Heyyy

Post by NMSportster »

Running easymod install - Getting this error

Parse error: syntax error, unexpected T_BOOLEAN_OR in /home/grabcash/public_html/testbb/includes/functions.php on line 778

It pertains to this line } if (empty ($template) ) , but if I remove the last ) and run it I don't get the parse error but then I get

FIND FAILED: In file [includes/functions.php] could not find:

}
if ( empty($template) )

MOD script line #576

Help Please!
Nefrit
Registered User
Posts: 25
Joined: Tue Aug 29, 2006 1:07 pm
Contact:

Post by Nefrit »

Post icons on index.php ?

Demo :

FULL SCREEN

Image
User avatar
xliz711x
Registered User
Posts: 47
Joined: Sun Jul 02, 2006 7:54 pm
Contact:

Post by xliz711x »

K I made sure I installed part two correctly and it still doesn't work. This is what my veiwforum.php looks like
<?php
//-- mod : post icon -------------------------------------------------------------------------------
/***************************************************************************
* viewforum.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : [email protected]
*
* $Id: viewforum.php,v 1.139.2.12 2004/03/13 15:08:23 acydburn Exp $
*
*
***************************************************************************/

/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//-- mod : post icon -------------------------------------------------------------------------------
//-- add
include($phpbb_root_path . 'includes/def_icons.'. $phpEx);
//-- fin mod : post icon ---------------------------------------------------------------------------
include($phpbb_root_path . 'includes/functions_separate.'.$phpEx);

//Request the bbcode parsing php page, so we don't call an undefined function ;)
include($phpbb_root_path . 'includes/bbcode.' .$phpEx);

//
// Start initial var setup
//
if ( isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL]) )
{
$forum_id = ( isset($HTTP_GET_VARS[POST_FORUM_URL]) ) ? intval($HTTP_GET_VARS[POST_FORUM_URL]) : intval($HTTP_POST_VARS[POST_FORUM_URL]);
}
else if ( isset($HTTP_GET_VARS['forum']))
{
$forum_id = intval($HTTP_GET_VARS['forum']);
}
else
{
$forum_id = '';
}

$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;

if ( isset($HTTP_GET_VARS['mark']) || isset($HTTP_POST_VARS['mark']) )
{
$mark_read = (isset($HTTP_POST_VARS['mark'])) ? $HTTP_POST_VARS['mark'] : $HTTP_GET_VARS['mark'];
}
else
{
$mark_read = '';
}
//
// End initial var setup
//

//
// Check if the user has actually sent a forum ID with his/her request
// If not give them a nice error page.
//
if ( !empty($forum_id) )
{
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}
}
else
{
message_die(GENERAL_MESSAGE, 'Forum_not_exist');
}

//
// If the query doesn't return any rows this isn't a valid forum. Inform
// the user.
//
if ( !($forum_row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'Forum_not_exist');
}

//
// Start session management
//
$userdata = session_pagestart($user_ip, $forum_id);
init_userprefs($userdata);
//
// End session management
//
//
// Forum view Threshold
//
$sql = "SELECT forum_view_threshold
FROM " . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query forum information.', '', __LINE__, __FILE__, $sql);
}
$forum_information = $db->sql_fetchrow($result);
$forum_view = $forum_information['forum_view_threshold'];

if ($forum_view > $userdata['user_posts'])
{
message_die(GENERAL_MESSAGE, sprintf($lang['Forum_view_threshold_sorry'], $forum_view));

// Added because of registered user and guest conflict
if (!$userdata['session_logged_in'])
{
message_die(GENERAL_MESSAGE, sprintf($lang['Forum_view_threshold_sorry'], $forum_view));
}
}

//
// Start auth check
//
$is_auth = array();
$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row);

if ( !$is_auth['auth_read'] || !$is_auth['auth_view'] )
{
if ( !$userdata['session_logged_in'] )
{
$redirect = POST_FORUM_URL . "=$forum_id" . ( ( isset($start) ) ? "&start=$start" : '' );
redirect(append_sid("login.$phpEx?redirect=viewforum.$phpEx&$redirect", true));
}
//
// The user is not authed to read this forum ...
//
$message = ( !$is_auth['auth_view'] ) ? $lang['Forum_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']);

message_die(GENERAL_MESSAGE, $message);
}
//
// End of auth check
//

//
// Handle marking posts
//
if ( $mark_read == 'topics' )
{
// Begin Simple Subforums MOD
$mark_list = ( isset($HTTP_GET_VARS['mark_list']) ) ? explode(',', $HTTP_GET_VARS['mark_list']) : array($forum_id);
$old_forum_id = $forum_id;
// End Simple Subforums MOD
if ( $userdata['session_logged_in'] )
{
$sql = "SELECT MAX(post_time) AS last_post
FROM " . POSTS_TABLE . "
WHERE forum_id = $forum_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}

if ( $row = $db->sql_fetchrow($result) )
{
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array();
$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();

if ( ( count($tracking_forums) + count($tracking_topics) ) >= 150 && empty($tracking_forums[$forum_id]) )
{
asort($tracking_forums);
unset($tracking_forums[key($tracking_forums)]);
}

if ( $row['last_post'] > $userdata['user_lastvisit'] )
{
$tracking_forums[$forum_id] = time();

// Begin Simple Subforums MOD
$set_cookie = true;
if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) )
{
$HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f'] = serialize($tracking_forums);
}
// End Simple Subforums MOD
}
}
// Begin Simple Subforums MOD
if( $set_cookie )
{
setcookie($board_config['cookie_name'] . '_f', serialize($tracking_forums), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
}
$forum_id = $old_forum_id;
// End Simple Subforums MOD
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="1;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">')
);
}

$message = $lang['Topics_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a> ');
message_die(GENERAL_MESSAGE, $message);
}
//
// End handle marking posts
//

$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : '';
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : '';

//
// Do the forum Prune
//
if ( $is_auth['auth_mod'] && $board_config['prune_enable'] )
{
if ( $forum_row['prune_next'] < time() && $forum_row['prune_enable'] )
{
include($phpbb_root_path . 'includes/prune.'.$phpEx);
require($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
auto_prune($forum_id);
}
}
//
// End of forum prune
//

//
// Obtain list of moderators of each forum
// First users, then groups ... broken into two queries
//
$sql = "SELECT u.user_id, u.username
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
WHERE aa.forum_id = $forum_id
AND aa.auth_mod = " . TRUE . "
AND g.group_single_user = 1
AND ug.group_id = aa.group_id
AND g.group_id = aa.group_id
AND u.user_id = ug.user_id
GROUP BY u.user_id, u.username
ORDER BY u.user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
}

$moderators = array();
while( $row = $db->sql_fetchrow($result) )
{
$moderators[] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>';
}

$sql = "SELECT g.group_id, g.group_name
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
WHERE aa.forum_id = $forum_id
AND aa.auth_mod = " . TRUE . "
AND g.group_single_user = 0
AND g.group_type <> ". GROUP_HIDDEN ."
AND ug.group_id = aa.group_id
AND g.group_id = aa.group_id
GROUP BY g.group_id, g.group_name
ORDER BY g.group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
}

while( $row = $db->sql_fetchrow($result) )
{
$moderators[] = '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $row['group_id']) . '">' . $row['group_name'] . '</a>';
}

$l_moderators = ( count($moderators) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
$forum_moderators = ( count($moderators) ) ? implode(', ', $moderators) : $lang['None'];
unset($moderators);

//
// Generate a 'Show topics in previous x days' select box. If the topicsdays var is sent
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
$previous_days_text = array($lang['All_Topics'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']);

if ( !empty($HTTP_POST_VARS['topicdays']) || !empty($HTTP_GET_VARS['topicdays']) )
{
$topic_days = ( !empty($HTTP_POST_VARS['topicdays']) ) ? intval($HTTP_POST_VARS['topicdays']) : intval($HTTP_GET_VARS['topicdays']);
$min_topic_time = time() - ($topic_days * 86400);

$sql = "SELECT COUNT(t.topic_id) AS forum_topics
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE t.forum_id = $forum_id
AND p.post_id = t.topic_last_post_id
AND p.post_time >= $min_topic_time";

if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain limited topics count information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);

$topics_count = ( $row['forum_topics'] ) ? $row['forum_topics'] : 1;
$limit_topics_time = "AND p.post_time >= $min_topic_time";

if ( !empty($HTTP_POST_VARS['topicdays']) )
{
$start = 0;
}
}
else
{
$topics_count = ( $forum_row['forum_topics'] ) ? $forum_row['forum_topics'] : 1;

$limit_topics_time = '';
$topic_days = 0;
}

$select_topic_days = '<select name="topicdays">';
for($i = 0; $i < count($previous_days); $i++)
{
$selected = ($topic_days == $previous_days[$i]) ? ' selected="selected"' : '';
$select_topic_days .= '<option value="' . $previous_days[$i] . '"' . $selected . '>' . $previous_days_text[$i] . '</option>';
}
$select_topic_days .= '</select>';


//
// All announcement data, this keeps announcements
// on each viewforum page ...
//
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2
WHERE t.forum_id = $forum_id
AND t.topic_poster = u.user_id
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u2.user_id
AND t.topic_type = " . POST_ANNOUNCE . "
ORDER BY t.topic_last_post_id DESC ";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}

$topic_rowset = array();
$total_announcements = 0;
while( $row = $db->sql_fetchrow($result) )
{
$topic_rowset[] = $row;
$total_announcements++;
}

$db->sql_freeresult($result);

//
// Grab all the basic data (all topics except announcements)
// for this forum
//
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
WHERE t.forum_id = $forum_id
AND t.topic_poster = u.user_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND u2.user_id = p2.poster_id
AND t.topic_type <> " . POST_ANNOUNCE . "
$limit_topics_time
ORDER BY t.topic_type DESC, t.topic_last_post_id DESC
LIMIT $start, ".$board_config['topics_per_page'];
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}

$total_topics = 0;
while( $row = $db->sql_fetchrow($result) )
{
$topic_rowset[] = $row;
$total_topics++;
}

$db->sql_freeresult($result);

//
// Total topics ...
//
$total_topics += $total_announcements;
$dividers = get_dividers($topic_rowset);


//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);

//
// Post URL generation for templating vars
//
$template->assign_vars(array(
'L_DISPLAY_TOPICS' => $lang['Display_topics'],

'U_POST_NEW_TOPIC' => append_sid("posting.$phpEx?mode=newtopic&" . POST_FORUM_URL . "=$forum_id"),

'S_SELECT_TOPIC_DAYS' => $select_topic_days,
'S_POST_DAYS_ACTION' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_id . "&start=$start"))
);

//
// User authorisation levels output
//
$s_auth_can = ( ( $is_auth['auth_post'] ) ? $lang['Rules_post_can'] : $lang['Rules_post_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_reply'] ) ? $lang['Rules_reply_can'] : $lang['Rules_reply_cannot'] ) . '<br />';
//MOD-REPLACE: Remove Users Signature & Editing Privileges ----------------------------------------
//added: && $userdata['user_allowedit']
$s_auth_can .= ( ( $is_auth['auth_edit'] && $userdata['user_allowedit'] ) ? $lang['Rules_edit_can'] : $lang['Rules_edit_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_delete'] ) ? $lang['Rules_delete_can'] : $lang['Rules_delete_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . '<br />';
//-- mod : calendar --------------------------------------------------------------------------------
//-- add
$s_auth_can .= ( ( $is_auth['auth_cal'] ) ? $lang['Rules_calendar_can'] : $lang['Rules_calendar_cannot'] ) . '<br />';
//-- fin mod : calendar ----------------------------------------------------------------------------

if ( $is_auth['auth_mod'] )
{
$s_auth_can .= sprintf($lang['Rules_moderate'], "<a href=\"modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&start=" . $start . "&sid=" . $userdata['session_id'] . '">', '</a>');
}

//
// Mozilla navigation bar
//
$nav_links['up'] = array(
'url' => append_sid('index.'.$phpEx),
'title' => sprintf($lang['Forum_Index'], $board_config['sitename'])
);

//
// Dump out the page header and load viewforum template
//
define('SHOW_ONLINE', true);
$page_title = $lang['View_forum'] . ' - ' . $forum_row['forum_name'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$template->set_filenames(array(
'body' => 'viewforum_body.tpl')
);
// Begin Simple Subforums MOD
$all_forums = array();
make_jumpbox_ref('viewforum.'.$phpEx, $forum_id, $all_forums);
// End Simple Subforums MOD

$template->assign_vars(array(
'FORUM_ID' => $forum_id,
'FORUM_NAME' => $forum_row['forum_name'],
'MODERATORS' => $forum_moderators,
'POST_IMG' => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'],

'FOLDER_IMG' => $images['folder'],
'FOLDER_NEW_IMG' => $images['folder_new'],
'FOLDER_HOT_IMG' => $images['folder_hot'],
'FOLDER_HOT_NEW_IMG' => $images['folder_hot_new'],
'FOLDER_LOCKED_IMG' => $images['folder_locked'],
'FOLDER_LOCKED_NEW_IMG' => $images['folder_locked_new'],
'FOLDER_STICKY_IMG' => $images['folder_sticky'],
'FOLDER_STICKY_NEW_IMG' => $images['folder_sticky_new'],
'FOLDER_ANNOUNCE_IMG' => $images['folder_announce'],
'FOLDER_ANNOUNCE_NEW_IMG' => $images['folder_announce_new'],

'L_TOPICS' => $lang['Topics'],
'L_REPLIES' => $lang['Replies'],
'L_VIEWS' => $lang['Views'],
'L_POSTS' => $lang['Posts'],
'L_LASTPOST' => $lang['Last_Post'],
'L_MODERATOR' => $l_moderators,
'L_MARK_TOPICS_READ' => $lang['Mark_all_topics'],
'L_POST_NEW_TOPIC' => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'],
'L_NO_NEW_POSTS' => $lang['No_new_posts'],
'L_NEW_POSTS' => $lang['New_posts'],
'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'],
'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'],
'L_NO_NEW_POSTS_HOT' => $lang['No_new_posts_hot'],
'L_NEW_POSTS_HOT' => $lang['New_posts_hot'],
'L_ANNOUNCEMENT' => $lang['Post_Announcement'],
'L_STICKY' => $lang['Post_Sticky'],
'L_POSTED' => $lang['Posted'],
'L_JOINED' => $lang['Joined'],
'L_AUTHOR' => $lang['Author'],

'S_AUTH_LIST' => $s_auth_can,

'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id"),

'U_MARK_READ' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&mark=topics"))
);
// Begin Simple Subforums MOD
if( $forum_row['forum_parent'] )
{
$parent_id = $forum_row['forum_parent'];
for( $i = 0; $i < count($all_forums); $i++ )
{
if( $all_forums[$i]['forum_id'] == $parent_id )
{
$template->assign_vars(array(
'PARENT_FORUM' => 1,
'U_VIEW_PARENT_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL .'=' . $all_forums[$i]['forum_id']),
'PARENT_FORUM_NAME' => $all_forums[$i]['forum_name'],
));
}
}
}
else
{
$sub_list = array();
for( $i = 0; $i < count($all_forums); $i++ )
{
if( $all_forums[$i]['forum_parent'] == $forum_id )
{
$sub_list[] = $all_forums[$i]['forum_id'];
}
}
if( count($sub_list) )
{
$sub_list[] = $forum_id;
$template->vars['U_MARK_READ'] .= '&mark_list=' . implode(',', $sub_list);
}
}
// assign additional variables for subforums mod
$template->assign_vars(array(
'NUM_TOPICS' => $forum_row['forum_topics'],
'CAN_POST' => $is_auth['auth_post'] ? 1 : 0,
'L_FORUM' => $lang['Forum'],
));

// End Simple Subforums MOD

//
// End header
//

//
// Okay, lets dump out the page ...
//
if( $total_topics )
{
for($i = 0; $i < $total_topics; $i++)
{
$topic_id = $topic_rowset[$i]['topic_id'];

$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
//Parse smilies to show the title
//This is where you would put the code to disable certain smilies
$topic_title = smilies_pass($topic_title);

$replies = $topic_rowset[$i]['topic_replies'];

$topic_type = $topic_rowset[$i]['topic_type'];
//-- mod : post icon -------------------------------------------------------------------------------
//-- add
$type = $topic_rowset[$i]['topic_type'];
if ($type == POST_NORMAL)
{
if (!empty($topic_rowset[$i]['topic_calendar_time']))
{
$type = POST_CALENDAR;
}
if (!empty($topic_rowset[$i]['topic_pic_url']))
{
$type = POST_PICTURE;
}
}
$icon = get_icon_title($topic_rowset[$i]['topic_icon'], 1, $type);
//-- fin mod : post icon ---------------------------------------------------------------------------

if( $topic_type == POST_ANNOUNCE )
{
$topic_type = $lang['Topic_Announcement'] . ' ';
}
else if( $topic_type == POST_STICKY )
{
$topic_type = $lang['Topic_Sticky'] . ' ';
}
else
{
$topic_type = '';
}

if( $topic_rowset[$i]['topic_vote'] )
{
$topic_type .= $lang['Topic_Poll'] . ' ';
}

if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED )
{
$topic_type = $lang['Topic_Moved'] . ' ';
$topic_id = $topic_rowset[$i]['topic_moved_id'];

$folder_image = $images['folder'];
$folder_alt = $lang['Topics_Moved'];
$newest_post_img = '';
}
else
{
if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE )
{
$folder = $images['folder_announce'];
$folder_new = $images['folder_announce_new'];
}
else if( $topic_rowset[$i]['topic_type'] == POST_STICKY )
{
$folder = $images['folder_sticky'];
$folder_new = $images['folder_sticky_new'];
}
else if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED )
{
$folder = $images['folder_locked'];
$folder_new = $images['folder_locked_new'];
}
else
{
if($replies >= $board_config['hot_threshold'])
{
$folder = $images['folder_hot'];
$folder_new = $images['folder_hot_new'];
}
else
{
$folder = $images['folder'];
$folder_new = $images['folder_new'];
}
}

$newest_post_img = '';
if( $userdata['session_logged_in'] )
{
if( $topic_rowset[$i]['post_time'] > $userdata['user_lastvisit'] )
{
if( !empty($tracking_topics) || !empty($tracking_forums) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
{
$unread_topics = true;

if( !empty($tracking_topics[$topic_id]) )
{
if( $tracking_topics[$topic_id] >= $topic_rowset[$i]['post_time'] )
{
$unread_topics = false;
}
}

if( !empty($tracking_forums[$forum_id]) )
{
if( $tracking_forums[$forum_id] >= $topic_rowset[$i]['post_time'] )
{
$unread_topics = false;
}
}

if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
{
if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] >= $topic_rowset[$i]['post_time'] )
{
$unread_topics = false;
}
}

if( $unread_topics )
{
$folder_image = $folder_new;
$folder_alt = $lang['New_posts'];

$newest_post_img = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> ';
}
else
{
$folder_image = $folder;
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

$newest_post_img = '';
}
}
else
{
$folder_image = $folder_new;
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['New_posts'];

$newest_post_img = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> ';
}
}
else
{
$folder_image = $folder;
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

$newest_post_img = '';
}
}
else
{
$folder_image = $folder;
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

$newest_post_img = '';
}
}

if( ( $replies + 1 ) > $board_config['posts_per_page'] )
{
$total_pages = ceil( ( $replies + 1 ) / $board_config['posts_per_page'] );
$goto_page = ' [ <img src="' . $images['icon_gotopost'] . '" alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': ';

$times = 1;
for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page'])
{
$goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . '">' . $times . '</a>';
if( $times == 1 && $total_pages > 4 )
{
$goto_page .= ' ... ';
$times = $total_pages - 3;
$j += ( $total_pages - 4 ) * $board_config['posts_per_page'];
}
else if ( $times < $total_pages )
{
$goto_page .= ', ';
}
$times++;
}
$goto_page .= ' ] ';
}
else
{
$goto_page = '';
}

$view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");

$topic_author = ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $topic_rowset[$i]['user_id']) . '">' : '';
$topic_author .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? $topic_rowset[$i]['username'] : ( ( $topic_rowset[$i]['post_username'] != '' ) ? $topic_rowset[$i]['post_username'] : $lang['Guest'] );

$topic_author .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? '</a>' : '';

$first_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['topic_time'], $board_config['board_timezone']);

$last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']);
//
// MOD - TODAY AT - BEGIN
//
if ( $board_config['time_today'] < $topic_rowset[$i]['post_time'])
{
$last_post_time = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']));
}
else if ( $board_config['time_yesterday'] < $topic_rowset[$i]['post_time'])
{
$last_post_time = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']));
}
// MOD - TODAY AT - END


$last_post_author = ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? ( ($topic_rowset[$i]['post_username2'] != '' ) ? $topic_rowset[$i]['post_username2'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $topic_rowset[$i]['id2']) . '">' . $topic_rowset[$i]['user2'] . '</a>';

$last_post_url = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $topic_rowset[$i]['topic_last_post_id']) . '#' . $topic_rowset[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" /></a>';

$views = $topic_rowset[$i]['topic_views'];

$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

$template->assign_block_vars('topicrow', array(
//-- mod : post icon -------------------------------------------------------------------------------
//-- add
'ICON' => $icon,
//-- fin mod : post icon ---------------------------------------------------------------------------
'ROW_COLOR' => $row_color,
'ROW_CLASS' => $row_class,
'FORUM_ID' => $forum_id,
'TOPIC_ID' => $topic_id,
'TOPIC_FOLDER_IMG' => $folder_image,
'TOPIC_AUTHOR' => $topic_author,
'GOTO_PAGE' => $goto_page,
'REPLIES' => $replies,
'NEWEST_POST_IMG' => $newest_post_img,
'TOPIC_TITLE' => $topic_title,
'TOPIC_TYPE' => $topic_type,
'VIEWS' => $views,
'FIRST_POST_TIME' => $first_post_time,
'LAST_POST_TIME' => $last_post_time,
'LAST_POST_AUTHOR' => $last_post_author,
'LAST_POST_IMG' => $last_post_url,

'L_TOPIC_FOLDER_ALT' => $folder_alt,

'U_VIEW_TOPIC' => $view_topic_url)
);
if ( array_key_exists($i, $dividers) )
{
$template->assign_block_vars('topicrow.divider', array(
'L_DIV_HEADERS' => $dividers[$i])
);
}

}

$topics_count -= $total_announcements;

$template->assign_vars(array(
'PAGINATION' => generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start),
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $topics_count / $board_config['topics_per_page'] )),

'L_GOTO_PAGE' => $lang['Goto_page'])
);
}
else
{
//
// No topics
//
$no_topics_msg = ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['No_topics_post_one'];
$template->assign_vars(array(
'L_NO_TOPICS' => $no_topics_msg)
);

$template->assign_block_vars('switch_no_topics', array() );

}
// Begin Simple Subforums MOD
switch(SQL_LAYER)
{
case 'postgresql':
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
WHERE p.post_id = f.forum_last_post_id
AND u.user_id = p.poster_id
AND f.forum_parent = '{$forum_id}'
UNION (
SELECT f.*, NULL, NULL, NULL, NULL
FROM " . FORUMS_TABLE . " f
WHERE NOT EXISTS (
SELECT p.post_time
FROM " . POSTS_TABLE . " p
WHERE p.post_id = f.forum_last_post_id
)
)
ORDER BY cat_id, forum_order";
break;

case 'oracle':
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
WHERE p.post_id = f.forum_last_post_id(+)
AND u.user_id = p.poster_id(+)
AND f.forum_parent = '{$forum_id}'
ORDER BY f.cat_id, f.forum_order";
break;

default:
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
FROM (( " . FORUMS_TABLE . " f
LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
WHERE f.forum_parent = '{$forum_id}'
ORDER BY f.cat_id, f.forum_order";
break;
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query subforums information', '', __LINE__, __FILE__, $sql);
}

$subforum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$subforum_data[] = $row;
}
$db->sql_freeresult($result);

if ( ($total_forums = count($subforum_data)) > 0 )
{
//
// Find which forums are visible for this user
//
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $subforum_data);

$display_forums = false;
for( $j = 0; $j < $total_forums; $j++ )
{
if ( $is_auth_ary[$subforum_data[$j]['forum_id']]['auth_view'] )
{
$display_forums = true;
}
}

if( !$display_forums )
{
$total_forums = 0;
}
}

if( $total_forums )
{
$template->assign_var('HAS_SUBFORUMS', 1);
$template->assign_block_vars('catrow', array(
'CAT_ID' => $forum_id,
'CAT_DESC' => $forum_row['forum_name'],
'U_VIEWCAT' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id"),
));

//
// Obtain a list of topic ids which contain
// posts made since user last visited
//
if ( $userdata['session_logged_in'] )
{
$sql = "SELECT t.forum_id, t.topic_id, p.post_time
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE p.post_id = t.topic_last_post_id
AND p.post_time > " . $userdata['user_lastvisit'] . "
AND t.topic_moved_id = 0";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql);
}

$new_topic_data = array();
while( $topic_data = $db->sql_fetchrow($result) )
{
$new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time'];
}
$db->sql_freeresult($result);
}
//
// Obtain list of moderators of each forum
// First users, then groups ... broken into two queries
//
$subforum_moderators = array();
$sql = "SELECT aa.forum_id, u.user_id, u.username
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
WHERE aa.auth_mod = " . TRUE . "
AND g.group_single_user = 1
AND ug.group_id = aa.group_id
AND g.group_id = aa.group_id
AND u.user_id = ug.user_id
GROUP BY u.user_id, u.username, aa.forum_id
ORDER BY aa.forum_id, u.user_id";
if ( !($result = $db->sql_query($sql, false, true)) )
{
message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
}

while( $row = $db->sql_fetchrow($result) )
{
$subforum_moderators[$row['forum_id']][] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>';
}
$db->sql_freeresult($result);

$sql = "SELECT aa.forum_id, g.group_id, g.group_name
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
WHERE aa.auth_mod = " . TRUE . "
AND g.group_single_user = 0
AND g.group_type <> " . GROUP_HIDDEN . "
AND ug.group_id = aa.group_id
AND g.group_id = aa.group_id
GROUP BY g.group_id, g.group_name, aa.forum_id
ORDER BY aa.forum_id, g.group_id";
if ( !($result = $db->sql_query($sql, false, true)) )
{
message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
}

while( $row = $db->sql_fetchrow($result) )
{
$subforum_moderators[$row['forum_id']][] = '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $row['group_id']) . '">' . $row['group_name'] . '</a>';
}
$db->sql_freeresult($result);

// show subforums
for( $j = 0; $j < $total_forums; $j++ )
{
$subforum_id = $subforum_data[$j]['forum_id'];

if ( $is_auth_ary[$subforum_id]['auth_view'] )
{
$unread_topics = false;
if ( $subforum_data[$j]['forum_status'] == FORUM_LOCKED )
{
$folder_image = $images['forum_locked'];
$folder_alt = $lang['Forum_locked'];
}
else
{
if ( $userdata['session_logged_in'] )
{
if ( !empty($new_topic_data[$subforum_id]) )
{
$subforum_last_post_time = 0;

while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$subforum_id]) )
{
if ( empty($tracking_topics[$check_topic_id]) )
{
$unread_topics = true;
$subforum_last_post_time = max($check_post_time, $subforum_last_post_time);
}
else
{
if ( $tracking_topics[$check_topic_id] < $check_post_time )
{
$unread_topics = true;
$subforum_last_post_time = max($check_post_time, $subforum_last_post_time);
}
}
}
if ( !empty($tracking_forums[$subforum_id]) )
{
if ( $tracking_forums[$subforum_id] > $subforum_last_post_time )
{
$unread_topics = false;
}
}
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
{
if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $subforum_last_post_time )
{
$unread_topics = false;
}
}

}
}

$folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum'];
$folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts'];
}

$posts = $subforum_data[$j]['forum_posts'];
$topics = $subforum_data[$j]['forum_topics'];

if ( $subforum_data[$j]['forum_last_post_id'] )
{
$last_post_time = create_date($board_config['default_dateformat'], $subforum_data[$j]['post_time'], $board_config['board_timezone']);

$last_post = $last_post_time . '<br />';

$last_post .= ( $subforum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($subforum_data[$j]['post_username'] != '' ) ? $subforum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $subforum_data[$j]['user_id']) . '">' . $subforum_data[$j]['username'] . '</a> ';

$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $subforum_data[$j]['forum_last_post_id']) . '#' . $subforum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
}
else
{
$last_post = $lang['No_Posts'];
}

if ( count($subforum_moderators[$subforum_id]) > 0 )
{
$l_moderators = ( count($subforum_moderators[$subforum_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
$moderator_list = implode(', ', $subforum_moderators[$subforum_id]);
}
else
{
$l_moderators = '&nbsp;';
$moderator_list = '';
}

$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

$template->assign_block_vars('catrow.forumrow', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'FORUM_FOLDER_IMG' => $folder_image,
'FORUM_NAME' => $subforum_data[$j]['forum_name'],
'FORUM_DESC' => $subforum_data[$j]['forum_desc'],
'POSTS' => $subforum_data[$j]['forum_posts'],
'TOPICS' => $subforum_data[$j]['forum_topics'],
'LAST_POST' => $last_post,
'MODERATORS' => $moderator_list,
'ID' => $subforum_data[$j]['forum_id'],
'UNREAD' => intval($unread_topics),
'LAST_POST_TIME' => $last_post_time,

'L_MODERATOR' => $l_moderators,
'L_FORUM_FOLDER_ALT' => $folder_alt,

'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$subforum_id"))
);

}
}
}
// End Simple Subforums MOD

//
// Parse the page and print
//
$template->pparse('body');

//
// Page footer
//
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>

veiwforum_body.tpl looks like
<!-- mod : post icon -->
<form method="post" action="{S_POST_DAYS_ACTION}">
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><br /><span class="gensmall"><b>{L_MODERATOR}: {MODERATORS}<br /><br />{LOGGED_IN_USER_LIST}</b></span></td>
<td align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><b>{PAGINATION}</b></span></td>
</tr>
<tr>
<td align="left" valign="middle" width="50"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" /></a></td>
<td align="left" valign="middle" class="nav" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a> <!-- IF PARENT_FORUM --> -> <a class="nav" href="{U_VIEW_PARENT_FORUM}">{PARENT_FORUM_NAME}</a> <!-- ENDIF --> -> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>
<td align="right" valign="bottom" class="nav" nowrap="nowrap"><span class="gensmall"><a href="{U_MARK_READ}">{L_MARK_TOPICS_READ}</a></span></td>
</tr>
</table>
<!-- BEGIN catrow -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th colspan="2" class="thCornerL" height="25" nowrap="nowrap">&nbsp;{catrow.CAT_DESC}&nbsp;</th>
<th width="50" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>
<th width="50" class="thTop" nowrap="nowrap">&nbsp;{L_POSTS}&nbsp;</th>
<th class="thCornerR" nowrap="nowrap">&nbsp;{L_LASTPOST}&nbsp;</th>
</tr>
<!-- BEGIN forumrow -->
<tr>
<td class="row1" align="center" valign="middle" height="50"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
<td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink<!-- IF catrow.forumrow.UNREAD --> topic-new<!-- ENDIF -->">{catrow.forumrow.FORUM_NAME}</a><br />
</span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
</span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.TOPICS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.POSTS}</span></td>
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
</tr>
<!-- END forumrow -->
</table>
<br />
<!-- END catrow -->

<!-- IF NUM_TOPICS || ! HAS_SUBFORUMS -->

<table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline">
<tr>
<th colspan="3" align="center" height="25" class="thCornerL" nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>
<th width="50" align="center" class="thTop" nowrap="nowrap">&nbsp;{L_REPLIES}&nbsp;</th>
<th width="100" align="center" class="thTop" nowrap="nowrap">&nbsp;{L_AUTHOR}&nbsp;</th>
<th width="50" align="center" class="thTop" nowrap="nowrap">&nbsp;{L_VIEWS}&nbsp;</th>
<th align="center" class="thCornerR" nowrap="nowrap">&nbsp;{L_LASTPOST}&nbsp;</th>
</tr>
<!-- BEGIN topicrow -->
<!-- BEGIN divider -->
<tr>
<td class="catHead" colspan="6" height="28"><span class="cattitle">{topicrow.divider.L_DIV_HEADERS}</span></td>
</tr>
<!-- END divider -->
<tr>
<td class="row1" align="center" valign="middle" width="20"><img src="{topicrow.TOPIC_FOLDER_IMG}" width="19" height="18" alt="{topicrow.L_TOPIC_FOLDER_ALT}" title="{topicrow.L_TOPIC_FOLDER_ALT}" /></td>
<td class="row1" align="center" valign="middle" width="20">{topicrow.ICON}</td>
<td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />
{topicrow.GOTO_PAGE}</span></td>
<td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.REPLIES}</span></td>
<td class="row3" align="center" valign="middle"><span class="name">{topicrow.TOPIC_AUTHOR}</span></td>
<td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.VIEWS}</span></td>
<td class="row3Right" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{topicrow.LAST_POST_TIME}<br />{topicrow.LAST_POST_AUTHOR} {topicrow.LAST_POST_IMG}</span></td>
</tr>
<!-- END topicrow -->
<!-- BEGIN switch_no_topics -->
<tr>
<td class="row1" colspan="7" height="30" align="center" valign="middle"><span class="gen">{L_NO_TOPICS}</span></td>
</tr>
<!-- END switch_no_topics -->
<tr>
<td class="catBottom" align="center" valign="middle" colspan="7" height="28"><span class="genmed">{L_DISPLAY_TOPICS}:&nbsp;{S_SELECT_TOPIC_DAYS}&nbsp;
<input type="submit" class="liteoption" value="{L_GO}" name="submit" />
</span></td>
</tr>
</table>

<table width="100%" cellspacing="2" border="0" align="center" cellpadding="2">
<tr>
<td align="left" valign="middle" width="50"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" /></a></td>
<td align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a> <!-- IF PARENT_FORUM --> -> <a class="nav" href="{U_VIEW_PARENT_FORUM}">{PARENT_FORUM_NAME}</a><!-- ENDIF --> -> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>
<td align="right" valign="middle" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span>
</td>
</tr>
<tr>
<td align="left" colspan="3"><span class="nav">{PAGE_NUMBER}</span></td>
</tr>
</table>
</form>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right">{JUMPBOX}</td>
</tr>
</table>

<table width="100%" cellspacing="0" border="0" align="center" cellpadding="0">
<tr>
<td align="left" valign="top"><table cellspacing="3" cellpadding="0" border="0">
<tr>
<td width="20" align="left"><img src="{FOLDER_NEW_IMG}" alt="{L_NEW_POSTS}" width="19" height="18" /></td>
<td class="gensmall">{L_NEW_POSTS}</td>
<td>&nbsp;&nbsp;</td>
<td width="20" align="center"><img src="{FOLDER_IMG}" alt="{L_NO_NEW_POSTS}" width="19" height="18" /></td>
<td class="gensmall">{L_NO_NEW_POSTS}</td>
<td>&nbsp;&nbsp;</td>
<td width="20" align="center"><img src="{FOLDER_ANNOUNCE_IMG}" alt="{L_ANNOUNCEMENT}" width="19" height="18" /></td>
<td class="gensmall">{L_ANNOUNCEMENT}</td>
</tr>
<tr>
<td width="20" align="center"><img src="{FOLDER_HOT_NEW_IMG}" alt="{L_NEW_POSTS_HOT}" width="19" height="18" /></td>
<td class="gensmall">{L_NEW_POSTS_HOT}</td>
<td>&nbsp;&nbsp;</td>
<td width="20" align="center"><img src="{FOLDER_HOT_IMG}" alt="{L_NO_NEW_POSTS_HOT}" width="19" height="18" /></td>
<td class="gensmall">{L_NO_NEW_POSTS_HOT}</td>
<td>&nbsp;&nbsp;</td>
<td width="20" align="center"><img src="{FOLDER_STICKY_IMG}" alt="{L_STICKY}" width="19" height="18" /></td>
<td class="gensmall">{L_STICKY}</td>
</tr>
<tr>
<td class="gensmall"><img src="{FOLDER_LOCKED_NEW_IMG}" alt="{L_NEW_POSTS_LOCKED}" width="19" height="18" /></td>
<td class="gensmall">{L_NEW_POSTS_LOCKED}</td>
<td>&nbsp;&nbsp;</td>
<td class="gensmall"><img src="{FOLDER_LOCKED_IMG}" alt="{L_NO_NEW_POSTS_LOCKED}" width="19" height="18" /></td>
<td class="gensmall">{L_NO_NEW_POSTS_LOCKED}</td>
</tr>
</table></td>
<td align="right"><span class="gensmall">{S_AUTH_LIST}</span></td>
</tr>
</table>
<!-- ELSE -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right">{JUMPBOX}</td>
</tr>
</table>
<!-- ENDIF -->


So I don't know what's wrong please help?
plc
Registered User
Posts: 39
Joined: Fri Sep 01, 2006 5:09 am

Post by plc »

*oops sorry
plc
Registered User
Posts: 39
Joined: Fri Sep 01, 2006 5:09 am

Re: Heyyy

Post by plc »

NMSportster wrote: Running easymod install - Getting this error

Parse error: syntax error, unexpected T_BOOLEAN_OR in /home/grabcash/public_html/testbb/includes/functions.php on line 778

It pertains to this line } if (empty ($template) ) , but if I remove the last ) and run it I don't get the parse error but then I get

FIND FAILED: In file [includes/functions.php] could not find:

}
if ( empty($template) )

MOD script line #576

Help Please!


change the installfile, it has to be

Code: Select all

if ( empty($template) || empty($theme) ) 
check page 17 of this topic for changes to be made in the install file to be able to install this with EasyMod.
I do not recommend easymod for this mod. I have done it manually end it works (for just one small detail...)
plc
Registered User
Posts: 39
Joined: Fri Sep 01, 2006 5:09 am

Post by plc »

xliz711x wrote:
Okinesu wrote:All errors fixed. Now I have a new problem:

Whenever I post a new thread with a post icon, the icon does not show up in the second column (the column where the icon should be, the column between the column with the thread name and the column with the "no new posts" image. I have no idea where I could fix this at, any help?

See the an example of the problem here.


I'm having the same problem how did you fix this?

Or anyone else please help?


I also have a similar problem. The icon does not show up when e NEW topic is made, only when a topic is EDITED...

So I always have to make a topic, and then edit it and select the icon again to make it show up...
User avatar
xliz711x
Registered User
Posts: 47
Joined: Sun Jul 02, 2006 7:54 pm
Contact:

Post by xliz711x »

Mine won't even show on the edit.
plc
Registered User
Posts: 39
Joined: Fri Sep 01, 2006 5:09 am

Post by plc »

xliz711x wrote: Mine won't even show on the edit.


do u even have the tables where icons should show up?
User avatar
xliz711x
Registered User
Posts: 47
Joined: Sun Jul 02, 2006 7:54 pm
Contact:

Post by xliz711x »

yes
plc
Registered User
Posts: 39
Joined: Fri Sep 01, 2006 5:09 am

Post by plc »

I dont think i can help u with this one...
i dont see a problem in your files.

have u tried to change the collspan to "3" in this line?

Code: Select all

<th colspan="2" class="thCornerL" height="25" nowrap="nowrap">&nbsp;{catrow.CAT_DESC}&nbsp;</th> 
i don't know, just suggesting...

do u have subforums?
User avatar
xliz711x
Registered User
Posts: 47
Joined: Sun Jul 02, 2006 7:54 pm
Contact:

Post by xliz711x »

I'm not sure I know I changed one of the "2" to "3". I'll try it, and yes I do have subforums.
plc
Registered User
Posts: 39
Joined: Fri Sep 01, 2006 5:09 am

Post by plc »

neox3 wrote: Would it be possible make a dropdown-list where you can sort all threads
depending wich icon they have?


or a search addon to search topics with a specific icon...
User avatar
xliz711x
Registered User
Posts: 47
Joined: Sun Jul 02, 2006 7:54 pm
Contact:

Post by xliz711x »

plc wrote: I dont think i can help u with this one...
i dont see a problem in your files.

have u tried to change the collspan to "3" in this line?

Code: Select all

<th colspan="2" class="thCornerL" height="25" nowrap="nowrap">&nbsp;{catrow.CAT_DESC}&nbsp;</th> 
i don't know, just suggesting...

do u have subforums?


Tried it still didn't work. But thanks anyway.
User avatar
littlepaws
Registered User
Posts: 353
Joined: Thu Mar 30, 2006 10:40 pm

Need help with part 2 of install

Post by littlepaws »

Problems with MOD-post_icons-part2.txt
I cannot find any of the code changes for viewforum_body.tpl

Im using a different template to that of subliver my viewforum_body.tpl
is a follows.

Code: Select all

<!-- Defines clickable area for the go back button in the right end of box panels -->
<map name="go_back">
  <area shape="circle" coords="23,17,8" href="{U_VIEW_FORUM}">
</map>

<table width="100%" cellspacing="2" cellpadding="2" border="0">
  <tr> 
	<td align="left" valign="bottom" colspan="2">
	  <span class="gensmall"><b>{PAGINATION}</b><br />
	  &nbsp; </span></td>
  </tr>
</table>

<table width="100%" cellspacing="2" cellpadding="2" border="0">
  <tr> 
	<td align="left" valign="bottom" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>&nbsp;&nbsp;&nbsp;<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
	<td align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a> 
	  &raquo; <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
  </tr>
</table>


			<table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td valign="top" class="box_content">
				  
				  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td class="box_topic_panel_left"><img src="templates/JustFooty/images/spacer.gif" alt="." width="1" height="1"></td>
                        <td class="box_panel_center"><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></td>
                        <td width="36" class="box_topic_panel_right"><img src="templates/JustFooty/images/box_forum_panel_right.jpg" alt="Go back" width="36" height="28" border="0" usemap="#go_back"></td>
                      </tr>
                    </table>
                    <table width="100%" border="0" cellpadding="5" cellspacing="0" class="stdtable">
                      <tr> 
                        <td width="175" align="center" nowrap="nowrap" class="table_topic_col_desc">{L_AUTHOR}</td>
                        <td width="100%" align="center" class="table_forum_col_desc">{L_MESSAGE}</td>
                      </tr>
					  <tr>
							{POLL_DISPLAY}
					  </tr>
	<!-- BEGIN postrow -->					  
                      <tr> 
                        <td class="stdcontent" align="center" valign="top" width="175">
						  <table border="0" class="post_user_details">
                            <tr> 
                              <td class="post_user_name">
							  	{postrow.POSTER_NAME}
							  </td>
                            </tr>
                            <tr> 
                              <td class="post_user_rank">
							  	{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}
							  </td>							 
                            </tr>
                            <tr> 
                              <td class="post_user_avatar" align="center" style="padding-top: 10px; padding-bottom: 10px; text-align: center"> 
                              	{postrow.POSTER_AVATAR}
                              </td>
                            </tr>
                            <tr> 
                              <td class="post_post_details" align="left"> 
								{postrow.POSTER_JOINED}<br />
								{postrow.POSTER_POSTS}<br />
								{postrow.POSTER_FROM}
							  </td>
                            </tr>
                            <tr> 
                              <td class="post_date_time">{postrow.POST_DATE}</td>
                            </tr>
                          </table>
						  <img src="templates/JustFooty/images/spacer.gif" width="174" alt="spacer" height="1">
						</td>
                        <td class="stdcontent" valign="top" width="100%" align="left" style="padding: 8px;"> 

                          <div class="post"> 
						  
							  <div class="post_postbuttons">
							  	<table border="0" cellspacing="0" cellpadding="3" align="right">
									<tr>
										<td valign="top">
											{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}						  									
										</td>
										<td valign="top">
											{postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG} {postrow.ICQ_IMG}									
										</td>
									</tr>							
								</table>
	                          </div>
							  
	                          <div class="post_msg_subject">
							  	<a name="{postrow.U_POST_ID}"></a><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="12" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a>&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}
							  </div>
							  								  
						  	<div class="post_msg_text" style="padding-top: 5px;"> 
								{postrow.MESSAGE}
								{postrow.SIGNATURE}
								<span class="gensmall">
									{postrow.EDITED_MESSAGE}
								</span>
							</div>
							
                          </div>

						</td>
                      </tr>
                      <tr> 
                        <td colspan="2" class="table_topic_post_hdiv"></td>
                      </tr>
	<!-- END postrow -->
	
				<tr align="center"> 
					<td colspan="2" height="28" class="viewmode">
					<table cellspacing="0" cellpadding="0" border="0">
						<tr><form method="post" action="{S_POST_DAYS_ACTION}">
							<td align="center"><span class="gensmall">{L_DISPLAY_POSTS}: {S_SELECT_POST_DAYS}&nbsp;{S_SELECT_POST_ORDER}&nbsp;<input type="submit" value="{L_GO}" class="liteoption" name="submit" /></span></td>
						</form></tr>
					</table>
					</td>
				</tr>
						  
					</table>					
					
					</td>
                  <td class="box_shadow_right" valign="top"><div class="box_shadow_right_top"><img src="templates/JustFooty/images/spacer.gif" alt="." width="1" height="1"></div></td>
                </tr>
                <tr> 
                  <td class="box_shadow_bottom" align="left"><div class="box_shadow_bottom_left"><img src="templates/JustFooty/images/spacer.gif" alt="." width="1" height="1"></div></td>
                  <td class="box_shadow_bottom_right"><img src="templates/JustFooty/images/spacer.gif" alt="." width="1" height="1"></td>
                </tr>
              </table>
			  

<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
  <tr> 
	<td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>&nbsp;&nbsp;&nbsp;<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
	<td align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a> 
	  &raquo; <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
	<td align="right" valign="top" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span> 
	  </td>
  </tr>
  <tr>
	<td align="left" colspan="3"><span class="nav">{PAGE_NUMBER}</span></td>
  </tr>
</table>

<table width="100%" cellspacing="2" border="0" align="center">
  <tr> 
	<td width="40%" valign="top" nowrap="nowrap" align="left"><span class="gensmall">{S_WATCH_TOPIC}</span><br />
	  &nbsp;<br />
	  {S_TOPIC_ADMIN}</td>
	<td align="right" valign="top" nowrap="nowrap">{JUMPBOX}<span class="gensmall">{S_AUTH_LIST}</span></td>
  </tr>
</table>
The changes in MOD-post_icons-part2.txt cannot be found

Code: Select all

############################################################## 
## MOD Title:		Post Icons : icons for topics and posts - Part 2
## MOD Author:		Ptirhiik < [email protected] > (Pierre) http://rpgnet.clanmckeen.com
## MOD Description:
##			This mod will allow to add an icon in front of each topic title. This part
##			is about the viewforum.php/viewforum_body.tpl if you haven't Split topic v2 mod
##			installed.
## MOD Version:		1.0.1
## 
## Installation Level:	Easy
## Installation Time:	3 Minutes
## Files To Edit:
##			viewforum.php
##			templates/subSilver/viewforum_body.tpl
##
## Included Files:(n/a)
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
##
##	You must have the part 1 of the mod installed.
##
############################################################## 
## MOD History: 
##
##   2003-10-28 - Version 1.0.1
##      - fix usage of image key entry in the configuration
##	- add the lang settings
## 
##   2003-09-14 - Version 1.0.0
##	- no change regarding 0.0.3
##
##   2003-09-07 - Version 0.0.3 (beta)
##	- add the admin part
##	- split the mod in two part for further add (split topic type v2)
##
##   2003-08-01 - Version 0.0.2 (alpha)
##	- add the function get_icon_title() in functions.php
##
##   2003-08-01 - Version 0.0.1 (alpha)
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
viewforum.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : post icon -------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : post icon -------------------------------------------------------------------------------
//-- add
include($phpbb_root_path . 'includes/def_icons.'. $phpEx);
//-- fin mod : post icon ---------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
		$topic_type = $topic_rowset[$i]['topic_type'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : post icon -------------------------------------------------------------------------------
//-- add
		$type = $topic_rowset[$i]['topic_type'];
		if ($type == POST_NORMAL)
		{
			if (!empty($topic_rowset[$i]['topic_calendar_time']))
			{
				$type = POST_CALENDAR;
			}
			if (!empty($topic_rowset[$i]['topic_pic_url']))
			{
				$type = POST_PICTURE;
			}
		}
		$icon = get_icon_title($topic_rowset[$i]['topic_icon'], 1, $type);
//-- fin mod : post icon ---------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
			'ROW_COLOR' => $row_color,
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : post icon -------------------------------------------------------------------------------
//-- add
			'ICON'					=> $icon,
//-- fin mod : post icon ---------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
<form method="post" action="{S_POST_DAYS_ACTION}">
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
<!-- mod : post icon -->
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full line is longer
#
  <table
	<tr>
	  <th colspan="2"
#
#-----[ IN-LINE FIND ]---------------------------------------- 
#
colspan="2"
#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
colspan="3"
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full line is longer
#
	  <td class="row1" width="100%"><span class="topictitle">
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
	  <td class="row1" align="center" valign="middle" width="20">{topicrow.ICON}</td>
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full line is longer
#
	<!-- BEGIN switch_no_topics -->
	<tr> 
	  <td class="row1" colspan="6"
#
#-----[ IN-LINE FIND ]---------------------------------------- 
#
colspan="6"
#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
colspan="7"
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full line is longer
#
	<!-- END switch_no_topics -->
	<tr> 
	  <td class="catBottom"
#
#-----[ IN-LINE FIND ]---------------------------------------- 
#
colspan="6"
#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
colspan="7"
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
What do i need to do many thanks

Littlepaws
www.littlepawsdogtraining.com
website for dog lovers

www.tottenhamhotspursforum.co.uk
Football Fans forum

www.xbox360fanzone.com
Xbox 360 Forum
Post Reply

Return to “[2.0.x] MOD Database Cleanup”