mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Support for new locked with new topics icon
git-svn-id: file:///svn/phpbb/trunk@1274 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
2a11de8efc
commit
f0e441777b
4 changed files with 58 additions and 49 deletions
|
@ -219,7 +219,8 @@ $template->assign_vars(array(
|
||||||
"L_NEW_POSTS" => $lang['New_posts'],
|
"L_NEW_POSTS" => $lang['New_posts'],
|
||||||
"L_NO_NEW_POSTS_HOT" => $lang['No_new_posts_hot'],
|
"L_NO_NEW_POSTS_HOT" => $lang['No_new_posts_hot'],
|
||||||
"L_NEW_POSTS_HOT" => $lang['New_posts_hot'],
|
"L_NEW_POSTS_HOT" => $lang['New_posts_hot'],
|
||||||
"L_TOPIC_IS_LOCKED" => $lang['Topic_is_locked'],
|
"L_NO_NEW_POSTS_LOCKED" => $lang['No_new_posts_locked'],
|
||||||
|
"L_NEW_POSTS_LOCKED" => $lang['New_posts_locked'],
|
||||||
"L_ANNOUNCEMENT" => $lang['Post_Announcement'],
|
"L_ANNOUNCEMENT" => $lang['Post_Announcement'],
|
||||||
"L_STICKY" => $lang['Post_Sticky'],
|
"L_STICKY" => $lang['Post_Sticky'],
|
||||||
"L_POSTED" => $lang['Posted'],
|
"L_POSTED" => $lang['Posted'],
|
||||||
|
|
|
@ -151,7 +151,8 @@ $lang['New_posts'] = "New posts";
|
||||||
$lang['New_post'] = "New post";
|
$lang['New_post'] = "New post";
|
||||||
$lang['No_new_posts_hot'] = "No new posts [ Popular ]";
|
$lang['No_new_posts_hot'] = "No new posts [ Popular ]";
|
||||||
$lang['New_posts_hot'] = "New posts [ Popular ]";
|
$lang['New_posts_hot'] = "New posts [ Popular ]";
|
||||||
$lang['Topic_is_locked'] = "Topic is locked";
|
$lang['No_new_posts_locked'] = "No new posts [ Locked ]";
|
||||||
|
$lang['New_posts_locked'] = "New posts [ Locked ]";
|
||||||
$lang['Forum_is_locked'] = "Forum is locked";
|
$lang['Forum_is_locked'] = "Forum is locked";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,8 @@
|
||||||
<td width="20" align="center"><img src="templates/subSilver/images/folder.gif" alt="{L_NO_NEW_POSTS}" width="19" height="18" /></td>
|
<td width="20" align="center"><img src="templates/subSilver/images/folder.gif" alt="{L_NO_NEW_POSTS}" width="19" height="18" /></td>
|
||||||
<td class="gensmall">{L_NO_NEW_POSTS}</td>
|
<td class="gensmall">{L_NO_NEW_POSTS}</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
|
<td width="20" align="center"><img src="templates/subSilver/images/folder_announce.gif" alt="{L_ANNOUNCEMENT}" width="19" height="18" /></td>
|
||||||
|
<td class="gensmall">{L_ANNOUNCEMENT}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="20" align="center"><img src="templates/subSilver/images/folder_new_hot.gif" alt="{L_NEW_POSTS_HOT}" width="19" height="18" /></td>
|
<td width="20" align="center"><img src="templates/subSilver/images/folder_new_hot.gif" alt="{L_NEW_POSTS_HOT}" width="19" height="18" /></td>
|
||||||
|
@ -81,16 +83,16 @@
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td width="20" align="center"><img src="templates/subSilver/images/folder_hot.gif" alt="{L_NO_NEW_POSTS_HOT}" width="19" height="18" /></td>
|
<td width="20" align="center"><img src="templates/subSilver/images/folder_hot.gif" alt="{L_NO_NEW_POSTS_HOT}" width="19" height="18" /></td>
|
||||||
<td class="gensmall">{L_NO_NEW_POSTS_HOT}</td>
|
<td class="gensmall">{L_NO_NEW_POSTS_HOT}</td>
|
||||||
</tr>
|
<td> </td>
|
||||||
<tr>
|
|
||||||
<td width="20" align="center"><img src="templates/subSilver/images/folder_sticky.gif" alt="{L_STICKY}" width="19" height="18" /></td>
|
<td width="20" align="center"><img src="templates/subSilver/images/folder_sticky.gif" alt="{L_STICKY}" width="19" height="18" /></td>
|
||||||
<td class="gensmall">{L_STICKY}</td>
|
<td class="gensmall">{L_STICKY}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="gensmall"><img src="templates/subSilver/images/folder_lock_new.gif" alt="{L_NEW_POSTS_TOPIC_LOCKED}" width="19" height="18" /></td>
|
||||||
|
<td class="gensmall">{L_NEW_POSTS_LOCKED}</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td width="20" align="center"><img src="templates/subSilver/images/folder_announce.gif" alt="{L_ANNOUNCEMENT}" width="19" height="18" /></td>
|
<td class="gensmall"><img src="templates/subSilver/images/folder_lock.gif" alt="{L_NO_NEW_POSTS_TOPIC_LOCKED}" width="19" height="18" /></td>
|
||||||
<td class="gensmall">{L_ANNOUNCEMENT}</td>
|
<td class="gensmall">{L_NO_NEW_POSTS_LOCKED}</td>
|
||||||
<td> </td>
|
|
||||||
<td class="gensmall"><img src="templates/subSilver/images/folder_lock.gif" alt="{L_TOPIC_IS_LOCKED}" width="19" height="18" /></td>
|
|
||||||
<td class="gensmall">{L_TOPIC_IS_LOCKED}</td>
|
|
||||||
</table></td>
|
</table></td>
|
||||||
<td align="right"><span class="gensmall">{S_AUTH_LIST}</span></td>
|
<td align="right"><span class="gensmall">{S_AUTH_LIST}</span></td>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -112,46 +112,49 @@ if( !$is_auth['auth_read'] || !$is_auth['auth_view'] )
|
||||||
//
|
//
|
||||||
if( $mark_read == "topics" )
|
if( $mark_read == "topics" )
|
||||||
{
|
{
|
||||||
$sql = "SELECT t.topic_id, p.post_time
|
if( $userdata['session_last_visit'] )
|
||||||
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 > " . $userdata['session_last_visit'] . "
|
|
||||||
AND t.topic_moved_id IS NULL";
|
|
||||||
if(!$t_result = $db->sql_query($sql))
|
|
||||||
{
|
{
|
||||||
message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql);
|
$sql = "SELECT t.topic_id, p.post_time
|
||||||
}
|
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
|
||||||
|
WHERE t.forum_id = $forum_id
|
||||||
if( $mark_read_rows = $db->sql_numrows($t_result) )
|
AND p.post_id = t.topic_last_post_id
|
||||||
{
|
AND p.post_time > " . $userdata['session_last_visit'] . "
|
||||||
$mark_read_list = $db->sql_fetchrowset($t_result);
|
AND t.topic_moved_id IS NULL";
|
||||||
|
if(!$t_result = $db->sql_query($sql))
|
||||||
for($i = 0; $i < $mark_read_rows; $i++ )
|
|
||||||
{
|
{
|
||||||
$topic_id = $mark_read_list[$i]['topic_id'];
|
message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql);
|
||||||
$post_time = $mark_read_list[$i]['post_time'];
|
}
|
||||||
|
|
||||||
if( empty($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) )
|
if( $mark_read_rows = $db->sql_numrows($t_result) )
|
||||||
|
{
|
||||||
|
$mark_read_list = $db->sql_fetchrowset($t_result);
|
||||||
|
|
||||||
|
for($i = 0; $i < $mark_read_rows; $i++ )
|
||||||
{
|
{
|
||||||
setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
|
$topic_id = $mark_read_list[$i]['topic_id'];
|
||||||
}
|
$post_time = $mark_read_list[$i]['post_time'];
|
||||||
else
|
|
||||||
{
|
if( empty($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) )
|
||||||
if( isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) )
|
|
||||||
{
|
{
|
||||||
setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
|
setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) )
|
||||||
|
{
|
||||||
|
setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
"META" => '<meta http-equiv="refresh" content="3;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);
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
|
||||||
"META" => '<meta http-equiv="refresh" content="3;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
|
// End handle marking posts
|
||||||
|
@ -474,12 +477,7 @@ if($total_topics)
|
||||||
$goto_page = "";
|
$goto_page = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED )
|
if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED )
|
||||||
{
|
|
||||||
$folder_image = "<img src=\"" . $images['folder_locked'] . "\" alt=\"" . $lang['Topic_locked'] . "\" />";
|
|
||||||
$newest_post_img = "";
|
|
||||||
}
|
|
||||||
else if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED )
|
|
||||||
{
|
{
|
||||||
$topic_type = $lang['Topic_Moved'] . " ";
|
$topic_type = $lang['Topic_Moved'] . " ";
|
||||||
$topic_id = $topic_rowset[$i]['topic_moved_id'];
|
$topic_id = $topic_rowset[$i]['topic_moved_id'];
|
||||||
|
@ -489,7 +487,12 @@ if($total_topics)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE )
|
if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED )
|
||||||
|
{
|
||||||
|
$folder = $images['folder_locked'];
|
||||||
|
$folder_new = $images['folder_locked_new'];
|
||||||
|
}
|
||||||
|
else if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE )
|
||||||
{
|
{
|
||||||
$folder = $images['folder_announce'];
|
$folder = $images['folder_announce'];
|
||||||
$folder_new = $images['folder_announce_new'];
|
$folder_new = $images['folder_announce_new'];
|
||||||
|
@ -504,7 +507,7 @@ if($total_topics)
|
||||||
if($replies >= $board_config['hot_threshold'])
|
if($replies >= $board_config['hot_threshold'])
|
||||||
{
|
{
|
||||||
$folder = $images['folder_hot'];
|
$folder = $images['folder_hot'];
|
||||||
$folder_new = $images['folder_new_hot'];
|
$folder_new = $images['folder_hot_new'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -531,13 +534,15 @@ if($total_topics)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$folder_image = "<img src=\"$folder\" alt=\"" . $lang['No_new_posts'] . "\" />";
|
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
|
||||||
|
$folder_image = "<img src=\"$folder\" alt=\"$folder_alt\" />";
|
||||||
$newest_post_img = "";
|
$newest_post_img = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$folder_image = "<img src=\"$folder\" alt=\"" . $lang['No_new_posts'] . "\" />";
|
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
|
||||||
|
$folder_image = "<img src=\"$folder\" alt=\"$folder_alt\" />";
|
||||||
$newest_post_img = "";
|
$newest_post_img = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue