• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP obtain_word_list函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中obtain_word_list函数的典型用法代码示例。如果您正苦于以下问题:PHP obtain_word_list函数的具体用法?PHP obtain_word_list怎么用?PHP obtain_word_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了obtain_word_list函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: includeNewsBlock

function includeNewsBlock()
{
    global $template, $lang, $db, $board_config, $auction_config_data;
    global $orig_word, $replacement_word;
    include './extension.inc';
    include './includes/bbcode.' . $phpEx;
    if ($auction_config_data['auction_block_display_news'] == 1) {
        $template->assign_block_vars('news_block', array('L_AUCTION_NEWS' => $lang['auction_news']));
        $sql = "SELECT t.*,\r\n                                   u.username,\r\n                                   u.user_id,\r\n                                   p.*,\r\n                                   x.*\r\n                            FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " x\r\n                            WHERE t.forum_id = " . $auction_config_data['auction_news_forum_id'] . " AND\r\n                                  t.topic_poster = u.user_id AND\r\n                                  p.post_id = t.topic_first_post_id AND\r\n                                  x.post_id = t.topic_first_post_id\r\n                            ORDER BY t.topic_first_post_id DESC\r\n                            LIMIT 0,3";
        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, 'Could not query news block information', '', __LINE__, __FILE__, $sql);
        }
        $total_topics = 0;
        while ($row = $db->sql_fetchrow($result)) {
            $topic_rowset[] = $row;
            $total_topics++;
        }
        $db->sql_freeresult($result);
        // Dump out the news
        if ($total_topics) {
            for ($i = 0; $i < $total_topics; $i++) {
                $topic_id = $topic_rowset[$i]['topic_id'];
                $post_subject = count($orig_word) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
                $topic_poster_url = $topic_rowset[$i]['user_id'] != ANONYMOUS ? append_sid("profile.{$phpEx}?mode=viewprofile&" . POST_USERS_URL . "=" . $topic_rowset[$i]['user_id']) : '';
                $topic_poster = $topic_rowset[$i]['user_id'] != ANONYMOUS ? $topic_rowset[$i]['username'] : ($topic_rowset[$i]['post_username'] != "" ? $topic_rowset[$i]['post_username'] : $lang['Guest']);
                $topic_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['topic_time'], $board_config['board_timezone']);
                $bbcode_uid = $topic_rowset[$i]['bbcode_uid'];
                // Format the message
                $message = $topic_rowset[$i]['post_text'];
                if (!$board_config['allow_html'] && $topic_rowset[$i]['enable_html']) {
                    $message = preg_replace("#(<)([\\/]?.*?)(>)#is", "&lt;\\2&gt;", $message);
                }
                if ($board_config['allow_bbcode'] && $bbcode_uid != "") {
                    $message = $board_config['allow_bbcode'] ? bbencode_second_pass($message, $bbcode_uid) : preg_replace("/\\:[0-9a-z\\:]+\\]/si", "]", $message);
                }
                $message = make_clickable($message);
                // Define censored word matches
                if (empty($orig_word) && empty($replacement_word)) {
                    $orig_word = array();
                    $replacement_word = array();
                    obtain_word_list($orig_word, $replacement_word);
                }
                // Replace naughty words
                if (count($orig_word)) {
                    $post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
                    $message = preg_replace($orig_word, $replacement_word, $message);
                }
                // Parse smilies
                if ($board_config['allow_smilies']) {
                    if ($topic_rowset[$i]['enable_smilies']) {
                        $message = smilies_pass($message);
                    }
                }
                // Replace newlines
                $message = str_replace("\n", "\n<br />\n", $message);
                $view_topic_url = append_sid("viewtopic.{$phpEx}?" . POST_TOPIC_URL . "={$topic_id}");
                $template->assign_block_vars('news_block.content_block', array('TOPIC_TITLE' => $post_subject, 'POST_TEXT' => $message, 'TOPIC_POSTER' => $topic_poster, 'U_TOPIC_POSTER' => $topic_poster_url, 'TOPIC_TIME' => $no_date ? '' : $topic_time, 'L_VIEW_TOPIC' => $lang['auction_news_more'], 'U_VIEW_TOPIC' => $view_topic_url));
            }
        }
    }
}
开发者ID:wrtcoder,项目名称:mini_isp,代码行数:61,代码来源:functions_blocks.php


示例2: create_atom

