1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-07 08:05:25 +02:00

- ucp register/remind/activate fixes mostly regarding account activation

- general ucp fixing (profile and ucp_main)
- created three new functions (return correct topic author string, generate topic related pagination and get topic type/status...). These general bits are used on several pages (subscribed topics, bookmarks, viewforum).
- config basic schema fix
- commented out inline fix for unread topic tracking in viewforum, instead tried another method (hopefully working as well)


git-svn-id: file:///svn/phpbb/trunk@5001 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2004-10-13 19:30:02 +00:00
parent 4804c05bca
commit c941f666cf
17 changed files with 392 additions and 335 deletions

View File

@ -340,6 +340,143 @@ function display_forums($root_data = '', $display_moderators = TRUE)
return $active_forum_ary;
}
function topic_topic_author(&$topic_row)
{
global $phpEx, $SID, $phpbb_root_path, $user;
$topic_author = ($topic_row['topic_poster'] != ANONYMOUS) ? "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $topic_row['topic_poster'] . '">' : '';
$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;
}
function topic_generate_pagination($replies, $url)
{
global $config, $user;
if (($replies + 1) > $config['posts_per_page'])
{
$total_pages = ceil(($replies + 1) / $config['posts_per_page']);
$pagination = '';
$times = 1;
for ($j = 0; $j < $replies + 1; $j += $config['posts_per_page'])
{
$pagination .= "<a href=\"$url&amp;start=$j\">$times</a>";
if ($times == 1 && $total_pages > 4)
{
$pagination .= ' ... ';
$times = $total_pages - 3;
$j += ($total_pages - 4) * $config['posts_per_page'];
}
else if ($times < $total_pages)
{
$pagination .= $user->theme['primary']['pagination_sep'];
}
$times++;
}
}
else
{
$pagination = '';
}
return $pagination;
}
function topic_status(&$topic_row, $replies, $mark_time_topic, $mark_time_forum, &$folder_img, &$folder_alt, &$topic_type)
{
global $user, $config;
$folder = $folder_new = '';
$unread_topic = false;
if ($topic_row['topic_status'] == ITEM_MOVED)
{
$topic_type = $user->lang['VIEW_TOPIC_MOVED'];
$folder_img = 'folder_moved';
$folder_alt = 'VIEW_TOPIC_MOVED';
}
else
{
switch ($topic_row['topic_type'])
{
case POST_GLOBAL:
case POST_ANNOUNCE:
$topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT'];
$folder = 'folder_announce';
$folder_new = 'folder_announce_new';
break;
case POST_STICKY:
$topic_type = $user->lang['VIEW_TOPIC_STICKY'];
$folder = 'folder_sticky';
$folder_new = 'folder_sticky_new';
break;
default:
if ($replies >= $config['hot_threshold'])
{
$folder = 'folder_hot';
$folder_new = 'folder_hot_new';
}
else
{
$folder = 'folder';
$folder_new = 'folder_new';
}
break;
}
if ($topic_row['topic_status'] == ITEM_LOCKED)
{
$topic_type = $user->lang['VIEW_TOPIC_LOCKED'];
$folder = 'folder_locked';
$folder_new = 'folder_locked_new';
}
if ($user->data['user_id'] != ANONYMOUS)
{
$unread_topic = $new_votes = true;
if ($mark_time_topic >= $topic_row['topic_last_post_time'] || $mark_time_forum >= $topic_row['topic_last_post_time']) //|| ($topic_row['topic_last_post_time'] == $topic_row['poll_last_vote'] && $replies))
{
$unread_topic = false;
}
/*
if ($topic_row['poll_start'] && ($mark_time_topic >= $topic_row['poll_last_vote'] || $mark_time_forum >= $topic_row['poll_last_vote']))
{
$new_votes = false;
}
*/
}
else
{
$unread_topic = false;
//$unread_topic = $new_votes = false;
}
// $folder_new .= ($new_votes) ? '_vote' : '';
$folder_img = ($unread_topic) ? $folder_new : $folder;
$folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
// Posted image?
if (!empty($topic_row['mark_type']))
{
$folder_img .= '_posted';
}
}
if ($topic_row['poll_start'])
{
$topic_type .= $user->lang['VIEW_TOPIC_POLL'];
}
return $unread_topic;
}
// Display Attachments
function display_attachments($forum_id, $blockname, &$attachment_data, &$update_count, $force_physical = false, $return = false)
{

View File

@ -42,23 +42,34 @@ class ucp_activate extends module
trigger_error($user->lang['WRONG_ACTIVATION']);
}
$sql_update_pass = ($row['user_newpasswd']) ? ", user_password = '" . $db->sql_escape($row['user_newpasswd']) . "', user_newpasswd = ''" : '';
$update_password = ($row['user_newpasswd']) ? true : false;
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_type = ' . USER_NORMAL . ", user_actkey = '$sql_update_pass'
WHERE user_id = {$row['user_id']}";
$sql_ary = array(
'user_type' => USER_NORMAL,
'user_actkey' => ''
);
if ($update_password)
{
$sql_ary += array(
'user_password' => $row['user_newpasswd'],
'user_newpasswd' => ''
);
}
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $row['user_id'];
$result = $db->sql_query($sql);
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && $sql_update_pass)
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)
{
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
$messenger = new messenger();
$messenger->template('admin_welcome_activated', $row['user_lang']);
$messenger->subject($subject);
$messenger->replyto($user->data['board_contact']);
$messenger->replyto($config['board_contact']);
$messenger->to($row['user_email'], $row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
@ -69,7 +80,7 @@ class ucp_activate extends module
$messenger->assign_vars(array(
'SITENAME' => $config['sitename'],
'USERNAME' => $row['username'],
'PASSWORD' => $password_confirm,
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']))
);
@ -80,10 +91,10 @@ class ucp_activate extends module
}
else
{
$message = (!$sql_update_pass) ? 'ACCOUNT_ACTIVE' : 'PASSWORD_ACTIVATED';
$message = (!$update_password) ? 'ACCOUNT_ACTIVE' : 'PASSWORD_ACTIVATED';
}
if (!$sql_update_pass)
if (!$update_password)
{
set_config('newest_user_id', $row['user_id']);
set_config('newest_username', $row['username']);

View File

@ -277,7 +277,12 @@ class ucp_main extends module
case 'subscribed':
if ($_POST['unwatch'])
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
$user->add_lang('viewforum');
$unwatch = (isset($_POST['unwatch'])) ? true : false;
if ($unwatch)
{
$forums = (isset($_POST['f'])) ? implode(', ', array_map('intval', array_keys($_POST['f']))) : false;
$topics = (isset($_POST['t'])) ? implode(', ', array_map('intval', array_keys($_POST['t']))) : false;
@ -305,9 +310,9 @@ class ucp_main extends module
$l_unwatch .= '_TOPICS';
}
$message = $user->lang['UNWATCHED' . $l_unwatch] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=watched\">", '</a>');
$message = $user->lang['UNWATCHED' . $l_unwatch] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=subscribed\">", '</a>');
meta_refresh(3, "ucp.$phpEx$SID&amp;i=$id&amp;mode=watched");
meta_refresh(3, "ucp.$phpEx$SID&amp;i=$id&amp;mode=subscribed");
trigger_error($message);
}
}
@ -396,137 +401,102 @@ class ucp_main extends module
// Subscribed Topics
$start = request_var('start', 0);
$sql = 'SELECT COUNT(topic_id) as topics_count
FROM ' . TOPICS_WATCH_TABLE . '
WHERE user_id = ' . $user->data['user_id'];
$result = $db->sql_query($sql);
$topics_count = (int) $db->sql_fetchfield('topics_count', 0, $result);
$db->sql_freeresult($result);
if ($topics_count)
{
$template->assign_vars(array(
'PAGINATION' => generate_pagination("ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode", $topics_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start),
'TOTAL_TOPICS' => ($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count))
);
}
$sql_from = ($config['load_db_lastread'] || $config['load_db_track']) ? '(' . TOPICS_TABLE . ' t LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . '))' : TOPICS_TABLE . ' t';
// $sql_f_tracking = ($config['load_db_lastread']) ? 'LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id'] . ')' : '';
$sql_f_tracking = ($config['load_db_lastread']) ? 'LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id'] . '), ' : '';
$sql_t_select = ($config['load_db_lastread'] || $config['load_db_track']) ? ', tt.mark_type, tt.mark_time' : '';
// $sql_f_select = ($config['load_db_lastread']) ? ', ft.mark_time AS forum_mark_time' : '';
$sql_f_select = ($config['load_db_lastread']) ? ', ft.mark_time AS forum_mark_time' : '';
$sql = "SELECT t.* $sql_f_select $sql_t_select
FROM $sql_from, " . TOPICS_WATCH_TABLE . ' tw
FROM $sql_from $sql_f_tracking " . TOPICS_WATCH_TABLE . ' tw
WHERE tw.user_id = ' . $user->data['user_id'] . '
AND t.topic_id = tw.topic_id
ORDER BY t.topic_last_post_time DESC';
$result = $db->sql_query_limit($sql, $config['topics_per_page']);
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
while ($row = $db->sql_fetchrow($result))
{
$forum_id = $row['forum_id'];
$topic_id = $row['topic_id'];
// Goto message generation
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
$forum_id = $row['forum_id'];
$topic_type = '';
switch ($row['topic_type'])
if ($config['load_db_lastread'])
{
case POST_ANNOUNCE:
$topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT'];
$folder = 'folder_announce';
$folder_new = 'folder_announce_new';
break;
case POST_STICKY:
$topic_type = $user->lang['VIEW_TOPIC_STICKY'];
$folder = 'folder_sticky';
$folder_new = 'folder_sticky_new';
break;
default:
if ($replies >= intval($config['hot_threshold']))
{
$folder = 'folder_hot';
$folder_new = 'folder_hot_new';
}
else
{
$folder = 'folder';
$folder_new = 'folder_new';
}
break;
}
if ($row['topic_status'] == ITEM_LOCKED)
{
$topic_type = $user->lang['VIEW_TOPIC_LOCKED'];
$folder = 'folder_locked';
$folder_new = 'folder_locked_new';
}
$unread_topic = ($user->data['user_id'] != ANONYMOUS) ? true : false;
if ($user->data['user_id'] != ANONYMOUS)
{
$topic_check = (!$config['load_db_lastread']) ? ((isset($tracking_topics[$forum_id][base_convert($topic_id, 10, 36)])) ? base_convert($tracking_topics[$forum_id36][$topic_id36], 36, 10) + $config['board_startdate'] : 0) : $row['mark_time'];
$forum_check = (!$config['load_db_lastread']) ? ((isset($tracking_topics[$forum_id][0])) ? base_convert($tracking_topics[$forum_id][0], 36, 10) + $config['board_startdate'] : 0) : $row['forum_mark_time'];
if ($topic_check > $row['topic_last_post_time'] || $forum_check > $row['topic_last_post_time'])
{
$unread_topic = false;
}
}
$newest_post_img = ($unread_topic) ? "<a href=\"viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id&amp;view=unread\">" . $user->img('icon_post_newest', 'VIEW_NEWEST_POST') . '</a> ' : '';
$folder_img = ($unread_topic) ? $folder_new : $folder;
$folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
// Posted image?
if (!empty($row['mark_type']))
{
$folder_img .= '_posted';
}
if (($replies + 1) > $config['posts_per_page'])
{
$total_pages = ceil(($replies + 1) / $config['posts_per_page']);
$goto_page = ' [ ' . $user->img('icon_post', 'GOTO_PAGE') . $user->lang['GOTO_PAGE'] . ': ';
$times = 1;
for($j = 0; $j < $replies + 1; $j += $config['posts_per_page'])
{
$goto_page .= "<a href=\"viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id&amp;start=$j\">$times</a>";
if ($times == 1 && $total_pages > 4)
{
$goto_page .= ' ... ';
$times = $total_pages - 3;
$j += ($total_pages - 4) * $config['posts_per_page'];
}
else if ($times < $total_pages)
{
$goto_page .= ', ';
}
$times++;
}
$goto_page .= ' ] ';
$mark_time_topic = ($user->data['user_id'] != ANONYMOUS) ? $row['mark_time'] : 0;
$mark_time_forum = $row['forum_mark_time'];
}
else
{
$goto_page = '';
$topic_id36 = base_convert($topic_id, 10, 36);
$forum_id36 = ($row['topic_type'] == POST_GLOBAL) ? 0 : $forum_id;
$mark_time_topic = (isset($tracking_topics[$forum_id36][$topic_id36])) ? base_convert($tracking_topics[$forum_id36][$topic_id36], 36, 10) + $config['board_startdate'] : 0;
$mark_time_forum = (isset($tracking_topics[$forum_id][0])) ? base_convert($tracking_topics[$forum_id][0], 36, 10) + $config['board_startdate'] : 0;
}
// Replies
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
if ($row['topic_status'] == ITEM_MOVED)
{
$topic_id = $row['topic_moved_id'];
}
// Get folder img, topic status/type related informations
$folder_img = $folder_alt = $topic_type = '';
$unread_topic = topic_status($row, $replies, $mark_time_topic, $mark_time_forum, $folder_img, $folder_alt, $topic_type);
$newest_post_img = ($unread_topic) ? "<a href=\"viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id&amp;view=unread#unread\">" . $user->img('icon_post_newest', 'VIEW_NEWEST_POST') . '</a> ' : '';
$view_topic_url = "viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id";
$last_post_img = "<a href=\"viewtopic.$phpEx$SID&amp;f=$forum_id&amp;p=" . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'] . '">' . $user->img('icon_post_latest', 'VIEW_LATEST_POST') . '</a>';
$last_post_author = ($row['topic_last_poster_id'] == ANONYMOUS) ? (($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] . ' ' : $user->lang['GUEST'] . ' ') : "<a href=\"memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $row['topic_last_poster_id'] . '">' . $row['topic_last_poster_name'] . '</a>';
// Send vars to template
$template->assign_block_vars('topicrow', array(
'FORUM_ID' => $forum_id,
'TOPIC_ID' => $topic_id,
'TOPIC_AUTHOR' => 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_POST_AUTHOR' => $last_post_author,
'GOTO_PAGE' => $goto_page,
'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, "viewtopic.$phpEx$SID&amp;f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&amp;t=$topic_id"),
'REPLIES' => $replies,
'VIEWS' => $row['topic_views'],
'TOPIC_TITLE' => censor_text($row['topic_title']),
'TOPIC_TYPE' => $topic_type,
'LAST_POST_IMG' => $last_post_img,
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
'NEWEST_POST_IMG' => $newest_post_img,
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', '') : '',
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '',
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', sprintf($user->lang['TOTAL_ATTACHMENTS'], $row['topic_attachment'])) : '',
'S_USER_POSTED' => (!empty($row['mark_type'])) ? true : false,
'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (!empty($row['mark_type'])) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic,
'U_LAST_POST' => $view_topic_url . '&amp;p=' . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'],
'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? "memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['topic_last_poster_id']}" : '',
'U_VIEW_TOPIC' => $view_topic_url)
);
}
$db->sql_freeresult($result);
@ -542,6 +512,9 @@ class ucp_main extends module
break;
}
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
$user->add_lang('viewforum');
$move_up = request_var('move_up', 0);
$move_down = request_var('move_down', 0);
@ -634,40 +607,12 @@ class ucp_main extends module
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
$topic_type = '';
switch ($row['topic_type'])
{
case POST_ANNOUNCE:
$topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT'];
$folder = 'folder_announce';
break;
// Get folder img, topic status/type related informations
$folder_img = $folder_alt = $topic_type = '';
$unread_topic = topic_status($row, $replies, time(), time(), $folder_img, $folder_alt, $topic_type);
case POST_STICKY:
$topic_type = $user->lang['VIEW_TOPIC_STICKY'];
$folder = 'folder_sticky';
break;
default:
if ($replies >= intval($config['hot_threshold']))
{
$folder = 'folder_hot';
}
else
{
$folder = 'folder';
}
break;
}
if ($row['topic_status'] == ITEM_LOCKED)
{
$topic_type = $user->lang['VIEW_TOPIC_LOCKED'];
$folder = 'folder_locked';
}
$folder_alt = ($row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'TOPIC';
$view_topic_url = "viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id";
$last_post_img = "<a href=\"viewtopic.$phpEx$SID&amp;f=$forum_id&amp;p=" . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'] . '">' . $user->img('icon_post_latest', 'VIEW_LATEST_POST') . '</a>';
// $last_post_img = "<a href=\"viewtopic.$phpEx$SID&amp;f=$forum_id&amp;p=" . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'] . '">' . $user->img('icon_post_latest', 'VIEW_LATEST_POST') . '</a>';
$template->assign_block_vars('topicrow', array(
'FORUM_ID' => $forum_id,
@ -676,13 +621,24 @@ class ucp_main extends module
'TOPIC_TITLE' => censor_text($row['topic_title']),
'TOPIC_TYPE' => $topic_type,
'FORUM_NAME' => $row['forum_name'],
'TOPIC_AUTHOR' => 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, "viewtopic.$phpEx$SID&amp;f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&amp;t=$topic_id"),
'POSTED_AT' => $user->format_date($row['topic_time']),
'TOPIC_FOLDER_IMG' => $user->img($folder, $folder_alt),
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', '') : '',
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
'U_LAST_POST' => $view_topic_url . '&amp;p=' . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'],
'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? "memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['topic_last_poster_id']}" : '',
'U_VIEW_TOPIC' => $view_topic_url,
'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&amp;f={$row['forum_id']}",
'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&amp;f=$forum_id}",
'U_MOVE_UP' => ($row['order_id'] != 1) ? "{$phpbb_root_path}ucp.$phpEx$SID&amp;i=main&amp;mode=bookmarks&amp;move_up={$row['order_id']}" : '',
'U_MOVE_DOWN' => ($row['order_id'] != $max_order_id) ? "{$phpbb_root_path}ucp.$phpEx$SID&amp;i=main&amp;mode=bookmarks&amp;move_down={$row['order_id']}" : '')
);

