当前位置: 首页>>代码示例>>PHP>>正文


PHP parsesmileys函数代码示例

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


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

示例1: showcomments_avatar


//.........这里部分代码省略.........
        if (!isset($_GET['c_start']) && $c_rows > 10) {
            $_GET['c_start'] = (ceil($c_rows / 10) - 1) * 10;
        }
        if (!isset($_GET['c_start']) || !isnum($_GET['c_start'])) {
            $_GET['c_start'] = 0;
        }
        $result = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_datestamp, tcm.comment_message,\r\n\t\t\ttcu.user_name, tcu.user_avatar, tcu.user_id, tcu.user_level, tcu.user_status\r\n\t\t\tFROM " . DB_COMMENTS . " tcm\r\n\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\r\n\t\t\tWHERE comment_item_id=" . _db($cid) . " AND comment_type=" . _db($ctype) . " AND comment_hidden='0'\r\n\t\t\tORDER BY comment_datestamp ASC LIMIT " . (int) $_GET['c_start'] . ",10");
        if (dbrows($result)) {
            $i = $_GET['c_start'] + 1;
            if ($c_rows > 10) {
                echo "<div style='text-align:center;margin-bottom:5px;'>" . makecommentnav($_GET['c_start'], 10, $c_rows, 3, $clink . "&amp;", $seo_root_link, $a, $seo_catid, $b, $rowstart, "-cstart-", $c, $seo_subject) . "</div>\n";
            }
            echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
            while ($data = dbarray($result)) {
                echo "<tr><td class='tbl2' width='10%' align='center'>\n";
                if ($data['user_name']) {
                    echo "<span class='comment-name'>" . profile_link($data['comment_name'], $data['user_name'], $data['user_status']) . "</span>\n";
                } else {
                    echo "<span class='comment-name'>" . $data['comment_name'] . "</span>\n";
                }
                echo "</td>\n";
                echo "<td class='tbl2'>\n<span class='small'>" . $locale['global_071'] . showdate("longdate", $data['comment_datestamp']) . "</span>\n";
                echo "<div style='float:right' class='comment_actions'>";
                if ((iMODERATOR || iADMIN) && checkrights("C") || iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name'])) {
                    echo "<!--comment_actions-->\n<a href='" . FUSION_SELF . "?" . FUSION_QUERY . "&amp;c_action=edit&amp;comment_id=" . $data['comment_id'] . "#edit_comment'>" . $locale['c108'] . "</a> |\n";
                    echo "<a href='" . FUSION_SELF . "?" . FUSION_QUERY . "&amp;c_action=delete&amp;comment_id=" . $data['comment_id'] . "'>" . $locale['c109'] . "</a> |\n";
                }
                echo "<a href='" . FUSION_REQUEST . "#c" . $data['comment_id'] . "' id='c" . $data['comment_id'] . "' name='c" . $data['comment_id'] . "'>#" . $i . "</a></div>\n";
                echo "</td>\n";
                echo "</tr>\n<tr>\n";
                $avatar = $data['user_avatar'] != "" && file_exists(IMAGES_AVA . $data['user_avatar']) ? IMAGES_AVA . $data['user_avatar'] : IMAGES_AVA . "noavatar.jpg";
                echo "<td class='tbl1' width='15%'>\n";
                echo "<div style='text-align:center;'><img src='" . $avatar . "' width='50' height='50' alt='' /></div><br />\n";
                if ($settings['warning_system_comments'] && $data['user_name']) {
                    $points = show_warning_points($data['user_id']);
                    echo "<div class='commentswarnings'>";
                    echo "<span class='small'><a style='cursor:help;' onclick=\"warning_info();\">" . $locale['WARN200'] . "</a></span> ";
                    echo warning_profile_link("1", $data['user_id'], $points);
                    echo "</div>";
                }
                echo "<span class='small2'>" . $locale['c110'] . number_format(dbcount("(comment_id)", DB_COMMENTS, "comment_name='" . (int) $data['user_id'] . "'")) . "<br />";
                echo $locale['c111'] . getuserlevel($data['user_level']) . "</span><br />";
                echo "</td>\n";
                echo "<td class='tbl2' valign='top'>\n" . nl2br(parseubb(parsesmileys($data['comment_message']))) . "</td>\n</tr>";
                $i++;
            }
            echo "\n</table>\n";
            if ((iMODERATOR || iADMIN) && checkrights("C")) {
                echo "<div align='right' class='tbl2'><a href='" . ADMIN . "comments.php" . $aidlink . "&amp;ctype={$ctype}&amp;cid={$cid}'>" . $locale['c106'] . "</a></div>\n";
            }
            if ($c_rows > 10) {
                echo "<br /><div style='text-align:center;margin-top:5px;'>" . makecommentnav($_GET['c_start'], 10, $c_rows, 3, $clink . "&amp;", $seo_root_link, $a, $seo_catid, $b, $rowstart, "-cstart-", $c, $seo_subject) . "</div>\n";
            }
        } else {
            echo $locale['c101'] . "\n";
        }
        closetable();
        opentable($locale['c102']);
        if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
            $eresult = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcu.user_name FROM " . DB_COMMENTS . " tcm\r\n\t\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\r\n\t\t\t\tWHERE comment_id='" . (int) $_GET['comment_id'] . "' AND comment_item_id=" . _db($cid) . " AND comment_type=" . _db($ctype) . " AND comment_hidden='0'");
            if (dbrows($eresult)) {
                $edata = dbarray($eresult);
                if ((iMODERATOR || iADMIN) && checkrights("C") || iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name'])) {
                    $clink .= "&amp;c_action=edit&amp;comment_id=" . $edata['comment_id'];
                    $comment_message = $edata['comment_message'];
                }
            } else {
                $comment_message = "";
            }
        } else {
            $comment_message = "";
        }
        if (iMEMBER || $settings['guestposts'] == "1") {
            require_once INCLUDES . "bbcode_include.php";
            echo "<a id='edit_comment' name='edit_comment'></a>\n";
            echo "<form name='inputform' method='post' action='" . (URL_REWRITE && $seo_root_link != "" ? $seo_link : $clink) . "'>\n";
            // Pimped
            if (iGUEST) {
                echo "<div align='center' class='tbl'>\n" . $locale['c104'] . "<br />\n";
                echo "<input type='text' name='comment_name' maxlength='30' class='textbox' style='width:360px' />\n";
                echo "</div>\n";
            }
            echo "<div align='center' class='tbl'>\n";
            echo "<textarea name='comment_message' cols='70' rows='6' class='textbox' style='width:360px'>" . $comment_message . "</textarea><br />\n";
            echo display_bbcodes("360px", "comment_message");
            if (iGUEST) {
                echo $locale['global_158'] . "<br />\n";
                echo "<img id='com_captcha' src='" . INCLUDES . "securimage/securimage_show.php' alt='' /><br />\n";
                echo "<a href='" . INCLUDES . "securimage/securimage_play.php'><img src='" . INCLUDES . "securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
                echo "<a href='#' onclick=\"document.getElementById('com_captcha').src = '" . INCLUDES . "securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='" . INCLUDES . "securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
                echo $locale['global_159'] . "<br />\n<input type='text' name='com_captcha_code' class='textbox' style='width:100px' />\n";
            }
            echo "<br />\n<input type='submit' name='post_comment' value='" . ($comment_message ? $locale['c103'] : $locale['c102']) . "' class='button' />\n";
            echo "</div>\n</form>\n";
        } else {
            echo $locale['c105'] . "\n";
        }
        closetable();
    }
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:101,代码来源:comments_include.php

