mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Moved remaining hard coded text in posting template to lang_main, smilies now from DB + external smilies window if > 20
git-svn-id: file:///svn/phpbb/trunk@1609 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -571,6 +571,85 @@ function topic_review($topic_id, $is_inline_review)
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
}
|
||||
}
|
||||
|
||||
function generate_smilies($mode)
|
||||
{
|
||||
global $db, $board_config, $template, $lang, $images, $theme, $phpEx;
|
||||
global $user_ip, $forum_id, $session_length;
|
||||
global $userdata;
|
||||
|
||||
if( $mode == 'window' )
|
||||
{
|
||||
$userdata = session_pagestart($user_ip, $forum_id, $session_length);
|
||||
init_userprefs($userdata);
|
||||
|
||||
$gen_simple_header = TRUE;
|
||||
|
||||
$page_title = $lang['Review_topic'] ." - $topic_title";
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"smiliesbody" => "posting_smilies.tpl")
|
||||
);
|
||||
}
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM " . SMILIES_TABLE . "
|
||||
GROUP BY emoticon
|
||||
ORDER BY smilies_id";
|
||||
if( $result = $db->sql_query($sql) )
|
||||
{
|
||||
if( $num_smilies = $db->sql_numrows($result) )
|
||||
{
|
||||
$rowset = $db->sql_fetchrowset($result);
|
||||
|
||||
$j = 0;
|
||||
$s_colspan = 0;
|
||||
$smilies_count = ( $mode == 'inline' ) ? min(20, $num_smilies) : $num_smilies;
|
||||
$smilies_split_row = ( $mode == 'inline' ) ? 3 : 7;
|
||||
for($i = 0; $i < $smilies_count; $i++)
|
||||
{
|
||||
if( !$j )
|
||||
{
|
||||
$template->assign_block_vars("smilies_row", array());
|
||||
}
|
||||
|
||||
$template->assign_block_vars("smilies_row.smilies_col", array(
|
||||
"SMILEY_CODE" => $rowset[$i]['code'],
|
||||
"SMILEY_IMG" => "images/smiles/" . $rowset[$i]['smile_url'],
|
||||
"SMILEY_DESC" => $rowset[$i]['emoticon'])
|
||||
);
|
||||
|
||||
$s_colspan = max($s_colspan, $j + 1);
|
||||
|
||||
$j = ( $j == $smilies_split_row ) ? 0 : $j + 1;
|
||||
}
|
||||
|
||||
if( $mode == 'inline' && $num_smilies > 20)
|
||||
{
|
||||
$template->assign_block_vars("switch_smilies_extra", array());
|
||||
|
||||
$template->assign_vars(array(
|
||||
"L_MORE_SMILIES" => $lang['More_emoticons'],
|
||||
"U_MORE_SMILIES" => append_sid("posting.$phpEx?mode=smilies"))
|
||||
);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
"L_EMOTICONS" => $lang['Emoticons'],
|
||||
"L_CLOSE_WINDOW" => $lang['Close_window'],
|
||||
"S_SMILIES_COLSPAN" => $s_colspan)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if( $mode == 'window' )
|
||||
{
|
||||
$template->pparse("smiliesbody");
|
||||
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
}
|
||||
}
|
||||
//
|
||||
// End page specific functions
|
||||
// ---------------------------
|
||||
@@ -685,6 +764,11 @@ if( $mode == "topicreview" )
|
||||
topic_review($topic_id, false);
|
||||
exit;
|
||||
}
|
||||
else if( $mode == "smilies" )
|
||||
{
|
||||
generate_smilies('window');
|
||||
exit;
|
||||
}
|
||||
|
||||
//
|
||||
// Set toggles for various options
|
||||
@@ -2491,12 +2575,10 @@ $template->assign_vars(array(
|
||||
//
|
||||
if( $preview && !$error )
|
||||
{
|
||||
|
||||
$orig_word = array();
|
||||
$replacement_word = array();
|
||||
$result = obtain_word_list($orig_word, $replacement_word);
|
||||
|
||||
|
||||
if( $bbcode_on )
|
||||
{
|
||||
$bbcode_uid = make_bbcode_uid();
|
||||
@@ -2581,6 +2663,11 @@ if( $error )
|
||||
// End error handling
|
||||
//
|
||||
|
||||
//
|
||||
// Send smilies to template
|
||||
//
|
||||
generate_smilies('inline');
|
||||
|
||||
//
|
||||
// User not logged in so offer up a username
|
||||
// field box
|
||||
@@ -2725,6 +2812,12 @@ if( !empty($post_message) && ( $preview || $error || $refresh ) )
|
||||
$post_message = stripslashes(preg_replace($html_entities_match, $html_entities_replace, $post_message));
|
||||
}
|
||||
|
||||
//
|
||||
// This enables the forum/topic title to be output for posting
|
||||
// but not for privmsg (where it makes no sense)
|
||||
//
|
||||
$template->assign_block_vars("switch_not_privmsg", array());
|
||||
|
||||
//
|
||||
// Output the data to the template
|
||||
//
|
||||
@@ -2733,7 +2826,7 @@ $template->assign_vars(array(
|
||||
"SUBJECT" => preg_replace($html_entities_match, $html_entities_replace, $post_subject),
|
||||
"MESSAGE" => $post_message,
|
||||
"HTML_STATUS" => $html_status,
|
||||
"BBCODE_STATUS" => $bbcode_status,
|
||||
"BBCODE_STATUS" => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'),
|
||||
"SMILIES_STATUS" => $smilies_status,
|
||||
"POLL_TITLE" => preg_replace($html_entities_match, $html_entities_replace, $poll_title),
|
||||
"POLL_LENGTH" => $poll_length,
|
||||
@@ -2753,6 +2846,47 @@ $template->assign_vars(array(
|
||||
"L_NOTIFY_ON_REPLY" => $lang['Notify'],
|
||||
"L_DELETE_POST" => $lang['Delete_post'],
|
||||
|
||||
"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_EMPTY_MESSAGE" => $lang['Empty_message'],
|
||||
|
||||
"L_FONT_COLOR" => $lang['Font_color'],
|
||||
"L_COLOR_DEFAULT" => $lang['color_default'],
|
||||
"L_COLOR_DARK_RED" => $lang['color_dark_red'],
|
||||
"L_COLOR_RED" => $lang['color_red'],
|
||||
"L_COLOR_ORANGE" => $lang['color_orange'],
|
||||
"L_COLOR_BROWN" => $lang['color_brown'],
|
||||
"L_COLOR_YELLOW" => $lang['color_yellow'],
|
||||
"L_COLOR_GREEN" => $lang['color_green'],
|
||||
"L_COLOR_OLIVE" => $lang['color_olive'],
|
||||
"L_COLOR_CYAN" => $lang['color_cyan'],
|
||||
"L_COLOR_BLUE" => $lang['color_blue'],
|
||||
"L_COLOR_DARK_BLUE" => $lang['color_dark_blue'],
|
||||
"L_COLOR_INDIGO" => $lang['color_indigo'],
|
||||
"L_COLOR_VIOLET" => $lang['color_violet'],
|
||||
"L_COLOR_WHITE" => $lang['color_white'],
|
||||
"L_COLOR_BLACK" => $lang['color_black'],
|
||||
|
||||
"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_BBCODE_CLOSE_TAGS" => $lang['Close_Tags'],
|
||||
"L_STYLES_TIP" => $lang['Styles_tip'],
|
||||
|
||||
"U_VIEWTOPIC" => ( $mode == "reply" ) ? append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postorder=desc") : "",
|
||||
"U_REVIEW_TOPIC" => ( $mode == "reply" ) ? append_sid("posting.$phpEx?mode=topicreview&" . POST_TOPIC_URL . "=$topic_id") : "",
|
||||
|
||||
@@ -2830,4 +2964,4 @@ $template->pparse("body");
|
||||
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
||||
?>
|
Reference in New Issue
Block a user