function create_atom($file_path, $mode, $id, $title, $topics)
{
    global $bb_cfg;
    $dir = dirname($file_path);
    if (!file_exists($dir)) {
        if (!bb_mkdir($dir)) {
            return false;
        }
    }
    foreach ($topics as $topic) {
        $last_time = $topic['topic_last_post_time'];
        if ($topic['topic_last_post_edit_time']) {
            $last_time = $topic['topic_last_post_edit_time'];
        }
        $date = bb_date($last_time, 'Y-m-d', 0);
        $time = bb_date($last_time, 'H:i:s', 0);
        break;
    }
    $atom = "";
    $atom .= "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
    $atom .= "<feed xmlns=\"http://www.w3.org/2005/Atom\" xml:base=\"http://" . $bb_cfg['server_name'] . $bb_cfg['script_path'] . "\">\n";
    $atom .= "<title>{$title}</title>\n";
    $atom .= "<updated>" . $date . "T{$time}+00:00</updated>\n";
    $atom .= "<id>tag:rto.feed,2000:/{$mode}/{$id}</id>\n";
    $atom .= "<link href=\"http://" . $bb_cfg['server_name'] . $bb_cfg['script_path'] . "\" />\n";
    foreach ($topics as $topic) {
        $topic_id = $topic['topic_id'];
        $tor_size = '';
        if (isset($topic['tor_size'])) {
            $tor_size = str_replace('&nbsp;', ' ', ' [' . humn_size($topic['tor_size']) . ']');
        }
        $topic_title = $topic['topic_title'];
        $orig_word = array();
        $replacement_word = array();
        obtain_word_list($orig_word, $replacement_word);
        if (count($orig_word)) {
            $topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
        }
        $topic_title = wbr($topic_title);
        $author_name = $topic['first_username'] ? wbr($topic['first_username']) : 'Гость';
        $last_time = $topic['topic_last_post_time'];
        if ($topic['topic_last_post_edit_time']) {
            $last_time = $topic['topic_last_post_edit_time'];
        }
        $date = bb_date($last_time, 'Y-m-d', 0);
        $time = bb_date($last_time, 'H:i:s', 0);
        $updated = '';
        $checktime = TIMENOW - 604800;
        // неделя (week)
        if ($topic['topic_first_post_edit_time'] && $topic['topic_first_post_edit_time'] > $checktime) {
            $updated = '[Обновлено] ';
        }
        $atom .= "<entry>\n";
        $atom .= "\t<title type=\"html\"><![CDATA[{$updated}{$topic_title}{$tor_size}]]></title>\n";
        $atom .= "\t<author>\n";
        $atom .= "\t\t<name>{$author_name}</name>\n";
        $atom .= "\t</author>\n";
        $atom .= "\t<updated>" . $date . "T{$time}+00:00</updated>\n";
        $atom .= "\t<id>tag:rto.feed," . $date . ":/t/{$topic_id}</id>\n";
        $atom .= "\t<link href=\"viewtopic.php?t={$topic_id}\" />\n";
        $atom .= "</entry>\n";
    }
    $atom .= "</feed>";
    @unlink($file_path);
    $fp = fopen($file_path, "w");
    fwrite($fp, $atom);
    fclose($fp);
    return true;
}
开发者ID:ErR163,项目名称:torrentpier,代码行数:69,代码来源:functions_atom.php


示例3: send_mail