示例2: dbquery

     if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
         $_GET['rowstart'] = 0;
     }
     $result = dbquery("SELECT fp.post_message, fp.post_datestamp, fp.post_edittime, fp.post_author, fp.post_edituser,\n                fu.user_name AS user_name, fu.user_status AS user_status, fe.user_name AS edit_name, fe.user_status AS edit_status,\n                ft.thread_subject, ff.forum_access\n                FROM " . DB_FORUM_THREADS . " ft\n                INNER JOIN " . DB_FORUM_POSTS . " fp ON ft.thread_id = fp.thread_id\n                INNER JOIN " . DB_FORUMS . " ff ON ff.forum_id = ft.forum_id\n                INNER JOIN " . DB_USERS . " fu ON fu.user_id = fp.post_author\n                LEFT JOIN " . DB_USERS . " fe ON fe.user_id = fp.post_edituser\n                WHERE ft.thread_id=" . $_GET['item_id'] . "\n                ORDER BY fp.post_datestamp\n                LIMIT " . $_GET['rowstart'] . ",{$posts_per_page}");
     $res = FALSE;
     $i = 0;
     if (dbrows($result)) {
         while ($data = dbarray($result)) {
             if (checkgroup($data['forum_access'])) {
                 $res = TRUE;
                 if ($i == 0) {
                     echo $locale['500'] . " <strong>" . $settings['sitename'] . " :: " . $data['thread_subject'] . "</strong><hr /><br />\n";
                 }
                 echo "<div style='margin-left:20px'>\n";
                 echo "<div style='float:left'>" . $locale['501'] . profile_link($data['post_author'], $data['user_name'], $data['user_status']) . $locale['502'] . showdate("forumdate", $data['post_datestamp']) . "</div><div style='float:right'>#" . ($i + 1) . "</div><div style='float:none;clear:both'></div><hr />\n";
                 echo nl2br(parseubb(parsesmileys($data['post_message'])));
                 if ($data['edit_name'] != '') {
                     echo "<div style='margin-left:20px'>\n<hr />\n";
                     echo $locale['503'] . profile_link($data['post_edituser'], $data['edit_name'], $data['edit_status']) . $locale['502'] . showdate("forumdate", $data['post_edittime']);
                     echo "</div>\n";
                 }
                 echo "</div>\n";
                 echo "<br />\n";
                 $i++;
             }
         }
     }
     if (!$res) {
         redirect($settings['opening_page']);
     }
 }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:print.php

