mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 19:54:12 +02:00
Mostly changes to turn userdata into user->data, lang into user->lang + bitstring 2nd format + inheritance for permission admin and various other updates/fixes/changes ... note that user->lang & user->theme isn't final
git-svn-id: file:///svn/phpbb/trunk@2958 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -24,49 +24,34 @@ $phpbb_root_path = './';
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
||||
|
||||
// Grab all data
|
||||
extract($_GET);
|
||||
extract($_POST);
|
||||
|
||||
// Check and impose var types?
|
||||
$vars = array(
|
||||
'intval' => array(
|
||||
'forum_id' => 'f',
|
||||
'post_id' => 'p',
|
||||
'topic_id' => 't',
|
||||
)
|
||||
// Some vars need their names changing and type imposing
|
||||
$int_vars = array(
|
||||
'f' => 'forum_id',
|
||||
'p' => 'post_id',
|
||||
't' => 'topic_id',
|
||||
);
|
||||
|
||||
foreach ( $vars as $vartype => $varcheck)
|
||||
foreach ( $int_vars as $in_var => $out_var)
|
||||
{
|
||||
foreach ( $varcheck as $varname => $varparse )
|
||||
{
|
||||
$$varname = ( isset($_POST[$varparse]) ) ? $vartype($_POST[$varparse]) : ( ( isset($_GET[$varparse]) ) ? $vartype($_GET[$varparse]) : false );
|
||||
}
|
||||
$$out_var = ( isset($$in_var) ) ? intval($$in_var) : false;
|
||||
}
|
||||
|
||||
$refresh = $preview || $poll_add || $poll_edit || $poll_delete;
|
||||
|
||||
// ------------------------------------------------
|
||||
// NOTE --> No data validation at present! <-- NOTE
|
||||
// ------------------------------------------------
|
||||
|
||||
// Start session management
|
||||
$userdata = $session->start();
|
||||
$auth->acl($userdata, $f, array('f_post', 'f_edit', 'f_delete', 'f_attach', 'f_poll', 'f_img', 'f_flash', 'f_bbcode', 'f_html', 'f_smilies', 'f_vote', 'f_sticky', 'f_announce'));
|
||||
$user = new user($userdata);
|
||||
$user->start();
|
||||
$user->setup();
|
||||
$auth->acl($user->data);
|
||||
// End session management
|
||||
|
||||
|
||||
// Was cancel pressed? If so then redirect to the appropriate
|
||||
// page, no point in continuing with any further checks
|
||||
// Was cancel pressed? If so then redirect to the appropriate page
|
||||
if ( !empty($cancel) )
|
||||
{
|
||||
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
|
||||
$redirect = ( $p ) ? "viewtopic.$phpEx$SID&p=$p#$p" : ( ( $t ) ? "viewtopic.$phpEx$SID&t=$t" : ( ( $f ) ? "viewforum.$phpEx$SID&f=$f" : "index.$phpEx$SID" ) );
|
||||
header($header_location . $redirect);
|
||||
exit;
|
||||
redirect($redirect);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,12 +66,12 @@ if ( !empty($cancel) )
|
||||
switch ( $mode )
|
||||
{
|
||||
case 'topicreview':
|
||||
require($phpbb_root_path . 'includes/topic_review.'.$phpEx);
|
||||
topic_review($t, false);
|
||||
// require($phpbb_root_path . 'includes/topic_review.'.$phpEx);
|
||||
// topic_review($t, false);
|
||||
break;
|
||||
|
||||
case 'smilies':
|
||||
generate_smilies('window', PAGE_POSTING);
|
||||
generate_smilies('window');
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -104,7 +89,7 @@ if ( !$board_config['allow_html'] )
|
||||
}
|
||||
else
|
||||
{
|
||||
$html_on = ( $post || $refresh ) ? ( ( !empty($disable_html) ) ? 0 : TRUE ) : ( ( !$userdata['user_id'] ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] );
|
||||
$html_on = ( $post || $refresh ) ? ( ( !empty($disable_html) ) ? 0 : TRUE ) : ( ( !$user->data['user_id'] ) ? $board_config['allow_html'] : $user->data['user_allowhtml'] );
|
||||
}
|
||||
|
||||
if ( !$board_config['allow_bbcode'] )
|
||||
@@ -113,7 +98,7 @@ if ( !$board_config['allow_bbcode'] )
|
||||
}
|
||||
else
|
||||
{
|
||||
$bbcode_on = ( $post || $refresh ) ? ( ( !empty($disable_bbcode) ) ? 0 : TRUE ) : ( ( !$userdata['user_id'] ) ? $board_config['allow_bbcode'] : $userdata['user_allowbbcode'] );
|
||||
$bbcode_on = ( $post || $refresh ) ? ( ( !empty($disable_bbcode) ) ? 0 : TRUE ) : ( ( !$user->data['user_id'] ) ? $board_config['allow_bbcode'] : $user->data['user_allowbbcode'] );
|
||||
}
|
||||
|
||||
$magic_urls_on = ( $post || $refresh ) ? ( ( !empty($disable_magic_url) ) ? 0 : TRUE ) : TRUE;
|
||||
@@ -124,10 +109,10 @@ if ( !$board_config['allow_smilies'] )
|
||||
}
|
||||
else
|
||||
{
|
||||
$smilies_on = ( $post || $refresh ) ? ( ( !empty($disable_smilies) ) ? 0 : TRUE ) : ( ( !$userdata['user_id'] ) ? $board_config['allow_smilies'] : $userdata['user_allowsmile'] );
|
||||
$smilies_on = ( $post || $refresh ) ? ( ( !empty($disable_smilies) ) ? 0 : TRUE ) : ( ( !$user->data['user_id'] ) ? $board_config['allow_smilies'] : $user->data['user_allowsmile'] );
|
||||
}
|
||||
|
||||
$attach_sig = ( $post || $refresh ) ? ( ( !empty($attach_sig) ) ? TRUE : 0 ) : ( ( !$userdata['user_id'] ) ? 0 : $userdata['user_attachsig'] );
|
||||
$attach_sig = ( $post || $refresh ) ? ( ( !empty($attach_sig) ) ? TRUE : 0 ) : ( ( !$user->data['user_id'] ) ? 0 : $user->data['user_attachsig'] );
|
||||
|
||||
|
||||
|
||||
@@ -139,24 +124,24 @@ switch ( $mode )
|
||||
case 'newtopic':
|
||||
if ( empty($f) )
|
||||
{
|
||||
message_die(MESSAGE, $lang['Forum_not_exist']);
|
||||
trigger($user->lang['Forum_not_exist']);
|
||||
}
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM " . FORUMS_TABLE . "
|
||||
WHERE forum_id = $f";
|
||||
WHERE forum_id = $forum_id";
|
||||
break;
|
||||
|
||||
case 'reply':
|
||||
case 'vote':
|
||||
if ( empty( $t) )
|
||||
{
|
||||
message_die(MESSAGE, $lang['No_topic_id']);
|
||||
trigger($user->lang['No_topic_id']);
|
||||
}
|
||||
|
||||
$sql = "SELECT f.*, t.*
|
||||
FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t
|
||||
WHERE t.topic_id = $t
|
||||
WHERE t.topic_id = $topic_id
|
||||
AND f.forum_id = t.forum_id";
|
||||
break;
|
||||
|
||||
@@ -166,7 +151,7 @@ switch ( $mode )
|
||||
case 'poll_delete':
|
||||
if ( empty($p) )
|
||||
{
|
||||
message_die(MESSAGE, $lang['No_post_id']);
|
||||
trigger($user->lang['No_post_id']);
|
||||
}
|
||||
|
||||
$select_sql = ( !$submit ) ? ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig' : ', pt.post_subject, pt.post_text';
|
||||
@@ -182,20 +167,18 @@ switch ( $mode )
|
||||
break;
|
||||
|
||||
default:
|
||||
message_die(MESSAGE, $lang['No_valid_mode']);
|
||||
message_die(MESSAGE, $user->lang['No_valid_mode']);
|
||||
}
|
||||
|
||||
if ( $result = $db->sql_query($sql) )
|
||||
{
|
||||
$post_info = $db->sql_fetchrow($result);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ( $post_info = $db->sql_fetchrow($result) )
|
||||
{
|
||||
$forum_id = $post_info['forum_id'];
|
||||
$forum_name = $post_info['forum_name'];
|
||||
|
||||
$topic_title = $post_info['topic_title'];
|
||||
$topic_id = $post_info['topic_id'];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -234,7 +217,8 @@ if ( isset($post) )
|
||||
print_r($message);
|
||||
echo "<br /><hr /><br />\n\n";
|
||||
|
||||
$result = $search->add($p, $message, $post_subject, $post_info['post_text'], $post_info['post_subject']);
|
||||
// Fulltext parser
|
||||
// $result = $search->add($p, $message, $post_subject, $post_info['post_text'], $post_info['post_subject']);
|
||||
}
|
||||
|
||||
exit;
|
||||
@@ -251,16 +235,14 @@ $message = $post_info['post_text'];
|
||||
// Remove encoded bbcode, urls, etc.
|
||||
$match = array(
|
||||
'#<!\-\- b \-\-><b>(.*?)</b><!\-\- b \-\->#s',
|
||||
'#<!\-\- b \-\-><u>(.*?)</u><!\-\- b \-\->#s',
|
||||
'#\[b:([0-9a-z]+)\](.*?)\[/b:\1\]#s',
|
||||
'#<!\-\- b \-\-><a href="mailto:(.*?)">.*?</a><!\-\- b \-\->#',
|
||||
'#<!\-\- b \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- b \-\->#',
|
||||
'#<!\-\- u \-\-><u>(.*?)</u><!\-\- u \-\->#s',
|
||||
'#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
|
||||
'#<!\-\- u \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- u \-\->#',
|
||||
);
|
||||
|
||||
$replace = array(
|
||||
'[b]\1[/b]',
|
||||
'[u]\1[/u]',
|
||||
'[b]\2[/b]',
|
||||
'\1',
|
||||
'\1',
|
||||
);
|
||||
@@ -282,19 +264,19 @@ if ( $post || $refresh )
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $mode != 'newtopic' && $userdata['user_id'] )
|
||||
if ( $mode != 'newtopic' && $user->data['user_id'] )
|
||||
{
|
||||
$sql = "SELECT topic_id
|
||||
FROM " . TOPICS_WATCH_TABLE . "
|
||||
WHERE topic_id = $topic_id
|
||||
AND user_id = " . $userdata['user_id'];
|
||||
AND user_id = " . $user->data['user_id'];
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$notify_user = ( $db->sql_fetchrow($result) ) ? TRUE : $userdata['user_notify'];
|
||||
$notify_user = ( $db->sql_fetchrow($result) ) ? TRUE : $user->data['user_notify'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$notify_user = ( $user_id['user_id'] ) ? $userdata['user_notify'] : 0;
|
||||
$notify_user = ( $user_id['user_id'] ) ? $user->data['user_notify'] : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +317,7 @@ if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
|
||||
{
|
||||
$topic_type_toggle .= ' checked="checked"';
|
||||
}
|
||||
$topic_type_toggle .= ' /> ' . $lang['Post_Sticky'] . ' ';
|
||||
$topic_type_toggle .= ' /> ' . $user->lang['Post_Sticky'] . ' ';
|
||||
}
|
||||
|
||||
if ( $auth->acl_get('f_announce', $forum_id) )
|
||||
@@ -345,21 +327,21 @@ if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
|
||||
{
|
||||
$topic_type_toggle .= ' checked="checked"';
|
||||
}
|
||||
$topic_type_toggle .= ' /> ' . $lang['Post_Announcement'] . ' ';
|
||||
$topic_type_toggle .= ' /> ' . $user->lang['Post_Announcement'] . ' ';
|
||||
}
|
||||
|
||||
if ( $topic_type_toggle != '' )
|
||||
{
|
||||
$topic_type_toggle = $lang['Post_topic_as'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL ) ? ' checked="checked"' : '' ) . ' /> ' . $lang['Post_Normal'] . ' ' . $topic_type_toggle;
|
||||
$topic_type_toggle = $user->lang['Post_topic_as'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL ) ? ' checked="checked"' : '' ) . ' /> ' . $user->lang['Post_Normal'] . ' ' . $topic_type_toggle;
|
||||
}
|
||||
}
|
||||
|
||||
// HTML, BBCode, Smilies, Images and Flash status
|
||||
$html_status = ( $board_config['allow_html'] && $auth->acl_get('f_html', $f) ) ? true : false;
|
||||
$bbcode_status = ( $board_config['allow_bbcode'] && $auth->acl_get('f_bbcode', $f) ) ? true : false;
|
||||
$smilies_status = ( $board_config['allow_smilies'] && $auth->acl_get('f_smilies', $f) ) ? true : false;
|
||||
$img_status = ( $board_config['allow_img'] && $auth->acl_get('f_img', $f) ) ? true : false;
|
||||
$flash_status = ( $board_config['allow_flash'] && $auth->acl_get('f_flash', $f) ) ? true : false;
|
||||
$html_status = ( $board_config['allow_html'] && $auth->acl_get('f_html', $forum_id) ) ? true : false;
|
||||
$bbcode_status = ( $board_config['allow_bbcode'] && $auth->acl_get('f_bbcode', $forum_id) ) ? true : false;
|
||||
$smilies_status = ( $board_config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id) ) ? true : false;
|
||||
$img_status = ( $board_config['allow_img'] && $auth->acl_get('f_img', $forum_id) ) ? true : false;
|
||||
$flash_status = ( $board_config['allow_flash'] && $auth->acl_get('f_flash', $forum_id) ) ? true : false;
|
||||
|
||||
// Page title/hidden fields
|
||||
$s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" />';
|
||||
@@ -367,18 +349,18 @@ $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" />';
|
||||
switch( $mode )
|
||||
{
|
||||
case 'newtopic':
|
||||
$page_title = $lang['Post_a_new_topic'];
|
||||
$s_hidden_fields .= '<input type="hidden" name="f" value="' . $f . '" />';
|
||||
$page_title = $user->lang['Post_a_new_topic'];
|
||||
$s_hidden_fields .= '<input type="hidden" name="f" value="' . $forum_id . '" />';
|
||||
break;
|
||||
|
||||
case 'reply':
|
||||
$page_title = $lang['Post_a_reply'];
|
||||
$s_hidden_fields .= '<input type="hidden" name="t" value="' . $t . '" />';
|
||||
$page_title = $user->lang['Post_a_reply'];
|
||||
$s_hidden_fields .= '<input type="hidden" name="t" value="' . $topic_id . '" />';
|
||||
break;
|
||||
|
||||
case 'editpost':
|
||||
$page_title = $lang['Edit_Post'];
|
||||
$s_hidden_fields .= '<input type="hidden" name="p" value="' . $p . '" />';
|
||||
$page_title = $user->lang['Edit_Post'];
|
||||
$s_hidden_fields .= '<input type="hidden" name="p" value="' . $post_id . '" />';
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -389,55 +371,55 @@ $template->assign_vars(array(
|
||||
'USERNAME' => $username,
|
||||
'SUBJECT' => $subject,
|
||||
'MESSAGE' => $message,
|
||||
'HTML_STATUS' => ( $html_status ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF'],
|
||||
'BBCODE_STATUS' => ( $bbcode_status ) ? sprintf($lang['BBCode_is_ON'], '<a href="' . "faq.$phpEx$SID&mode=bbcode" . '" target="_phpbbcode">', '</a>') : sprintf($lang['BBCode_is_OFF'], '<a href="' . "faq.$phpEx$SID&mode=bbcode" . '" target="_phpbbcode">', '</a>'),
|
||||
'SMILIES_STATUS' => ( $smilies_status ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF'],
|
||||
'IMG_STATUS' => ( $img_status ) ? $lang['Images_are_ON'] : $lang['Images_are_OFF'],
|
||||
'FLASH_STATUS' => ( $flash_status ) ? $lang['Flash_is_ON'] : $lang['Flash_is_OFF'],
|
||||
'HTML_STATUS' => ( $html_status ) ? $user->lang['HTML_is_ON'] : $user->lang['HTML_is_OFF'],
|
||||
'BBCODE_STATUS' => ( $bbcode_status ) ? sprintf($user->lang['BBCode_is_ON'], '<a href="' . "faq.$phpEx$SID&mode=bbcode" . '" target="_phpbbcode">', '</a>') : sprintf($user->lang['BBCode_is_OFF'], '<a href="' . "faq.$phpEx$SID&mode=bbcode" . '" target="_phpbbcode">', '</a>'),
|
||||
'SMILIES_STATUS' => ( $smilies_status ) ? $user->lang['Smilies_are_ON'] : $user->lang['Smilies_are_OFF'],
|
||||
'IMG_STATUS' => ( $img_status ) ? $user->lang['Images_are_ON'] : $user->lang['Images_are_OFF'],
|
||||
'FLASH_STATUS' => ( $flash_status ) ? $user->lang['Flash_is_ON'] : $user->lang['Flash_is_OFF'],
|
||||
|
||||
'L_POST_A' => $page_title,
|
||||
'L_POST_SUBJECT' => $lang['Post_subject'],
|
||||
'L_VIEW_MODERATORS' => $lang['View_moderators'],
|
||||
'L_TOPIC_ICON' => $lang['Topic_icon'],
|
||||
'L_SUBJECT' => $lang['Subject'],
|
||||
'L_MESSAGE_BODY' => $lang['Message_body'],
|
||||
'L_OPTIONS' => $lang['Options'],
|
||||
'L_PREVIEW' => $lang['Preview'],
|
||||
'L_SPELLCHECK' => $lang['Spellcheck'],
|
||||
'L_SUBMIT' => $lang['Submit'],
|
||||
'L_SAVE' => $lang['Save'],
|
||||
'L_CANCEL' => $lang['Cancel'],
|
||||
'L_CONFIRM_DELETE' => $lang['Confirm_delete'],
|
||||
'L_DISABLE_HTML' => $lang['Disable_HTML_post'],
|
||||
'L_DISABLE_BBCODE' => $lang['Disable_BBCode_post'],
|
||||
'L_DISABLE_SMILIES' => $lang['Disable_Smilies_post'],
|
||||
'L_DISABLE_MAGIC_URL' => $lang['Disable_magic_url'],
|
||||
'L_ATTACH_SIGNATURE' => $lang['Attach_signature'],
|
||||
'L_NOTIFY_ON_REPLY' => $lang['Notify'],
|
||||
'L_DELETE_POST' => $lang['Delete_post'],
|
||||
'L_NONE' => $lang['None'],
|
||||
'L_EMPTY_MESSAGE' => $lang['Empty_message'],
|
||||
'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'],
|
||||
'L_STYLES_TIP' => $lang['Styles_tip'],
|
||||
'L_BBCODE_B_HELP' => $lang['bbcode_b_help'],
|
||||
'L_BBCODE_I_HELP' => $lang['bbcode_i_help'],
|
||||
'L_BBCODE_U_HELP' => $lang['bbcode_u_help'],
|
||||
'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'],
|
||||
'L_BBCODE_C_HELP' => $lang['bbcode_c_help'],
|
||||
'L_BBCODE_L_HELP' => $lang['bbcode_l_help'],
|
||||
'L_BBCODE_O_HELP' => $lang['bbcode_o_help'],
|
||||
'L_BBCODE_P_HELP' => $lang['bbcode_p_help'],
|
||||
'L_BBCODE_W_HELP' => $lang['bbcode_w_help'],
|
||||
'L_BBCODE_A_HELP' => $lang['bbcode_a_help'],
|
||||
'L_BBCODE_S_HELP' => $lang['bbcode_s_help'],
|
||||
'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
|
||||
'L_FONT_COLOR' => $lang['Font_color'],
|
||||
'L_FONT_SIZE' => $lang['Font_size'],
|
||||
'L_FONT_TINY' => $lang['font_tiny'],
|
||||
'L_FONT_SMALL' => $lang['font_small'],
|
||||
'L_FONT_NORMAL' => $lang['font_normal'],
|
||||
'L_FONT_LARGE' => $lang['font_large'],
|
||||
'L_FONT_HUGE' => $lang['font_huge'],
|
||||
'L_POST_SUBJECT' => $user->lang['Post_subject'],
|
||||
'L_VIEW_MODERATORS' => $user->lang['View_moderators'],
|
||||
'L_TOPIC_ICON' => $user->lang['Topic_icon'],
|
||||
'L_SUBJECT' => $user->lang['Subject'],
|
||||
'L_MESSAGE_BODY' => $user->lang['Message_body'],
|
||||
'L_OPTIONS' => $user->lang['Options'],
|
||||
'L_PREVIEW' => $user->lang['Preview'],
|
||||
'L_SPELLCHECK' => $user->lang['Spellcheck'],
|
||||
'L_SUBMIT' => $user->lang['Submit'],
|
||||
'L_SAVE' => $user->lang['Save'],
|
||||
'L_CANCEL' => $user->lang['Cancel'],
|
||||
'L_CONFIRM_DELETE' => $user->lang['Confirm_delete'],
|
||||
'L_DISABLE_HTML' => $user->lang['Disable_HTML_post'],
|
||||
'L_DISABLE_BBCODE' => $user->lang['Disable_BBCode_post'],
|
||||
'L_DISABLE_SMILIES' => $user->lang['Disable_Smilies_post'],
|
||||
'L_DISABLE_MAGIC_URL' => $user->lang['Disable_magic_url'],
|
||||
'L_ATTACH_SIGNATURE' => $user->lang['Attach_signature'],
|
||||
'L_NOTIFY_ON_REPLY' => $user->lang['Notify'],
|
||||
'L_DELETE_POST' => $user->lang['Delete_post'],
|
||||
'L_NONE' => $user->lang['None'],
|
||||
'L_EMPTY_MESSAGE' => $user->lang['Empty_message'],
|
||||
'L_BBCODE_CLOSE_TAGS' => $user->lang['Close_Tags'],
|
||||
'L_STYLES_TIP' => $user->lang['Styles_tip'],
|
||||
'L_BBCODE_B_HELP' => $user->lang['bbcode_b_help'],
|
||||
'L_BBCODE_I_HELP' => $user->lang['bbcode_i_help'],
|
||||
'L_BBCODE_U_HELP' => $user->lang['bbcode_u_help'],
|
||||
'L_BBCODE_Q_HELP' => $user->lang['bbcode_q_help'],
|
||||
'L_BBCODE_C_HELP' => $user->lang['bbcode_c_help'],
|
||||
'L_BBCODE_L_HELP' => $user->lang['bbcode_l_help'],
|
||||
'L_BBCODE_O_HELP' => $user->lang['bbcode_o_help'],
|
||||
'L_BBCODE_P_HELP' => $user->lang['bbcode_p_help'],
|
||||
'L_BBCODE_W_HELP' => $user->lang['bbcode_w_help'],
|
||||
'L_BBCODE_A_HELP' => $user->lang['bbcode_a_help'],
|
||||
'L_BBCODE_S_HELP' => $user->lang['bbcode_s_help'],
|
||||
'L_BBCODE_F_HELP' => $user->lang['bbcode_f_help'],
|
||||
'L_FONT_COLOR' => $user->lang['Font_color'],
|
||||
'L_FONT_SIZE' => $user->lang['Font_size'],
|
||||
'L_FONT_TINY' => $user->lang['font_tiny'],
|
||||
'L_FONT_SMALL' => $user->lang['font_small'],
|
||||
'L_FONT_NORMAL' => $user->lang['font_normal'],
|
||||
'L_FONT_LARGE' => $user->lang['font_large'],
|
||||
'L_FONT_HUGE' => $user->lang['font_huge'],
|
||||
|
||||
'U_VIEW_FORUM' => "viewforum.$phpEx$SID&f=$forum_id",
|
||||
'U_VIEWTOPIC' => ( $mode != 'newtopic' ) ? "viewtopic.$phpEx$SID&t=$topic_id" : '',
|
||||
@@ -451,15 +433,15 @@ $template->assign_vars(array(
|
||||
'S_MAGIC_URL_CHECKED' => ( !$magic_urls_on ) ? 'checked="checked"' : '',
|
||||
'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? 'checked="checked"' : '',
|
||||
'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '',
|
||||
'S_DISPLAY_USERNAME' => ( !$userdata['user_id'] || ( $mode == 'editpost' && $post_info['post_username'] ) ) ? true : false,
|
||||
'S_DISPLAY_USERNAME' => ( !$user->data['user_id'] || ( $mode == 'editpost' && $post_info['post_username'] ) ) ? true : false,
|
||||
|
||||
'S_SAVE_ALLOWED' => ( $auth->acl_get('f_save', $f) ) ? true : false,
|
||||
'S_SAVE_ALLOWED' => ( $auth->acl_get('f_save', $forum_id) ) ? true : false,
|
||||
'S_HTML_ALLOWED' => $html_status,
|
||||
'S_BBCODE_ALLOWED' => $bbcode_status,
|
||||
'S_SMILIES_ALLOWED' => $smilies_status,
|
||||
'S_SIG_ALLOWED' => ( $auth->acl_get('f_sigs', $f) ) ? true : false,
|
||||
'S_NOTIFY_ALLOWED' => ( $userdata['user_id'] ) ? true : false,
|
||||
'S_DELETE_ALLOWED' => ( $mode == 'editpost' && ( ( $auth->acl_get('f_delete', $f) && $post_data['last_post'] && ( !$post_data['has_poll'] || $post_data['edit_poll'] ) ) || $auth->acl_is_mod($f) ) ) ? true : false,
|
||||
'S_SIG_ALLOWED' => ( $auth->acl_get('f_sigs', $forum_id) ) ? true : false,
|
||||
'S_NOTIFY_ALLOWED' => ( $user->data['user_id'] ) ? true : false,
|
||||
'S_DELETE_ALLOWED' => ( $mode == 'editpost' && ( ( $auth->acl_get('f_delete', $forum_id) && $post_data['last_post'] && ( !$post_data['has_poll'] || $post_data['edit_poll'] ) ) || $auth->acl_get('m_', $forum_id) ) ) ? true : false,
|
||||
'S_TYPE_TOGGLE' => $topic_type_toggle,
|
||||
|
||||
'S_TOPIC_ID' => $t,
|
||||
@@ -467,26 +449,24 @@ $template->assign_vars(array(
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields)
|
||||
);
|
||||
|
||||
//
|
||||
// Poll entry
|
||||
//
|
||||
if ( ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) ) && $auth->acl_get('f_poll', $f) )
|
||||
if ( ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) ) && $auth->acl_get('f_poll', $forum_id) )
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_SHOW_POLL_BOX' => true,
|
||||
'S_POLL_DELETE' => ( $mode == 'editpost' && $post_data['edit_poll'] ) ? true : false,
|
||||
|
||||
'L_ADD_A_POLL' => $lang['Add_poll'],
|
||||
'L_ADD_POLL_EXPLAIN' => $lang['Add_poll_explain'],
|
||||
'L_POLL_QUESTION' => $lang['Poll_question'],
|
||||
'L_POLL_OPTION' => $lang['Poll_option'],
|
||||
'L_ADD_OPTION' => $lang['Add_option'],
|
||||
'L_UPDATE_OPTION' => $lang['Update'],
|
||||
'L_DELETE_OPTION' => $lang['Delete'],
|
||||
'L_POLL_LENGTH' => $lang['Poll_for'],
|
||||
'L_DAYS' => $lang['Days'],
|
||||
'L_POLL_LENGTH_EXPLAIN' => $lang['Poll_for_explain'],
|
||||
'L_POLL_DELETE' => $lang['Delete_poll'],
|
||||
'L_ADD_A_POLL' => $user->lang['Add_poll'],
|
||||
'L_ADD_POLL_EXPLAIN' => $user->lang['Add_poll_explain'],
|
||||
'L_POLL_QUESTION' => $user->lang['Poll_question'],
|
||||
'L_POLL_OPTION' => $user->lang['Poll_option'],
|
||||
'L_ADD_OPTION' => $user->lang['Add_option'],
|
||||
'L_UPDATE_OPTION' => $user->lang['Update'],
|
||||
'L_DELETE_OPTION' => $user->lang['Delete'],
|
||||
'L_POLL_LENGTH' => $user->lang['Poll_for'],
|
||||
'L_DAYS' => $user->lang['Days'],
|
||||
'L_POLL_LENGTH_EXPLAIN' => $user->lang['Poll_for_explain'],
|
||||
'L_POLL_DELETE' => $user->lang['Delete_poll'],
|
||||
|
||||
'POLL_TITLE' => $poll_title,
|
||||
'POLL_LENGTH' => $poll_length)
|
||||
@@ -506,16 +486,16 @@ if ( ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post']
|
||||
}
|
||||
|
||||
// Attachment entry
|
||||
if ( $auth->acl_get('f_attach', $f) )
|
||||
if ( $auth->acl_get('f_attach', $forum_id) )
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_SHOW_ATTACH_BOX' => true,
|
||||
'L_ADD_ATTACHMENT' => $lang['Add_attach'],
|
||||
'L_ADD_ATTACHMENT_EXPLAIN' => $lang['Add_attach_explain'],
|
||||
'L_ADD_ATTACHMENT' => $user->lang['Add_attach'],
|
||||
'L_ADD_ATTACHMENT_EXPLAIN' => $user->lang['Add_attach_explain'],
|
||||
|
||||
'L_ADD_FILE' => $lang['Add_file'],
|
||||
'L_FILE_NAME' => $lang['Filename'],
|
||||
'L_FILE_COMMENT' => $lang['File_comment'],)
|
||||
'L_ADD_FILE' => $user->lang['Add_file'],
|
||||
'L_FILE_NAME' => $user->lang['Filename'],
|
||||
'L_FILE_COMMENT' => $user->lang['File_comment'],)
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user