Exemple #1
0
    if (file_exists(KUNENA_ABSTMPLTPATH . '/fb_pathway.php')) {
        require_once KUNENA_ABSTMPLTPATH . '/fb_pathway.php';
    } else {
        require_once KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'fb_pathway.php';
    }
    ?>
<!-- / Pathway -->
<?php 
    if ($objCatInfo->headerdesc) {
        ?>
<div class="fb_forum-headerdesc"><?php 
        $smileyList = smile::getEmoticons(0);
        $headerdesc = stripslashes(smile::smileReplace($objCatInfo->headerdesc, 0, $fbConfig->disemoticons, $smileyList));
        $headerdesc = nl2br($headerdesc);
        //wordwrap:
        $headerdesc = smile::htmlwrap($headerdesc, $fbConfig->wrap);
        echo $headerdesc;
        ?>
</div>
<?php 
    }
    //(JJ)
    if (file_exists(KUNENA_ABSTMPLTPATH . '/fb_sub_category_list.php')) {
        include KUNENA_ABSTMPLTPATH . '/fb_sub_category_list.php';
    } else {
        include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'fb_sub_category_list.php';
    }
    ?>
    <!-- top nav -->

    <table border = "0" cellspacing = "0" class = "jr-topnav" cellpadding = "0">
Exemple #2
0
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
}
Exemple #3
0
 $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');
         }
     } else {
Exemple #4
0
$is_user = strtolower($kunena_my->usertype) != '';
// BEGIN: READ ANN
if ($do == "read") {
    $kunena_db->setQuery("SELECT id, title, sdescription, description, created, published, showdate FROM #__fb_announcement WHERE id='{$id}' AND published='1'");
    $anns_ = $kunena_db->loadObjectList();
    check_dberror("Unable to load announcements.");
    $ann = $anns_[0];
    $annID = $ann->id;
    $anntitle = stripslashes($ann->title);
    $smileyList = smile::getEmoticons(0);
    $annsdescription = stripslashes(smile::smileReplace($ann->sdescription, 0, $fbConfig->disemoticons, $smileyList));
    $annsdescription = nl2br($annsdescription);
    $annsdescription = smile::htmlwrap($annsdescription, $fbConfig->wrap);
    $anndescription = stripslashes(smile::smileReplace($ann->description, 0, $fbConfig->disemoticons, $smileyList));
    $anndescription = nl2br($anndescription);
    $anndescription = smile::htmlwrap($anndescription, $fbConfig->wrap);
    $anncreated = KUNENA_timeformat(strtotime($ann->created));
    $annpublished = $ann->published;
    $annshowdate = $ann->showdate;
    if ($annpublished > 0) {
        ?>

        <table class = "fb_blocktable" id = "fb_announcement" border = "0" cellspacing = "0" cellpadding = "0" width="100%">
            <thead>
                <tr>
                    <th>
                        <div class = "fb_title_cover fbm">
                            <span class = "fb_title fbl"> <?php 
        echo $app->getCfg('sitename');
        ?>
 <?php 
Exemple #5
0
 $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 {
     //user is not allowed to write a post
     if ($topicLocked == 1 || $forumLocked) {
         $msg_closed = _POST_LOCK_SET;
     } else {
         $msg_closed = _VIEW_DISABLED;
     }
Exemple #6
0
 if (sizeof($rows) == 0) {
     echo '' . _GEN_NOFORUMS . '';
 } else {
     foreach ($rows as $singlerow) {
         $obj_fb_cat = new jbCategory($kunena_db, $singlerow->id);
         $is_Mod = fb_has_moderator_permission($kunena_db, $obj_fb_cat, $kunena_my->id, $is_admin);
         if (in_array($singlerow->id, $allow_forum)) {
             //    $k=for alternating row colors:
             $k = 1 - $k;
             $numtopics = $singlerow->numTopics;
             $numreplies = $singlerow->numPosts;
             $lastPosttime = $singlerow->time_last_msg;
             $lastptime = KUNENA_timeformat(CKunenaTools::fbGetShowTime($singlerow->time_last_msg));
             $forumDesc = stripslashes(smile::smileReplace($singlerow->description, 0, $fbConfig->disemoticons, $smileyList));
             $forumDesc = nl2br($forumDesc);
             $forumDesc = smile::htmlwrap($forumDesc, $fbConfig->wrap);
             //    Get the forumsubparent categories :: get the subcategories here
             $kunena_db->setQuery("SELECT id, name, numTopics, numPosts FROM #__fb_categories WHERE parent='{$singlerow->id}' AND published='1' ORDER BY ordering");
             $forumparents = $kunena_db->loadObjectList();
             check_dberror("Unable to load categories.");
             foreach ($forumparents as $childnum => $childforum) {
                 if (!in_array($childforum->id, $allow_forum)) {
                     unset($forumparents[$childnum]);
                 }
             }
             $forumparents = array_values($forumparents);
             if ($kunena_my->id) {
                 //    get all threads with posts after the users last visit; don't bother for guests
                 $kunena_db->setQuery("SELECT DISTINCT thread FROM #__fb_messages WHERE catid='{$singlerow->id}' AND hold='0' AND moved='0' AND time>'{$prevCheck}' GROUP BY thread");
                 $newThreadsAll = $kunena_db->loadObjectList();
                 check_dberror("Unable to load messages.");
                echo '<sup><span class="newchar">&nbsp;(' . $newPostsAvailable . ' ' . stripslashes($fbConfig->newchar) . ")</span></sup>";
            }
            $cxThereisNewInForum = 0;
            if ($singlerow->locked) {
                echo isset($fbIcons['forumlocked']) ? '&nbsp;&nbsp;<img src="' . KUNENA_URLICONSPATH . $fbIcons['forumlocked'] . '" border="0" alt="' . _GEN_LOCKED_FORUM . '" title="' . _GEN_LOCKED_FORUM . '"/>' : '&nbsp;&nbsp;<img src="' . KUNENA_URLEMOTIONSPATH . 'lock.gif"  border="0" alt="' . _GEN_LOCKED_FORUM . '">';
                $lockedForum = 1;
            }
            if ($singlerow->review) {
                echo isset($fbIcons['forummoderated']) ? '&nbsp;&nbsp;<img src="' . KUNENA_URLICONSPATH . $fbIcons['forummoderated'] . '" border="0" alt="' . _GEN_MODERATED . '" title="' . _GEN_MODERATED . '"/>' : '&nbsp;&nbsp;<img src="' . KUNENA_URLEMOTIONSPATH . 'review.gif" border="0"  alt="' . _GEN_MODERATED . '"/>';
                $moderatedForum = 1;
            }
            echo '</div>';
            if ($forumDesc != "") {
                $tmpforumdesc = stripslashes(smile::smileReplace($forumDesc, 0, $fbConfig->disemoticons, $smileyList));
                $tmpforumdesc = nl2br($tmpforumdesc);
                $tmpforumdesc = smile::htmlwrap($tmpforumdesc, $fbConfig->wrap);
                echo '<div class="' . $boardclass . 'thead-desc  fbm">' . $tmpforumdesc . ' </div>';
            }
            if (count($forumparents) > 0) {
                if (count($forumparents) == 1) {
                    echo '<div class="' . $boardclass . 'thead-child  fbs"><b>' . _KUNENA_CHILD_BOARD . ' </b>';
                } else {
                    echo '<div class="' . $boardclass . 'thead-child  fbs"><b>' . _KUNENA_CHILD_BOARDS . ' </b>';
                }
                foreach ($forumparents as $forumparent) {
                    ?>

            <?php 
                    //Begin: parent read unread iconset
                    if ($fbConfig->showchildcaticon) {
                        //
    /**
     * Display results
     * @param string actionstring
     */
    function show()
    {
        $fbConfig =& CKunenaConfig::getInstance();
        extract($this->params);
        $q = implode(" ", $this->get_searchstrings());
        $searchuser = $this->get_searchusername();
        $limitstart = $this->get_limitstart();
        $limit = $this->get_limit();
        $selected = ' selected="selected"';
        $checked = ' checked="checked"';
        $fb_advsearch_hide = 1;
        if ($this->int_kunena_errornr) {
            $q = $this->searchword;
            $fb_advsearch_hide = 0;
        }
        if (file_exists(KUNENA_ABSTMPLTPATH . '/plugin/advancedsearch/advsearch.php')) {
            include KUNENA_ABSTMPLTPATH . '/plugin/advancedsearch/advsearch.php';
        } else {
            include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/advancedsearch/advsearch.php';
        }
        $results = $this->get_results();
        $totalRows = $this->total;
        $pagination = KunenaSearchPagination($this->func, $q, $this->getUrlParams(), floor($limitstart / $limit) + 1, $limit, floor($totalRows / $limit) + 1, 7);
        if (defined('KUNENA_DEBUG')) {
            echo '<p style="background-color:#FFFFCC;border:1px solid red;">' . $this->str_kunena_errormsg . '</p>';
        }
        ?>

<?php 
        if (empty($q) && empty($searchuser)) {
            return;
        }
        $boardclass = 'fb_';
        ?>
<div class="<?php 
        echo $boardclass;
        ?>
_bt_cvr1">
<div class="<?php 
        echo $boardclass;
        ?>
_bt_cvr2">
<div class="<?php 
        echo $boardclass;
        ?>
_bt_cvr3">
<div class="<?php 
        echo $boardclass;
        ?>
_bt_cvr4">
<div class="<?php 
        echo $boardclass;
        ?>
_bt_cvr5">
        <table  class = "fb_blocktable" id ="fb_forumsearch"  border = "0" cellspacing = "0" cellpadding = "0" width="100%">
            <thead>
                <tr>
                    <th colspan = "3">
                        <div class = "fb_title_cover">
                            <span class="fb_title fbl"><?php 
        echo _KUNENA_SEARCH_RESULTS;
        ?>
</span>
                            <b><?php 
        printf(_FORUM_SEARCH, $q);
        ?>
</b>
                        </div>
                    </th>
                </tr>
            </thead>

            <tbody>
                <tr class = "fb_sth">
                    <th class = "th-1 <?php 
        echo $boardclass;
        ?>
sectiontableheader">
<?php 
        echo _GEN_SUBJECT;
        ?>
                    </th>

                    <th class = "th-2 <?php 
        echo $boardclass;
        ?>
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));
            $ressubject = smile::htmlwrap($ressubject, $fbConfig->wrap);
            $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);
            $resmessage = smile::htmlwrap($resmessage, $fbConfig->wrap);
            $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_LIVEURLREL . '&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 
    }