示例3: nl2br

     echo "<div style='float:right'><input type='checkbox' name='delete_post[]' value='" . $data['post_id'] . "' /></div>\n";
 }
 echo nl2br(parseubb($message));
 echo "<!--sub_forum_post_message-->";
 if ($data['attach_id']) {
     if (in_array($data['attach_ext'], $imagetypes) && @getimagesize(FORUM . "attachments/" . $data['attach_name'])) {
         echo "\n<hr />\n" . $data['user_name'] . $locale['506'] . "<br /><br />\n" . display_image($data['attach_name']) . "<br />[" . parsebytesize(filesize(FORUM . "attachments/" . $data['attach_name'])) . "]\n";
     } else {
         echo "\n<hr />\n" . $data['user_name'] . $locale['507'] . "<br />\n<a href='" . FUSION_SELF . "?thread_id=" . $_GET['thread_id'] . "&amp;getfile=" . $data['post_id'] . "'>" . $data['attach_name'] . "</a>";
     }
 }
 if ($data['post_edittime'] != "0") {
     echo "\n<hr />\n" . $locale['508'] . "<a href='../profile.php?lookup=" . $data['post_edituser'] . "'>" . $data['edit_name'] . "</a>" . $locale['509'] . showdate("forumdate", $data['post_edittime']);
 }
 if ($data['post_showsig'] && array_key_exists("user_sig", $data) && $data['user_sig']) {
     echo "\n<hr />" . nl2br(parseubb(parsesmileys($data['user_sig']), "b|i|u||center|small|url|mail|img|color"));
 }
 echo "<!--sub_forum_post--></td>\n</tr>\n";
 echo "<tr>\n<td class='tbl2' style='width:140px;white-space:nowrap'>";
 if ($settings['forum_ips'] && iMEMBER || iMOD) {
     echo "<strong>" . $locale['571'] . "</strong>: " . $data['post_ip'];
 } else {
     echo "&nbsp;";
 }
 echo "</td>\n<td class='tbl2 forum_thread_userbar'>\n<div style='float:left;white-space:nowrap' class='small'><!--forum_thread_userbar-->\n";
 if (array_key_exists("user_web", $data) && $data['user_web']) {
     if (!strstr($data['user_web'], "http://")) {
         $urlprefix = "http://";
     } else {
         $urlprefix = "";
     }
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:viewthread.php

示例4: render_reply_form

 public function render_reply_form()
 {
     global $locale, $userdata, $forum_settings, $defender;
     $thread_data = $this->thread_info['thread'];
     if ((!iMOD or !iSUPERADMIN) && $thread_data['thread_locked']) {
         redirect(INFUSIONS . 'forum/index.php');
     }
     if ($this->getThreadPermission("can_reply")) {
         add_to_title($locale['global_201'] . $locale['forum_0503']);
         add_breadcrumb(array('link' => '', 'title' => $locale['forum_0503']));
         // field data
         $post_data = array('post_id' => 0, 'forum_id' => $this->thread_info['thread']['forum_id'], 'thread_id' => $this->thread_info['thread']['thread_id'], 'post_message' => isset($_POST['post_message']) ? form_sanitizer($_POST['post_message'], '', 'post_message') : '', 'post_showsig' => isset($_POST['post_showsig']) ? 1 : 0, 'post_smileys' => isset($_POST['post_smileys']) || isset($_POST['post_message']) && preg_match("#(\\[code\\](.*?)\\[/code\\]|\\[geshi=(.*?)\\](.*?)\\[/geshi\\]|\\[php\\](.*?)\\[/php\\])#si", $_POST['post_message']) ? 1 : 0, 'post_author' => $userdata['user_id'], 'post_datestamp' => time(), 'post_ip' => USER_IP, 'post_ip_type' => USER_IP_TYPE, 'post_edituser' => 0, 'post_edittime' => 0, 'post_editreason' => '', 'post_hidden' => 0, 'notify_me' => 0, 'post_locked' => $forum_settings['forum_edit_lock'] || isset($_POST['post_locked']) ? 1 : 0);
         // execute form post actions
         if (isset($_POST['post_reply'])) {
             require_once INCLUDES . "flood_include.php";
             // all data is sanitized here.
             if (!flood_control("post_datestamp", DB_FORUM_POSTS, "post_author='" . $userdata['user_id'] . "'")) {
                 // have notice
                 $update_forum_lastpost = FALSE;
                 if ($defender->safe()) {
                     // Prepare forum merging action
                     $last_post_author = dbarray(dbquery("SELECT post_author FROM " . DB_FORUM_POSTS . " WHERE thread_id='" . $thread_data['thread_id'] . "' ORDER BY post_id DESC LIMIT 1"));
                     if ($last_post_author['post_author'] == $post_data['post_author'] && $thread_data['forum_merge']) {
                         $last_message = dbarray(dbquery("SELECT post_id, post_message FROM " . DB_FORUM_POSTS . " WHERE thread_id='" . $thread_data['thread_id'] . "' ORDER BY post_id DESC"));
                         $post_data['post_id'] = $last_message['post_id'];
                         $post_data['post_message'] = $last_message['post_message'] . "\n\n" . $locale['forum_0640'] . " " . showdate("longdate", time()) . ":\n" . $post_data['post_message'];
                         dbquery_insert(DB_FORUM_POSTS, $post_data, 'update', array('primary_key' => 'post_id', 'keep_session' => TRUE));
                     } else {
                         $update_forum_lastpost = TRUE;
                         dbquery_insert(DB_FORUM_POSTS, $post_data, 'save', array('primary_key' => 'post_id', 'keep_session' => TRUE));
                         $post_data['post_id'] = dblastid();
                         if (!defined("FUSION_NULL")) {
                             dbquery("UPDATE " . DB_USERS . " SET user_posts=user_posts+1 WHERE user_id='" . $post_data['post_author'] . "'");
                         }
                     }
                     // Attach files if permitted
                     if (!empty($_FILES) && is_uploaded_file($_FILES['file_attachments']['tmp_name'][0]) && $this->getThreadPermission("can_upload_attach")) {
                         $upload = form_sanitizer($_FILES['file_attachments'], '', 'file_attachments');
                         if ($upload['error'] == 0) {
                             foreach ($upload['target_file'] as $arr => $file_name) {
                                 $adata = array('thread_id' => $thread_data['thread_id'], 'post_id' => $post_data['post_id'], 'attach_name' => $file_name, 'attach_mime' => $upload['type'][$arr], 'attach_size' => $upload['source_size'][$arr], 'attach_count' => 0);
                                 dbquery_insert(DB_FORUM_ATTACHMENTS, $adata, "save", array('keep_session' => TRUE));
                             }
                         }
                     }
                     // Update stats in forum and threads
                     if ($update_forum_lastpost == TRUE) {
                         // find all parents and update them
                         $list_of_forums = get_all_parent(dbquery_tree(DB_FORUMS, 'forum_id', 'forum_cat'), $thread_data['forum_id']);
                         foreach ($list_of_forums as $fid) {
                             dbquery("UPDATE " . DB_FORUMS . " SET forum_lastpost='" . time() . "', forum_postcount=forum_postcount+1, forum_lastpostid='" . $post_data['post_id'] . "', forum_lastuser='" . $post_data['post_author'] . "' WHERE forum_id='" . $fid . "'");
                         }
                         // update current forum
                         dbquery("UPDATE " . DB_FORUMS . " SET forum_lastpost='" . time() . "', forum_postcount=forum_postcount+1, forum_lastpostid='" . $post_data['post_id'] . "', forum_lastuser='" . $post_data['post_author'] . "' WHERE forum_id='" . $thread_data['forum_id'] . "'");
                         // update current thread
                         dbquery("UPDATE " . DB_FORUM_THREADS . " SET thread_lastpost='" . time() . "', thread_lastpostid='" . $post_data['post_id'] . "', thread_postcount=thread_postcount+1, thread_lastuser='" . $post_data['post_author'] . "' WHERE thread_id='" . $thread_data['thread_id'] . "'");
                     }
                     if ($forum_settings['thread_notify'] && isset($_POST['notify_me'])) {
                         if (!dbcount("(thread_id)", DB_FORUM_THREAD_NOTIFY, "thread_id='" . $thread_data['thread_id'] . "' AND notify_user='" . $post_data['post_author'] . "'")) {
                             dbquery("INSERT INTO " . DB_FORUM_THREAD_NOTIFY . " (thread_id, notify_datestamp, notify_user, notify_status) VALUES('" . $thread_data['thread_id'] . "', '" . time() . "', '" . $post_data['post_author'] . "', '1')");
                         }
                     }
                     if ($defender->safe()) {
                         redirect(INFUSIONS . "forum/postify.php?post=reply&error=0&amp;forum_id=" . intval($post_data['forum_id']) . "&amp;thread_id=" . intval($post_data['thread_id']) . "&amp;post_id=" . intval($post_data['post_id']));
                     }
                 }
             }
         }
         // template data
         $form_action = INFUSIONS . "forum/viewthread.php?action=reply&amp;forum_id=" . $thread_data['forum_id'] . "&amp;thread_id=" . $thread_data['thread_id'];
         // Quote Get
         if (isset($_GET['quote']) && isnum($_GET['quote'])) {
             $quote_result = dbquery("SELECT a.post_message, b.user_name\n\t\t\t\t\t\t\t\t\t\tFROM " . DB_FORUM_POSTS . " a\n\t\t\t\t\t\t\t\t\t\tINNER JOIN " . DB_USERS . " b ON a.post_author=b.user_id\n\t\t\t\t\t\t\t\t\t\tWHERE thread_id='" . $thread_data['thread_id'] . "' and post_id='" . $_GET['quote'] . "'");
             if (dbrows($quote_result) > 0) {
                 $quote_data = dbarray($quote_result);
                 // do not do this. to silently inject.
                 $post_data['post_message'] = "[quote name=" . $quote_data['user_name'] . " post=" . $_GET['quote'] . "]@" . $quote_data['user_name'] . " - " . strip_bbcodes($quote_data['post_message']) . "[/quote]" . $post_data['post_message'];
                 $form_action .= "&amp;post_id=" . $_GET['post_id'] . "&amp;quote=" . $_GET['quote'];
             } else {
                 redirect(INFUSIONS . "forum/index.php");
             }
         }
         $info = array('title' => $locale['forum_0503'], 'description' => $locale['forum_2000'] . $thread_data['thread_subject'], 'openform' => openform('input_form', 'post', $form_action, array('enctype' => $this->getThreadPermission("can_upload_attach") ? TRUE : FALSE, 'max_tokens' => 1)), 'closeform' => closeform(), 'forum_id_field' => form_hidden('forum_id', "", $post_data['forum_id']), 'thread_id_field' => form_hidden('thread_id', "", $post_data['thread_id']), "forum_field" => "", 'subject_field' => form_hidden('thread_subject', "", $thread_data['thread_subject']), 'message_field' => form_textarea('post_message', $locale['forum_0601'], $post_data['post_message'], array('required' => TRUE, 'error_text' => '', 'autosize' => TRUE, 'no_resize' => TRUE, 'preview' => TRUE, 'form_name' => 'input_form', 'bbcode' => TRUE)), 'delete_field' => '', 'edit_reason_field' => '', 'attachment_field' => $this->getThreadPermission("can_upload_attach") ? form_fileinput('file_attachments[]', $locale['forum_0557'], "", array('input_id' => 'file_attachments', 'upload_path' => INFUSIONS . 'forum/attachments/', 'type' => 'object', 'preview_off' => TRUE, "multiple" => TRUE, "inline" => false, 'max_count' => $forum_settings['forum_attachmax_count'], 'valid_ext' => $forum_settings['forum_attachtypes'], "class" => "m-b-0")) . "\n\t\t\t\t\t\t\t\t <div class='m-b-20'>\n<small>" . sprintf($locale['forum_0559'], parsebytesize($forum_settings['forum_attachmax']), str_replace('|', ', ', $forum_settings['forum_attachtypes']), $forum_settings['forum_attachmax_count']) . "</small>\n</div>\n" : "", "poll_form" => "", 'smileys_field' => form_checkbox('post_smileys', $locale['forum_0622'], $post_data['post_smileys'], array('class' => 'm-b-0')), 'signature_field' => array_key_exists("user_sig", $userdata) && $userdata['user_sig'] ? form_checkbox('post_showsig', $locale['forum_0623'], $post_data['post_showsig'], array('class' => 'm-b-0')) : '', 'sticky_field' => '', 'lock_field' => '', 'hide_edit_field' => '', 'post_locked_field' => '', 'notify_field' => $forum_settings['thread_notify'] ? form_checkbox('notify_me', $locale['forum_0626'], $post_data['notify_me'], array('class' => 'm-b-0')) : '', 'post_buttons' => form_button('post_reply', $locale['forum_0504'], $locale['forum_0504'], array('class' => 'btn-primary')) . form_button('cancel', $locale['cancel'], $locale['cancel'], array('class' => 'btn-default m-l-10')), 'last_posts_reply' => '');
         // only in reply
         if ($forum_settings['forum_last_posts_reply']) {
             $result = dbquery("\n\t\t\t\tSELECT\n\t\t\t\tp.thread_id, p.post_message, p.post_smileys, p.post_author, p.post_datestamp, p.post_hidden,\n\t\t\t\t\t\t\tu.user_id, u.user_name, u.user_status, u.user_avatar\n\t\t\t\t\t\t\tFROM " . DB_FORUM_POSTS . " p\n\t\t\t\t\t\t\tLEFT JOIN " . DB_USERS . " u ON p.post_author = u.user_id\n\t\t\t\t\t\t\tWHERE p.thread_id='" . $thread_data['thread_id'] . "' AND p.post_hidden='0'\n\t\t\t\t\t\t\tGROUP BY p.post_id\n\t\t\t\t\t\t\tORDER BY p.post_datestamp DESC LIMIT 0," . $forum_settings['posts_per_page']);
             if (dbrows($result)) {
                 $title = sprintf($locale['forum_0526'], $forum_settings['forum_last_posts_reply']);
                 if ($forum_settings['forum_last_posts_reply'] == "1") {
                     $title = $locale['forum_0525'];
                 }
                 ob_start();
                 echo "<p><strong>" . $title . "</strong>\n</p>\n";
                 echo "<table class='table table-responsive'>\n";
                 $i = $forum_settings['posts_per_page'];
                 while ($data = dbarray($result)) {
                     $message = $data['post_message'];
                     if ($data['post_smileys']) {
                         $message = parsesmileys($message);
                     }
//.........这里部分代码省略.........
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:101,代码来源:Viewthread.php

示例5: dbquery

// xss injection
$result = dbquery("SELECT tn.thread_id FROM " . DB_FORUM_THREAD_NOTIFY . " tn\n            INNER JOIN " . DB_FORUM_THREADS . " tt ON tn.thread_id = tt.thread_id\n            INNER JOIN " . DB_FORUMS . " tf ON tt.forum_id = tf.forum_id\n            WHERE tn.notify_user=" . $userdata['user_id'] . " AND " . groupaccess('forum_access') . " AND tt.thread_hidden='0'");
$rows = dbrows($result);
if (!isset($_GET['rowstart']) or !isnum($_GET['rowstart']) or $_GET['rowstart'] > $rows) {
    $_GET['rowstart'] = 0;
}
$info['post_rows'] = $rows;
if ($rows) {
    require_once INCLUDES . "mimetypes_include.php";
    $info['page_nav'] = $rows > 10 ? makepagenav($_GET['rowstart'], 16, $rows, 3, FUSION_REQUEST, "rowstart") : "";
    $result = dbquery("\n                SELECT tf.forum_id, tf.forum_name, tf.forum_access, tf.forum_type, tf.forum_mods,\n                tn.thread_id, tn.notify_datestamp, tn.notify_user,\n                ttc.forum_id AS forum_cat_id, ttc.forum_name AS forum_cat_name,\n                tp.post_datestamp, tp.post_message,\n                tt.thread_subject, tt.forum_id, tt.thread_lastpost, tt.thread_lastpostid, tt.thread_lastuser, tt.thread_postcount, tt.thread_views, tt.thread_locked,\n                tt.thread_author, tt.thread_poll, tt.thread_sticky,\n                uc.user_id AS s_user_id, uc.user_name AS author_name, uc.user_status AS author_status, uc.user_avatar AS author_avatar,\n                u.user_id, u.user_name as last_user_name, u.user_status as last_user_status, u.user_avatar as last_user_avatar,\n                count(v.post_id) AS vote_count,\n                count(a1.attach_mime) 'attach_image',\n\t\t\t\tcount(a2.attach_mime) 'attach_files'\n                FROM " . DB_FORUM_THREAD_NOTIFY . " tn\n                INNER JOIN " . DB_FORUM_THREADS . " tt ON tn.thread_id = tt.thread_id\n                INNER JOIN " . DB_FORUMS . " tf ON tt.forum_id = tf.forum_id\n                LEFT JOIN " . DB_FORUMS . " ttc ON ttc.forum_id = tf.forum_cat\n                LEFT JOIN " . DB_USERS . " uc ON tt.thread_author = uc.user_id\n                LEFT JOIN " . DB_USERS . " u ON tt.thread_lastuser = u.user_id\n                LEFT JOIN " . DB_FORUM_POSTS . " tp ON tt.thread_id = tp.thread_id\n                LEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = tt.thread_id AND tp.post_id = v.post_id\n                LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = tt.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = tt.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n                WHERE tn.notify_user=" . $userdata['user_id'] . " AND " . groupaccess('forum_access') . " AND tt.thread_hidden='0'\n                GROUP BY tn.thread_id\n                ORDER BY tn.notify_datestamp DESC\n                LIMIT " . $_GET['rowstart'] . ",16\n            ");
    $i = 0;
    while ($threads = dbarray($result)) {
        // opt for moderators.
        $this->forum_info['moderators'] = \PHPFusion\Forums\Moderator::parse_forum_mods($threads['forum_mods']);
        $icon = "";
        $match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id'];
        if ($threads['thread_lastpost'] > $this->forum_info['lastvisited']) {
            if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) {
                $icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>";
            } else {
                $icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>";
            }
        }
        $author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']);
        $lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']);
        $threads += array("thread_link" => array("link" => INFUSIONS . "forum/viewthread.php?thread_id=" . $threads['thread_id'], "title" => $threads['thread_subject']), "forum_type" => $threads['forum_type'], "thread_pages" => makepagenav(0, $forum_settings['posts_per_page'], $threads['thread_postcount'], 3, FORUM . "viewthread.php?thread_id=" . $threads['thread_id'] . "&amp;"), "thread_icons" => array('lock' => $threads['thread_locked'] ? "<i class='" . get_forumIcons('lock') . "' title='" . $locale['forum_0263'] . "'></i>" : '', 'sticky' => $threads['thread_sticky'] ? "<i class='" . get_forumIcons('sticky') . "' title='" . $locale['forum_0103'] . "'></i>" : '', 'poll' => $threads['thread_poll'] ? "<i class='" . get_forumIcons('poll') . "' title='" . $locale['forum_0314'] . "'></i>" : '', 'hot' => $threads['thread_postcount'] >= 20 ? "<i class='" . get_forumIcons('hot') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'reads' => $threads['thread_views'] >= 20 ? "<i class='" . get_forumIcons('reads') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'image' => $threads['attach_image'] > 0 ? "<i class='" . get_forumIcons('image') . "' title='" . $locale['forum_0313'] . "'></i>" : '', 'file' => $threads['attach_files'] > 0 ? "<i class='" . get_forumIcons('file') . "' title='" . $locale['forum_0312'] . "'></i>" : '', 'icon' => $icon), "thread_starter" => $locale['forum_0006'] . timer($threads['post_datestamp']) . " " . $locale['by'] . " " . profile_link($author['user_id'], $author['user_name'], $author['user_status']) . "</span>", "thread_author" => $author, "thread_last" => array('avatar' => display_avatar($lastuser, '30px', '', '', ''), 'profile_link' => profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']), 'time' => $threads['post_datestamp'], 'post_message' => parseubb(parsesmileys($threads['post_message'])), "formatted" => "<div class='pull-left'>" . display_avatar($lastuser, '30px', '', '', '') . "</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='overflow-hide'>" . $locale['forum_0373'] . " <span class='forum_profile_link'>" . profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']) . "</span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . timer($threads['post_datestamp']) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>"), "track_button" => array('link' => FORUM . "index.php?section=tracked&amp;delete=" . $threads['thread_id'], 'title' => $locale['global_058']));
        // push
        $this->forum_info['item'][$threads['thread_id']] = $threads;
    }
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:tracked.php

示例6: dbquery

     $msg_send_state = "";
     $msg_to_group = "";
     $msg_to_group_state = " disabled";
     $sendtoall_chk = "";
     $disablesmileys_chk = "";
 }
 if (isset($_GET['msg_id']) && isnum($_GET['msg_id'])) {
     $result = dbquery("SELECT m.message_subject, m.message_message, m.message_smileys, u.user_id, u.user_name FROM " . DB_MESSAGES . " m\n\t\t\tLEFT JOIN " . DB_USERS . " u ON m.message_from=u.user_id\n\t\t\tWHERE message_to='" . $userdata['user_id'] . "' AND message_id='" . $_GET['msg_id'] . "'");
     $data = dbarray($result);
     $_GET['msg_send'] = $data['user_id'];
     if ($subject == "") {
         $subject = (!strstr($data['message_subject'], "RE: ") ? "RE: " : "") . $data['message_subject'];
     }
     $reply_message = $data['message_message'];
     if (!$data['message_smileys']) {
         $reply_message = parsesmileys($reply_message);
     }
 } else {
     $reply_message = "";
 }
 $user_list = "";
 $user_types = "";
 if (!isset($_POST['chk_sendtoall']) || $_GET['msg_send'] != "0") {
     $sel = "";
     $result = dbquery("SELECT user_id, user_name FROM " . DB_USERS . " WHERE user_status='0' ORDER BY user_level DESC, user_name ASC");
     while ($data = dbarray($result)) {
         if ($data['user_id'] != $userdata['user_id']) {
             $sel = $_GET['msg_send'] == $data['user_id'] ? " selected='selected'" : "";
             $user_list .= "<option value='" . $data['user_id'] . "'{$sel}>" . $data['user_name'] . "</option>\n";
         }
     }
开发者ID:caveman4572,项目名称:PHP-Fusion,代码行数:31,代码来源:messages.php

示例7: parsesmileys

         }
     }
 }
 if (isset($_POST['previewpost'])) {
     if ($subject == "") {
         $subject = $locale['420'];
     }
     if ($message == "") {
         $previewmessage = $locale['421'];
     } else {
         $previewmessage = $message;
         if ($sig_checked) {
             $previewmessage = $previewmessage . "\n\n" . $userdata['user_sig'];
         }
         if (!$disable_smileys_check) {
             $previewmessage = parsesmileys($previewmessage);
         }
         $previewmessage = parseubb($previewmessage);
         $previewmessage = nl2br($previewmessage);
     }
     //$is_mod = iMOD && iUSER < "102" ? true : false;
     opentable($locale['400']);
     echo "<div class='tbl2' style='margin-bottom:5px'><span class='small'><a href='index.php'>" . $settings['sitename'] . "</a> :: " . $caption . "</span></div>\n";
     if ($fdata['forum_poll'] && checkgroup($fdata['forum_poll'])) {
         if (isset($poll_title) && $poll_title && (isset($poll_opts) && is_array($poll_opts))) {
             echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin-bottom:5px'>\n<tr>\n";
             echo "<td align='center' class='tbl2'><strong>" . $poll_title . "</strong></td>\n</tr>\n<tr>\n<td class='tbl1'>\n";
             echo "<table align='center' cellpadding='0' cellspacing='0'>\n";
             foreach ($poll_opts as $poll_option) {
                 echo "<tr>\n<td class='tbl1'><input type='radio' name='poll_option' value='{$i}' style='vertical-align:middle;' /> " . $poll_option . "</td>\n</tr>\n";
                 $i++;
开发者ID:roniwahyu,项目名称:AKEUDA,代码行数:31,代码来源:postnewthread.php

示例8: shd_format_text

/**
 *	Formats a string for bbcode and/or smileys.
 *
 *	Formatting is done according to the supplied settings and the master administration settings.
 *
 *	@param string $text Raw text with optional bbcode formatting
 *	@param bool $smileys Whether smileys should be used; this is not an override to the master administration setting of
 *	whether to use smileys or not, and that takes precedence.
 *	@param string $cache If specified, this will provide the cache'd id that SMF should use to cache the output if it is suitably large.
 *
 *	@return string Will return $text as processed for bbcode (if $modSettings['shd_allow_ticket_bbc'] permits) and smileys (if
 *	$modSettings['shd_allow_ticket_smileys'] and $smileys permits)
 *	@since 1.0
*/
function shd_format_text($text, $smileys = true, $cache = '')
{
    global $modSettings, $scripturl, $smcFunc;
    static $smf_disabled = false, $shd_disabled = false;
    if (empty($modSettings['shd_allow_ticket_bbc'])) {
        if (!empty($modSettings['shd_allow_wikilinks'])) {
            shd_parse_wikilinks($text);
        }
        if (!empty($modSettings['shd_allow_ticket_smileys']) && $smileys) {
            parsesmileys($text);
        }
    } else {
        // Figure out what's disabled, if anything, and do a bait'n'switch
        if ($smf_disabled === false) {
            $original_tags = parse_bbc(false);
            $tags = array();
            foreach ($original_tags as $smf_tag) {
                if (!isset($tags[$smf_tag['tag']])) {
                    $tags[$smf_tag['tag']] = true;
                }
            }
            // See what tagz we can haz.
            if (!empty($modSettings['shd_enabled_bbc'])) {
                $enabled_tags = explode(',', $modSettings['shd_enabled_bbc']);
            } else {
                $enabled_tags = array(false);
            }
            $disabled_tags = array_diff(array_keys($tags), $enabled_tags);
            // this gets us what's present in SMF but not enabled by SD
            $disabled_tags[] = '_SHD_DUMMY_TAG';
            $smf_disabled = isset($modSettings['disabledBBC']) ? $modSettings['disabledBBC'] . ',_SHD_DUMMY_TAG' : '_SHD_DUMMY_TAG';
            $shd_disabled = implode(',', $disabled_tags);
        }
        // wecanhazbbc
        if ($shd_disabled == $smf_disabled) {
            // What SMF and SD have is the same, yay
            $text = parse_bbc($text, !empty($modSettings['shd_allow_ticket_smileys']) ? $smileys : false, $cache);
        } else {
            // first override SMF's disabled set with ours
            $modSettings['disabledBBC'] = $shd_disabled;
            parse_bbc(false);
            $text = parse_bbc($text, !empty($modSettings['shd_allow_ticket_smileys']) ? $smileys : false, $cache);
            // Now put it back
            $modSettings['disabledBBC'] = $smf_disabled;
            parse_bbc(false);
        }
    }
    return $text;
}
开发者ID:jdarwood007,项目名称:SimpleDesk,代码行数:63,代码来源:Subs-SimpleDesk.php

示例9: dbarray

 }
 $original_data = dbarray(dbquery("select * from " . DB_POSTS . " where thread_id='" . $data['thread_id'] . "' order by post_id asc limit 1"));
 $timepassed = timePassed($original_data['post_datestamp']);
 echo "</td>\n\t\t<td width='40%' class='" . $row_color . "'>";
 $threadPost = dbarray(dbquery("select * from " . DB_THREADS . " t\n\t\tleft join " . DB_POSTS . " p on p.thread_id=t.thread_id\n\t\twhere t.thread_id='" . $data['thread_id'] . "' order by p.post_id asc limit 1"));
 $post_res = dbquery("select * from " . DB_PREFIX . "fb_posts where post_id='" . $threadPost['post_id'] . "'");
 if (dbrows($post_res)) {
     $post_data = dbarray($post_res);
     if ($post_data['post_icon'] && $post_data['post_icon'] !== "page_white.png" && $fb4['post_icons']) {
         echo "<div style='float:left;'><br /><img src='" . INFUSIONS . "fusionboard4/images/post_icons/" . $post_data['post_icon'] . "' alt='' style='vertical-align:middle;' />&nbsp;<br /></div>";
     }
 }
 echo "<a";
 if ($fb4['latest_popup']) {
     $originalpost = dbarray(dbquery("select * from " . DB_POSTS . " where thread_id='" . $data['thread_id'] . "' order by post_id asc limit 1"));
     $post_message = $originalpost['post_smileys'] == 1 ? parsesmileys($originalpost['post_message']) : $originalpost['post_message'];
     $post_message = phpentities(nl2br(parseubb($post_message)));
     echo " title=\"header=[ " . str_replace("]", "]]", str_replace("[", "[[", trimlink($data['thread_subject'], 70))) . "] body=[" . str_replace("]", "]]", str_replace("[", "[[", trimlink($post_message, 150))) . "] delay=[0] fade=[on]\"";
 }
 echo " href='" . FORUM . "viewthread.php?thread_id=" . $data['thread_id'] . "' title='" . $data['thread_subject'] . "'\n\t\tstyle='text-decoration:underline; font-size:12px;{$threadbold}'>" . trimlink($data['thread_subject'], 40) . "</a> ";
 if ($fb4['latest_post']) {
     echo "&nbsp;<a";
     if ($fb4['latest_popup']) {
         $originalpost = dbarray(dbquery("select * from " . DB_POSTS . " where post_id='" . $data['thread_lastpostid'] . "' order by post_id asc limit 1"));
         $post = trimlink(nl2br(stripinput(parseubb($originalpost['post_message']))), 200);
         echo " title='header=[" . $locale['fb615'] . ":] body=[" . $post . "] delay=[0] fade=[on]'";
     }
     echo " href='" . FORUM . "viewthread.php?thread_id=" . $data['thread_id'] . "&amp;pid=" . $data['thread_lastpostid'] . "#post_" . $data['thread_lastpostid'] . "'" . (!$fb4['latest_popup'] ? " title='" . $locale['fb615'] . "'" : "") . " class='small'>(<b>&raquo;</b>)</a>";
 }
 echo "<br />\n<a href='" . BASEDIR . "profile.php?lookup=" . $data['original_id'] . "' style='font-size:11px;'>" . showLabel($data['original_id'], false, "panel") . "</a><br />\n\t\t<span style='font-size:10px;'>" . $timepassed . "</span>\n\t\t</td>\n";
 echo "<td width='20%' class='" . $row_color . "' style='text-align:right;white-space:nowrap'>\n\t\t" . timePassed($data['thread_lastpost'], false) . "<br />\n\t\tby <a href='" . BASEDIR . "profile.php?lookup=" . $data['thread_lastuser'] . "'>" . showLabel($data['thread_lastuser'], false, "panel") . "</a>";
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:fb_threads_list_panel.php

示例10: Copyright

<?php

/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: user_sig_include.php
| Author: Digitanium
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) {
    die("Access Denied");
}
// Display user field input
if ($profile_method == "input") {
    require_once INCLUDES . "bbcode_include.php";
    $options += array("bbcode" => TRUE, "inline" => TRUE, 'form_name' => 'userfieldsform');
    $user_fields = form_textarea('user_sig', $locale['uf_sig'], $field_value, $options);
} elseif ($profile_method == "display") {
    // Display in profile
    $user_fields = array('title' => $locale['uf_sig'], 'value' => $field_value ? parseubb(parsesmileys($field_value)) : $locale['na']);
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:30,代码来源:user_sig_include.php

示例11: get_tag_thread

 /**
  * Get thread structure when given specific tag id
  * @param string     $tag_id
  * @param bool|FALSE $filter
  * @return array
  */
 public static function get_tag_thread($tag_id = '0', $filter = FALSE)
 {
     $info = array();
     $locale = fusion_get_locale("", FORUM_LOCALE);
     $forum_settings = ForumServer::get_forum_settings();
     $userdata = fusion_get_userdata();
     $userdata['user_id'] = !empty($userdata['user_id']) ? (int) intval($userdata['user_id']) : 0;
     $lastVisited = isset($userdata['user_lastvisit']) && isnum($userdata['user_lastvisit']) ? $userdata['user_lastvisit'] : time();
     /**
      * Get threads with filter conditions (XSS prevention)
      */
     $thread_query = "\n        SELECT\n        count(t.thread_id) 'thread_max_rows',\n        count(a1.attach_id) 'attach_image',\n        count(a2.attach_id) 'attach_files'\n        FROM " . DB_FORUM_THREADS . " t\n        LEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = t.forum_id\n        INNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n        #LEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id\n        LEFT JOIN " . DB_FORUM_POSTS . " p1 ON p1.thread_id = t.thread_id and p1.post_id = t.thread_lastpostid\n        LEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n        #LEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND p1.post_id = v.post_id\n        LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n        LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = t.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n        WHERE " . in_group('t.thread_tags', intval($tag_id), '.') . " AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . "\n        " . (isset($filter['condition']) ? $filter['condition'] : '') . "\n        GROUP BY tf.forum_id\n        ";
     $thread_result = dbquery($thread_query);
     $thread_rows = dbrows($thread_result);
     $count = array("thread_max_rows" => 0, "attach_image" => 0, "attach_files" => 0);
     $info['item'][$tag_id]['forum_threadcount'] = 0;
     $info['item'][$tag_id]['forum_threadcount_word'] = format_word($count['thread_max_rows'], $locale['fmt_thread']);
     if ($thread_rows > 0) {
         $count = dbarray($thread_result);
         $info['item'][$tag_id]['forum_threadcount'] = 0;
         $info['item'][$tag_id]['forum_threadcount_word'] = format_word($count['thread_max_rows'], $locale['fmt_thread']);
     }
     $info['thread_max_rows'] = $count['thread_max_rows'];
     if ($info['thread_max_rows'] > 0) {
         $info['threads']['pagenav'] = "";
         $info['threads']['pagenav2'] = "";
         // anti-XSS filtered rowstart
         $_GET['thread_rowstart'] = isset($_GET['thread_rowstart']) && isnum($_GET['thread_rowstart']) && $_GET['thread_rowstart'] <= $count['thread_max_rows'] ? $_GET['thread_rowstart'] : 0;
         $thread_query = "\n            SELECT t.*, tf.forum_type, tf.forum_name, tf.forum_cat,\n            tu1.user_name ' author_name', tu1.user_status 'author_status', tu1.user_avatar 'author_avatar',\n            tu2.user_name 'last_user_name', tu2.user_status 'last_user_status', tu2.user_avatar 'last_user_avatar',\n            p1.post_datestamp, p1.post_message,\n            IF (n.thread_id > 0, 1 , 0) 'user_tracked',\n            count(v.vote_user) 'thread_rated',\n            count(pv.forum_vote_user_id) 'poll_voted',\n            p.forum_poll_title,\n            count(v.post_id) AS vote_count,\n            a1.attach_name, a1.attach_id,\n            a2.attach_name, a2.attach_id,\n            count(a1.attach_mime) 'attach_image',\n            count(a2.attach_mime) 'attach_files',\n            min(p2.post_datestamp) 'first_post_datestamp'\n            FROM " . DB_FORUM_THREADS . " t\n            LEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = t.forum_id\n            INNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n            LEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id\n            LEFT JOIN " . DB_FORUM_POSTS . " p1 ON p1.thread_id = t.thread_id and p1.post_id = t.thread_lastpostid\n            LEFT JOIN " . DB_FORUM_POSTS . " p2 ON p2.thread_id = t.thread_id\n            LEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n            #LEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND p1.post_id = v.post_id\n            LEFT JOIN " . DB_FORUM_VOTES . " v on v.thread_id = t.thread_id AND v.vote_user='" . $userdata['user_id'] . "' AND v.forum_id = t.forum_id AND tf.forum_type='4'\n            LEFT JOIN " . DB_FORUM_POLL_VOTERS . " pv on pv.thread_id = t.thread_id AND pv.forum_vote_user_id='" . $userdata['user_id'] . "' AND t.thread_poll=1\n            LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n            LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = t.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n            LEFT JOIN " . DB_FORUM_THREAD_NOTIFY . " n on n.thread_id = t.thread_id and n.notify_user = '" . $userdata['user_id'] . "'\n            WHERE " . in_group('t.thread_tags', intval($tag_id), '.') . " AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . "\n            " . (isset($filter['condition']) ? $filter['condition'] : '') . "\n            " . (multilang_table("FO") ? "AND tf.forum_language='" . LANGUAGE . "'" : '') . "\n            GROUP BY t.thread_id\n            " . (isset($filter['order']) ? $filter['order'] : '') . "\n            LIMIT " . intval($_GET['thread_rowstart']) . ", " . $forum_settings['threads_per_page'];
         $cthread_result = dbquery($thread_query);
         if (dbrows($cthread_result) > 0) {
             while ($threads = dbarray($cthread_result)) {
                 $icon = "";
                 $match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id'];
                 if ($threads['thread_lastpost'] > $lastVisited) {
                     if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) {
                         $icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>";
                     } else {
                         $icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>";
                     }
                 }
                 $author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']);
                 $lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']);
                 $threads += array("thread_link" => array("link" => FORUM . "viewthread.php?thread_id=" . $threads['thread_id'], "title" => $threads['thread_subject']), "forum_type" => $threads['forum_type'], "thread_pages" => makepagenav(0, $forum_settings['posts_per_page'], $threads['thread_postcount'], 3, FORUM . "viewthread.php?thread_id=" . $threads['thread_id'] . "&amp;"), "thread_icons" => array('lock' => $threads['thread_locked'] ? "<i class='" . self::get_forumIcons('lock') . "' title='" . $locale['forum_0263'] . "'></i>" : '', 'sticky' => $threads['thread_sticky'] ? "<i class='" . self::get_forumIcons('sticky') . "' title='" . $locale['forum_0103'] . "'></i>" : '', 'poll' => $threads['thread_poll'] ? "<i class='" . self::get_forumIcons('poll') . "' title='" . $locale['forum_0314'] . "'></i>" : '', 'hot' => $threads['thread_postcount'] >= 20 ? "<i class='" . self::get_forumIcons('hot') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'reads' => $threads['thread_views'] >= 20 ? "<i class='" . self::get_forumIcons('reads') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'image' => $threads['attach_image'] > 0 ? "<i class='" . self::get_forumIcons('image') . "' title='" . $locale['forum_0313'] . "'></i>" : '', 'file' => $threads['attach_files'] > 0 ? "<i class='" . self::get_forumIcons('file') . "' title='" . $locale['forum_0312'] . "'></i>" : '', 'icon' => $icon), "thread_starter" => $locale['forum_0006'] . timer($threads['first_post_datestamp']) . " " . $locale['by'] . " " . profile_link($author['user_id'], $author['user_name'], $author['user_status']) . "</span>", "thread_author" => $author, "thread_last" => array('avatar' => display_avatar($lastuser, '30px', '', '', ''), 'profile_link' => profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']), 'time' => $threads['post_datestamp'], 'post_message' => parseubb(parsesmileys($threads['post_message'])), "formatted" => "<div class='pull-left'>" . display_avatar($lastuser, '30px', '', '', '') . "</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='overflow-hide'>" . $locale['forum_0373'] . " <span class='forum_profile_link'>" . profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']) . "</span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . timer($threads['post_datestamp']) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>"));
                 if ($threads['thread_sticky']) {
                     $info['threads']['sticky'][$threads['thread_id']] = $threads;
                 } else {
                     $info['threads']['item'][$threads['thread_id']] = $threads;
                 }
             }
         }
         if ($info['thread_max_rows'] > $forum_settings['threads_per_page']) {
             $info['threads']['pagenav'] = makepagenav($_GET['thread_rowstart'], $forum_settings['threads_per_page'], $info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&amp;", "thread_rowstart");
             $info['threads']['pagenav2'] = makepagenav($_GET['thread_rowstart'], $forum_settings['threads_per_page'], $info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&amp;", "thread_rowstart", TRUE);
         }
     }
     return (array) $info;
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:64,代码来源:tags.php

示例12: closetable

        echo "</tbody>\n</table>\n";
        echo "</div>\n";
    } else {
        echo "<div style='text-align:center'>" . $locale['416'] . "</div>\n";
    }
    closetable();
} else {
    if ($_GET['page'] == 2) {
        if (isset($_POST['post_test'])) {
            $test_message = form_sanitizer($_POST['test_message'], '', 'test_message');
            $smileys_checked = isset($_POST['test_smileys']) || preg_match("#(\\[code\\](.*?)\\[/code\\]|\\[geshi=(.*?)\\](.*?)\\[/geshi\\]|\\[php\\](.*?)\\[/php\\])#si", $test_message) ? " checked='checked'" : "";
            if (!defined('FUSION_NULL')) {
                opentable($locale['417']);
                echo "<div class='well'>\n";
                if (!$smileys_checked) {
                    echo parseubb(parsesmileys($test_message));
                } else {
                    echo parseubb($test_message);
                }
                echo "</div>\n";
                closetable();
            }
        } else {
            $test_message = "";
            $smileys_checked = "";
        }
        include LOCALE . LOCALESET . "comments.php";
        opentable($locale['401']);
        echo $navigation;
        echo openform('input_form', 'input_form', 'post', FUSION_SELF . $aidlink . "&amp;page=2", array('downtime' => 0));
        echo "<table cellspacing='0' cellpadding='0' class='table table-responsive center'>\n<tr>\n";
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:bbcodes.php

示例13: sprintf

 if (dbrows($result)) {
     $title = "";
     if ($settings['forum_last_posts_reply'] == "1") {
         $title = $locale['431'];
     } else {
         $title = sprintf($locale['432'], $settings['forum_last_posts_reply']);
     }
     opentable($title);
     echo "<div style='max-height:350px;overflow:auto;'>\n";
     echo "<table cellpadding='1' cellspacing='1' width='100%' class='tbl-border forum_thread_table'>\n";
     $i = $settings['forum_last_posts_reply'];
     while ($data = dbarray($result)) {
         $data['user_aliases'] = alias1($data['user_aliases']);
         $message = $data['post_message'];
         if ($data['post_smileys']) {
             $message = parsesmileys($message);
         }
         $message = parseubb($message);
         echo "<tr>\n<td class='tbl2 forum_thread_user_name' style='width:10%'><!--forum_thread_user_name-->" . alias2($data['post_alias'], $data['user_aliases'], $data['user_id'], $data['user_name'], $data['user_status']) . "</td>\n";
         echo "<td class='tbl2 forum_thread_post_date'>\n";
         echo "<div style='float:right' class='small'>\n";
         echo $i . ($i == $settings['forum_last_posts_reply'] ? " (" . $locale['431'] . ")" : "");
         echo "</div>\n";
         echo "<div class='small'>" . $locale['426'] . showdate("forumdate", $data['post_datestamp']) . "</div>\n";
         echo "</td>\n";
         echo "</tr>\n<tr>\n<td valign='top' class='tbl2 forum_thread_user_info' style='width:10%'>\n";
         if ($data['user_avatar'] && file_exists(IMAGES . "avatars/" . $data['user_avatar']) && $data['user_status'] != 6 && $data['user_status'] != 5 && $data['post_alias'] < 0) {
             echo "<img src='" . IMAGES . "avatars/" . $data['user_avatar'] . "' alt='" . $locale['567'] . "' /><br /><br />\n";
         } elseif ($data['post_alias'] >= 0) {
             echo "<img src='" . IMAGES . "avatars/noavatar100.png' alt='-' /><br /><br />\n";
             echo "<span class='small'>";
开发者ID:necrophcodr,项目名称:Muks,代码行数:31,代码来源:postreply.php

示例14: profileValidateSignature

function profileValidateSignature(&$value)
{
    global $sourcedir, $modSettings, $smcFunc, $txt;
    require_once $sourcedir . '/Subs-Post.php';
    // Admins can do whatever they hell they want!
    if (!allowedTo('admin_forum')) {
        // Load all the signature limits.
        list($sig_limits, $sig_bbc) = explode(':', $modSettings['signature_settings']);
        $sig_limits = explode(',', $sig_limits);
        $disabledTags = !empty($sig_bbc) ? explode(',', $sig_bbc) : array();
        $unparsed_signature = strtr(un_htmlspecialchars($value), array("\r" => '', '&#039' => '\''));
        // Too long?
        if (!empty($sig_limits[1]) && $smcFunc['strlen']($unparsed_signature) > $sig_limits[1]) {
            $_POST['signature'] = trim(htmlspecialchars($smcFunc['substr']($unparsed_signature, 0, $sig_limits[1]), ENT_QUOTES));
            $txt['profile_error_signature_max_length'] = sprintf($txt['profile_error_signature_max_length'], $sig_limits[1]);
            return 'signature_max_length';
        }
        // Too many lines?
        if (!empty($sig_limits[2]) && substr_count($unparsed_signature, "\n") >= $sig_limits[2]) {
            $txt['profile_error_signature_max_lines'] = sprintf($txt['profile_error_signature_max_lines'], $sig_limits[2]);
            return 'signature_max_lines';
        }
        // Too many images?!
        if (!empty($sig_limits[3]) && substr_count(strtolower($unparsed_signature), '[img') + substr_count(strtolower($unparsed_signature), '<img') > $sig_limits[3]) {
            $txt['profile_error_signature_max_image_count'] = sprintf($txt['profile_error_signature_max_image_count'], $sig_limits[3]);
            return 'signature_max_image_count';
        }
        // What about too many smileys!
        $smiley_parsed = $unparsed_signature;
        parsesmileys($smiley_parsed);
        $smiley_count = substr_count(strtolower($smiley_parsed), '<img') - substr_count(strtolower($unparsed_signature), '<img');
        if (!empty($sig_limits[4]) && $sig_limits[4] == -1 && $smiley_count > 0) {
            return 'signature_allow_smileys';
        } elseif (!empty($sig_limits[4]) && $sig_limits[4] > 0 && $smiley_count > $sig_limits[4]) {
            $txt['profile_error_signature_max_smileys'] = sprintf($txt['profile_error_signature_max_smileys'], $sig_limits[4]);
            return 'signature_max_smileys';
        }
        // Maybe we are abusing font sizes?
        if (!empty($sig_limits[7]) && preg_match_all('~\\[size=([\\d\\.]+)?(px|pt|em|x-large|larger)~i', $unparsed_signature, $matches) !== false && isset($matches[2])) {
            foreach ($matches[1] as $ind => $size) {
                $limit_broke = 0;
                // Attempt to allow all sizes of abuse, so to speak.
                if ($matches[2][$ind] == 'px' && $size > $sig_limits[7]) {
                    $limit_broke = $sig_limits[7] . 'px';
                } elseif ($matches[2][$ind] == 'pt' && $size > $sig_limits[7] * 0.75) {
                    $limit_broke = (int) $sig_limits[7] * 0.75 . 'pt';
                } elseif ($matches[2][$ind] == 'em' && $size > (double) $sig_limits[7] / 16) {
                    $limit_broke = (double) $sig_limits[7] / 16 . 'em';
                } elseif ($matches[2][$ind] != 'px' && $matches[2][$ind] != 'pt' && $matches[2][$ind] != 'em' && $sig_limits[7] < 18) {
                    $limit_broke = 'large';
                }
                if ($limit_broke) {
                    $txt['profile_error_signature_max_font_size'] = sprintf($txt['profile_error_signature_max_font_size'], $limit_broke);
                    return 'signature_max_font_size';
                }
            }
        }
        // The difficult one - image sizes! Don't error on this - just fix it.
        if (!empty($sig_limits[5]) || !empty($sig_limits[6])) {
            // Get all BBC tags...
            preg_match_all('~\\[img(\\s+width=([\\d]+))?(\\s+height=([\\d]+))?(\\s+width=([\\d]+))?\\s*\\](?:<br />)*([^<">]+?)(?:<br />)*\\[/img\\]~i', $unparsed_signature, $matches);
            // ... and all HTML ones.
            preg_match_all('~<img\\s+src=(?:")?((?:http://|ftp://|https://|ftps://).+?)(?:")?(?:\\s+alt=(?:")?(.*?)(?:")?)?(?:\\s?/)?>~i', $unparsed_signature, $matches2, PREG_PATTERN_ORDER);
            // And stick the HTML in the BBC.
            if (!empty($matches2)) {
                foreach ($matches2[0] as $ind => $dummy) {
                    $matches[0][] = $matches2[0][$ind];
                    $matches[1][] = '';
                    $matches[2][] = '';
                    $matches[3][] = '';
                    $matches[4][] = '';
                    $matches[5][] = '';
                    $matches[6][] = '';
                    $matches[7][] = $matches2[1][$ind];
                }
            }
            $replaces = array();
            // Try to find all the images!
            if (!empty($matches)) {
                foreach ($matches[0] as $key => $image) {
                    $width = -1;
                    $height = -1;
                    // Does it have predefined restraints? Width first.
                    if ($matches[6][$key]) {
                        $matches[2][$key] = $matches[6][$key];
                    }
                    if ($matches[2][$key] && $sig_limits[5] && $matches[2][$key] > $sig_limits[5]) {
                        $width = $sig_limits[5];
                        $matches[4][$key] = $matches[4][$key] * ($width / $matches[2][$key]);
                    } elseif ($matches[2][$key]) {
                        $width = $matches[2][$key];
                    }
                    // ... and height.
                    if ($matches[4][$key] && $sig_limits[6] && $matches[4][$key] > $sig_limits[6]) {
                        $height = $sig_limits[6];
                        if ($width != -1) {
                            $width = $width * ($height / $matches[4][$key]);
                        }
                    } elseif ($matches[4][$key]) {
                        $height = $matches[4][$key];
//.........这里部分代码省略.........
开发者ID:valek0972,项目名称:hackits,代码行数:101,代码来源:Profile-Modify.php

示例15: profile_link

         echo "<div class='attachments-list'>" . $a_images . "</div>\n";
         echo "</div>\n";
     }
 }
 if ($data['post_edittime'] != "0") {
     echo "\n<hr />\n<span class='small'>" . $locale['508'] . profile_link($data['post_edituser'], $data['edit_name'], $data['edit_status']) . $locale['509'] . showdate("forumdate", $data['post_edittime']) . "</span>\n";
     if ($data['post_editreason'] != "" && iMEMBER) {
         $edit_reason = true;
         echo "<br /><div class='edit_reason'><a id='reason_pid_" . $data['post_id'] . "' rel='" . $data['post_id'] . "' class='reason_button small' href='#reason_div_pid_" . $data['post_id'] . "'>";
         echo "<strong>" . $locale['508a'] . "</strong>";
         echo "</a>\n";
         echo "<div id='reason_div_pid_" . $data['post_id'] . "' class='reason_div small'>" . $data['post_editreason'] . "</div></div>\n";
     }
 }
 if ($data['post_showsig'] && isset($data['user_sig']) && $data['user_sig'] && $data['user_status'] != 6 && $data['user_status'] != 5) {
     echo "\n<hr /><div class='forum_sig'>" . nl2br(parseubb(parsesmileys($data['user_sig']), "b|i|u||center|small|url|mail|img|color")) . "</div>\n";
 }
 echo "<!--sub_forum_post--></td>\n</tr>\n";
 echo "<tr>\n<td class='tbl2 forum_thread_ip' style='width:140px;white-space:nowrap'>";
 if ($settings['forum_ips'] && iMEMBER || iMOD) {
     echo "<strong>" . $locale['571'] . "</strong>: " . $data['post_ip'];
 } else {
     echo "&nbsp;";
 }
 echo "</td>\n<td class='tbl2 forum_thread_userbar'>\n<div style='float:left;white-space:nowrap' class='small'><!--forum_thread_userbar-->\n";
 if (isset($data['user_web']) && $data['user_web'] && (iADMIN || $data['user_status'] != 6 && $data['user_status'] != 5)) {
     echo "<a href='" . $data['user_web'] . "' target='_blank'><img src='" . get_image("web") . "' alt='" . $data['user_web'] . "' style='border:0;vertical-align:middle' /></a>";
 }
 if (iMEMBER && $data['user_id'] != $userdata['user_id'] && (iADMIN || $data['user_status'] != 6 && $data['user_status'] != 5)) {
     echo "<a href='" . BASEDIR . "messages.php?msg_send=" . $data['user_id'] . "'><img src='" . get_image("pm") . "' alt='" . $locale['572'] . "' style='border:0;vertical-align:middle' /></a>\n";
 }
开发者ID:keddyboys,项目名称:kmods,代码行数:31,代码来源:viewthread.php


注:本文中的parsesmileys函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。