Пример #1
0
function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0)
{
    global $board_config, $html_entities_match, $html_entities_replace;
    //
    // Clean up the message
    //
    $message = trim($message);
    if ($html_on) {
        // If HTML is on, we try to make it safe
        // This approach is quite agressive and anything that does not look like a valid tag
        // is going to get converted to HTML entities
        $message = stripslashes($message);
        $html_match = '#<[^\\w<]*(\\w+)((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?>#';
        $matches = array();
        $message_split = preg_split($html_match, $message);
        preg_match_all($html_match, $message, $matches);
        $message = '';
        foreach ($message_split as $part) {
            $tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2]));
            $message .= preg_replace($html_entities_match, $html_entities_replace, $part) . clean_html($tag);
        }
        $message = addslashes($message);
        $message = str_replace('&quot;', '\\&quot;', $message);
    } else {
        $message = preg_replace($html_entities_match, $html_entities_replace, $message);
    }
    if ($bbcode_on && $bbcode_uid != '') {
        $message = bbencode_first_pass($message, $bbcode_uid);
    }
    return $message;
}
Пример #2
0
/**
 * 进行了适当修改,以便脱离 phpbb 使用 (dualface@gmail.com)
 */
function bbencode_all($text, $uid)
{
    $text = bbencode_first_pass($text, 'post');
    $text = bbencode_second_pass($text, 'post');
    $text .= "\n";
    $text = str_replace(array("\r\n", "\r"), "\n", $text);
    // cross-platform newlines
    $text = preg_replace('/(.+)\\n(.+)/', "\$1<br />\$2", $text);
    $text = preg_replace('/\\n?(.+?)(?:\\n\\s*\\n|\\z)/s', "<p>\$1</p>\n", $text);
    // make paragraphs, including one at the end
    return $text;
}
Пример #3
0
function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0)
{
    global $ft_cfg, $html_entities_match, $html_entities_replace;
    //
    // Clean up the message
    //
    $message = preg_replace("#([ \t]+?)(\r?\n|\r)#", '\\2', $message);
    $message = preg_replace("#(\r\n){3,}#", "\r\n\r\n", $message);
    $message = preg_replace("#(\n){3,}#", "\n\n", $message);
    $message = trim($message);
    if ($html_on) {
        $allowed_html_tags = split(',', $ft_cfg['allow_html_tags']);
        $end_html = 0;
        $start_html = 1;
        $tmp_message = '';
        $message = ' ' . $message . ' ';
        while ($start_html = strpos($message, '<', $start_html)) {
            $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1, $start_html - $end_html - 1));
            if ($end_html = strpos($message, '>', $start_html)) {
                $length = $end_html - $start_html + 1;
                $hold_string = substr($message, $start_html, $length);
                if (($unclosed_open = strrpos(' ' . $hold_string, '<')) != 1) {
                    $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($hold_string, 0, $unclosed_open - 1));
                    $hold_string = substr($hold_string, $unclosed_open - 1);
                }
                $tagallowed = false;
                for ($i = 0; $i < sizeof($allowed_html_tags); $i++) {
                    $match_tag = trim($allowed_html_tags[$i]);
                    if (preg_match('#^<\\/?' . $match_tag . '[> ]#i', $hold_string)) {
                        $tagallowed = preg_match('#^<\\/?' . $match_tag . ' .*?(style[\\t ]*?=|on[\\w]+[\\t ]*?=)#i', $hold_string) ? false : true;
                    }
                }
                $tmp_message .= $length && !$tagallowed ? preg_replace($html_entities_match, $html_entities_replace, $hold_string) : $hold_string;
                $start_html += $length;
            } else {
                $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $start_html, strlen($message)));
                $start_html = strlen($message);
                $end_html = $start_html;
            }
        }
        if (!$end_html || $end_html != strlen($message) && $tmp_message != '') {
            $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1));
        }
        $message = $tmp_message != '' ? trim($tmp_message) : trim($message);
    } else {
        $message = preg_replace($html_entities_match, $html_entities_replace, $message);
    }
    if ($bbcode_on && $bbcode_uid != '') {
        $message = bbencode_first_pass($message, $bbcode_uid);
    }
    return $message;
}
Пример #4
0
function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0)
{
    global $board_config;
    global $html_entities_match, $html_entities_replace;
    global $code_entities_match, $code_entities_replace;
    //
    // Clean up the message
    //
    $message = trim($message);
    if ($html_on) {
        $allowed_html_tags = split(',', $board_config['allow_html_tags']);
        $end_html = 0;
        $start_html = 1;
        $tmp_message = '';
        $message = ' ' . $message . ' ';
        while ($start_html = strpos($message, '<', $start_html)) {
            $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1, $start_html - $end_html - 1));
            if ($end_html = strpos($message, '>', $start_html)) {
                $length = $end_html - $start_html + 1;
                $hold_string = substr($message, $start_html, $length);
                if (($unclosed_open = strrpos(' ' . $hold_string, '<')) != 1) {
                    $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($hold_string, 0, $unclosed_open - 1));
                    $hold_string = substr($hold_string, $unclosed_open - 1);
                }
                $tagallowed = false;
                for ($i = 0; $i < sizeof($allowed_html_tags); $i++) {
                    $match_tag = trim($allowed_html_tags[$i]);
                    if (preg_match('/^<\\/?' . $match_tag . '(?!(\\s*)style(\\s*)\\=)/i', $hold_string)) {
                        $tagallowed = true;
                    }
                }
                $tmp_message .= $length && !$tagallowed ? preg_replace($html_entities_match, $html_entities_replace, $hold_string) : $hold_string;
                $start_html += $length;
            } else {
                $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $start_html, strlen($message)));
                $start_html = strlen($message);
                $end_html = $start_html;
            }
        }
        if ($end_html != strlen($message) && $tmp_message != '') {
            $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1));
        }
        $message = $tmp_message != '' ? trim($tmp_message) : trim($message);
    } else {
        $message = preg_replace($html_entities_match, $html_entities_replace, $message);
    }
    if ($bbcode_on && $bbcode_uid != '') {
        $message = bbencode_first_pass($message, $bbcode_uid);
    }
    return $message;
}
Пример #5
0
function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0)
{
    global $board_config, $html_entities_match, $html_entities_replace;
    //
    // Clean up the message
    //
    $message = trim($message);
    if ($html_on) {
        // This is the old phpBB 2.0.19 code, because the 2.0.20 code is way too aggressive.
        $allowed_html_tags = split(',', $board_config['allow_html_tags']);
        $end_html = 0;
        $start_html = 1;
        $tmp_message = '';
        $message = ' ' . $message . ' ';
        while ($start_html = strpos($message, '<', $start_html)) {
            $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1, $start_html - $end_html - 1));
            if ($end_html = strpos($message, '>', $start_html)) {
                $length = $end_html - $start_html + 1;
                $hold_string = substr($message, $start_html, $length);
                if (($unclosed_open = strrpos(' ' . $hold_string, '<')) != 1) {
                    $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($hold_string, 0, $unclosed_open - 1));
                    $hold_string = substr($hold_string, $unclosed_open - 1);
                }
                $tagallowed = false;
                for ($i = 0; $i < sizeof($allowed_html_tags); $i++) {
                    $match_tag = trim($allowed_html_tags[$i]);
                    if (preg_match('#^<\\/?' . $match_tag . '[> ]#i', $hold_string)) {
                        $tagallowed = preg_match('#^<\\/?' . $match_tag . ' .*?(style[\\t ]*?=|on[\\w]+[\\t ]*?=)#i', $hold_string) ? false : true;
                    }
                }
                $tmp_message .= $length && !$tagallowed ? preg_replace($html_entities_match, $html_entities_replace, $hold_string) : $hold_string;
                $start_html += $length;
            } else {
                $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $start_html, strlen($message)));
                $start_html = strlen($message);
                $end_html = $start_html;
            }
        }
        if (!$end_html || $end_html != strlen($message) && $tmp_message != '') {
            $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1));
        }
        $message = $tmp_message != '' ? trim($tmp_message) : trim($message);
    } else {
        $message = preg_replace($html_entities_match, $html_entities_replace, $message);
    }
    if ($bbcode_on && $bbcode_uid != '') {
        $message = bbencode_first_pass($message, $bbcode_uid);
    }
    return $message;
}
Пример #6
0
 public function __construct()
 {
     global $template, $announcement_centre_config;
     $this->config = $announcement_centre_config;
     $this->config['announcement_text'] = smilies_pass($this->config['announcement_text']);
     $announcement_text_uid = make_bbcode_uid();
     $this->config['announcement_text'] = bbencode_first_pass($this->config['announcement_text'], $announcement_text_uid);
     $this->config['announcement_text'] = bbencode_second_pass($this->config['announcement_text'], $announcement_text_uid);
     $this->config['announcement_text'] = str_replace("\n", "\n<br />\n", $this->config['announcement_text']);
     $this->config['announcement_guest_text'] = smilies_pass($this->config['announcement_guest_text']);
     $announcement_guest_text_uid = make_bbcode_uid();
     $this->config['announcement_guest_text'] = bbencode_first_pass($this->config['announcement_guest_text'], $announcement_guest_text_uid);
     $this->config['announcement_guest_text'] = bbencode_second_pass($this->config['announcement_guest_text'], $announcement_guest_text_uid);
     $this->config['announcement_guest_text'] = str_replace("\n", "\n<br />\n", $this->config['announcement_guest_text']);
     $announcement_guest_text = $this->config['announcement_guest_text'];
     $announcement_title = empty($this->config['announcement_title']) ? $lang['Site_announcement_block_title'] : str_replace("\n", "\n<br />\n", $this->config['announcement_title']);
     $announcement_guest_title = empty($this->config['announcement_guest_title']) ? $lang['Guest_announcement_block_title'] : str_replace("\n", "\n<br />\n", $this->config['announcement_guest_title']);
     // get the post information in case last topic or forum has been entered
     if (!$this->config['announcement_forum_id'] == '' || !$this->config['announcement_topic_id'] == '') {
         if (!($result = $db->sql_query($this->getFetchSql()))) {
             message_die(GENERAL_ERROR, 'Error in getting announcement post', '', __LINE__, __FILE__, $sql);
         }
         if ($row = $db->sql_fetchrow($result)) {
             $row['post_text'] = smilies_pass($row['post_text']);
             $row['post_text'] = bbencode_first_pass($row['post_text'], $row['bbcode_uid']);
             $row['post_text'] = bbencode_second_pass($row['post_text'], $row['bbcode_uid']);
             $row['post_text'] = str_replace("\n", "\n<br />\n", $row['post_text']);
             $announcement_text = $row['post_text'];
         }
     } else {
         $announcement_text = $this->config['announcement_text'];
     }
     // who sees the announcements
     if ($this->config['announcement_status'] == ANNOUNCEMENTS_LEFTY74_SHOW_YES) {
         switch ($this->getDisplay()) {
             case 'normal':
                 $template->assign_block_vars('announcement_displayed', array());
                 break;
             case 'guest':
                 $template->assign_block_vars('guest_announcement_displayed', array());
                 break;
             default:
                 $template->assign_block_vars('announcement_not_displayed', array());
         }
     }
     //BEGIN ACP Site Announcement Centre by lefty74
     $template->assign_vars(array('L_ANNOUNCEMENT_TITLE' => $announcement_title, 'SITE_ANNOUNCEMENTS_LEFTY74' => $announcement_text, 'L_ANNOUNCEMENT_GUEST_TITLE' => $announcement_guest_title, 'GUEST_ANNOUNCEMENTS_LEFTY74' => $announcement_guest_text));
 }
