mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 14:28:56 +00:00
Use different folder images for posted to topics
git-svn-id: file:///svn/phpbb/trunk@3502 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
60a18eb9d6
commit
ec6a5740bf
2 changed files with 31 additions and 20 deletions
|
@ -25,14 +25,15 @@ include($phpbb_root_path . 'extension.inc');
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include($phpbb_root_path . 'common.'.$phpEx);
|
||||||
|
|
||||||
// Start initial var setup
|
// Start initial var setup
|
||||||
$mark_read = (!empty($_REQUEST['mark'])) ? $_REQUEST['mark'] : '';
|
$mark_read = (!empty($_GET['mark'])) ? $_GET['mark'] : '';
|
||||||
$forum_id = (!empty($_REQUEST['f'])) ? intval($_REQUEST['f']) : 0;
|
$forum_id = (!empty($_GET['f'])) ? intval($_GET['f']) : 0;
|
||||||
$start = (isset($_GET['start'])) ? intval($_GET['start']) : 0;
|
$start = (isset($_GET['start'])) ? intval($_GET['start']) : 0;
|
||||||
$sort_key = (!empty($_REQUEST['sort_key'])) ? $_REQUEST['sort_key']{0} : 't';
|
$sort_key = (!empty($_POST['sort_key'])) ? $_POST['sort_key']{0} : 't';
|
||||||
$sort_dir = (!empty($_REQUEST['sort_dir'])) ? $_REQUEST['sort_dir']{0} : 'd';
|
$sort_dir = (!empty($_POST['sort_dir'])) ? $_POST['sort_dir']{0} : 'd';
|
||||||
// End initial var setup
|
// End initial var setup
|
||||||
|
|
||||||
// Start session
|
// Start session
|
||||||
|
//$user->fetch_data(array());
|
||||||
$user->start();
|
$user->start();
|
||||||
|
|
||||||
// Check if the user has actually sent a forum ID with his/her request
|
// Check if the user has actually sent a forum ID with his/her request
|
||||||
|
@ -222,6 +223,8 @@ if ($forum_data['forum_postable'])
|
||||||
|
|
||||||
$post_alt = (intval($forum_data['forum_status']) == ITEM_LOCKED) ? 'Forum_locked' : 'Post_new_topic';
|
$post_alt = (intval($forum_data['forum_status']) == ITEM_LOCKED) ? 'Forum_locked' : 'Post_new_topic';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Basic pagewide vars
|
// Basic pagewide vars
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_IS_POSTABLE' => TRUE,
|
'S_IS_POSTABLE' => TRUE,
|
||||||
|
@ -257,10 +260,14 @@ if ($forum_data['forum_postable'])
|
||||||
'U_MARK_READ' => 'viewforum.' . $phpEx . $SID . '&f=' . $forum_id . '&mark=topics')
|
'U_MARK_READ' => 'viewforum.' . $phpEx . $SID . '&f=' . $forum_id . '&mark=topics')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Grab icons
|
// Grab icons
|
||||||
$icons = array();
|
$icons = array();
|
||||||
obtain_icons($icons);
|
obtain_icons($icons);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Grab all the basic data. If we're not on page 1 we also grab any
|
// Grab all the basic data. If we're not on page 1 we also grab any
|
||||||
// announcements that may exist.
|
// announcements that may exist.
|
||||||
$total_topics = 0;
|
$total_topics = 0;
|
||||||
|
@ -335,11 +342,14 @@ if ($forum_data['forum_postable'])
|
||||||
|
|
||||||
if (empty($forum_data['topics_list']) && !empty($topics_list))
|
if (empty($forum_data['topics_list']) && !empty($topics_list))
|
||||||
{
|
{
|
||||||
$sql = 'INSERT INTO ' . TOPICS_PREFETCH_TABLE . " (forum_id, start, sort_key, sort_dir, topics_list)
|
// $sql = 'INSERT INTO ' . TOPICS_PREFETCH_TABLE . " (forum_id, start, sort_key, sort_dir, topics_list)
|
||||||
VALUES ($forum_id, $start, '$sort_key', '$sort_dir', '$topics_list')";
|
// VALUES ($forum_id, $start, '$sort_key', '$sort_dir', '$topics_list')";
|
||||||
// $db->sql_query($sql);
|
// $db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Okay, lets dump out the page ...
|
// Okay, lets dump out the page ...
|
||||||
if ($total_topics)
|
if ($total_topics)
|
||||||
{
|
{
|
||||||
|
@ -351,13 +361,6 @@ if ($forum_data['forum_postable'])
|
||||||
|
|
||||||
$topic_title = (!empty($censors)) ? preg_replace($censors['match'], $censors['replace'], $topic_row['topic_title']) : $topic_row['topic_title'];
|
$topic_title = (!empty($censors)) ? preg_replace($censors['match'], $censors['replace'], $topic_row['topic_title']) : $topic_row['topic_title'];
|
||||||
|
|
||||||
// See if the user has posted in this topic.
|
|
||||||
if($topic_row['lastread_type'] == LASTREAD_POSTED)
|
|
||||||
{
|
|
||||||
// Making titles italic is only a hack. This should be done in the templates or in the folder images.
|
|
||||||
$topic_title = "<i>" . $topic_title . "</i>";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Type and folder
|
// Type and folder
|
||||||
$topic_type = '';
|
$topic_type = '';
|
||||||
if ($topic_row['topic_status'] == ITEM_MOVED)
|
if ($topic_row['topic_status'] == ITEM_MOVED)
|
||||||
|
@ -402,7 +405,7 @@ if ($forum_data['forum_postable'])
|
||||||
}
|
}
|
||||||
|
|
||||||
$unread_topic = true;
|
$unread_topic = true;
|
||||||
if ($user->data['user_id']
|
if ($user->data['user_id'] != ANONYMOUS
|
||||||
&&
|
&&
|
||||||
( $topic_row['topic_last_post_time'] <= $topic_row['lastread_time']
|
( $topic_row['topic_last_post_time'] <= $topic_row['lastread_time']
|
||||||
|| $topic_row['topic_last_post_time'] < (time()-$config['lastread'])
|
|| $topic_row['topic_last_post_time'] < (time()-$config['lastread'])
|
||||||
|
@ -417,6 +420,10 @@ if ($forum_data['forum_postable'])
|
||||||
$folder_img = ($unread_topic) ? $folder_new : $folder;
|
$folder_img = ($unread_topic) ? $folder_new : $folder;
|
||||||
$folder_alt = ($unread_topic) ? 'New_posts' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'Topic_locked' : 'No_new_posts');
|
$folder_alt = ($unread_topic) ? 'New_posts' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'Topic_locked' : 'No_new_posts');
|
||||||
|
|
||||||
|
if ($topic_row['lastread_type'] == LASTREAD_POSTED)
|
||||||
|
{
|
||||||
|
$folder_img .= '_posted';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intval($topic_row['poll_start']))
|
if (intval($topic_row['poll_start']))
|
||||||
|
@ -470,6 +477,7 @@ if ($forum_data['forum_postable'])
|
||||||
$last_post_url = '<a href="viewtopic.' . $phpEx . $SID . '&f=' . $forum_id . '&p=' . $topic_row['topic_last_post_id'] . '#' . $topic_row['topic_last_post_id'] . '">' . $user->img('goto_post_latest', 'VIEW_LATEST_POST') . '</a>';
|
$last_post_url = '<a href="viewtopic.' . $phpEx . $SID . '&f=' . $forum_id . '&p=' . $topic_row['topic_last_post_id'] . '#' . $topic_row['topic_last_post_id'] . '">' . $user->img('goto_post_latest', 'VIEW_LATEST_POST') . '</a>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Send vars to template
|
// Send vars to template
|
||||||
$template->assign_block_vars('topicrow', array(
|
$template->assign_block_vars('topicrow', array(
|
||||||
'FORUM_ID' => $forum_id,
|
'FORUM_ID' => $forum_id,
|
||||||
|
@ -489,6 +497,8 @@ if ($forum_data['forum_postable'])
|
||||||
'TOPIC_ICON' => (!empty($icons[$topic_row['icon_id']]) ) ? '<img src="' . $config['icons_path'] . '/' . $icons[$topic_row['icon_id']]['img'] . '" width="' . $icons[$topic_row['icon_id']]['width'] . '" height="' . $icons[$topic_row['icon_id']]['height'] . '" alt="" title="" />' : '',
|
'TOPIC_ICON' => (!empty($icons[$topic_row['icon_id']]) ) ? '<img src="' . $config['icons_path'] . '/' . $icons[$topic_row['icon_id']]['img'] . '" width="' . $icons[$topic_row['icon_id']]['width'] . '" height="' . $icons[$topic_row['icon_id']]['height'] . '" alt="" title="" />' : '',
|
||||||
|
|
||||||
'S_ROW_COUNT' => $i,
|
'S_ROW_COUNT' => $i,
|
||||||
|
'S_TOPIC_TYPE' => $topic_type,
|
||||||
|
'S_USER_POSTED' => ($topic_row['lastread_type'] == LASTREAD_POSTED) ? true : false,
|
||||||
|
|
||||||
'U_VIEW_TOPIC' => $view_topic_url)
|
'U_VIEW_TOPIC' => $view_topic_url)
|
||||||
);
|
);
|
||||||
|
@ -499,21 +509,22 @@ if ($forum_data['forum_postable'])
|
||||||
|
|
||||||
if ($user->data['user_id'] != ANONYMOUS)
|
if ($user->data['user_id'] != ANONYMOUS)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
// $mark_topics isn't set as of now
|
// $mark_topics isn't set as of now
|
||||||
//
|
|
||||||
//setcookie($config['cookie_name'] . '_t', serialize($mark_topics), 0, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']);
|
//setcookie($config['cookie_name'] . '_t', serialize($mark_topics), 0, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dump out the page header and load viewforum template
|
// Mozilla navigation links
|
||||||
$page_title = $user->lang['View_forum'] . ' - ' . $forum_data['forum_name'];
|
|
||||||
|
|
||||||
$nav_links['up'] = array(
|
$nav_links['up'] = array(
|
||||||
'url' => 'index.' . $phpEx . $SID,
|
'url' => 'index.' . $phpEx . $SID,
|
||||||
'title' => sprintf($user->lang['Forum_Index'], $config['sitename'])
|
'title' => sprintf($user->lang['Forum_Index'], $config['sitename'])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Dump out the page header and load viewforum template
|
||||||
|
$page_title = $user->lang['View_forum'] . ' - ' . $forum_data['forum_name'];
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||||
|
|
||||||
$template->set_filenames(array(
|
$template->set_filenames(array(
|
||||||
|
|
|
@ -61,7 +61,7 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$view_online = false;
|
$view_online = false;
|
||||||
|
|
||||||
if ($row['user_id'])
|
if ($row['user_id'] != ANONYMOUS)
|
||||||
{
|
{
|
||||||
$user_id = $row['user_id'];
|
$user_id = $row['user_id'];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue