From c5ea123ae7dc5b6c1de2af850d152e98aa809f6b Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 5 Jun 2001 13:34:23 +0000 Subject: [PATCH] Basic new post folder colour change git-svn-id: file:///svn/phpbb/trunk@430 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/common.php | 1 + phpBB/index.php | 34 +++++++++++++++++++++++++--------- phpBB/viewforum.php | 20 ++++++++++++++++++-- 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/phpBB/common.php b/phpBB/common.php index d3c5693141..7277e040fa 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -56,6 +56,7 @@ $images['msnm'] = "$url_images/msnm.gif"; $images['quote'] = "$url_images/quote.gif"; $images['posticon'] = "$url_images/posticon.gif"; $images['folder'] = "$url_images/folder.gif"; +$images['new_folder'] = "$url_images/red_folder.gif"; $images['latest_reply'] = "$url_images/latest_reply.gif"; include('includes/template.inc'); diff --git a/phpBB/index.php b/phpBB/index.php index 9743a67b0c..e2db35a677 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -94,12 +94,11 @@ if($total_categories) { case 'postgresql': $limit_forums = ($viewcat != -1) ? "AND f.cat_id = $viewcat " : ""; - $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, af.auth_view, af.auth_read, af.auth_post, af.auth_reply, af.auth_edit, af.auth_delete, af.auth_votecreate, af.auth_vote - FROM ".FORUMS_TABLE." f, ".TOPICS_TABLE." t, ".POSTS_TABLE." p, ".USERS_TABLE." u, ".AUTH_FORUMS_TABLE." af + $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time + FROM ".FORUMS_TABLE." f, ".TOPICS_TABLE." t, ".POSTS_TABLE." p, ".USERS_TABLE." u WHERE f.forum_last_post_id = p.post_id AND p.post_id = t.topic_last_post_id AND p.poster_id = u.user_id - AND af.forum_id = f.forum_id $limit_forums UNION ( SELECT f.*, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL @@ -116,12 +115,11 @@ if($total_categories) case 'oracle': $limit_forums = ($viewcat != -1) ? "AND f.cat_id = $viewcat " : ""; - $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, af.auth_view, af.auth_read, af.auth_post, af.auth_reply, af.auth_edit, af.auth_delete, af.auth_votecreate, af.auth_vote - FROM ".FORUMS_TABLE." f, ".POSTS_TABLE." p, ".TOPICS_TABLE." t, ".USERS_TABLE." u, ".AUTH_FORUMS_TABLE." af + $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time + FROM ".FORUMS_TABLE." f, ".POSTS_TABLE." p, ".TOPICS_TABLE." t, ".USERS_TABLE." u WHERE f.forum_last_post_id = p.post_id(+) AND p.post_id = t.topic_last_post_id(+) AND p.poster_id = u.user_id(+) - AND af.forum_id = f.forum_id(+) $limit_forums ORDER BY f.cat_id, f.forum_order"; break; @@ -129,6 +127,15 @@ if($total_categories) default: // This works on: MySQL, MSSQL and ODBC (Access) $limit_forums = ($viewcat != -1) ? "WHERE f.cat_id = $viewcat " : ""; +/* + $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time + FROM ((( ".FORUMS_TABLE." f + LEFT JOIN ".POSTS_TABLE." p ON f.forum_last_post_id = p.post_id ) + LEFT JOIN ".TOPICS_TABLE." t ON p.post_id = t.topic_last_post_id ) + LEFT JOIN ".USERS_TABLE." u ON p.poster_id = u.user_id ) + $limit_forums + ORDER BY f.cat_id, f.forum_order"; +*/ $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, af.auth_view, af.auth_read, af.auth_post, af.auth_reply, af.auth_edit, af.auth_delete, af.auth_votecreate, af.auth_vote FROM ((( ".FORUMS_TABLE." f LEFT JOIN ".POSTS_TABLE." p ON f.forum_last_post_id = p.post_id ) @@ -139,6 +146,7 @@ if($total_categories) ORDER BY f.cat_id, f.forum_order"; break; } + if(!$q_forums = $db->sql_query($sql)) { if(DEBUG) @@ -199,10 +207,18 @@ if($total_categories) for($j = 0; $j < $total_forums; $j++) { if( ( ($forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $viewcat == -1) || - ($category_rows[$i]['cat_id'] == $viewcat) ) && - $is_auth_ary[$forum_rows[$j]['forum_id']]['auth_view']) + ($category_rows[$i]['cat_id'] == $viewcat) ) && $is_auth_ary[$forum_rows[$j]['forum_id']]['auth_view']) { - $folder_image = ""; + + if($userdata['session_start'] == $userdata['session_time']) + { + $folder_image = ($forum_rows[$j]['post_time'] > $userdata['session_last_visit']) ? "" : ""; + } + else + { + $folder_image = ($forum_rows[$j]['post_time'] > $userdata['session_time'] - 300) ? "" : ""; + } + $posts = $forum_rows[$j]['forum_posts']; $topics = $forum_rows[$j]['forum_topics']; if($forum_rows[$j]['username'] != "" && $forum_rows[$j]['post_time'] > 0) diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 59f8c2ca74..b07764614f 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -56,6 +56,15 @@ init_userprefs($userdata); // if(isset($forum_id)) { +/* + $sql = "SELECT f.forum_name, f.forum_topics, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_votecreate, f.auth_vote, u.username, u.user_id + FROM ".FORUMS_TABLE." f, ".USERS_TABLE." u, ".USER_GROUP_TABLE." ug, ".AUTH_ACCESS_TABLE." aa + WHERE f.forum_id = $forum_id + AND aa.auth_mod = 1 + AND aa.forum_id = f.forum_id + AND ug.group_id = aa.group_id + AND u.user_id = ug.user_id"; +*/ $sql = "SELECT f.forum_name, f.forum_topics, u.username, u.user_id, fa.* FROM ".FORUMS_TABLE." f, ".USERS_TABLE." u, ".USER_GROUP_TABLE." ug, ".AUTH_ACCESS_TABLE." aa, ".AUTH_FORUMS_TABLE." fa WHERE f.forum_id = $forum_id @@ -275,7 +284,14 @@ if($total_topics) $goto_page = ""; } - $folder_img = ""; + if($userdata['session_start'] == $userdata['session_time']) + { + $folder_image = ($topic_rowset[$x]['post_time'] > $userdata['session_last_visit']) ? "" : ""; + } + else + { + $folder_image = ($topic_rowset[$x]['post_time'] > $userdata['session_time'] - 300) ? "" : ""; + } $view_topic_url = append_sid("viewtopic.".$phpEx."?".POST_TOPIC_URL."=".$topic_id."&".$replies); @@ -291,7 +307,7 @@ if($total_topics) $template->assign_block_vars("topicrow", array( "FORUM_ID" => $forum_id, "TOPIC_ID" => $topic_id, - "FOLDER" => $folder_img, + "FOLDER" => $folder_image, "TOPIC_POSTER" => $topic_poster, "GOTO_PAGE" => $goto_page, "REPLIES" => $replies,