View File

@ -21,7 +21,7 @@ class ucp_prefs extends module
$error = $data = array();
$s_hidden_fields = '';
switch($mode)
switch ($mode)
{
case 'personal':
@ -40,10 +40,9 @@ class ucp_prefs extends module
'notifypm' => true,
'popuppm' => false,
'allowpm' => true,
'report_pm_notify' => false
);
$var_ary['report_pm_notify'] = false;
foreach ($var_ary as $var => $default)
{
$data[$var] = request_var($var, $default);
@ -89,6 +88,9 @@ class ucp_prefs extends module
$message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode\">", '</a>');
trigger_error($message);
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$viewemail = (isset($viewemail)) ? $viewemail : $user->data['user_allow_viewemail'];
@ -214,6 +216,9 @@ class ucp_prefs extends module
$message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode\">", '</a>');
trigger_error($message);
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$sk = (isset($sk)) ? $sk : ((!empty($user->data['user_sortby_type'])) ? $user->data['user_sortby_type'] : 't');
@ -310,6 +315,9 @@ class ucp_prefs extends module
$message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode\">", '</a>');
trigger_error($message);
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$bbcode = (isset($bbcode)) ? $bbcode : $user->optionget('bbcode');

View File

@ -23,6 +23,7 @@ class ucp_profile extends module
$submit = (!empty($_POST['submit'])) ? true : false;
$delete = (!empty($_POST['delete'])) ? true : false;
$error = $data = array();
$s_hidden_fields = '';
switch ($mode)
{
@ -47,13 +48,13 @@ class ucp_profile extends module
$var_ary = array(
'username' => array(
array('string', false, $config['min_name_chars'], $config['max_name_chars']),
array('username', $username)),
array('username', $data['username'])),
'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
'new_password' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
'cur_password' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
'email' => array(
array('string', false, 6, 60),
array('email', $email)),
array('email', $data['email'])),
'email_confirm' => array('string', true, 6, 60),
);
@ -99,10 +100,10 @@ class ucp_profile extends module
$messenger = new messenger();
$messenger->template($email_template, $lang);
$messenger->subject($subject);
$template_file = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? 'user_activate_inactive' : 'user_activate';
$messenger->template($template_file, $user->data['user_lang']);
$messenger->replyto($user->data['board_contact']);
$messenger->replyto($config['board_contact']);
$messenger->to($email, $username);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
@ -112,12 +113,10 @@ class ucp_profile extends module
$messenger->assign_vars(array(
'SITENAME' => $config['sitename'],
'WELCOME_MSG' => sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']),
'USERNAME' => $username,
'PASSWORD' => $password_confirm,
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&k=$user_actkey")
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
);
$messenger->send(NOTIFY_EMAIL);
@ -127,23 +126,23 @@ class ucp_profile extends module
// Grab an array of user_id's with a_user permissions
$admin_ary = $auth->acl_get_list(false, 'a_user', false);
$sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
FROM ' . USERS_TABLE . '
WHERE user_id IN (' . implode(', ', $admin_ary[0]['a_user']) .')';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$messenger->use_template('admin_activate', $row['user_lang']);
$messenger->template('admin_activate', $row['user_lang']);
$messenger->replyto($config['board_contact']);
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array(
'USERNAME' => $row['username'],
'USERNAME' => $username,
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&k=$user_actkey")
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
);
$messenger->send($row['user_notify_type']);
@ -174,6 +173,9 @@ class ucp_profile extends module
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode\">", '</a>');
trigger_error($message);
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS');
@ -304,6 +306,9 @@ class ucp_profile extends module
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode\">", '</a>');
trigger_error($message);
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
if (!isset($bday_day))
@ -364,8 +369,6 @@ class ucp_profile extends module
include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
$s_hidden_fields = '';
$var_ary = array(
'enable_html' => (bool) $config['allow_html'],
'enable_bbcode' => (bool) $config['allow_bbcode'],
@ -394,7 +397,7 @@ class ucp_profile extends module
if (strlen($signature) > $config['max_sig_chars'])
{
$error[] = $user->lang['SIGNATURE_TOO_LONG'];
$error[] = 'SIGNATURE_TOO_LONG';
}
if (!sizeof($error))
@ -426,6 +429,9 @@ class ucp_profile extends module
trigger_error($message);
}
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$signature_preview = '';
@ -468,7 +474,6 @@ class ucp_profile extends module
$category = request_var('category', '');
$delete = (isset($_POST['delete'])) ? true : false;
$avatarselect = request_var('avatarselect', '');
$s_hidden_fields = '';
// Can we upload?
$can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && is_writeable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
@ -553,7 +558,7 @@ class ucp_profile extends module
unset($data);
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$lang['\\1'])) ? \$lang['\\1'] : '\\1'", $error);
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
// Generate users avatar