function send_mail($type, $from_userdata, &$to_user_ids, &$recips, $subject, $message, $time = 0, $copy = true, $parsed_values = array())
{
    global $db, $board_config, $lang, $phpbb_root_path, $phpEx, $userdata;
    // fix some parameters
    $subject = trim($subject);
    $message = trim($message);
    // check we have a message and a subject
    if (empty($subject)) {
        return 'Empty_subject';
    }
    if (empty($message)) {
        return 'Empty_message';
    }
    // recipient is not an array, so make one
    if (!is_array($to_user_ids) && !empty($to_user_ids)) {
        $to_user_ids = array(intval($to_user_ids));
    }
    // check if recipients
    if (empty($to_user_ids)) {
        return 'No_to_user';
    }
    $s_to_user_ids = implode(', ', $to_user_ids);
    // censor words
    $orig_word = array();
    $replacement_word = array();
    obtain_word_list($orig_word, $replacement_word);
    // process some cleaning
    $subject = count($orig_word) ? preg_replace($orig_word, $replacement_word, unprepare_message($subject)) : unprepare_message($subject);
    $message = count($orig_word) ? preg_replace($orig_word, $replacement_word, unprepare_message($message)) : unprepare_message($message);
    // clean any bbcode_uid
    $subject = preg_replace('/\\:[0-9a-z\\:]+\\]/si', ']', $subject);
    $message = preg_replace('/\\:[0-9a-z\\:]+\\]/si', ']', $message);
    // clean HTML
    $subject = preg_replace('#(<)([\\/]?.*?)(>)#is', "&lt;\\2&gt;", $subject);
    $message = preg_replace('#(<)([\\/]?.*?)(>)#is', "&lt;\\2&gt;", $message);
    // from_user_id can be 0 for sys message (sent by the board)
    if (empty($from_userdata)) {
        $from_userdata['user_id'] = 0;
        $from_userdata['user_level'] = ADMIN;
        $from_userdata['username'] = $board_config['sitename'];
    }
    $from_user_id = intval($from_userdata['user_id']);
    // get the recipients
    $sql_where = "user_email <> '' AND user_email IS NOT NULL";
    // this will require enhancement for the pcp ignore/friend list
    if (!$copy) {
        $sql_where .= " AND user_id <> " . intval($from_userdata['user_id']);
    }
    if ($userdata['user_level'] != ADMIN) {
        $sql_where .= " AND (user_viewemail = 1 OR user_id = " . intval($userdata['user_id']) . ")";
    }
    //
    // Make sure user wánts the mail
    //
    $notify_sql = '';
    $sql_notify = '';
    if ($type == 'privmsg_notify') {
        $sql_notify = ', user_notify_pm';
        $notify_sql = 'AND user_notify_pm != 0';
    }
    // read the mail recipients
    $sql = "SELECT user_id, user_email, user_lang, username" . $sql_notify . "\n                FROM " . USERS_TABLE . "\n                WHERE user_id IN ({$s_to_user_ids})\n                {$notify_sql}\n                AND user_id NOT IN (0, " . ANONYMOUS . ")\n                AND {$sql_where}";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Could not read recipient mail list', '', __LINE__, __FILE__, $sql);
    }
    $count = 0;
    $bcc_list_ary = array();
    while ($row = $db->sql_fetchrow($result)) {
        $count++;
        $bcc_list_ary[$row['user_lang']][] = array('user_id' => $row['user_id'], 'mail' => $row['user_email'], 'username' => $row['username']);
    }
    if ($count > 0) {
        // read the message recipients
        $msg_to = '';
        if (!empty($recips)) {
            for ($i = 0; $i < count($recips); $i++) {
                $username = isset($recips[$i]['privmsg_to_username']) ? $recips[$i]['privmsg_to_username'] : $recips[$i]['username'];
                if (!empty($username)) {
                    $msg_to .= (empty($msg_to) ? '' : ', ') . $username;
                }
            }
        }
        //
        // Let's do some checking to make sure that mass mail functions
        // are working in win32 versions of php.
        //
        if (preg_match('/[c-z]:\\\\.*/i', getenv('PATH')) && !$board_config['smtp_delivery']) {
            $ini_val = @phpversion() >= '4.0.0' ? 'ini_get' : 'get_cfg_var';
            // We are running on windows, force delivery to use our smtp functions
            // since php's are broken by default
            $board_config['smtp_delivery'] = 1;
            $board_config['smtp_host'] = @$ini_val('SMTP');
        }
        // init the mailer
        $emailer = new emailer($board_config['smtp_delivery']);
        // init server vars
        $server_name = trim($board_config['server_name']);
        $server_protocol = $board_config['cookie_secure'] ? 'https://' : 'http://';
        $server_port = $board_config['server_port'] != 80 ? ':' . trim($board_config['server_port']) . '/' : '/';
        // sender script
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:101,代码来源:functions_messages.php


示例4: topic_list

function topic_list($box, $tpl = '', $topic_rowset, $list_title = '', $split_type = false, $display_nav_tree = true, $footer = '', $inbox = true, $select_field = '', $select_type = 0, $select_formname = '', $select_values = array())
{
    global $db, $template, $board_config, $userdata, $phpEx, $lang, $images, $HTTP_COOKIE_VARS;
    global $tree, $bbcode_parse;
    static $box_id;
    // save template state
    $sav_tpl = $template->_tpldata;
    // init
    if (empty($tpl)) {
        $tpl = 'topics_list_box';
    }
    if (empty($list_title)) {
        $list_title = $lang['Topics'];
    }
    if (!empty($select_values) && !is_array($select_values)) {
        $s_values = $select_values;
        $select_values = array();
        $select_values[] = $s_values;
    }
    // selections
    $select_multi = false;
    $select_unique = false;
    if (!empty($select_field) && $select_type > 0 && !empty($select_formname)) {
        switch ($select_type) {
            case 1:
                $select_multi = true;
                break;
            case 2:
                $select_unique = true;
                break;
        }
    }
    if ($split_type) {
        // set in separate table
        $split_box = $inbox && (isset($board_config['split_topic_split']) ? intval($board_config['split_topic_split']) : false);
        // get split params
        $switch_split_global_announce = isset($board_config['split_global_announce']) ? intval($board_config['split_global_announce']) : false;
        $switch_split_announce = isset($board_config['split_announce']) ? intval($board_config['split_announce']) : false;
        $switch_split_sticky = isset($board_config['split_sticky']) ? intval($board_config['split_sticky']) : false;
        if (!$switch_split_global_announce && !$switch_split_announce && !$switch_split_sticky) {
            $split_box = $split_type = false;
        }
    } else {
        $split_box = $switch_split_global_announce = $switch_split_announce = $switch_split_sticky = false;
    }
    // Define censored word matches
    $orig_word = array();
    $replacement_word = array();
    obtain_word_list($orig_word, $replacement_word);
    //-- mod : keep unread -----------------------------------------------------------------------------
    //-- delete
    //  // read the user cookie
    //  $tracking_topics    = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t"]) : array();
    //  $tracking_forums    = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f"]) : array();
    //  $tracking_all       = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) ) ? intval($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) : NULL;
    //-- add
    // get last visit for guest
    if (!$userdata['session_logged_in']) {
        $userdata['user_lastvisit'] = $board_config['guest_lastvisit'];
    }
    //-- fin mod : keep unread -------------------------------------------------------------------------
    // get a default title
    if (empty($list_title)) {
        $list_title = $lang['forum'];
    }
    // choose template
    $template->set_filenames(array($tpl => $tpl . '.tpl'));
    // check if user replied to the topics
    $user_topics = array();
    $topic_rowset_count = count($topic_rowset);
    if ($userdata['user_id'] != ANONYMOUS) {
        // get all the topic ids to display
        $topic_ids = array();
        for ($i = 0; $i < $topic_rowset_count; $i++) {
            $topic_item_type = substr($topic_rowset[$i]['topic_id'], 0, 1);
            $topic_id = intval(substr($topic_rowset[$i]['topic_id'], 1));
            if ($topic_item_type == POST_TOPIC_URL) {
                $topic_ids[] = $topic_id;
            }
        }
        // check if the user replied to
        if (!empty($topic_ids)) {
            // check the posts
            $s_topic_ids = implode(', ', $topic_ids);
            $sql = 'SELECT DISTINCT topic_id FROM ' . POSTS_TABLE . "\n                    WHERE topic_id IN ({$s_topic_ids})\n                        AND poster_id = " . $userdata['user_id'];
            if (!($result = $db->sql_query($sql))) {
                message_die(GENERAL_ERROR, 'Could not obtain post information', '', __LINE__, __FILE__, $sql);
            }
            while ($row = $db->sql_fetchrow($result)) {
                $user_topics[POST_TOPIC_URL . $row['topic_id']] = true;
            }
        }
    }
    // initiate
    $template->assign_block_vars($tpl, array('FORMNAME' => $select_formname, 'FIELDNAME' => $select_field));
    // spanning of the first column (list name)
    $span_left = 1;
    if ($topic_rowset_count > 0) {
        // add folder image
        $span_left++;
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:101,代码来源:functions_topics_list.php


示例5: privmsg_review

function privmsg_review($view_user_id, $privmsg_recip_id, $is_inline_review)
{
    global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;
    global $userdata, $user_ip;
    global $orig_word, $replacement_word;
    global $starttime;
    global $admin_level, $level_prior, $bbcode_parse;
    global $icones;
    include_once $phpbb_root_path . './includes/functions_messages.' . $phpEx;
    // fix parameters
    $privmsg_recip_id = intval($privmsg_recip_id);
    $view_user_id = intval($view_user_id);
    // check if exists and belongs to the user
    $sql = "SELECT privmsg_id\n                FROM " . PRIVMSGA_RECIPS_TABLE . "\n                WHERE privmsg_user_id = {$view_user_id}\n                    AND privmsg_recip_id = {$privmsg_recip_id}";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Could not obtain private message information', '', __LINE__, __FILE__, $sql);
    }
    if (!($row = $db->sql_fetchrow($result))) {
        message_die(GENERAL_MESSAGE, 'No_post_id');
    }
    $privmsg_id = intval($row['privmsg_id']);
    if (!$is_inline_review) {
        //
        // Start session management
        //
        $userdata = session_pagestart($user_ip, $forum_id);
        init_userprefs($userdata);
        //
        // End session management
        //
        $sql = "SELECT *\n                    FROM " . USERS_TABLE . "\n                    WHERE user_id = {$view_user_id}";
        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, 'Could not read user information', '', __LINE__, __FILE__, $sql);
        }
        if (!($view_userdata = $db->sql_fetchrow($result))) {
            message_die(GENERAL_MESSAGE, 'User_not_exist');
        }
        check_user($view_userdata);
    }
    //
    // Define censored word matches
    //
    if (empty($orig_word) && empty($replacement_word)) {
        $orig_word = array();
        $replacement_word = array();
        obtain_word_list($orig_word, $replacement_word);
    }
    //
    // Dump out the page header and load viewtopic body template
    //
    if (!$is_inline_review) {
        $gen_simple_header = true;
        $page_title = _lang('Topic_review');
        include $phpbb_root_path . 'includes/page_header.' . $phpEx;
    }
    $template->set_filenames(array('reviewbody' => 'posting_topic_review.tpl'));
    // Read the message id
    $sql = "SELECT p.*, pa.*, u.username AS privmsg_from_username\n                FROM " . PRIVMSGA_TABLE . " p, " . PRIVMSGA_RECIPS_TABLE . " pa, " . USERS_TABLE . " u\n                WHERE p.privmsg_id = {$privmsg_id}\n                    AND pa.privmsg_id = p.privmsg_id AND pa.privmsg_direct = 0\n                    AND ( (pa.privmsg_user_id <> 0 AND u.user_id = pa.privmsg_user_id) OR (pa.privmsg_user_id = 0 AND u.user_id = " . ANONYMOUS . ") )";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Could not obtain post/user information', '', __LINE__, __FILE__, $sql);
    }
    if ($row = $db->sql_fetchrow($result)) {
        $poster_id = $row['privmsg_user_id'];
        $poster = empty($poster_id) ? $board_config['sitename'] : $poster_id == ANONYMOUS ? _lang('Guest') : $row['privmsg_from_username'];
        $post_date = create_date($userdata['user_dateformat'], $row['privmsg_time'], $userdata['user_timezone']);
        $post_subject = empty($row['privmsg_subject']) ? '' : $row['privmsg_subject'];
        $message = $row['privmsg_text'];
        $bbcode_uid = $row['privmsg_bbcode_uid'];
        //
        // If the board has HTML off but the post has HTML
        // on then we process it, else leave it alone
        //
        if (!$board_config['allow_html'] && $row['privmsg_enable_html']) {
            $message = preg_replace('#(<)([\\/]?.*?)(>)#is', '&lt;\\2&gt;', $message);
        }
        if (!empty($bbcode_uid)) {
            $message = $board_config['allow_bbcode'] ? $bbcode_parse->bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\\:[0-9a-z\\:]+\\]/si', ']', $message);
        }
        $message = $bbcode_parse->make_clickable($message);
        if (count($orig_word)) {
            $post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
            $message = preg_replace($orig_word, $replacement_word, $message);
        }
        if ($board_config['allow_smilies'] && $row['enable_smilies']) {
            $message = $bbcode_parse->smilies_pass($message);
        }
        $message = str_replace("\n", '<br />', $message);
        $message = $bbcode_parse->acronym_pass($message);
        $message = $bbcode_parse->smart_pass($message);
        if (function_exists('get_icon_title')) {
            $post_subject = get_icon_title($row['post_icon']) . '&nbsp;' . $post_subject;
        }
        // just for the template : no signification here
        $mini_post_img = _images('icon_minipost');
        $mini_post_alt = _lang('Post');
        //
        // Again this will be handled by the templating
        // code at some point
        //
        $color = true;
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:101,代码来源:privmsga_review.php


