mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-18 06:38:43 +01:00
- fixing a few smaller bugs/glitches
- init user session in cron.php (else it can produce errors if functions expect the user object being set) - fix sql escaping for mssql/mssql_odbc git-svn-id: file:///svn/phpbb/trunk@5957 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
2ddac10375
commit
530b7e94c5
@ -234,7 +234,9 @@
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<tr>
|
||||
<td><a href="{groups.U_EDIT}">{groups.GROUP_NAME}</a></td>
|
||||
<td><a href="{groups.U_EDIT}">{groups.GROUP_NAME}</a>
|
||||
<!-- IF groups.S_GROUP_ALLOWED and not groups.S_ALLOWED_IN_PM --><br /><span>» {L_NOT_ALLOWED_IN_PM}</span><!-- ENDIF -->
|
||||
</td>
|
||||
<td>{groups.CATEGORY}</td>
|
||||
<td align="center" valign="middle" style="white-space: nowrap;"> <a href="{groups.U_EDIT}">{L_EDIT}</a> | <a href="{groups.U_DELETE}">{L_DELETE}</a> | <a href="{groups.U_ACT_DEACT}">{groups.L_ACT_DEACT}</a> </td>
|
||||
</tr>
|
||||
|
@ -16,6 +16,9 @@ $phpbb_root_path = './';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.' . $phpEx);
|
||||
|
||||
$user->session_begin();
|
||||
$auth->acl($user->data);
|
||||
|
||||
$cron_type = request_var('cron_type', '');
|
||||
$use_shutdown_function = (@function_exists('register_shutdown_function')) ? true : false;
|
||||
|
||||
|
@ -249,6 +249,11 @@ class cache extends acm
|
||||
$extensions = $return;
|
||||
}
|
||||
|
||||
if (!isset($extensions['_allowed_']))
|
||||
{
|
||||
$extensions['_allowed_'] = array();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -785,7 +785,9 @@ class acp_attachments
|
||||
$act_deact = ($row['allow_group']) ? 'deactivate' : 'activate';
|
||||
|
||||
$template->assign_block_vars('groups', array(
|
||||
'S_ADD_SPACER' => $s_add_spacer,
|
||||
'S_ADD_SPACER' => $s_add_spacer,
|
||||
'S_ALLOWED_IN_PM' => ($row['allow_in_pm']) ? true : false,
|
||||
'S_GROUP_ALLOWED' => ($row['allow_group']) ? true : false,
|
||||
|
||||
'U_EDIT' => $this->u_action . "&action=edit&g={$row['group_id']}",
|
||||
'U_DELETE' => $this->u_action . "&action=delete&g={$row['group_id']}",
|
||||
|
@ -71,8 +71,8 @@ class acp_bbcodes
|
||||
case 'create':
|
||||
$display_on_posting = request_var('display_on_posting', 0);
|
||||
|
||||
$bbcode_match = (isset($_POST['bbcode_match'])) ? htmlspecialchars(stripslashes($_POST['bbcode_match'])) : '';
|
||||
$bbcode_tpl = (isset($_POST['bbcode_tpl'])) ? stripslashes($_POST['bbcode_tpl']) : '';
|
||||
$bbcode_match = request_var('bbcode_match', '');
|
||||
$bbcode_tpl = html_entity_decode(request_var('bbcode_tpl', ''));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -207,19 +207,19 @@ class acp_bbcodes
|
||||
/*
|
||||
* Build regular expression for custom bbcode
|
||||
*/
|
||||
function build_regexp($msg_bbcode, $msg_html)
|
||||
function build_regexp(&$bbcode_match, &$bbcode_tpl)
|
||||
{
|
||||
$msg_bbcode = trim($msg_bbcode);
|
||||
$msg_html = trim($msg_html);
|
||||
$bbcode_match = trim($bbcode_match);
|
||||
$bbcode_tpl = trim($bbcode_tpl);
|
||||
|
||||
$fp_match = preg_quote($msg_bbcode, '!');
|
||||
$fp_replace = preg_replace('#^\[(.*?)\]#', '[$1:$uid]', $msg_bbcode);
|
||||
$fp_match = preg_quote($bbcode_match, '!');
|
||||
$fp_replace = preg_replace('#^\[(.*?)\]#', '[$1:$uid]', $bbcode_match);
|
||||
$fp_replace = preg_replace('#\[/(.*?)\]$#', '[/$1:$uid]', $fp_replace);
|
||||
|
||||
$sp_match = preg_quote($msg_bbcode, '!');
|
||||
$sp_match = preg_quote($bbcode_match, '!');
|
||||
$sp_match = preg_replace('#^\\\\\[(.*?)\\\\\]#', '\[$1:$uid\]', $sp_match);
|
||||
$sp_match = preg_replace('#\\\\\[/(.*?)\\\\\]$#', '\[/$1:$uid\]', $sp_match);
|
||||
$sp_replace = $msg_html;
|
||||
$sp_replace = $bbcode_tpl;
|
||||
|
||||
// @todo Make sure to change this too if something changed in message parsing
|
||||
$tokens = array(
|
||||
@ -236,7 +236,7 @@ class acp_bbcodes
|
||||
'!(.*?)!es' => "str_replace('\\\"', '"', str_replace('\\'', ''', '\$1'))"
|
||||
),
|
||||
'COLOR' => array(
|
||||
'!([a-z]+|#[0-9abcdef]+!i' => '$1'
|
||||
'!([a-z]+|#[0-9abcdef]+)!i' => '$1'
|
||||
),
|
||||
'NUMBER' => array(
|
||||
'!([0-9]+)!' => '$1'
|
||||
@ -246,7 +246,7 @@ class acp_bbcodes
|
||||
$pad = 0;
|
||||
$modifiers = 'i';
|
||||
|
||||
if (preg_match_all('/\{(' . implode('|', array_keys($tokens)) . ')[0-9]*\}/i', $msg_bbcode, $m))
|
||||
if (preg_match_all('/\{(' . implode('|', array_keys($tokens)) . ')[0-9]*\}/i', $bbcode_match, $m))
|
||||
{
|
||||
foreach ($m[0] as $n => $token)
|
||||
{
|
||||
@ -311,7 +311,7 @@ class acp_bbcodes
|
||||
}
|
||||
|
||||
// Lowercase tags
|
||||
$bbcode_tag = preg_replace('/.*?\[([a-z]+=?).*/i', '$1', $msg_bbcode);
|
||||
$bbcode_tag = preg_replace('/.*?\[([a-z]+=?).*/i', '$1', $bbcode_match);
|
||||
$fp_match = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $fp_match);
|
||||
$fp_replace = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $fp_replace);
|
||||
$sp_match = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $sp_match);
|
||||
|
@ -28,16 +28,16 @@ class acp_email
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$error = array();
|
||||
|
||||
$usernames = request_var('usernames', '');
|
||||
$group_id = request_var('g', 0);
|
||||
$usernames = request_var('usernames', '');
|
||||
$group_id = request_var('g', 0);
|
||||
$subject = request_var('subject', '', true);
|
||||
$message = request_var('message', '', true);
|
||||
|
||||
// Do the job ...
|
||||
if ($submit)
|
||||
{
|
||||
// Error checking needs to go here ... if no subject and/or no message then skip
|
||||
// over the send and return to the form
|
||||
$subject = request_var('subject', '', true);
|
||||
$message = request_var('message', '', true);
|
||||
$use_queue = (isset($_POST['send_immediatly'])) ? false : true;
|
||||
$priority = request_var('mail_priority_flag', MAIL_NORMAL_PRIORITY);
|
||||
|
||||
|
@ -26,13 +26,13 @@ class acp_prune
|
||||
{
|
||||
case 'forums':
|
||||
$this->tpl_name = 'acp_prune_forums';
|
||||
$this->page_header = 'ACP_PRUNE_FORUMS';
|
||||
$this->page_title = 'ACP_PRUNE_FORUMS';
|
||||
$this->prune_forums($id, $mode);
|
||||
break;
|
||||
|
||||
case 'users':
|
||||
$this->tpl_name = 'acp_prune_users';
|
||||
$this->page_header = 'ACP_PRUNE_USERS';
|
||||
$this->page_title = 'ACP_PRUNE_USERS';
|
||||
$this->prune_users($id, $mode);
|
||||
break;
|
||||
}
|
||||
|
@ -307,13 +307,20 @@ class auth_admin extends auth
|
||||
|
||||
if (sizeof($roles))
|
||||
{
|
||||
$s_role_js_array = array();
|
||||
|
||||
// Make sure every role (even if empty) has its array defined
|
||||
foreach ($roles as $_role_id => $null)
|
||||
{
|
||||
$s_role_js_array[$_role_id] = "\n" . 'role_options[' . $_role_id . '] = new Array();' . "\n";
|
||||
}
|
||||
|
||||
$sql = 'SELECT r.role_id, o.auth_option, r.auth_setting
|
||||
FROM ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' o
|
||||
WHERE o.auth_option_id = r.auth_option_id
|
||||
AND r.role_id IN (' . implode(', ', array_keys($roles)) . ')';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$s_role_js_array = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$flag = substr($row['auth_option'], 0, strpos($row['auth_option'], '_') + 1);
|
||||
@ -322,10 +329,6 @@ class auth_admin extends auth
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($s_role_js_array[$row['role_id']]))
|
||||
{
|
||||
$s_role_js_array[$row['role_id']] = "\n" . 'role_options[' . $row['role_id'] . '] = new Array();' . "\n";
|
||||
}
|
||||
$s_role_js_array[$row['role_id']] .= 'role_options[' . $row['role_id'] . '][\'' . $row['auth_option'] . '\'] = ' . $row['auth_setting'] . '; ';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
@ -105,6 +105,11 @@ class bbcode
|
||||
{
|
||||
$this->template_bitfield = $user->theme['bbcode_bitfield'];
|
||||
$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html';
|
||||
|
||||
if (!@file_exists($this->template_filename))
|
||||
{
|
||||
trigger_error('The file ' . $this->template_filename . ' is missing.', E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = '';
|
||||
|
@ -312,7 +312,7 @@ class dbal_mssql extends dbal
|
||||
*/
|
||||
function sql_escape($msg)
|
||||
{
|
||||
return str_replace("'", "''", str_replace('\\', '\\\\', $msg));
|
||||
return str_replace("'", "''", $msg);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -319,7 +319,7 @@ class dbal_mssql_odbc extends dbal
|
||||
*/
|
||||
function sql_escape($msg)
|
||||
{
|
||||
return str_replace("'", "''", str_replace('\\', '\\\\', $msg));
|
||||
return str_replace("'", "''", $msg);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1961,7 +1961,7 @@ function add_log()
|
||||
$data = (!sizeof($args)) ? '' : serialize($args);
|
||||
|
||||
$sql_ary = array(
|
||||
'user_id' => $user->data['user_id'],
|
||||
'user_id' => (empty($user->data)) ? ANONYMOUS : $user->data['user_id'],
|
||||
'log_ip' => $user->ip,
|
||||
'log_time' => time(),
|
||||
'log_operation' => $action,
|
||||
|
@ -765,7 +765,7 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
|
||||
{
|
||||
if ($config['img_link_width'] || $config['img_link_height'])
|
||||
{
|
||||
list($width, $height) = getimagesize($filename);
|
||||
list($width, $height) = @getimagesize($filename);
|
||||
|
||||
$display_cat = (!$width && !$height) ? ATTACHMENT_CATEGORY_IMAGE : (($width <= $config['img_link_width'] && $height <= $config['img_link_height']) ? ATTACHMENT_CATEGORY_IMAGE : ATTACHMENT_CATEGORY_NONE);
|
||||
}
|
||||
|
@ -688,13 +688,13 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
|
||||
// If forum_id == 0 AND topic_id == 0 then this is a PM draft
|
||||
if (!$topic_id && !$forum_id)
|
||||
{
|
||||
$sql_and = 'AND d.forum_id = 0 AND d.topic_id = 0';
|
||||
$sql_and = ' AND d.forum_id = 0 AND d.topic_id = 0';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql_and = '';
|
||||
$sql_and .= ($forum_id) ? 'AND d.forum_id = ' . $forum_id : '';
|
||||
$sql_and .= ($topic_id) ? 'AND d.topic_id = ' . $topic_id : '';
|
||||
$sql_and .= ($forum_id) ? ' AND d.forum_id = ' . $forum_id : '';
|
||||
$sql_and .= ($topic_id) ? ' AND d.topic_id = ' . $topic_id : '';
|
||||
}
|
||||
|
||||
$sql = 'SELECT d.*, f.forum_id, f.forum_name
|
||||
@ -1580,7 +1580,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
{
|
||||
if (trim($poll['poll_options'][$i]))
|
||||
{
|
||||
if (!$cur_poll_options[$i])
|
||||
if (empty($cur_poll_options[$i]))
|
||||
{
|
||||
$sql_insert_ary[] = array(
|
||||
'poll_option_id' => (int) $i,
|
||||
|
@ -1211,11 +1211,11 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
||||
|
||||
if (sizeof($group_attributes))
|
||||
{
|
||||
foreach ($attribute_ary as $attribute => $type)
|
||||
foreach ($attribute_ary as $attribute => $_type)
|
||||
{
|
||||
if (isset($group_attributes[$attribute]))
|
||||
{
|
||||
settype($group_attributes[$attribute], $type);
|
||||
settype($group_attributes[$attribute], $_type);
|
||||
$sql_ary[$attribute] = $group_attributes[$attribute];
|
||||
}
|
||||
}
|
||||
@ -1224,7 +1224,16 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
||||
// Setting the log message before we set the group id (if group gets added)
|
||||
$log = ($group_id) ? 'LOG_GROUP_UPDATED' : 'LOG_GROUP_CREATED';
|
||||
|
||||
$sql = ($group_id) ? 'UPDATE ' . GROUPS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE group_id = $group_id" : 'INSERT INTO ' . GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||
if ($group_id)
|
||||
{
|
||||
$sql = 'UPDATE ' . GROUPS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
|
||||
WHERE group_id = $group_id";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'INSERT INTO ' . GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||
}
|
||||
$db->sql_query($sql);
|
||||
|
||||
if (!$group_id)
|
||||
@ -1236,7 +1245,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
||||
$sql_ary = array();
|
||||
if (sizeof($group_attributes))
|
||||
{
|
||||
foreach ($attribute_ary as $attribute => $type)
|
||||
foreach ($attribute_ary as $attribute => $_type)
|
||||
{
|
||||
if (isset($group_attributes[$attribute]) && !in_array($attribute, $group_only_ary))
|
||||
{
|
||||
@ -1258,6 +1267,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$name = ($type == GROUP_SPECIAL) ? $user->lang['G_' . $name] : $name;
|
||||
add_log('admin', $log, $name);
|
||||
}
|
||||
|
||||
|
@ -1237,13 +1237,22 @@ class user extends session
|
||||
return $imgs[$img . $suffix];
|
||||
}
|
||||
|
||||
if ($width === false)
|
||||
// Do not include dimensions?
|
||||
if (strpos($this->theme[$img], '*') === false)
|
||||
{
|
||||
list($imgsrc, $height, $width) = explode('*', $this->theme[$img]);
|
||||
$imgsrc = trim($this->theme[$img]);
|
||||
$width = $height = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
list($imgsrc, $height) = explode('*', $this->theme[$img]);
|
||||
if ($width === false)
|
||||
{
|
||||
list($imgsrc, $height, $width) = explode('*', $this->theme[$img]);
|
||||
}
|
||||
else
|
||||
{
|
||||
list($imgsrc, $height) = explode('*', $this->theme[$img]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($suffix !== '')
|
||||
@ -1262,19 +1271,19 @@ class user extends session
|
||||
{
|
||||
case 'src':
|
||||
return $imgs[$img . $suffix]['src'];
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'width':
|
||||
return $imgs[$img . $suffix]['width'];
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'height':
|
||||
return $imgs[$img . $suffix]['height'];
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
return '<img src="' . $imgs[$img . $suffix]['src'] . '"' . (($imgs[$img . $suffix]['width']) ? ' width="' . $imgs[$img . $suffix]['width'] . '"' : '') . (($imgs[$img . $suffix]['height']) ? ' height="' . $imgs[$img . $suffix]['height'] . '"' : '') . ' alt="' . $alt . '" title="' . $alt . '" />';
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ class ucp_attachments
|
||||
}
|
||||
else
|
||||
{
|
||||
$view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&t={$row['topic_id']}&p={$row['post_msg_id']}#{$row['post_msg_id']}";
|
||||
$view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&t={$row['topic_id']}&p={$row['post_msg_id']}#p{$row['post_msg_id']}";
|
||||
}
|
||||
|
||||
$template->assign_block_vars('attachrow', array(
|
||||
|
@ -137,7 +137,7 @@ class ucp_main
|
||||
'S_USER_POSTED' => (!empty($row['topic_posted']) && $row['topic_posted']) ? true : false,
|
||||
'S_UNREAD' => $unread_topic,
|
||||
|
||||
'U_LAST_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$g_forum_id&t=$topic_id&p=" . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'],
|
||||
'U_LAST_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$g_forum_id&t=$topic_id&p=" . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],
|
||||
'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['topic_last_poster_id'] : '',
|
||||
'U_NEWEST_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$g_forum_id&t=$topic_id&view=unread#unread",
|
||||
'U_VIEW_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$g_forum_id&t=$topic_id")
|
||||
@ -287,7 +287,7 @@ class ucp_main
|
||||
$last_poster = ($row['forum_last_poster_name'] != '') ? $row['forum_last_poster_name'] : $user->lang['GUEST'];
|
||||
$last_poster_url = ($row['forum_last_poster_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['forum_last_poster_id'];
|
||||
|
||||
$last_post_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&p=" . $row['forum_last_post_id'] . '#' . $row['forum_last_post_id'];
|
||||
$last_post_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&p=" . $row['forum_last_post_id'] . '#p' . $row['forum_last_post_id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -444,7 +444,7 @@ class ucp_main
|
||||
'S_UNREAD_TOPIC' => $unread_topic,
|
||||
|
||||
'U_NEWEST_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&view=unread#unread",
|
||||
'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'],
|
||||
'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']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['topic_last_poster_id']}" : '',
|
||||
'U_VIEW_TOPIC' => $view_topic_url)
|
||||
);
|
||||
@ -590,7 +590,7 @@ class ucp_main
|
||||
'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 . '&p=' . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'],
|
||||
'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']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['topic_last_poster_id']}" : '',
|
||||
'U_VIEW_TOPIC' => $view_topic_url,
|
||||
'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f={$forum_id}",
|
||||
|
@ -59,7 +59,11 @@ function compose_pm($id, $mode, $action)
|
||||
// Was cancel pressed? If so then redirect to the appropriate page
|
||||
if ($cancel || ($current_time - $lastclick < 2 && $submit))
|
||||
{
|
||||
redirect("ucp.$phpEx$SID&i=pm&mode=view&action=view_message" . (($msg_id) ? "&p=$msg_id" : ''));
|
||||
if ($msg_id)
|
||||
{
|
||||
redirect("ucp.$phpEx$SID&i=pm&mode=view&action=view_message&p=$msg_id");
|
||||
}
|
||||
redirect("ucp.$phpEx$SID&i=pm");
|
||||
}
|
||||
|
||||
$sql = '';
|
||||
@ -79,12 +83,6 @@ function compose_pm($id, $mode, $action)
|
||||
case 'quote':
|
||||
case 'forward':
|
||||
case 'quotepost':
|
||||
if ($submit)
|
||||
{
|
||||
// We don't need to retrieve the post text again when the user is submitting.
|
||||
break;
|
||||
}
|
||||
|
||||
if (!$msg_id)
|
||||
{
|
||||
trigger_error('NO_MESSAGE');
|
||||
@ -167,14 +165,14 @@ function compose_pm($id, $mode, $action)
|
||||
if ($sql)
|
||||
{
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$post = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!($post = $db->sql_fetchrow($result)))
|
||||
if (!$post)
|
||||
{
|
||||
trigger_error('NO_MESSAGE');
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$msg_id = (int) $post['msg_id'];
|
||||
$folder_id = (isset($post['folder_id'])) ? $post['folder_id'] : 0;
|
||||
$message_text = (isset($post['message_text'])) ? $post['message_text'] : '';
|
||||
@ -397,9 +395,11 @@ function compose_pm($id, $mode, $action)
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$_REQUEST['subject'] = $row['draft_subject'];
|
||||
$_REQUEST['message'] = $row['draft_message'];
|
||||
$refresh = true;
|
||||
// $_REQUEST['subject'] = $row['draft_subject'];
|
||||
// $_REQUEST['message'] = $row['draft_message'];
|
||||
// $refresh = false;
|
||||
$message_parser->message = $row['draft_message'];
|
||||
$message_subject = $row['draft_subject'];
|
||||
$template->assign_var('S_DRAFT_LOADED', true);
|
||||
}
|
||||
else
|
||||
@ -445,7 +445,7 @@ function compose_pm($id, $mode, $action)
|
||||
// Parse Attachments - before checksum is calculated
|
||||
$message_parser->parse_attachments('fileupload', $action, 0, $submit, $preview, $refresh, true);
|
||||
|
||||
// Check checksum ... don't re-parse message if the same
|
||||
// Parse message
|
||||
$message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, true);
|
||||
|
||||
if ($action != 'edit' && !$preview && !$refresh && $config['flood_interval'] && !$auth->acl_get('u_ignoreflood'))
|
||||
@ -578,7 +578,7 @@ function compose_pm($id, $mode, $action)
|
||||
if ($action == 'quotepost')
|
||||
{
|
||||
$post_id = request_var('p', 0);
|
||||
$message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#{$post_id}]{$message_subject}[/url]\n";
|
||||
$message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$message_subject}[/url]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -592,7 +592,7 @@ function compose_pm($id, $mode, $action)
|
||||
$message_subject = ((!preg_match('/^Re:/', $message_subject)) ? 'Re: ' : '') . censor_text($message_subject);
|
||||
}
|
||||
|
||||
if ($action == 'forward' && !$preview && !$refresh)
|
||||
if ($action == 'forward' && !$preview && !$refresh && !$submit)
|
||||
{
|
||||
$fwd_to_field = write_pm_addresses(array('to' => $post['to_address']), 0, true);
|
||||
|
||||
|
@ -186,7 +186,8 @@ class ucp_zebra
|
||||
FROM ' . ZEBRA_TABLE . ' z, ' . USERS_TABLE . ' u
|
||||
WHERE z.user_id = ' . $user->data['user_id'] . "
|
||||
AND $sql_and
|
||||
AND u.user_id = z.zebra_id";
|
||||
AND u.user_id = z.zebra_id
|
||||
ORDER BY u.username ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$s_username_options = '';
|
||||
|
@ -104,6 +104,7 @@ $lang = array_merge($lang, array(
|
||||
'MODE_INLINE' => 'Inline',
|
||||
'MODE_PHYSICAL' => 'Physical',
|
||||
|
||||
'NOT_ALLOWED_IN_PM' => 'Not allowed in private messages',
|
||||
'NOT_ASSIGNED' => 'Not assigned',
|
||||
'NO_EXT_GROUP_NAME' => 'No Group Name entered',
|
||||
'NO_EXT_GROUP_SPECIFIED' => 'No Extension Group specified',
|
||||
|
@ -87,6 +87,7 @@ $lang = array_merge($lang, array(
|
||||
'LIST_USER' => '1 User',
|
||||
'LIST_USERS' => '%d Users',
|
||||
'LOGIN_EXPLAIN_LEADERS' => 'The board administrator requires you to be registered and logged in to view the team listing.',
|
||||
'LOGIN_EXPLAIN_SEARCHUSER' => 'The board administrator requires you to be registered and logged in to search users.',
|
||||
'LOGIN_EXPLAIN_VIEWPROFILE' => 'The board administrator requires you to be registered and logged in to view profiles.',
|
||||
|
||||
'MORE_THAN' => 'More than',
|
||||
|
@ -41,7 +41,7 @@
|
||||
<!-- ENDIF -->
|
||||
<td class="row1">
|
||||
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF -->
|
||||
{topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
|
||||
{topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
|
||||
<!-- IF topicrow.S_TOPIC_UNAPPROVED -->
|
||||
<a href="{topicrow.U_MCP_QUEUE}">{UNAPPROVED_IMG}</a>
|
||||
<!-- ENDIF -->
|
||||
@ -161,7 +161,7 @@
|
||||
<!-- ENDIF -->
|
||||
<td class="row1">
|
||||
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF -->
|
||||
{topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
|
||||
{topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
|
||||
<!-- IF topicrow.S_TOPIC_UNAPPROVED -->
|
||||
<a href="{topicrow.U_MCP_QUEUE}">{UNAPPROVED_IMG}</a>
|
||||
<!-- ENDIF -->
|
||||
|
@ -57,7 +57,7 @@
|
||||
</tr>
|
||||
<!-- IF S_HAS_POLL -->
|
||||
<tr>
|
||||
<td class="row2" colspan="2"><br clear="all" /><form method="post" action="{S_POLL_ACTION}">
|
||||
<td class="row2" colspan="2" align="center"><br clear="all" /><form method="post" action="{S_POLL_ACTION}">
|
||||
|
||||
<table cellspacing="0" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
|
@ -263,7 +263,9 @@ $sql = $db->sql_build_query('SELECT_DISTINCT', array(
|
||||
AND z.friend = 1
|
||||
AND u.user_id = z.zebra_id',
|
||||
|
||||
'GROUP_BY' => 'z.zebra_id, u.user_id, u.username, u.user_allow_viewonline'
|
||||
'GROUP_BY' => 'z.zebra_id, u.user_id, u.username, u.user_allow_viewonline',
|
||||
|
||||
'ORDER_BY' => 'u.username ASC',
|
||||
));
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
@ -500,6 +500,11 @@ if (sizeof($topic_list))
|
||||
'S_UNREAD_TOPIC' => $unread_topic,
|
||||
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_report', $forum_id)) ? true : false,
|
||||
'S_TOPIC_UNAPPROVED' => (!$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false,
|
||||
'S_HAS_POLL' => ($row['poll_start']) ? true : false,
|
||||
'S_POST_ANNOUNCE' => ($row['topic_type'] == POST_ANNOUNCE) ? true : false,
|
||||
'S_POST_GLOBAL' => ($row['topic_type'] == POST_GLOBAL) ? true : false,
|
||||
'S_POST_STICKY' => ($row['topic_type'] == POST_STICKY) ? true : false,
|
||||
'S_TOPIC_MOVED' => ($row['topic_status'] == ITEM_MOVED) ? true : false,
|
||||
|
||||
'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'],
|
||||
|
@ -157,7 +157,7 @@ if ($view && !$post_id)
|
||||
// also allows for direct linking to a post (and the calculation of which
|
||||
// page the post is on and the correct display of viewtopic)
|
||||
$sql_array = array(
|
||||
'SELECT' => 't.topic_id, t.forum_id, t.topic_title, t.topic_attachment, t.topic_status, t.topic_approved, t.topic_replies_real, t.topic_replies, t.topic_first_post_id, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_poster, t.topic_time, t.topic_time_limit, t.topic_type, t.topic_bumped, t.topic_bumper, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, t.poll_vote_change, f.forum_name, f.forum_desc, f.forum_desc_uid, f.forum_desc_bitfield, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_type, f.forum_id, f.forum_style, f.forum_password, f.forum_rules, f.forum_rules_link, f.forum_rules_uid, f.forum_rules_bitfield',
|
||||
'SELECT' => 't.*, f.*',
|
||||
|
||||
'FROM' => array(
|
||||
FORUMS_TABLE => 'f',
|
||||
|
Loading…
x
Reference in New Issue
Block a user