Пример #7
0
 $title = str_replace("\\'", "''", $title);
 $short_desc = str_replace("\\'", "''", $short_desc);
 $price = str_replace("\\'", "''", $price);
 $additional_info = str_replace("\\'", "''", $additional_info);
 $field_1 = str_replace("\\'", "''", $field_1);
 $field_2 = str_replace("\\'", "''", $field_2);
 $field_3 = str_replace("\\'", "''", $field_3);
 $field_4 = str_replace("\\'", "''", $field_4);
 $field_5 = str_replace("\\'", "''", $field_5);
 $field_6 = str_replace("\\'", "''", $field_6);
 $field_7 = str_replace("\\'", "''", $field_7);
 $field_8 = str_replace("\\'", "''", $field_8);
 $field_9 = str_replace("\\'", "''", $field_9);
 $field_10 = str_replace("\\'", "''", $field_10);
 // Handle BBCode
 $additional_info = bbencode_first_pass($additional_info, '');
 // Check that the ad exists
 $sql = "SELECT * \r\n\t\t\tFROM " . ADS_ADVERTS_TABLE . " \r\n\t\t\tWHERE id = '{$id}'";
 $result = $db->sql_query($sql);
 $row = $db->sql_fetchrow($result);
 if (!$row) {
     message_die(GENERAL_ERROR, $lang['ad_not_found']);
 }
 // Update the ad
 $user_id = $userdata['user_id'];
 $time = time();
 if (empty($HTTP_POST_VARS['cat_sub_cat']) or $HTTP_POST_VARS['cat_sub_cat'] == $lang['please_select']) {
     $sql = "UPDATE " . ADS_ADVERTS_TABLE . " \r\n\t\t\t\tSET edit_user_id = {$user_id}, edit_time = {$time}, edit_count = edit_count + 1, title = '{$title}', short_desc = '{$short_desc}', price = '{$price}', trade_ind = {$trade_ind} \r\n\t\t\t\tWHERE id = {$id}";
 } else {
     list($category, $sub_category) = split('>>', $HTTP_POST_VARS['cat_sub_cat']);
     // Sanitize input data
Пример #8
0
 if ($row['msg_text'] == NULL) {
     // We already converted this post to the new style BBcode, skip this post.
     continue;
 }
 //
 // Nathan's bbcode2 conversion
 //
 // undo 1.2.x encoding..
 $row['msg_text'] = bbdecode(stripslashes($row['msg_text']));
 $row['msg_text'] = undo_make_clickable($row['msg_text']);
 $row['msg_text'] = str_replace("<BR>", "\n", $row['msg_text']);
 // make a uid
 $uid = make_bbcode_uid();
 // do 2.x first-pass encoding..
 $row['msg_text'] = smiley_replace($row['msg_text']);
 $row['msg_text'] = bbencode_first_pass($row['msg_text'], $uid);
 $checksig = preg_replace('/\\[addsig\\]$/', '', $row['msg_text']);
 $enable_sig = strlen($checksig) == strlen($row['msg_text']) ? 0 : 1;
 if (preg_match("/^(.*?)\n-----------------\n.*\$/is", $checksig, $matches)) {
     $checksig = $matches[1];
     $enable_sig = 1;
 }
 $row['msg_text'] = $checksig;
 $row['msg_status'] = $row['msg_status'] == 1 ? PRIVMSGS_READ_MAIL : PRIVMSGS_NEW_MAIL;
 // Subject contains first 60 characters of msg, remove any BBCode tags
 $subject = addslashes(strip_tags(substr($row['msg_text'], 0, 60)));
 $subject = preg_replace("/\\[.*?\\:(([a-z0-9]:)?){$uid}.*?\\]/si", "", $subject);
 $row['msg_text'] = addslashes($row['msg_text']);
 $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)\n\t\t\t\t\t\tVALUES ('" . $row['msg_id'] . "', '{$uid}', '" . $row['msg_text'] . "')";
 query($sql, "Couldn't insert PrivMsg text into " . PRIVMSGS_TEXT_TABLE . " table msg_id " . $row['msg_id']);
 $sql = "UPDATE " . PRIVMSGS_TABLE . " \n\t\t\t\t\t\tSET msg_text = NULL, msg_status = " . $row['msg_status'] . ", privmsgs_subject = '{$subject}', privmsgs_attach_sig = {$enable_sig}\n\t\t\t\t\t\tWHERE msg_id = " . $row['msg_id'];
