mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
Initial batch of colourization changes. This includes:
- schema changes for first post and last post - display in viewforum, search and ucp of first post - update of database on posting Still outstanding - display of last post git-svn-id: file:///svn/phpbb/trunk@6309 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -1638,7 +1638,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
|
||||
unset($delete_topics);
|
||||
}
|
||||
|
||||
$sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_username, p.post_time, u.username
|
||||
$sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_username, p.post_time, u.username, u.user_colour
|
||||
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
|
||||
WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . '
|
||||
AND u.user_id = p.poster_id';
|
||||
@@ -1658,6 +1658,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
|
||||
$topic_data[$topic_id]['time'] = $row['post_time'];
|
||||
$topic_data[$topic_id]['poster'] = $row['poster_id'];
|
||||
$topic_data[$topic_id]['first_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username'];
|
||||
$topic_data[$topic_id]['first_poster_colour'] = $row['user_colour'];
|
||||
}
|
||||
|
||||
if ($row['post_id'] == $topic_data[$topic_id]['last_post_id'])
|
||||
@@ -1665,6 +1666,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
|
||||
$topic_data[$topic_id]['last_poster_id'] = $row['poster_id'];
|
||||
$topic_data[$topic_id]['last_post_time'] = $row['post_time'];
|
||||
$topic_data[$topic_id]['last_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username'];
|
||||
$topic_data[$topic_id]['last_poster_colour'] = $row['user_colour'];
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
@@ -498,7 +498,7 @@ 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_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>' : '';
|
||||
|
||||
|
@@ -1197,7 +1197,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
|
||||
break;
|
||||
|
||||
case 'delete_first_post':
|
||||
$sql = 'SELECT p.post_id, p.poster_id, p.post_username, u.username
|
||||
$sql = 'SELECT p.post_id, p.poster_id, p.post_username, u.username, u.user_colour
|
||||
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
|
||||
WHERE p.topic_id = $topic_id
|
||||
AND p.poster_id = u.user_id
|
||||
@@ -1211,7 +1211,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
|
||||
$sql_data[FORUMS_TABLE] = 'forum_posts = forum_posts - 1';
|
||||
}
|
||||
|
||||
$sql_data[TOPICS_TABLE] = 'topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'";
|
||||
$sql_data[TOPICS_TABLE] = 'topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_colour = '" . $db->sql_escape($row['user_colour']) . ", topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'";
|
||||
$sql_data[TOPICS_TABLE] .= ', topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : '');
|
||||
|
||||
$next_post_id = (int) $row['post_id'];
|
||||
@@ -1462,6 +1462,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
'topic_approved' => (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1,
|
||||
'topic_title' => $subject,
|
||||
'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''),
|
||||
'topic_first_poster_colour' => (($user->data['user_id'] != ANONYMOUS) ? $user->data['user_colour'] : ''),
|
||||
'topic_type' => $topic_type,
|
||||
'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0,
|
||||
'topic_attachment' => (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0
|
||||
@@ -1560,7 +1561,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
'topic_last_post_id' => $data['post_id'],
|
||||
'topic_last_post_time' => $current_time,
|
||||
'topic_last_poster_id' => (int) $user->data['user_id'],
|
||||
'topic_last_poster_name'=> (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '')
|
||||
'topic_last_poster_name'=> (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''),
|
||||
'topic_last_poster_colour' => (($user->data['user_id'] != ANONYMOUS) ? $user->data['user_colour'] : ''),
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -419,7 +419,9 @@ class ucp_main
|
||||
$template->assign_block_vars('topicrow', array(
|
||||
'FORUM_ID' => $forum_id,
|
||||
'TOPIC_ID' => $topic_id,
|
||||
'TOPIC_AUTHOR' => topic_topic_author($row),
|
||||
'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']),
|
||||
@@ -578,7 +580,9 @@ class ucp_main
|
||||
'S_DELETED_TOPIC' => (!$row['topic_id']) ? true : false,
|
||||
'S_GLOBAL_TOPIC' => (!$forum_id) ? true : false,
|
||||
|
||||
'TOPIC_AUTHOR' => topic_topic_author($row),
|
||||
'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']),
|
||||
|
Reference in New Issue
Block a user