View File

@ -154,6 +154,19 @@ class ucp_register extends module
}
}
if (!sizeof($error))
{
if ($new_password != $password_confirm)
{
$error[] = 'NEW_PASSWORD_ERROR';
}
if ($email != $email_confirm)
{
$error[] = 'NEW_EMAIL_ERROR';
}
}
if (!sizeof($error))
{
$server_url = generate_board_url();
@ -262,7 +275,6 @@ class ucp_register extends module
$messenger = new messenger();
$messenger->template($email_template, $lang);
$messenger->subject($subject);
$messenger->replyto($config['board_contact']);
$messenger->to($email, $username);
@ -300,7 +312,7 @@ class ucp_register extends module
// can activate a user
$admin_ary = $auth->acl_get_list(false, 'a_user', false);
$sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
FROM ' . USERS_TABLE . '
WHERE user_id IN (' . implode(', ', $admin_ary[0]['a_user']) .')';
$result = $db->sql_query($sql);
@ -313,7 +325,7 @@ class ucp_register extends module
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array(
'USERNAME' => $row['username'],
'USERNAME' => $username,
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")

View File

@ -28,20 +28,17 @@ class ucp_remind extends module
FROM ' . USERS_TABLE . "
WHERE user_email = '" . $db->sql_escape($email) . "'
AND username = '" . $db->sql_escape($username) . "'";
if (!($result = $db->sql_query($sql)))
{
trigger_error($user->lang['NO_USER']);
}
$result = $db->sql_query($sql);
if (!($row = $db->sql_fetchrow($result)))
{
trigger_error($lang['NO_EMAIL']);
trigger_error('NO_EMAIL_USER');
}
$db->sql_freeresult($result);
if ($row['user_type'] == USER_INACTIVE)
{
trigger_error($lang['ACCOUNT_INACTIVE']);
trigger_error('ACCOUNT_NOT_ACTIVATED');
}
$server_url = generate_board_url();
@ -49,7 +46,7 @@ class ucp_remind extends module
$user_id = $row['user_id'];
$key_len = 54 - strlen($server_url);
$key_len = ($str_len > 6) ? $key_len : 6;
$key_len = ($key_len > 6) ? $key_len : 6;
$user_actkey = substr(gen_rand_string(10), 0, $key_len);
$user_password = gen_rand_string(8);
@ -63,7 +60,6 @@ class ucp_remind extends module
$messenger = new messenger();
$messenger->template('user_activate_passwd', $row['user_lang']);
$messenger->subject($subject);
$messenger->replyto($user->data['user_email']);
$messenger->to($row['user_email'], $row['username']);

View File

@ -18,6 +18,7 @@ class ucp_zebra extends module
global $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx;
$submit = (!empty($_POST['submit']) || !empty($_GET['add'])) ? true : false;
$s_hidden_fields = '';
if ($submit)
{
@ -174,7 +175,7 @@ class ucp_zebra extends module
$db->sql_freeresult($result);
$template->assign_vars(array(
'L_TITLE' => $user->lang['UCP_' . strtoupper($mode)],
'L_TITLE' => $user->lang['UCP_ZEBRA_' . strtoupper($mode)],
'U_SEARCH_USER' => "memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=ucp&amp;field=add",

View File

@ -21,7 +21,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_uploa
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_nocensors','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_emailreuse','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bookmarks','1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars','.*?');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars','.*');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable_msg','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_dst','0');

View File

@ -262,6 +262,8 @@ $lang += array(
'PM' => 'PM',
'POSTING_MESSAGE' => 'Posting message in %s',
'POST' => 'Post',
'POST_ANNOUNCEMENT' => 'Announce',
'POST_STICKY' => 'Sticky',
'POSTED' => 'Posted',
'POSTS' => 'Posts',
'POST_BY_FOE' => 'This post was made by <b>%1$s</b> who is currently on your ignore list. To display this post click %2$sHERE%3$s.',
@ -367,6 +369,7 @@ $lang += array(
'TOPICS' => 'Topics',
'TOPIC_ICON' => 'Topic icon',
'TOPIC_LOCKED' => 'This topic is locked you cannot edit posts or make replies',
'TOPIC_MOVED' => 'Moved Topic',
'TOPIC_TITLE' => 'Topic Title',
'TOPIC_UNAPPROVED' => 'This topic has not been approved',
'TOTAL_ATTACHMENTS' => '%d Attachments',

View File

@ -139,7 +139,6 @@ $lang += array(
'POLL_VOTE_CHANGE' => 'Allow Vote Change',
'POLL_VOTE_CHANGE_EXPLAIN' => 'If enabled users are able to change their vote.',
'POSTED_ATTACHMENTS' => 'Posted attachments',
'POST_ANNOUNCEMENT' => 'Announce',
'POST_DELETED' => 'Your message has been deleted successfully',
'POST_EDITED' => 'Your message has been edited successfully',
'POST_EDITED_MOD' => 'Your message has been edited but requires approval',
@ -149,7 +148,6 @@ $lang += array(
'POST_REPLY' => 'Post a reply',
'POST_REVIEW' => 'Post Review',
'POST_REVIEW_EXPLAIN' => 'At least one new post has been made to this topic. You may wish to review your post inlight of this.',
'POST_STICKY' => 'Sticky',
'POST_STORED' => 'Your message has been posted successfully',
'POST_STORED_MOD' => 'Your message has been saved but requires approval',
'POST_TOPIC' => 'Post a new topic',

View File

@ -26,8 +26,19 @@
<!-- IF topicrow.S_DELETED_TOPIC -->
<td class="postdetails" style="padding: 4px" width="100%" colspan="2">{L_DELETED_TOPIC}</td>
<!-- ELSE -->
<td style="padding: 4px;" width="100%"><p class="topictitle">{topicrow.ATTACH_ICON_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></p><br /><span class="gensmall">{L_FORUM}: <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span></td>
<td class="postdetails" style="padding: 4px;" align="left" valign="top" nowrap="nowrap">{L_POSTED}:<br />{topicrow.POSTED_AT}</td>
<td style="padding: 4px;" width="100%" valign="top">
<p class="topictitle">{topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></p><br />
<span class="gensmall"><b>{L_FORUM}: </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span>
<!-- IF topicrow.PAGINATION -->
<p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p>
<!-- ENDIF -->
</td>
<td style="padding: 4px;" align="left" valign="top" nowrap="nowrap">
<p class="topicdetails">{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 -->
<a href="{topicrow.U_LAST_POST}">{topicrow.LAST_POST_IMG}</a>
</p>
</td>
<!-- ENDIF -->
<td class="postdetails" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap"><!-- IF topicrow.U_MOVE_UP --><a href="{topicrow.U_MOVE_UP}">{L_MOVE_UP}</a><!-- ENDIF --><!-- IF topicrow.U_MOVE_UP and topicrow.U_MOVE_DOWN --> | <!-- ENDIF --><!-- IF topicrow.U_MOVE_DOWN --><a href="{topicrow.U_MOVE_DOWN}">{L_MOVE_DOWN}</a><!-- ENDIF --></td>
<td style="padding: 4px;"> <input type="checkbox" name="t[{topicrow.TOPIC_ID}]" /> </td>

View File

@ -31,14 +31,15 @@
<!-- IF draftrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td class="postdetails" style="padding: 4px;">{draftrow.DATE}</td>
<td style="padding: 4px;"><b class="gen">{draftrow.DRAFT_SUBJECT}</b>
<td class="postdetails" style="padding: 4px;" nowrap="nowrap">{draftrow.DATE}</td>
<td style="padding: 4px;" valign="top" width="100%">
<p class="topictitle">{draftrow.DRAFT_SUBJECT}</p>
<!-- IF draftrow.S_LINK_TOPIC --><br /><span class="gensmall">{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
<!-- ELSEIF draftrow.S_LINK_FORUM --><br /><span class="gensmall">{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
<!-- ELSEIF draftrow.S_LINK_PM --><br /><span class="gensmall">{L_PRIVATE_MESSAGE}</span>
<!-- ELSE --><br /><span class="gensmall">{L_NO_TOPIC_FORUM}</span><!-- ENDIF -->
</td>
<td style="padding: 4px;" align="center"><span class="gen"><!-- IF draftrow.U_INSERT --><a href="{draftrow.U_INSERT}">{L_LOAD_DRAFT}</a><br /><!-- ENDIF --><a href="{draftrow.U_VIEW_EDIT}">{L_VIEW_EDIT}</a></td>
<td style="padding: 4px;" align="center" nowrap="nowrap"><span class="gen"><!-- IF draftrow.U_INSERT --><a href="{draftrow.U_INSERT}">{L_LOAD_DRAFT}</a><br /><!-- ENDIF --><a href="{draftrow.U_VIEW_EDIT}">{L_VIEW_EDIT}</a></td>
<td style="padding: 4px;" align="center"><input type="checkbox" name="d[{draftrow.DRAFT_ID}]" /></td>
</tr>
<!-- BEGINELSE -->

View File

@ -22,7 +22,7 @@
<!-- ENDIF -->
<td style="padding: 4px;" width="20" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td>
<td style="padding: 4px;" width="100%" class="topictitle"><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></span></td>
<td style="padding: 4px;" width="100%"><p class="topictitle"><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></p></td>
<td class="gensmall" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap"><!-- IF forumrow.LAST_POST_TIME -->{forumrow.LAST_POST_TIME}<br /><!-- IF forumrow.U_LAST_POST_AUTHOR --><a href="{forumrow.U_LAST_POST_AUTHOR}">{forumrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{forumrow.LAST_POST_AUTHOR}<!-- ENDIF --> <a href="{forumrow.U_LAST_POST}">{forumrow.LAST_POST_IMG}</a><!-- ELSE -->{L_NO_POSTS}<!-- ENDIF --></td>
<td style="padding: 4px;"> <input type="checkbox" name="f[{forumrow.FORUM_ID}]" /> </td>
</tr>
@ -36,6 +36,20 @@
<th colspan="4">{L_WATCHED_TOPICS}</th>
</tr>
<!-- IF TOTAL_TOPICS -->
<tr>
<td class="row3" colspan="4">
<table width="100%" cellspacing="1">
<tr>
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
<td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_TOPICS} ]&nbsp;</td>
<td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a>&nbsp;&nbsp;<!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE -->&nbsp;&nbsp;<a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></td>
</tr>
</table>
</td>
</tr>
<!-- ENDIF -->
<!-- BEGIN topicrow -->
<!-- IF topicrow.S_ROW_COUNT is even -->
@ -45,8 +59,17 @@
<!-- ENDIF -->
<td style="padding: 4px;" width="20" align="center" valign="middle">{topicrow.TOPIC_FOLDER_IMG}</td>
<td style="padding: 4px;" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.ATTACH_ICON_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />{topicrow.GOTO_PAGE}</span></td>
<td class="postdetails" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap">{topicrow.LAST_POST_TIME}<br />{topicrow.LAST_POST_AUTHOR} {topicrow.LAST_POST_IMG}</td>
<td style="padding: 4px;" width="100%" valign="top">
<p class="topictitle">{topicrow.NEWEST_POST_IMG} {topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></p><br />
<!-- IF topicrow.PAGINATION -->
<p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p>
<!-- ENDIF -->
<td style="padding: 4px;" align="left" valign="top" nowrap="nowrap">
<p class="topicdetails">{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 -->
<a href="{topicrow.U_LAST_POST}">{topicrow.LAST_POST_IMG}</a>
</p>
</td>
<td style="padding: 4px;"> <input type="checkbox" name="t[{topicrow.TOPIC_ID}]" /> </td>
</tr>
<!-- BEGINELSE -->

View File

@ -27,7 +27,7 @@
<!-- IF S_CHANGE_EMAIL -->
<tr>
<td class="row1" width="35%"><b class="genmed">{L_CONFIRM_EMAIL}: </b><br /><span class="gensmall">{L_CONFIRM_EMAIL_EXPLAIN}</span></td>
<td class="row2"><input type="text" class="post" name="confirm_email" size="30" maxlength="60" value="{CONFIRM_EMAIL}" /></td>
<td class="row2"><input type="text" class="post" name="email_confirm" size="30" maxlength="60" value="{CONFIRM_EMAIL}" /></td>
</tr>
<!-- ENDIF -->
<!-- IF S_CHANGE_PASSWORD -->

View File

@ -1,10 +1,6 @@
<!-- INCLUDE overall_header.html -->
<form action="{S_PROFILE_ACTION}" method="post"><table width="50%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td class="nav" align="left"><a href="{U_INDEX}">{L_INDEX}</a></td>
</tr>
</table>
<form action="{S_PROFILE_ACTION}" method="post">
<table class="tablebg" width="50%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>

View File

@ -15,6 +15,7 @@ define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session
$user->start();
@ -25,9 +26,9 @@ $forum_id = request_var('f', 0);
$mark_read = request_var('mark', '');
$start = request_var('start', 0);
$sort_days = (isset($_REQUEST['st'])) ? max(intval($_REQUEST['st']), 0) : ((!empty($user->data['user_show_days'])) ? $user->data['user_show_days'] : 0);
$sort_key = (!empty($_REQUEST['sk'])) ? htmlspecialchars($_REQUEST['sk']) : ((!empty($user->data['user_sortby_type'])) ? $user->data['user_sortby_type'] : 't');
$sort_dir = (!empty($_REQUEST['sd'])) ? htmlspecialchars($_REQUEST['sd']) : ((!empty($user->data['user_sortby_dir'])) ? $user->data['user_sortby_dir'] : 'd');
$sort_days = request_var('st', ((!empty($user->data['user_show_days'])) ? $user->data['user_show_days'] : 0));
$sort_key = request_var('sk', ((!empty($user->data['user_sortby_type'])) ? $user->data['user_sortby_type'] : 't'));
$sort_dir = request_var('sd', ((!empty($user->data['user_sortby_dir'])) ? $user->data['user_sortby_dir'] : 'd'));
// Check if the user has actually sent a forum ID with his/her request
// If not give them a nice error page.
@ -150,7 +151,6 @@ $active_forum_ary = $moderators = array();
if ($forum_data['left_id'] != $forum_data['right_id'] - 1)
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
$active_forum_ary = display_forums($forum_data);
}
else
@ -372,7 +372,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
ORDER BY t.topic_type DESC, $sql_sort_order";
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
while($row = $db->sql_fetchrow($result))
while ($row = $db->sql_fetchrow($result))
{
$rowset[$row['topic_id']] = $row;
$topic_list[] = $row['topic_id'];
@ -398,7 +398,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
$s_type_switch = 0;
foreach ($topic_list as $topic_id)
{
$row =& $rowset[$topic_id];
$row = &$rowset[$topic_id];
if ($config['load_db_lastread'])
{
@ -407,150 +407,43 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
else
{
$topic_id36 = base_convert($topic_id, 10, 36);
$forum_id36 = ($row['topic_type'] == POST_GLOBAL) ? 0 : $row['forum_id'];
$forum_id36 = ($row['topic_type'] == POST_GLOBAL) ? 0 : $forum_id;
$mark_time_topic = (isset($tracking_topics[$forum_id36][$topic_id36])) ? base_convert($tracking_topics[$forum_id36][$topic_id36], 36, 10) + $config['board_startdate'] : 0;
}
// Replies
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
// Topic type/folder
$topic_type = '';
if ($row['topic_status'] == ITEM_MOVED)
{
$topic_type = $user->lang['VIEW_TOPIC_MOVED'];
$topic_id = $row['topic_moved_id'];
$folder_img = 'folder_moved';
$folder_alt = 'Topic_Moved';
$newest_post_img = '';
}
else
{
switch ($row['topic_type'])
{
case POST_GLOBAL:
case POST_ANNOUNCE:
$topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT'];
$folder = 'folder_announce';
$folder_new = 'folder_announce_new';
break;
case POST_STICKY:
$topic_type = $user->lang['VIEW_TOPIC_STICKY'];
$folder = 'folder_sticky';
$folder_new = 'folder_sticky_new';
break;
default:
if ($replies >= $config['hot_threshold'])
{
$folder = 'folder_hot';
$folder_new = 'folder_hot_new';
}
else
{
$folder = 'folder';
$folder_new = 'folder_new';
}
break;
}
if ($row['topic_status'] == ITEM_LOCKED)
{
$topic_type = $user->lang['VIEW_TOPIC_LOCKED'];
$folder = 'folder_locked';
$folder_new = 'folder_locked_new';
}
if ($user->data['user_id'] != ANONYMOUS)
{
$unread_topic = $new_votes = true;
if ($mark_time_topic >= $row['topic_last_post_time'] || $mark_time_forum >= $row['topic_last_post_time'] || ($row['topic_last_post_time'] == $row['poll_last_vote'] && $replies))
{
$unread_topic = false;
}
/*
if ($row['poll_start'] && ($mark_time_topic >= $row['poll_last_vote'] || $mark_time_forum >= $row['poll_last_vote']))
{
$new_votes = false;
}*/
}
else
{
$unread_topic = $new_votes = false;
}
// $folder_new .= ($new_votes) ? '_vote' : '';
$newest_post_img = ($unread_topic) ? "<a href=\"viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id&amp;view=unread#unread\">" . $user->img('icon_post_newest', 'VIEW_NEWEST_POST') . '</a> ' : '';
$folder_img = ($unread_topic) ? $folder_new : $folder;
$folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
// Posted image?
if (!empty($row['mark_type']))
{
$folder_img .= '_posted';
}
}
if (!$row['poll_start'])
{
$topic_type .= $user->lang['VIEW_TOPIC_POLL'];
}
// Goto message generation
if (($replies + 1) > $config['posts_per_page'])
{
$total_pages = ceil(($replies + 1) / $config['posts_per_page']);
$pagination = '';
$times = 1;
for($j = 0; $j < $replies + 1; $j += $config['posts_per_page'])
{
$pagination .= "<a href=\"viewtopic.$phpEx$SID&amp;f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&amp;t=$topic_id&amp;start=$j\">$times</a>";
if ($times == 1 && $total_pages > 4)
{
$pagination .= ' ... ';
$times = $total_pages - 3;
$j += ($total_pages - 4) * $config['posts_per_page'];
}
else if ($times < $total_pages)
{
$pagination .= $user->theme['primary']['pagination_sep'];
}
$times++;
}
}
else
{
$pagination = '';
}
// Generate all the URIs ...
$view_topic_url = "viewtopic.$phpEx$SID&amp;f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&amp;t=$topic_id";
$topic_author = ($row['topic_poster'] != ANONYMOUS) ? "<a href=\"memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $row['topic_poster'] . '">' : '';
$topic_author .= ($row['topic_poster'] != ANONYMOUS) ? $row['topic_first_poster_name'] : (($row['topic_first_poster_name'] != '') ? $row['topic_first_poster_name'] : $user->lang['GUEST']);
$topic_author .= ($row['topic_poster'] != ANONYMOUS) ? '</a>' : '';
// This will allow the style designer to output a different header
// or even seperate the list of announcements from sticky and normal
// topics
$s_type_switch_test = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0;
// Replies
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
if ($row['topic_status'] == ITEM_MOVED)
{
$topic_id = $row['topic_moved_id'];
}
// Get folder img, topic status/type related informations
$folder_img = $folder_alt = $topic_type = '';
$unread_topic = topic_status($row, $replies, $mark_time_topic, $mark_time_forum, $folder_img, $folder_alt, $topic_type);
$newest_post_img = ($unread_topic) ? "<a href=\"viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id&amp;view=unread#unread\">" . $user->img('icon_post_newest', 'VIEW_NEWEST_POST') . '</a> ' : '';
// Generate all the URIs ...
$view_topic_url = "viewtopic.$phpEx$SID&amp;f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&amp;t=$topic_id";
// Send vars to template
$template->assign_block_vars('topicrow', array(
'FORUM_ID' => $forum_id,
'TOPIC_ID' => $topic_id,
'TOPIC_AUTHOR' => $topic_author,
'FIRST_POST_TIME' => $user->format_date($row['topic_time'], $config['board_timezone']),
'TOPIC_AUTHOR' => 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' => $pagination,
'REPLIES' => ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'],
'PAGINATION' => topic_generate_pagination($replies, "viewtopic.$phpEx$SID&amp;f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&amp;t=$topic_id"),
'REPLIES' => $replies,
'VIEWS' => $row['topic_views'],
'TOPIC_TITLE' => censor_text($row['topic_title']),
'TOPIC_TYPE' => $topic_type,
@ -561,23 +454,29 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '',
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', sprintf($user->lang['TOTAL_ATTACHMENTS'], $row['topic_attachment'])) : '',
'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test,
'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (!empty($row['mark_type'])) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic,
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_', $forum_id)) ? TRUE : FALSE,
'S_TOPIC_UNAPPROVED' => (!$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id)) ? TRUE : FALSE,
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_', $forum_id)) ? true : false,
'S_TOPIC_UNAPPROVED' => (!$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false,
'U_LAST_POST' => $view_topic_url . '&amp;p=' . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'],
'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? "memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['topic_last_poster_id']}" : '',
'U_VIEW_TOPIC' => $view_topic_url,
'U_MCP_REPORT' => "mcp.$phpEx?sid={$user->session_id}&amp;mode=reports&amp;t=$topic_id",
'U_MCP_QUEUE' => "mcp.$phpEx?sid={$user->session_id}&amp;i=queue&amp;mode=approve_details&amp;t=$topic_id")
'U_MCP_QUEUE' => "mcp.$phpEx?sid={$user->session_id}&amp;i=queue&amp;mode=approve_details&amp;t=$topic_id",
'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test)
);
$s_type_switch = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0;
if ($mark_time_topic < $row['topic_last_post_time'] && $mark_time_forum < $row['topic_last_post_time'])
{
$mark_forum_read = false;
}
/*
if ($config['load_db_lastread'])
{
if ((isset($row['mark_time']) && $row['topic_last_post_time'] > $row['mark_time']) || (empty($row['mark_time']) && $row['topic_last_post_time'] > $forum_data['mark_time']))
@ -607,7 +506,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
}
}
}
*/
unset($rowset[$topic_id]);
}
}