示例6: topic_review

function topic_review($topic_id, $is_inline_review)
{
    global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;
    global $userdata, $user_ip;
    global $orig_word, $replacement_word;
    global $starttime;
    if (!$is_inline_review) {
        if (!isset($topic_id)) {
            message_die(GENERAL_MESSAGE, 'Topic_not_exist');
        }
        //
        // Get topic info ...
        //
        $sql = "SELECT t.topic_title, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments \n\t\t\tFROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f \n\t\t\tWHERE t.topic_id = {$topic_id}\n\t\t\t\tAND f.forum_id = t.forum_id";
        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
        }
        if (!($forum_row = $db->sql_fetchrow($result))) {
            message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
        }
        $db->sql_freeresult($result);
        $forum_id = $forum_row['forum_id'];
        $topic_title = $forum_row['topic_title'];
        //
        // Start session management
        //
        $userdata = session_pagestart($user_ip, $forum_id);
        init_userprefs($userdata);
        //
        // End session management
        //
        $is_auth = array();
        $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row);
        if (!$is_auth['auth_read']) {
            message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']));
        }
    }
    //
    // Define censored word matches
    //
    if (empty($orig_word) && empty($replacement_word)) {
        $orig_word = array();
        $replacement_word = array();
        obtain_word_list($orig_word, $replacement_word);
    }
    //
    // Dump out the page header and load viewtopic body template
    //
    if (!$is_inline_review) {
        $gen_simple_header = TRUE;
        $page_title = $lang['Topic_review'] . ' - ' . $topic_title;
        include $phpbb_root_path . 'includes/page_header.' . $phpEx;
        $template->set_filenames(array('reviewbody' => 'posting_topic_review.tpl'));
    }
    //
    // Go ahead and pull all data for this topic
    //
    $sql = "SELECT u.username, u.user_id, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid\n\t\tFROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt\n\t\tWHERE p.topic_id = {$topic_id}\n\t\t\tAND p.poster_id = u.user_id\n\t\t\tAND p.post_id = pt.post_id\n\t\tORDER BY p.post_time DESC\n\t\tLIMIT " . $board_config['posts_per_page'];
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Could not obtain post/user information', '', __LINE__, __FILE__, $sql);
    }
    //
    // Okay, let's do the loop, yeah come on baby let's do the loop
    // and it goes like this ...
    //
    if ($row = $db->sql_fetchrow($result)) {
        $mini_post_img = $images['icon_minipost'];
        $mini_post_alt = $lang['Post'];
        $i = 0;
        do {
            $poster_id = $row['user_id'];
            $poster = $row['username'];
            $post_date = create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone']);
            //
            // Handle anon users posting with usernames
            //
            if ($poster_id == ANONYMOUS && $row['post_username'] != '') {
                $poster = $row['post_username'];
                $poster_rank = $lang['Guest'];
            } elseif ($poster_id == ANONYMOUS) {
                $poster = $lang['Guest'];
                $poster_rank = '';
            }
            $post_subject = $row['post_subject'] != '' ? $row['post_subject'] : '';
            $message = $row['post_text'];
            $bbcode_uid = $row['bbcode_uid'];
            //
            // If the board has HTML off but the post has HTML
            // on then we process it, else leave it alone
            //
            if (!$board_config['allow_html'] && $row['enable_html']) {
                $message = preg_replace('#(<)([\\/]?.*?)(>)#is', '&lt;\\2&gt;', $message);
            }
            if ($bbcode_uid != "") {
                $message = $board_config['allow_bbcode'] ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\\:[0-9a-z\\:]+\\]/si', ']', $message);
            }
            $message = make_clickable($message);
            if (count($orig_word)) {
                $post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
                $message = preg_replace($orig_word, $replacement_word, $message);
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:101,代码来源:topic_review.php


示例7: censor

 function censor($passage)
 {
     $GLOBALS['wpUtdInt']->switch_db('TO_P');
     if ('PHPBB2' == $this->ver) {
         // define censored word matches
         $orig_word = array();
         $replacement_word = array();
         obtain_word_list($orig_word, $replacement_word);
         // censor text and title
         if (count($orig_word)) {
             $passage = preg_replace($orig_word, $replacement_word, $passage);
         }
     } else {
         $passage = censor_text($passage);
     }
     $GLOBALS['wpUtdInt']->switch_db('TO_W');
     return $passage;
 }
开发者ID:Oddsor,项目名称:lpt-forum,代码行数:18,代码来源:abstractify.php


示例8: make_cat_nav_tree

function make_cat_nav_tree($cur, $pgm = '', $nav_class = 'nav', $topic_title = '', $forum_id = 0)
{
    global $phpbb_root_path, $phpEx, $db;
    global $global_orig_word, $global_replacement_word;
    global $nav_separator;
    global $tree;
    // get topic or post level
    $type = substr($cur, 0, 1);
    $id = intval(substr($cur, 1));
    $fcur = '';
    switch ($type) {
        case POST_TOPIC_URL:
            if (empty($forum_id) || empty($topic_title)) {
                $sql = "SELECT forum_id, topic_title\n\t\t\t\t\t\t\tFROM " . TOPICS_TABLE . " WHERE topic_id = {$id}";
                if (!($result = $db->sql_query($sql))) {
                    message_die(GENERAL_ERROR, 'Could not query topics information', '', __LINE__, __FILE__, $sql);
                }
                if ($row = $db->sql_fetchrow($result)) {
                    $topic_title = $row['topic_title'];
                    $forum_id = $row['forum_id'];
                }
            } else {
                $row = array();
                $row['topic_title'] = $topic_title;
                $row['forum_id'] = $forum_id;
            }
            if (!empty($forum_id)) {
                $fcur = POST_FORUM_URL . $row['forum_id'];
                $topic_title = $row['topic_title'];
                $orig_word = array();
                $replacement_word = array();
                obtain_word_list($orig_word, $replacement_word);
                if (count($orig_word)) {
                    $topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
                }
            }
            break;
        case POST_POST_URL:
            if (empty($forum_id) || empty($topic_title)) {
                $sql = "SELECT t.forum_id, t.topic_title\n\t\t\t\t\t\t\tFROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t\n\t\t\t\t\t\t\tWHERE t.topic_id=p.topic_id AND post_id = {$id}";
                if (!($result = $db->sql_query($sql))) {
                    message_die(GENERAL_ERROR, 'Could not query posts information', '', __LINE__, __FILE__, $sql);
                }
                if (!($row = $db->sql_fetchrow($result))) {
                    $row['forum_id'] = 0;
                    $row['topic_title'] = '';
                }
            } else {
                $row['forum_id'] = $forum_id;
                $row['topic_title'] = $topic_title;
            }
            if (!empty($forum_id) && !empty($topic_title)) {
                $fcur = POST_FORUM_URL . $row['forum_id'];
                $topic_title = $row['topic_title'];
                $orig_word = array();
                $replacement_word = array();
                obtain_word_list($orig_word, $replacement_word);
                if (count($orig_word)) {
                    $topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
                }
            }
            break;
    }
    // keep the compliancy with prec versions
    if (!isset($tree['keys'][$cur])) {
        $cur = isset($tree['keys'][POST_CAT_URL . $cur]) ? POST_CAT_URL . $cur : $cur;
    }
    // find the object
    $this_key = isset($tree['keys'][$cur]) ? $tree['keys'][$cur] : -1;
    $res = '';
    while ($this_key >= 0 || $fcur != '') {
        $type = substr($fcur, 0, 1) != '' ? substr($cur, 0, 1) : $tree['type'][$this_key];
        switch ($type) {
            case POST_CAT_URL:
                $field_name = get_object_lang($cur, 'name');
                $param_type = POST_CAT_URL;
                $param_value = $tree['id'][$this_key];
                $pgm_name = "forum.{$phpEx}";
                break;
            case POST_FORUM_URL:
                $field_name = get_object_lang($cur, 'name');
                $param_type = POST_FORUM_URL;
                $param_value = $tree['id'][$this_key];
                $pgm_name = "viewforum.{$phpEx}";
                break;
            case POST_TOPIC_URL:
                $field_name = $topic_title;
                $param_type = POST_TOPIC_URL;
                $param_value = $id;
                $pgm_name = "viewtopic.{$phpEx}";
                break;
            case POST_POST_URL:
                $field_name = $topic_title;
                $param_type = POST_POST_URL;
                $param_value = $id . '#' . $id;
                $pgm_name = "viewtopic.{$phpEx}";
                break;
            default:
                $field_name = '';
                $param_type = '';
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:101,代码来源:functions_categories_hierarchy.php


示例9: user_notification

function user_notification($mode, &$post_data, &$forum_id, &$topic_id, &$post_id, &$notify_user)
{
    global $board_config, $lang, $db, $phpbb_root_path;
    global $userdata, $user_ip;
    $current_time = time();
    if ($mode == 'delete') {
        $delete_sql = !$post_data['first_post'] && !$post_data['last_post'] ? " AND user_id = " . $userdata['user_id'] : '';
        $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " WHERE topic_id = {$topic_id}" . $delete_sql;
        if (!$db->sql_query($sql)) {
            message_die(GENERAL_ERROR, 'Could not change topic notify data', '', __LINE__, __FILE__, $sql);
        }
    } else {
        if ($mode == 'reply') {
            $sql = "SELECT ban_userid \r\n\t\t\t\tFROM " . BANLIST_TABLE;
            if (!($result = $db->sql_query($sql))) {
                message_die(GENERAL_ERROR, 'Could not obtain banlist', '', __LINE__, __FILE__, $sql);
            }
            $user_id_sql = '';
            while ($row = $db->sql_fetchrow($result)) {
                if (isset($row['ban_userid'])) {
                    $user_id_sql = ', ' . $row['ban_userid'];
                }
            }
            $sql = "SELECT u.user_id, u.username, u.user_email, u.user_lang, t.topic_title \r\n\t\t\t\tFROM " . TOPICS_WATCH_TABLE . " tw, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u \r\n\t\t\t\tWHERE tw.topic_id = {$topic_id} \r\n\t\t\t\t\tAND tw.user_id NOT IN (" . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . " ) \r\n\t\t\t\t\tAND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . " \r\n\t\t\t\t\tAND t.topic_id = tw.topic_id \r\n\t\t\t\t\tAND u.user_id = tw.user_id";
            if (!($result = $db->sql_query($sql))) {
                message_die(GENERAL_ERROR, 'Could not obtain list of topic watchers', '', __LINE__, __FILE__, $sql);
            }
            $orig_word = array();
            $replacement_word = array();
            obtain_word_list($orig_word, $replacement_word);
            include $phpbb_root_path . 'includes/emailer.php';
            $emailer = new emailer($board_config['smtp_delivery']);
            $script_name = preg_replace('/^\\/?(.*?)\\/?$/', '\\1', trim($board_config['script_path']));
            $script_name = $script_name != '' ? $script_name . '/viewtopic.php' : 'viewtopic.php';
            $server_name = trim($board_config['server_name']);
            $server_protocol = $board_config['cookie_secure'] ? 'https://' : 'http://';
            $server_port = $board_config['server_port'] != 80 ? ':' . trim($board_config['server_port']) . '/' : '/';
            $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\n";
            $update_watched_sql = '';
            if ($row = $db->sql_fetchrow($result)) {
                @set_time_limit(120);
                $topic_title = preg_replace($orig_word, $replacement_word, unprepare_message($row['topic_title']));
                do {
                    if ($row['user_email'] != '') {
                        $emailer->use_template('topic_notify', $row['user_lang']);
                        $emailer->email_address($row['user_email']);
                        $emailer->set_subject();
                        $emailer->extra_headers($email_headers);
                        $emailer->assign_vars(array('EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']), 'USERNAME' => $row['username'], 'SITENAME' => $board_config['sitename'], 'TOPIC_TITLE' => $topic_title, 'U_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . "={$post_id}#{$post_id}", 'U_STOP_WATCHING_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_TOPIC_URL . "={$topic_id}&unwatch=topic"));
                        $emailer->send();
                        $emailer->reset();
                        $update_watched_sql .= $update_watched_sql != '' ? ', ' . $row['user_id'] : $row['user_id'];
                    }
                } while ($row = $db->sql_fetchrow($result));
            }
            if ($update_watched_sql != '') {
                $sql = "UPDATE " . TOPICS_WATCH_TABLE . "\r\n\t\t\t\t\tSET notify_status = " . TOPIC_WATCH_NOTIFIED . "\r\n\t\t\t\t\tWHERE topic_id = {$topic_id}\r\n\t\t\t\t\t\tAND user_id IN ({$update_watched_sql})";
                $db->sql_query($sql);
            }
        }
        $sql = "SELECT topic_id \r\n\t\t\tFROM " . TOPICS_WATCH_TABLE . "\r\n\t\t\tWHERE topic_id = {$topic_id}\r\n\t\t\t\tAND user_id = " . $userdata['user_id'];
        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, 'Could not obtain topic watch information', '', __LINE__, __FILE__, $sql);
        }
        $row = $db->sql_fetchrow($result);
        if (!$notify_user && !empty($row['topic_id'])) {
            $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "\r\n\t\t\t\tWHERE topic_id = {$topic_id}\r\n\t\t\t\t\tAND user_id = " . $userdata['user_id'];
            if (!$db->sql_query($sql)) {
                message_die(GENERAL_ERROR, 'Could not delete topic watch information', '', __LINE__, __FILE__, $sql);
            }
        } else {
            if ($notify_user && empty($row['topic_id'])) {
                $sql = "INSERT INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status)\r\n\t\t\t\tVALUES (" . $userdata['user_id'] . ", {$topic_id}, 0)";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not insert topic watch information', '', __LINE__, __FILE__, $sql);
                }
            }
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:80,代码来源:functions_post.php


示例10: censor_text

function censor_text($text)
{
    global $_CLASS;
    if ($_CLASS['core_user']->is_user && !$_CLASS['core_user']->optionget('viewcensors')) {
        return $text;
    }
    $censors = obtain_word_list();
    if (!empty($censors)) {
        return preg_replace($censors['match'], $censors['replace'], $text);
    }
    return $text;
}
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:12,代码来源:functions.php


示例11: censor_text

/**
* Censoring
*/
function censor_text($str)
{
    static $censors;
    if (!isset($censors) || !is_array($censors)) {
        $censors = array();
        obtain_word_list($censors['match'], $censors['replace']);
    }
    return count($censors['match']) ? preg_replace($censors['match'], $censors['replace'], $str) : $str;
}
开发者ID:Nekrofage,项目名称:FJR,代码行数:12,代码来源:class_common.php


示例12: phpbb_fetch_thread

function phpbb_fetch_thread($topic_id = null)
{
    global $CFG, $userdata;
    if (!$topic_id) {
        phpbb_raise_error('no topic id specified', __FILE__, __LINE__);
    }
    $sql = 'SELECT p.*, pt.*, u.*';
    if (!$CFG['posts_hide_ranks']) {
        $sql .= ', r.*';
    }
    $sql .= '
				FROM ' . USERS_TABLE . ' AS u,
					 ' . POSTS_TEXT_TABLE . ' AS pt,
					 ' . POSTS_TABLE . ' AS p';
    if (!$CFG['posts_hide_ranks']) {
        $sql .= ',
					 ' . RANKS_TABLE . ' AS r';
    }
    $sql .= '
				WHERE p.topic_id = ' . $topic_id . '
					AND u.user_id  = p.poster_id
					AND pt.post_id = p.post_id
					AND u.user_id  = p.poster_id';
    if (!$CFG['posts_hide_ranks']) {
        $sql .= '
					AND r.rank_id = u.user_rank';
    }
    if ($CFG['posts_search_string']) {
        $sql .= '
					AND (' . $CFG['posts_search_string'] . ')';
    }
    $sql .= '
				ORDER BY ' . $CFG['posts_order'];
    if ($CFG['posts_span_pages']) {
        $CFG['posts_span_pages_numrows'] = phpbb_numrows(phpbb_query($sql));
        if ($CFG['posts_span_pages_offset'] > $CFG['posts_span_pages_numrows']) {
            $CFG['posts_span_pages_offset'] = $CFG['posts_span_pages_numrows'] - 1;
        }
        $CFG['posts_offset'] = $CFG['posts_span_pages_offset'];
    } else {
        $CFG['posts_offset'] = 0;
    }
    if ($CFG['posts_limit'] != 0) {
        $sql .= ' LIMIT ' . $CFG['posts_offset'] . ',' . $CFG['posts_limit'];
    }
    $result = phpbb_fetch_rows($sql);
    if ($result) {
        if ($CFG['auth_check']) {
            phpbb_get_auth_list();
            $authed = array();
            for ($i = 0; $i < count($result); $i++) {
                if (in_array($result[$i]['forum_id'], $CFG['auth_list'])) {
                    $authed[] = $result[$i];
                }
            }
            $result = $authed;
        }
        $orig_word = array();
        $replacement_word = array();
        obtain_word_list($orig_word, $replacement_word);
        for ($i = 0; $i < count($result); $i++) {
            $result[$i]['post_time'] = $result[$i]['post_time'] + $CFG['time_zone'];
            $result[$i]['topic_time'] = $result[$i]['topic_time'] + $CFG['time_zone'];
            $result[$i]['post_edit_time'] = $result[$i]['post_edit_time'] + $CFG['time_zone'];
            $result[$i]['date'] = date($CFG['date_format'], $result[$i]['post_time']);
            $result[$i]['time'] = date($CFG['time_format'], $result[$i]['post_time']);
            $result[$i]['edit_date'] = date($CFG['date_format'], $result[$i]['post_edit_time']);
            $result[$i]['edit_time'] = date($CFG['time_format'], $result[$i]['post_edit_time']);
            $result[$i]['post_text'] = phpbb_parse_text($result[$i]['post_text'], $result[$i]['bbcode_uid'], $result[$i]['enable_smilies'], $CFG['posts_enable_bbcode'], $CFG['posts_enable_html'], $CFG['posts_hide_images'], $CFG['posts_replace_images']);
            if (count($orig_word)) {
                $result[$i]['topic_title'] = preg_replace($orig_word, $replacement_word, $result[$i]['topic_title']);
                $result[$i]['post_text'] = preg_replace($orig_word, $replacement_word, $result[$i]['post_text']);
            }
            $result[$i]['trimmed'] = false;
            phpbb_trim_text($result[$i]['post_text'], $result[$i]['trimmed'], $CFG['posts_trim_text_character'], $CFG['posts_trim_text_number'], $CFG['posts_trim_text_words']);
            $result[$i]['topic_trimmed'] = false;
            phpbb_trim_text($result[$i]['topic_title'], $result[$i]['topic_trimmed'], '', $CFG['posts_trim_topic_number'], '');
        }
        if (is_array($topic_id)) {
            $sorted = array();
            for ($i = 0; $i < count($topic_id); $i++) {
                for ($j = 0; $j < count($result); $j++) {
                    if ($topic_id[$i] == $result[$j]['topic_id']) {
                        $sorted[] = $result[$j];
                    }
                }
            }
            $result = $sorted;
        }
    }
    return $result;
}
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:92,代码来源:posts.php


示例13: privmsg_list

function privmsg_list($privmsg_rowset, $recips, $folder_id, $select = false, $mark_ids = array(), $detailed = false)
{
    global $template, $userdata;
    global $lang, $images, $board_config, $phpEx, $phpbb_root_path;
    global $folders;
    global $main_pgm, $from_to_separator;
    global $all_marked, $marked_on_this_page;
    global $msg_days;
    global $nav_separator;
    global $icones;
    // is the post icon mod installed ?
    $mod_post_icon = function_exists('get_icon_title');
    // censor word
    $orig_word = array();
    $replacement_word = array();
    obtain_word_list($orig_word, $replacement_word);
    // get main folder
    $folder_main = $folder_id;
    if (!empty($folders['main'][$folder_id])) {
        $folder_main = $folders['main'][$folder_id];
    }
    // author/recip
    $from_to = '';
    switch ($folder_main) {
        case INBOX:
            $from_to = _lang('From');
            break;
        case OUTBOX:
            $from_to = _lang('To');
            break;
        case SENTBOX:
            $from_to = _lang('To');
            break;
        case SAVEBOX:
            $from_to = _lang('From') . $from_to_separator . _lang('To');
            break;
    }
    // get save sub-folder list
    $s_move_folder = '';
    if ($folder_main != SAVEBOX) {
        $s_move_folder = get_folders_list($folder_id);
    }
    $s_move_folder .= get_folders_list(SAVEBOX);
    // template name
    $template->set_filenames(array('privmsga_box' => 'privmsga_box.tpl'));
    $span = 4;
    if ($mod_post_icon) {
        $span++;
    }
    if ($select) {
        $span++;
    }
    // Header
    $template->assign_vars(array('L_DISPLAY_MESSAGES' => _lang('Display_messages'), 'S_SELECT_MSG_DAYS' => get_days_list($msg_days), 'L_GO' => _lang('Go'), 'L_CANCEL' => _lang('Cancel'), 'L_FLAG' => _lang('Flag'), 'L_SUBJECT' => $select 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP obten_filas函数代码示例发布时间:2022-05-15
下一篇:
PHP obtain_users_online_string函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap