diff options
author | Graham Eames <grahamje@users.sourceforge.net> | 2006-08-22 11:01:56 +0000 |
---|---|---|
committer | Graham Eames <grahamje@users.sourceforge.net> | 2006-08-22 11:01:56 +0000 |
commit | b0afc8e6320598734ae20e664be9f840ca501f91 (patch) | |
tree | 3d389420e36749440e292f704e8d9e18a3dd246d | |
parent | 556bbfe856e5a36f38a26c3ae8357eeba0d3b228 (diff) | |
download | forums-b0afc8e6320598734ae20e664be9f840ca501f91.tar forums-b0afc8e6320598734ae20e664be9f840ca501f91.tar.gz forums-b0afc8e6320598734ae20e664be9f840ca501f91.tar.bz2 forums-b0afc8e6320598734ae20e664be9f840ca501f91.tar.xz forums-b0afc8e6320598734ae20e664be9f840ca501f91.zip |
Phase 2 of the changes
This should now be complete
git-svn-id: file:///svn/phpbb/trunk@6311 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/develop/create_schema_files.php | 1 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 17 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 2 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_main.php | 39 | ||||
-rw-r--r-- | phpBB/install/schemas/firebird_schema.sql | 1 | ||||
-rw-r--r-- | phpBB/install/schemas/mssql_schema.sql | 1 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_schema.sql | 1 | ||||
-rw-r--r-- | phpBB/install/schemas/oracle_schema.sql | 1 | ||||
-rw-r--r-- | phpBB/install/schemas/postgres_schema.sql | 1 | ||||
-rw-r--r-- | phpBB/install/schemas/schema_data.sql | 6 | ||||
-rw-r--r-- | phpBB/install/schemas/sqlite_schema.sql | 1 | ||||
-rw-r--r-- | phpBB/search.php | 16 | ||||
-rw-r--r-- | phpBB/styles/subSilver/template/index_body.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subSilver/template/search_results.html | 4 | ||||
-rw-r--r-- | phpBB/styles/subSilver/template/viewforum_body.html | 4 | ||||
-rw-r--r-- | phpBB/styles/subSilver/template/viewforum_subforum.html | 2 | ||||
-rw-r--r-- | phpBB/viewforum.php | 20 |
18 files changed, 66 insertions, 59 deletions
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 546fcdbe07..f3c03a7a69 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -903,6 +903,7 @@ function get_schema_struct() 'forum_last_poster_id' => array('UINT', 0), 'forum_last_post_time' => array('TIMESTAMP', 0), 'forum_last_poster_name'=> array('VCHAR', ''), + 'forum_last_poster_colour'=> array('VCHAR:6', ''), 'forum_flags' => array('TINT:4', 32), 'display_on_index' => array('BOOL', 1), 'enable_indexing' => array('BOOL', 1), diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index fdedac05ed..1fc6b63996 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -183,6 +183,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $forum_rows[$parent_id]['forum_last_post_time'] = $row['forum_last_post_time']; $forum_rows[$parent_id]['forum_last_poster_id'] = $row['forum_last_poster_id']; $forum_rows[$parent_id]['forum_last_poster_name'] = $row['forum_last_poster_name']; + $forum_rows[$parent_id]['forum_last_poster_colour'] = $row['forum_last_poster_colour']; $forum_rows[$parent_id]['forum_id_last_post'] = $forum_id; } else @@ -306,6 +307,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $last_post_time = $user->format_date($row['forum_last_post_time']); $last_poster = ($row['forum_last_poster_name'] != '') ? $row['forum_last_poster_name'] : $user->lang['GUEST']; + $last_poster_colour = ($row['forum_last_poster_colour']) ? '#' . $row['forum_last_poster_colour'] : ''; $last_poster_url = ($row['forum_last_poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['forum_last_poster_id']); $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; @@ -342,6 +344,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'SUBFORUMS' => $subforums_list, 'LAST_POST_TIME' => $last_post_time, 'LAST_POSTER' => $last_poster, + 'LAST_POSTER_COLOUR' => $last_poster_colour, 'MODERATORS' => $moderators_list, 'L_SUBFORUM_STR' => $l_subforums, @@ -492,20 +495,6 @@ function get_forum_parents(&$forum_data) } /** -* Get topic author -*/ -function topic_topic_author(&$topic_row) -{ - global $phpEx, $phpbb_root_path, $user; - - $topic_author = ($topic_row['topic_poster'] != ANONYMOUS) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $topic_row['topic_poster']) . ($topic_row['topic_first_poster_colour'] ? '" style="color: #' . $topic_row['topic_first_poster_colour'] : '') . '">' : ''; - $topic_author .= ($topic_row['topic_poster'] != ANONYMOUS) ? $topic_row['topic_first_poster_name'] : (($topic_row['topic_first_poster_name'] != '') ? $topic_row['topic_first_poster_name'] : $user->lang['GUEST']); - $topic_author .= ($topic_row['topic_poster'] != ANONYMOUS) ? '</a>' : ''; - - return $topic_author; -} - -/** * Generate topic pagination */ function topic_generate_pagination($replies, $url) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 695f821c73..6fc9d83be6 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -139,15 +139,16 @@ function update_post_information($type, $ids, $return_update_sql = false) foreach ($empty_forums as $void => $forum_id) { $update_sql[$forum_id][] = 'forum_last_post_id = 0'; - $update_sql[$forum_id][] = 'forum_last_post_time = 0'; + $update_sql[$forum_id][] = 'forum_last_post_time = 0'; $update_sql[$forum_id][] = 'forum_last_poster_id = 0'; $update_sql[$forum_id][] = "forum_last_poster_name = ''"; + $update_sql[$forum_id][] = "forum_last_poster_colour = ''"; } } if (sizeof($last_post_ids)) { - $sql = 'SELECT p.' . $type . '_id, p.post_id, p.post_time, p.poster_id, p.post_username, u.user_id, u.username + $sql = 'SELECT p.' . $type . '_id, p.post_id, p.post_time, p.poster_id, p.post_username, u.user_id, u.username, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE p.poster_id = u.user_id AND ' . $db->sql_in_set('p.post_id', $last_post_ids); @@ -158,6 +159,7 @@ function update_post_information($type, $ids, $return_update_sql = false) $update_sql[$row["{$type}_id"]][] = $type . '_last_post_id = ' . (int) $row['post_id']; $update_sql[$row["{$type}_id"]][] = $type . '_last_post_time = ' . (int) $row['post_time']; $update_sql[$row["{$type}_id"]][] = $type . '_last_poster_id = ' . (int) $row['poster_id']; + $update_sql[$row["{$type}_id"]][] = "{$type}_last_poster_colour = '" . $db->sql_escape($row['user_colour']) . "'"; $update_sql[$row["{$type}_id"]][] = "{$type}_last_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'"; } $db->sql_freeresult($result); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index c03e92d0b0..870c20f665 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -262,7 +262,7 @@ function user_delete($mode, $user_id, $post_username = false) { case 'retain': $sql = 'UPDATE ' . FORUMS_TABLE . ' - SET forum_last_poster_id = ' . ANONYMOUS . (($post_username !== false) ? ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "'" : '') . " + SET forum_last_poster_id = ' . ANONYMOUS . (($post_username !== false) ? ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "'" : '') . ", forum_last_poster_colour = '' WHERE forum_last_poster_id = $user_id"; $db->sql_query($sql); diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index dc975d0585..0dd69e4bcf 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -286,6 +286,7 @@ class ucp_main $last_post_time = $user->format_date($row['forum_last_post_time']); $last_poster = ($row['forum_last_poster_name'] != '') ? $row['forum_last_poster_name'] : $user->lang['GUEST']; + $last_poster_colour = ($row['forum_last_poster_colour']) ? '#' . $row['forum_last_poster_colour'] : ''; $last_poster_url = ($row['forum_last_poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['forum_last_poster_id']); $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&p=" . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; @@ -303,6 +304,7 @@ class ucp_main 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), 'LAST_POST_TIME' => $last_post_time, 'LAST_POST_AUTHOR' => $last_poster, + 'LAST_POST_AUTHOR_COLOUR' => $last_poster_colour, 'U_LAST_POST_AUTHOR' => $last_poster_url, 'U_LAST_POST' => $last_post_url, @@ -417,15 +419,16 @@ class ucp_main // Send vars to template $template->assign_block_vars('topicrow', array( - 'FORUM_ID' => $forum_id, - 'TOPIC_ID' => $topic_id, - 'TOPIC_AUTHOR' => ($row['topic_first_poster_name']) ? $row['topic_first_poster_name'] : $user->lang['GUEST'], - 'TOPIC_AUTHOR_COLOUR' => ($row['topic_first_poster_colour']) ? '#' . $row['topic_first_poster_colour'] : '', - 'TOPIC_AUTHOR_LINK' => topic_topic_author($row), - 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), - 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), - 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), - 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'FORUM_ID' => $forum_id, + 'TOPIC_ID' => $topic_id, + 'TOPIC_AUTHOR' => ($row['topic_first_poster_name']) ? $row['topic_first_poster_name'] : $user->lang['GUEST'], + 'TOPIC_AUTHOR_COLOUR' => ($row['topic_first_poster_colour']) ? '#' . $row['topic_first_poster_colour'] : '', + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'LAST_POST_AUTHOR_COLOUR' => ($row['topic_last_poster_colour']) ? '#' . $row['topic_last_poster_colour'] : '', + 'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id")), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], @@ -448,6 +451,7 @@ class ucp_main 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread', 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '', + 'U_TOPIC_AUTHOR' => ($row['topic_poster'] != ANONYMOUS && $row['topic_poster']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_poster']) : '', 'U_VIEW_TOPIC' => $view_topic_url) ); } @@ -580,15 +584,15 @@ class ucp_main 'S_DELETED_TOPIC' => (!$row['topic_id']) ? true : false, 'S_GLOBAL_TOPIC' => (!$forum_id) ? true : false, - 'TOPIC_AUTHOR' => ($row['topic_first_poster_name']) ? $row['topic_first_poster_name'] : $user->lang['GUEST'], - 'TOPIC_AUTHOR_COLOUR' => ($row['topic_first_poster_colour']) ? '#' . $row['topic_first_poster_colour'] : '', - 'TOPIC_AUTHOR_LINK' => topic_topic_author($row), - 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), - 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), - 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), - 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], - 'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id")), + 'TOPIC_AUTHOR' => ($row['topic_first_poster_name']) ? $row['topic_first_poster_name'] : $user->lang['GUEST'], + 'TOPIC_AUTHOR_COLOUR' => ($row['topic_first_poster_colour']) ? '#' . $row['topic_first_poster_colour'] : '', + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'LAST_POST_AUTHOR_COLOUR' => ($row['topic_last_poster_colour']) ? '#' . $row['topic_last_poster_colour'] : '', + 'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id")), 'POSTED_AT' => $user->format_date($row['topic_time']), 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), @@ -598,6 +602,7 @@ class ucp_main 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '', + 'U_TOPIC_AUTHOR' => ($row['topic_poster'] != ANONYMOUS && $row['topic_poster']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_poster']) : '', 'U_VIEW_TOPIC' => $view_topic_url, 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), 'U_MOVE_UP' => ($row['order_id'] != 1) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=main&mode=bookmarks&move_up=' . $row['order_id']) : '', diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 6ff0ac3e97..4a4415f185 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -372,6 +372,7 @@ CREATE TABLE phpbb_forums ( forum_last_poster_id INTEGER DEFAULT 0 NOT NULL, forum_last_post_time INTEGER DEFAULT 0 NOT NULL, forum_last_poster_name VARCHAR(255) DEFAULT '' NOT NULL, + forum_last_poster_colour VARCHAR(6) DEFAULT '' NOT NULL, forum_flags INTEGER DEFAULT 32 NOT NULL, display_on_index INTEGER DEFAULT 1 NOT NULL, enable_indexing INTEGER DEFAULT 1 NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index d878f26473..acd33bda23 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -424,6 +424,7 @@ CREATE TABLE [phpbb_forums] ( [forum_last_poster_id] [int] DEFAULT (0) NOT NULL , [forum_last_post_time] [int] DEFAULT (0) NOT NULL , [forum_last_poster_name] [varchar] (255) DEFAULT ('') NOT NULL , + [forum_last_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL , [forum_flags] [int] DEFAULT (32) NOT NULL , [display_on_index] [int] DEFAULT (1) NOT NULL , [enable_indexing] [int] DEFAULT (1) NOT NULL , diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index 0ed3de8167..6b418fe2ef 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -244,6 +244,7 @@ CREATE TABLE phpbb_forums ( forum_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL, forum_last_poster_name varchar(255) DEFAULT '' NOT NULL, + forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL, forum_flags tinyint(4) DEFAULT '32' NOT NULL, display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index c9574dda86..adc683ec07 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -499,6 +499,7 @@ CREATE TABLE phpbb_forums ( forum_last_poster_id number(8) DEFAULT '0' NOT NULL, forum_last_post_time number(11) DEFAULT '0' NOT NULL, forum_last_poster_name varchar2(255) DEFAULT '' , + forum_last_poster_colour varchar2(6) DEFAULT '' , forum_flags number(4) DEFAULT '32' NOT NULL, display_on_index number(1) DEFAULT '1' NOT NULL, enable_indexing number(1) DEFAULT '1' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index a7ea962311..d6db57ad10 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -376,6 +376,7 @@ CREATE TABLE phpbb_forums ( forum_last_poster_id INT4 DEFAULT '0' NOT NULL CHECK (forum_last_poster_id >= 0), forum_last_post_time INT4 DEFAULT '0' NOT NULL CHECK (forum_last_post_time >= 0), forum_last_poster_name varchar(255) DEFAULT '' NOT NULL, + forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL, forum_flags INT2 DEFAULT '32' NOT NULL, display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0), enable_indexing INT2 DEFAULT '1' NOT NULL CHECK (enable_indexing >= 0), diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index fba8c5ccce..ac8e86a25c 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -391,9 +391,9 @@ INSERT INTO phpbb_styles_template (template_name, template_copyright, template_p INSERT INTO phpbb_styles_theme (theme_name, theme_copyright, theme_path, theme_data) VALUES ('subSilver', '© phpBB Group', 'subSilver', ''); # -- Forums -INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed) VALUES ('My first Category', '', 1, 4, 0, 0, 1, 1, 1, 1, 2, 'Admin', 972086460, '', '', '', '', '', '', '', 0, 0); +INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed) VALUES ('My first Category', '', 1, 4, 0, 0, 1, 1, 1, 1, 2, 'Admin', 'AA0000', 972086460, '', '', '', '', '', '', '', 0, 0); -INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed) VALUES ('Test Forum 1', 'This is just a test forum.', 2, 3, 1, 1, 1, 1, 1, 1, 2, 'Admin', 972086460, '', '', '', '', '', '', '', 0, 0); +INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed) VALUES ('Test Forum 1', 'This is just a test forum.', 2, 3, 1, 1, 1, 1, 1, 1, 2, 'Admin', 'AA0000', 972086460, '', '', '', '', '', '', '', 0, 0); # -- Users / Anonymous user INSERT INTO phpbb_users (user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (2, 1, 'Anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); @@ -542,7 +542,7 @@ INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, # -- Demo Topic -INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_replies_real, forum_id, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_post_time, topic_last_view_time, poll_title) VALUES ('Welcome to phpBB 3', 2, 972086460, 0, 0, 0, 2, 0, 0, 1, 'Admin', 1, 2, 'Admin', 972086460, 972086460, ''); +INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_replies_real, forum_id, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_first_poster_colour, topic_last_post_time, topic_last_view_time, poll_title) VALUES ('Welcome to phpBB 3', 2, 972086460, 0, 0, 0, 2, 0, 0, 1, 'Admin', 'AA0000', 1, 2, 'Admin', 'AA0000', 972086460, 972086460, ''); # -- Demo Post INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, icon_id, post_time, post_username, poster_ip, post_subject, post_text, post_checksum, bbcode_uid) VALUES (1, 2, 2, 1, 972086460, '', '127.0.0.1', 'Welcome to phpBB 3', 'This is an example post in your phpBB 3.0 installation. You may delete this post, this topic and even this forum if you like since everything seems to be working!', '5dd683b17f641daf84c040bfefc58ce9', ''); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 65b1d5c369..a06d6b1f24 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -237,6 +237,7 @@ CREATE TABLE phpbb_forums ( forum_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0', forum_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0', forum_last_poster_name varchar(255) NOT NULL DEFAULT '', + forum_last_poster_colour varchar(6) NOT NULL DEFAULT '', forum_flags tinyint(4) NOT NULL DEFAULT '32', display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_indexing INTEGER UNSIGNED NOT NULL DEFAULT '1', diff --git a/phpBB/search.php b/phpBB/search.php index 47362a9951..6fa500d761 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -677,13 +677,14 @@ if ($keywords || $author || $author_id || $search_id || $submit) $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$result_topic_id", true, $user->session_id) : ''; $tpl_ary = array( - 'TOPIC_AUTHOR' => ($row['topic_first_poster_name']) ? $row['topic_first_poster_name'] : $user->lang['GUEST'], - 'TOPIC_AUTHOR_COLOUR' => ($row['topic_first_poster_colour']) ? '#' . $row['topic_first_poster_colour'] : '', - 'TOPIC_AUTHOR_LINK' => topic_topic_author($row), - 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), - 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), - 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), - 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'TOPIC_AUTHOR' => ($row['topic_first_poster_name']) ? $row['topic_first_poster_name'] : $user->lang['GUEST'], + 'TOPIC_AUTHOR_COLOUR' => ($row['topic_first_poster_colour']) ? '#' . $row['topic_first_poster_colour'] : '', + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'LAST_POST_AUTHOR_COLOUR' => ($row['topic_last_poster_colour']) ? '#' . $row['topic_last_poster_colour'] : '', + 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), 'TOPIC_TYPE' => $topic_type, @@ -707,6 +708,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '', + 'U_TOPIC_AUTHOR' => ($row['topic_poster'] != ANONYMOUS && $row['topic_poster']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_poster']) : '', 'U_NEWEST_POST' => $view_topic_url . '&view=unread#unread', 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&t=' . $result_topic_id, true, $user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue, diff --git a/phpBB/styles/subSilver/template/index_body.html b/phpBB/styles/subSilver/template/index_body.html index e8dfafbcdf..7e60aad70c 100644 --- a/phpBB/styles/subSilver/template/index_body.html +++ b/phpBB/styles/subSilver/template/index_body.html @@ -55,7 +55,7 @@ <p class="topicdetails">{forumrow.LAST_POST_TIME}</p> <p class="topicdetails"> <!-- IF forumrow.U_LAST_POSTER --> - <a href="{forumrow.U_LAST_POSTER}">{forumrow.LAST_POSTER}</a> + <a href="{forumrow.U_LAST_POSTER}"<!-- IF forumrow.LAST_POSTER_COLOUR --> style="color: {forumrow.LAST_POSTER_COLOUR}"<!-- ENDIF -->>{forumrow.LAST_POSTER}</a> <!-- ELSE --> {forumrow.LAST_POSTER} <!-- ENDIF --> diff --git a/phpBB/styles/subSilver/template/search_results.html b/phpBB/styles/subSilver/template/search_results.html index 932a346ed0..a192f090ad 100644 --- a/phpBB/styles/subSilver/template/search_results.html +++ b/phpBB/styles/subSilver/template/search_results.html @@ -51,12 +51,12 @@ <p class="gensmall">{L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></p> <!-- ENDIF --> </td> - <td class="row2" width="100" align="center"><p class="topicauthor">{searchresults.TOPIC_AUTHOR_LINK}</p></td> + <td class="row2" width="100" align="center"><p class="topicauthor"><!-- IF searchresults.U_TOPIC_AUTHOR --><a href="{searchresults.U_TOPIC_AUTHOR}"<!-- IF searchresults.TOPIC_AUTHOR_COLOUR --> style="color: {searchresults.TOPIC_AUTHOR_COLOUR}"<!-- ENDIF -->>{searchresults.TOPIC_AUTHOR}</a><!-- ELSE -->{searchresults.TOPIC_AUTHOR}</a><!-- ENDIF --></p></td> <td class="row1" width="50" align="center"><p class="topicdetails">{searchresults.TOPIC_REPLIES}</p></td> <td class="row2" width="50" align="center"><p class="topicdetails">{searchresults.TOPIC_VIEWS}</p></td> <td class="row1" width="120" align="center"> <p class="topicdetails">{searchresults.LAST_POST_TIME}</p> - <p class="topicdetails"><!-- IF searchresults.U_LAST_POST_AUTHOR --><a href="{searchresults.U_LAST_POST_AUTHOR}">{searchresults.LAST_POST_AUTHOR}</a><!-- ELSE -->{searchresults.LAST_POST_AUTHOR}<!-- ENDIF --> + <p class="topicdetails"><!-- IF searchresults.U_LAST_POST_AUTHOR --><a href="{searchresults.U_LAST_POST_AUTHOR}"<!-- IF searchresults.LAST_POST_AUTHOR_COLOUR --> style="color: {searchresults.LAST_POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{searchresults.LAST_POST_AUTHOR}</a><!-- ELSE -->{searchresults.LAST_POST_AUTHOR}<!-- ENDIF --> <a href="{searchresults.U_LAST_POST}">{searchresults.LAST_POST_IMG}</a> </p> </td> diff --git a/phpBB/styles/subSilver/template/viewforum_body.html b/phpBB/styles/subSilver/template/viewforum_body.html index fb8e14a239..4fdf762baf 100644 --- a/phpBB/styles/subSilver/template/viewforum_body.html +++ b/phpBB/styles/subSilver/template/viewforum_body.html @@ -173,12 +173,12 @@ <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p> <!-- ENDIF --> </td> - <td class="row2" width="100" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR_LINK}</p></td> + <td class="row2" width="100" align="center"><p class="topicauthor"><!-- IF topicrow.U_TOPIC_AUTHOR --><a href="{topicrow.U_TOPIC_AUTHOR}"<!-- IF topicrow.TOPIC_AUTHOR_COLOUR --> style="color: {topicrow.TOPIC_AUTHOR_COLOUR}"<!-- ENDIF -->>{topicrow.TOPIC_AUTHOR}</a><!-- ELSE -->{topicrow.TOPIC_AUTHOR}</a><!-- ENDIF --></p></td> <td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td> <td class="row2" width="50" align="center"><p class="topicdetails">{topicrow.VIEWS}</p></td> <td class="row1" width="140" align="center"> <p class="topicdetails" style="white-space: nowrap;">{topicrow.LAST_POST_TIME}</p> - <p class="topicdetails"><!-- IF topicrow.U_LAST_POST_AUTHOR --><a href="{topicrow.U_LAST_POST_AUTHOR}">{topicrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{topicrow.LAST_POST_AUTHOR}<!-- ENDIF --> + <p class="topicdetails"><!-- IF topicrow.U_LAST_POST_AUTHOR --><a href="{topicrow.U_LAST_POST_AUTHOR}"<!-- IF topicrow.LAST_POST_AUTHOR_COLOUR --> style="color: {topicrow.LAST_POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{topicrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{topicrow.LAST_POST_AUTHOR}<!-- ENDIF --> <a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> </p> </td> diff --git a/phpBB/styles/subSilver/template/viewforum_subforum.html b/phpBB/styles/subSilver/template/viewforum_subforum.html index 64a31583ee..46f8ede834 100644 --- a/phpBB/styles/subSilver/template/viewforum_subforum.html +++ b/phpBB/styles/subSilver/template/viewforum_subforum.html @@ -47,7 +47,7 @@ <p class="topicdetails">{forumrow.LAST_POST_TIME}</p> <p class="topicdetails"> <!-- IF forumrow.U_LAST_POSTER --> - <a href="{forumrow.U_LAST_POSTER}">{forumrow.LAST_POSTER}</a> + <a href="{forumrow.U_LAST_POSTER}"<!-- IF forumrow.LAST_POSTER_COLOUR --> style="color: {forumrow.LAST_POSTER_COLOUR}"<!-- ENDIF -->>{forumrow.LAST_POSTER}</a> <!-- ELSE --> {forumrow.LAST_POSTER} <!-- ENDIF --> diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index bd7c50b8d5..6c85ed7ffe 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -509,15 +509,16 @@ if (sizeof($topic_list)) // Send vars to template $template->assign_block_vars('topicrow', array( - 'FORUM_ID' => $forum_id, - 'TOPIC_ID' => $topic_id, - 'TOPIC_AUTHOR' => ($row['topic_first_poster_name']) ? $row['topic_first_poster_name'] : $user->lang['GUEST'], - 'TOPIC_AUTHOR_COLOUR' => ($row['topic_first_poster_colour']) ? '#' . $row['topic_first_poster_colour'] : '', - 'TOPIC_AUTHOR_LINK' => topic_topic_author($row), - 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), - 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), - 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), - 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name']) ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'FORUM_ID' => $forum_id, + 'TOPIC_ID' => $topic_id, + 'TOPIC_AUTHOR' => ($row['topic_first_poster_name']) ? $row['topic_first_poster_name'] : $user->lang['GUEST'], + 'TOPIC_AUTHOR_COLOUR' => ($row['topic_first_poster_colour']) ? '#' . $row['topic_first_poster_colour'] : '', + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name']) ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'LAST_POST_AUTHOR_COLOUR' => ($row['topic_last_poster_colour']) ? '#' . $row['topic_last_poster_colour'] : '', + 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], @@ -548,6 +549,7 @@ if (sizeof($topic_list)) 'U_NEWEST_POST' => $view_topic_url . '&view=unread#unread', 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '', + 'U_TOPIC_AUTHOR' => ($row['topic_poster'] != ANONYMOUS && $row['topic_poster']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_poster']) : '', 'U_VIEW_TOPIC' => $view_topic_url, 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&f=' . $forum_id . '&t=' . $topic_id, true, $user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue, |