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


PHP CKunenaTools::prepareContent方法代码示例

本文整理汇总了PHP中CKunenaTools::prepareContent方法的典型用法代码示例。如果您正苦于以下问题:PHP CKunenaTools::prepareContent方法的具体用法?PHP CKunenaTools::prepareContent怎么用?PHP CKunenaTools::prepareContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CKunenaTools的用法示例。


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

示例1: utf8_urldecode

 $settings = !empty($_COOKIE['fboard_settings']) ? $_COOKIE['fboard_settings'] : '';
 $board_title = $fbConfig->board_title;
 $fromBot = 0;
 $prefview = $fbConfig->default_view;
 // JOOMLA STYLE CHECK
 if ($fbConfig->joomlastyle < 1) {
     $boardclass = "fb_";
 }
 // Include preview here before inclusion of other files
 if ($func == "getpreview") {
     $message = utf8_urldecode(utf8_decode(stripslashes($msgpreview)));
     $smileyList = smile::getEmoticons(1);
     $msgbody = smile::smileReplace($message, 0, $fbConfig->disemoticons, $smileyList);
     $msgbody = nl2br($msgbody);
     $msgbody = str_replace("__FBTAB__", "\t", $msgbody);
     $msgbody = CKunenaTools::prepareContent($msgbody);
     // $msgbody = ereg_replace('%u0([[:alnum:]]{3})', '&#x1;',$msgbody);
     $msgbody = smile::htmlwrap($msgbody, $fbConfig->wrap);
     header("Content-Type: text/html; charset=utf-8");
     echo $msgbody;
     $app->close();
 }
 if ($no_html == 0) {
     $document =& JFactory::getDocument();
     // inline jscript with image location
     $document->addScriptDeclaration('jr_expandImg_url = "' . KUNENA_URLIMAGESPATH . '";');
     if (is_object($kunenaProfile) && $kunenaProfile->useProfileIntegration()) {
         if (defined('KUNENA_COREJSURL')) {
             global $_CB_framework;
             $_CB_framework->addJQueryPlugin('kunena_tmpl', KUNENA_COREJSPATH);
             $_CB_framework->outputCbJQuery('', 'kunena_tmpl');
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:31,代码来源:kunena.php

示例2: array_flip

 $table = array_flip(get_html_translation_table(HTML_ENTITIES));
 $fb_subject_txt = strtr($fb_subject_txt, $table);
 $fb_subject_txt = stripslashes($fb_subject_txt);
 $fb_subject_txt = smile::htmlwrap($fb_subject_txt, $fbConfig->wrap);
 $msg_subject = smile::fbHtmlSafe($fb_subject_txt);
 $msg_date = date(_DATETIME, $fmessage->time);
 $fb_message_txt = stripslashes($fmessage->message);
 $fb_message_txt = smile::smileReplace($fb_message_txt, 0, $fbConfig->disemoticons, $smileyList);
 $fb_message_txt = nl2br($fb_message_txt);
 //$fb_message_txt = str_replace("<P>&nbsp;</P><br />","",$fb_message_txt);
 //$fb_message_txt = str_replace("</P><br />","</P>",$fb_message_txt);
 //$fb_message_txt = str_replace("<P><br />","<P>",$fb_message_txt);
 // Code tag: restore TABS as we had to 'hide' them from the rest of the logic
 $fb_message_txt = str_replace("__FBTAB__", "&#009;", $fb_message_txt);
 $fb_message_txt = smile::htmlwrap($fb_message_txt, $fbConfig->wrap);
 $msg_text = CKunenaTools::prepareContent($fb_message_txt);
 $signature = $userinfo->signature;
 if ($signature) {
     $signature = stripslashes(smile::smileReplace($signature, 0, $fbConfig->disemoticons, $smileyList));
     $signature = nl2br($signature);
     //wordwrap:
     $signature = smile::htmlwrap($signature, $fbConfig->wrap);
     //restore the \n (were replaced with _CTRL_) occurences inside code tags, but only after we have striplslashes; otherwise they will be stripped again
     //$signature = str_replace("_CRLF_", "\\n", stripslashes($signature));
     $msg_signature = $signature;
 }
 if ($is_Moderator || $forumLocked == 0 && $topicLocked == 0 && ($kunena_my->id > 0 || $fbConfig->pubwrite)) {
     //user is allowed to reply/quote
     $msg_reply = CKunenaLink::GetTopicPostReplyLink('reply', $catid, $fmessage->id, isset($fbIcons['reply']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['reply'] . '" alt="Reply" border="0" title="' . _VIEW_REPLY . '" />' : _GEN_REPLY);
     $msg_quote = CKunenaLink::GetTopicPostReplyLink('quote', $catid, $fmessage->id, isset($fbIcons['quote']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['quote'] . '" alt="Quote" border="0" title="' . _VIEW_QUOTE . '" />' : _GEN_QUOTE);
 } else {
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:31,代码来源:view.php

示例3: listThreadHistory

function listThreadHistory($id, $fbConfig, $kunena_db)
{
    if ($id != 0) {
        //get the parent# for the post on which 'reply' or 'quote' is chosen
        $kunena_db->setQuery("SELECT parent FROM #__fb_messages WHERE id='{$id}'");
        $this_message_parent = $kunena_db->loadResult();
        //Get the thread# for the same post
        $kunena_db->setQuery("SELECT thread FROM #__fb_messages WHERE id='{$id}'");
        $this_message_thread = $kunena_db->loadResult();
        //determine the correct thread# for the entire thread
        if ($this_message_parent == 0) {
            $thread = $id;
        } else {
            $thread = $this_message_thread;
        }
        //get all the messages for this thread
        $kunena_db->setQuery("SELECT * FROM #__fb_messages AS m LEFT JOIN #__fb_messages_text AS t ON m.id=t.mesid WHERE (thread='{$thread}' OR id='{$thread}') AND hold='0' ORDER BY time DESC LIMIT " . $fbConfig->historylimit);
        $messages = $kunena_db->loadObjectList();
        check_dberror("Unable to load messages.");
        //and the subject of the first thread (for reference)
        $kunena_db->setQuery("SELECT subject FROM #__fb_messages WHERE id='{$thread}' and parent='0'");
        $this_message_subject = $kunena_db->loadResult();
        check_dberror("Unable to load messages.");
        echo "<b>" . _POST_TOPIC_HISTORY . ":</b> " . kunena_htmlspecialchars(stripslashes($this_message_subject)) . " <br />" . _POST_TOPIC_HISTORY_MAX . " {$fbConfig->historylimit} " . _POST_TOPIC_HISTORY_LAST . "<br />";
        ?>

        <table border = "0" cellspacing = "1" cellpadding = "3" width = "100%" class = "fb_review_table">
            <tr>
                <td class = "fb_review_header" width = "20%" align = "center">
                    <strong><?php 
        echo _GEN_AUTHOR;
        ?>
</strong>
                </td>

                <td class = "fb_review_header" align = "center">
                    <strong><?php 
        echo _GEN_MESSAGE;
        ?>
</strong>
                </td>
            </tr>

            <?php 
        $k = 0;
        $smileyList = smile::getEmoticons(1);
        foreach ($messages as $mes) {
            $k = 1 - $k;
            $mes->name = kunena_htmlspecialchars($mes->name);
            $mes->email = kunena_htmlspecialchars($mes->email);
            $mes->subject = kunena_htmlspecialchars($mes->subject);
            $fb_message_txt = stripslashes($mes->message);
            $fb_message_txt = smile::smileReplace($fb_message_txt, 1, $fbConfig->disemoticons, $smileyList);
            $fb_message_txt = nl2br($fb_message_txt);
            $fb_message_txt = str_replace("__FBTAB__", "\t", $fb_message_txt);
            ?>

                <tr>
                    <td class = "fb_review_body<?php 
            echo $k;
            ?>
" valign = "top">
                        <?php 
            echo stripslashes($mes->name);
            ?>
                    </td>

                    <td class = "fb_review_body<?php 
            echo $k;
            ?>
">
                        <?php 
            $fb_message_txt = str_replace("</P><br />", "</P>", $fb_message_txt);
            //Long Words Wrap:
            $fb_message_txt = smile::htmlwrap($fb_message_txt, $fbConfig->wrap);
            $fb_message_txt = CKunenaTools::prepareContent($fb_message_txt);
            echo $fb_message_txt;
            ?>
                    </td>
                </tr>

            <?php 
        }
        ?>
        </table>

<?php 
    }
    //else: this is a new topic so there can't be a history
}
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:90,代码来源:post.php

示例4: show


//.........这里部分代码省略.........
        ?>
sectiontableheader">
<?php 
        echo _GEN_AUTHOR;
        ?>
                    </th>

                    <th class = "th-3 <?php 
        echo $boardclass;
        ?>
sectiontableheader">
<?php 
        echo _GEN_DATE;
        ?>
                    </th>
                </tr>

                <?php 
        $tabclass = array("sectiontableentry1", "sectiontableentry2");
        $k = 0;
        if ($totalRows == 0 && $this->int_kunena_errornr) {
            echo '<tr class="' . $boardclass . '' . $tabclass[$k] . '" ><td colspan="3"  style="text-align:center;font-weight:bold">' . $this->str_kunena_errormsg . '</td></tr>';
        }
        // Cleanup incoming searchword; international chars can cause garbage at the end
        // real problem might lie with search box form and how we post and receive the data
        // However, this works for now
        $q = trim($q);
        // JJ Add different color
        $searchlist = $this->get_searchstrings();
        foreach ($results as $result) {
            $k = 1 - $k;
            $ressubject = $result->subject;
            // Clean up subject
            $ressubject = stripslashes(smile::purify($ressubject));
            $resmessage = stripslashes($result->message);
            // Strip smiles and bbcode out of search results; they look ugly
            $resmessage = CKunenaTools::prepareContent($resmessage);
            $resmessage = smile::purify($resmessage);
            $resmessage = kn_mb_substr(kunena_htmlspecialchars($resmessage), 0, 300);
            $utf8 = KUNENA_CHARSET == 'UTF-8' ? "u" : "";
            foreach ($searchlist as $searchword) {
                if (empty($searchword)) {
                    continue;
                }
                $ressubject = preg_replace("/" . preg_quote($searchword, '/') . "/i" . $utf8, '<span  class="searchword" >' . $searchword . '</span>', $ressubject);
                $resmessage = preg_replace("/" . preg_quote($searchword, '/') . "/i" . $utf8, '<span  class="searchword" >' . $searchword . '</span>', $resmessage);
            }
            echo '<tr class="' . $boardclass . '' . $tabclass[$k] . '">';
            echo '<td  class = "td-1" ><a href="' . JRoute::_(KUNENA_LIVEURL . '&amp;func=view&amp;id=' . $result->id . '&amp;catid=' . $result->catid) . '#' . $result->id . '" >' . $ressubject . '</a><br />' . $resmessage . '<br /><br /></td>';
            echo '<td class = "td-2" >' . kunena_htmlspecialchars(stripslashes($result->name)) . '</td>';
            echo '<td class = "td-3" >' . date(_DATETIME, $result->time) . '</td></tr>';
            echo "\n";
        }
        ?>

                <?php 
        if ($totalRows > $limit) {
            ?>

                    <tr  class = "fb_sth" >
                        <th colspan = "3" style = "text-align:center" class = "th-1 <?php 
            echo $boardclass;
            ?>
sectiontableheader">
                            <?php 
            echo $pagination;
            ?>
                        </th>
                    </tr>

                <?php 
        }
        ?>

                <tr  class = "fb_sth" >
                   <th colspan = "3" style = "text-align:center" class = "th-1 <?php 
        echo $boardclass;
        ?>
sectiontableheader">
                        <?php 
        $resStart = $limitstart + 1;
        $resStop = $limitstart + count($results);
        if ($resStart < $resStop) {
            $resStartStop = (string) $resStart . ' - ' . (string) $resStop;
        } else {
            $resStartStop = '0';
        }
        printf(_FORUM_SEARCHRESULTS, $resStartStop, $totalRows);
        ?>
                    </th>
                </tr>
            </tbody>
        </table>
</div>
</div>
</div>
</div>
</div>
<?php 
    }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:101,代码来源:kunena.search.class.php


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