Пример #9
0
//-- mod : toolbar -------------------------------------------------------------
//-- add
build_toolbar('viewforum', $l_privmsgs_text, $s_privmsg_new, $forum_id);
//-- fin mod : toolbar ---------------------------------------------------------
$template->set_filenames(array('body' => 'viewforum_body.tpl'));
make_jumpbox('viewforum.' . $phpEx);
// Start Smilies Invasion Mod
if ($board_config['allow_smilies']) {
    $forum_row['forum_name'] = smilies_pass($forum_row['forum_name']);
}
// V: Addon Smilies&Bbcode too long desc
$long_desc = $forum_row['forum_desc_long'];
if ($long_desc) {
    $bbcode_uid = make_bbcode_uid();
    $long_desc = smilies_pass($long_desc);
    $long_desc = bbencode_first_pass($long_desc, $bbcode_uid);
    $long_desc = bbencode_second_pass($long_desc, $bbcode_uid);
    $long_desc = nl2br($long_desc);
}
$template->assign_vars(array('FORUM_ID' => $forum_id, 'FORUM_NAME' => $forum_row['forum_name'], 'FORUM_DESC_LONG' => $long_desc, 'MODERATORS' => $forum_moderators, 'POST_IMG' => $forum_row['forum_status'] == FORUM_LOCKED ? $images['post_locked'] : $images['post_new'], 'FOLDER_IMG' => $images['folder'], 'FOLDER_NEW_IMG' => $images['folder_new'], 'FOLDER_HOT_IMG' => $images['folder_hot'], 'FOLDER_HOT_NEW_IMG' => $images['folder_hot_new'], 'FOLDER_LOCKED_IMG' => $images['folder_locked'], 'FOLDER_LOCKED_NEW_IMG' => $images['folder_locked_new'], 'FOLDER_STICKY_IMG' => $images['folder_sticky'], 'FOLDER_STICKY_NEW_IMG' => $images['folder_sticky_new'], 'FOLDER_ANNOUNCE_IMG' => $images['folder_announce'], 'FOLDER_ANNOUNCE_NEW_IMG' => $images['folder_announce_new'], 'L_TOPICS' => $lang['Topics'], 'L_REPLIES' => $lang['Replies'], 'L_VIEWS' => $lang['Views'], 'L_POSTS' => $lang['Posts'], 'L_LASTPOST' => $lang['Last_Post'], 'L_MODERATOR' => $l_moderators, 'L_MARK_TOPICS_READ' => $lang['Mark_all_topics'], 'L_POST_NEW_TOPIC' => $forum_row['forum_status'] == FORUM_LOCKED ? $lang['Forum_locked'] : $lang['Post_new_topic'], 'L_NO_NEW_POSTS' => $lang['No_new_posts'], 'L_NEW_POSTS' => $lang['New_posts'], 'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'], 'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'], 'L_NO_NEW_POSTS_HOT' => $lang['No_new_posts_hot'], 'L_NEW_POSTS_HOT' => $lang['New_posts_hot'], 'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 'L_GLOBAL_ANNOUNCEMENT' => $lang['Post_Global_Announcement'], 'L_STICKY' => $lang['Post_Sticky'], 'L_POSTED' => $lang['Posted'], 'L_JOINED' => $lang['Joined'], 'L_AUTHOR' => $lang['Author'], 'S_AUTH_LIST' => $s_auth_can, 'U_VIEW_FORUM' => append_sid("viewforum.{$phpEx}?" . POST_FORUM_URL . "={$forum_id}"), 'U_MARK_READ' => append_sid("viewforum.{$phpEx}?" . POST_FORUM_URL . "={$forum_id}&amp;mark=topics")));
//
// End header
//
//
// Okay, lets dump out the page ...
//
//-- mod : topic display order ---------------------------------------------------------------------
//-- add
$template->assign_vars(array('S_DISPLAY_ORDER' => $s_display_order));
//-- fin mod : topic display order -----------------------------------------------------------------
if ($total_topics) {
Пример #10
0
                $row++;
            } else {
                $col++;
            }
        }
        if ($mode == 'inline' && $num_smilies > $inline_rows * $inline_columns) {
            $template->assign_block_vars('switch_smilies_extra', array());
            $template->assign_vars(array('L_MORE_SMILIES' => $lang['More_emoticons'], 'U_MORE_SMILIES_ANNOUNCEMENT_TEXT' => append_sid("../posting.{$phpEx}?mode=smilies_announcement_text")));
        }
        $template->assign_vars(array('L_EMOTICONS' => $lang['Emoticons'], 'L_CLOSE_WINDOW' => $lang['Close_window'], 'S_SMILIES_COLSPAN' => $s_colspan));
    }
}
$template->set_filenames(array("body" => "admin/announcement_centre_config_body.tpl"));
//
// Escape any quotes in the site description for proper display in the text
// box on the Announcement Box page
//
$new['announcement_text'] = str_replace('"', '&quot;', $new['announcement_text']);
$new['announcement_guest_text'] = str_replace('"', '&quot;', $new['announcement_guest_text']);
$new['announcement_text_draft'] = str_replace('"', '&quot;', $new['announcement_text_draft']);
$new['announcement_title'] = str_replace('"', '&quot;', $new['announcement_title']);
$new['announcement_guest_title'] = str_replace('"', '&quot;', $new['announcement_guest_title']);
$preview_announcement = $new['announcement_text_draft'];
$preview_announcement_uid = make_bbcode_uid();
$preview_announcement = bbencode_first_pass($preview_announcement, $preview_announcement_uid);
$preview_announcement = bbencode_second_pass($preview_announcement, $preview_announcement_uid);
$preview_announcement = smilies_pass($preview_announcement, './../');
$preview_announcement = str_replace("\n", "\n<br />\n", $preview_announcement);
$template->assign_vars(array("S_ANNOUNCEMENT_ACTION" => append_sid("admin_announcement_centre.{$phpEx}"), "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'], "L_ANNOUNCEMENT_MAIN_TITLE" => $lang['Announcement_main_title'], "L_ANNOUNCEMENT_MAIN_TITLE_EXPLAIN" => $lang['Announcement_main_title_explain'], "L_ANNOUNCEMENT_BLOCK_TITLE" => $lang['Announcement_block_title'], "L_ANNOUNCEMENT_DRAFT_TEXT" => $lang['Announcement_draft_text'], "L_ANNOUNCEMENT_DRAFT_TEXT_EXPLAIN" => $lang['Announcement_draft_text_explain'], "L_SHOW_ANNOUNCEMENT_TEXT" => $lang['Show_announcement_text'], "L_ANNOUNCEMENT_TITLE" => $lang['Announcement_title'], "L_ANNOUNCEMENT_TITLE_EXPLAIN" => $lang['Announcement_title_explain'], "L_ANNOUNCEMENT_DEFAULT_TITLE_EXPLAIN" => $lang['Announcement_default_title_explain'] . $lang['Site_announcement_block_title'], "L_ANNOUNCEMENT_TEXT" => $lang['Announcement_text'], "L_ANNOUNCEMENT_TEXT_EXPLAIN" => $lang['Announcement_text_explain'], "L_FORUM_ID" => $lang['Forum_ID'], "L_TOPIC_ID" => $lang['Topic_ID'], "L_ANNOUNCEMENT_FORUM_TOPIC_LATEST" => $lang['Announcement_forum_topic_latest'], "L_ANNOUNCEMENT_FORUM_TOPIC_FIRST" => $lang['Announcement_forum_topic_first'], "L_ANNOUNCEMENT_GUEST_TITLE" => $lang['Announcement_guest_title'], "L_ANNOUNCEMENT_DEFAULT_GUEST_TITLE_EXPLAIN" => $lang['Announcement_default_title_explain'] . $lang['Guest_announcement_block_title'], "L_ANNOUNCEMENT_GUEST_TITLE_EXPLAIN" => $lang['Announcement_guest_title_explain'], "L_ANNOUNCEMENT_GUEST_TEXT" => $lang['Announcement_guest_text'], "L_SELECT_ALL" => $lang['Select_all'], "L_COPY_TO_ANNOUNCEMENT" => $lang['Copy_to_Announcement'], "L_COPY_TO_GUEST_ANNOUNCEMENT" => $lang['Copy_to_Guest_Announcement'], "L_SUBMIT" => $lang['Submit'], "L_PREVIEW" => $lang['Preview'], "L_RESET" => $lang['Reset'], "L_YES" => $lang['Yes'], "L_NO" => $lang['No'], "ANNOUNCEMENT_VERSION" => sprintf($announcement_centre_config['announcement_mod_version']), "L_SHOW_ANNOUNCEMENT_ALL" => $lang['Show_announcement_all'], "L_SHOW_ANNOUNCEMENT_REG" => $lang['Show_announcement_reg'], "L_SHOW_ANNOUNCEMENT_MOD" => $lang['Show_announcement_mod'], "L_SHOW_ANNOUNCEMENT_ADM" => $lang['Show_announcement_adm'], "L_SHOW_ANNOUNCEMENT_WHO" => $lang['Show_announcement_who'], "L_ANNOUNCEMENT_GUESTS_ONLY" => $lang['Announcement_guests_only'], "L_ANNOUNCEMENT_GUESTS_ONLY_EXPLAIN" => $lang['Announcement_guests_only_explain'], "ANNOUNCEMENT_FORUM_ID" => $new['announcement_forum_id'], "ANNOUNCEMENT_TOPIC_ID" => $new['announcement_topic_id'], "ANNOUNCEMENT_TITLE" => $new['announcement_title'], "ANNOUNCEMENT_TEXT" => $new['announcement_text'], "ANNOUNCEMENT_GUEST_TITLE" => $new['announcement_guest_title'], "ANNOUNCEMENT_GUEST_TEXT" => $new['announcement_guest_text'], "ANNOUNCEMENT_TEXT_DRAFT" => $new['announcement_text_draft'], "ANNOUNCEMENT_PREVIEW" => $preview_announcement, "S_ANNOUNCEMENT_STATUS_YES" => $announcement_status_yes, "SHOW_ANNOUNCEMENT_YES" => ANNOUNCEMENTS_LEFTY74_SHOW_YES, "S_ANNOUNCEMENT_STATUS_NO" => $announcement_status_no, "SHOW_ANNOUNCEMENT_NO" => ANNOUNCEMENTS_LEFTY74_SHOW_NO, "S_ANNOUNCEMENT_FORUM_TOPIC_LATEST" => $announcement_forum_topic_latest, "ANNOUNCEMENT_FORUM_TOPIC_LATEST" => ANNOUNCEMENTS_LEFTY74_FORUM_TOPIC_LATEST, "S_ANNOUNCEMENT_FORUM_TOPIC_FIRST" => $announcement_forum_topic_first, "ANNOUNCEMENT_FORUM_TOPIC_FIRST" => ANNOUNCEMENTS_LEFTY74_FORUM_TOPIC_FIRST, "ANNOUNCEMENT_GUEST_SEPARATE_STATUS_YES" => ANNOUNCEMENTS_LEFTY74_GUEST_YES, "S_ANNOUNCEMENT_GUEST_SEPARATE_STATUS_YES" => $announcement_guestannouncement_status_yes, "ANNOUNCEMENT_GUEST_SEPARATE_STATUS_NO" => ANNOUNCEMENTS_LEFTY74_GUEST_NO, "S_ANNOUNCEMENT_GUEST_SEPARATE_STATUS_NO" => $announcement_guestannouncement_status_no, "SHOW_ANNOUNCEMENT_ALL" => ANNOUNCEMENTS_LEFTY74_SHOW_ALL, "S_SHOW_ANNOUNCEMENT_ALL_CHECKED" => $show_announcement_all, "SHOW_ANNOUNCEMENT_REG" => ANNOUNCEMENTS_LEFTY74_SHOW_REG, "S_SHOW_ANNOUNCEMENT_REG_CHECKED" => $show_announcement_reg, "SHOW_ANNOUNCEMENT_MOD" => ANNOUNCEMENTS_LEFTY74_SHOW_MOD, "S_SHOW_ANNOUNCEMENT_MOD_CHECKED" => $show_announcement_mod, "SHOW_ANNOUNCEMENT_ADM" => ANNOUNCEMENTS_LEFTY74_SHOW_ADM, "S_SHOW_ANNOUNCEMENT_ADM_CHECKED" => $show_announcement_adm));
$template->pparse("body");
include './page_footer_admin.' . $phpEx;
Пример #11
0
if ($auction_offer_row['auction_offer_time_stop'] < time() && $userdata['user_id'] == $auction_offer_max_bidder_id or $auction_offer_row['auction_offer_state'] == 2 && $auction_offer_row['FK_auction_offer_last_bid_user_id'] == $userdata['user_id']) {
    $template->assign_block_vars('raterow', array('L_AUCTION_RATE_SELLER' => $lang['auction_rate_seller'], 'L_AUCTION_RATING_PERSON' => $lang['auction_offer_offerer'], 'L_AUCTION_RATE_SELLER_TEXT' => $lang['auction_rate_seller_text'], 'L_AUCTION_RATE_NOW' => $lang['auction_rate_now'], 'AUCTION_OFFER_OFFERER' => $auction_offer_row['username'], 'L_AUCTION_RATING_CATEGORY' => $lang['auction_rating_category'], 'AUCTION_OFFER_RATING_CATEGORIES' => $auction_category_list, 'S_AUCTION_RATE_ACTION' => append_sid("auction_rating.{$phpEx}?mode=create&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id)));
}
// END RATING
// BEGIN prepare meassage
$message = $auction_offer_row['auction_offer_text'];
if (!$board_config['allow_html']) {
    if ($board_config['allow_html']) {
        $message = preg_replace('#(<)([\\/]?.*?)(>)#is', "&lt;\\2&gt;", $message);
    }
}
// Parse message and/or sig for BBCode if reqd
if ($board_config['allow_bbcode']) {
    $message = str_replace("\n", "<br>", $message);
    $bbcode_uid = make_bbcode_uid();
    $message = bbencode_first_pass($message, $bbcode_uid);
    $message = $board_config['allow_bbcode'] ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\\:[0-9a-z\\:]+\\]/si', ']', $message);
    //              $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, 0) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
}
$message = make_clickable($message);
// Parse smilies
if ($board_config['allow_smilies']) {
    $message = smilies_pass($message);
}
// END prepare message
$message = break_text($message);
// Create time-2-end-chart
if ($auction_offer_row['auction_offer_time_stop'] > time() and $auction_config_data['auction_show_timeline'] and $auction_offer_row['auction_offer_state'] != 2) {
    $time_to_end = daydiff(time(), $auction_offer_row['auction_offer_time_stop']);
    $time_total = daydiff($auction_offer_row['auction_offer_time_start'], $auction_offer_row['auction_offer_time_stop']);
    $template->assign_block_vars('timetoend_chart', array('TIME_TOTAL' => $time_total, 'TIME_TO_END' => $time_to_end));
Пример #12
0
function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0)
{
    global $board_config;
    global $html_entities_match, $html_entities_replace;
    global $code_entities_match, $code_entities_replace;
    //
    // Clean up the message
    //
    $message = trim($message);
    if ($html_on) {
        $allowed_html_tags = split(',', $board_config['allow_html_tags']);
        $end_html = 0;
        $start_html = 1;
        $tmp_message = '';
        $message = ' ' . $message . ' ';
        while ($start_html = strpos($message, '<', $start_html)) {
            $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1, $start_html - $end_html - 1));
            if ($end_html = strpos($message, '>', $start_html)) {
                $length = $end_html - $start_html + 1;
                $hold_string = substr($message, $start_html, $length);
                if (($unclosed_open = strrpos(' ' . $hold_string, '<')) != 1) {
                    $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($hold_string, 0, $unclosed_open - 1));
                    $hold_string = substr($hold_string, $unclosed_open - 1);
                }
                $tagallowed = false;
                for ($i = 0; $i < sizeof($allowed_html_tags); $i++) {
                    $match_tag = trim($allowed_html_tags[$i]);
                    if (preg_match('/^<\\/?' . $match_tag . '\\b/i', $hold_string)) {
                        $tagallowed = true;
                    }
                }
                $tmp_message .= $length && !$tagallowed ? preg_replace($html_entities_match, $html_entities_replace, $hold_string) : $hold_string;
                $start_html += $length;
            } else {
                $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $start_html, strlen($message)));
                $start_html = strlen($message);
                $end_html = $start_html;
            }
        }
        if ($end_html != strlen($message) && $tmp_message != '') {
            $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1));
        }
        $message = $tmp_message != '' ? trim($tmp_message) : trim($message);
    } else {
        $message = preg_replace($html_entities_match, $html_entities_replace, $message);
    }
    if ($bbcode_on && $bbcode_uid != '') {
        $tmp_message = $message;
        if ($match_count = preg_match_all('#^(.*?)\\[code\\](.*?)\\[\\/code\\](.*?)$#is', $tmp_message, $match)) {
            $code_entities_match = array('#<#', '#>#', '#"#', '#:#', '#\\[#', '#\\]#', '#\\(#', '#\\)#', '#\\{#', '#\\}#');
            $code_entities_replace = array('&lt;', '&gt;', '&quot;', '&#58;', '&#91;', '&#93;', '&#40;', '&#41;', '&#123;', '&#125;');
            $message = '';
            for ($i = 0; $i < $match_count; $i++) {
                $message .= $match[1][$i] . '[code]' . preg_replace($code_entities_match, $code_entities_replace, $match[2][$i]) . '[/code]';
                $tmp_message = $match[3][$i];
            }
            $message .= $tmp_message;
        }
        $message = bbencode_first_pass($message, $bbcode_uid);
    }
    return $message;
}