Example #1
0
function showChildren($category, $prefix = "", &$allow_forum)
{
    $kunena_db =& JFactory::getDBO();
    $kunena_db->setQuery("SELECT id, name, parent FROM #__fb_categories WHERE parent='{$category}' AND published='1' ORDER BY ordering");
    $forums = $kunena_db->loadObjectList();
    check_dberror("Unable to load categories.");
    foreach ($forums as $forum) {
        if (in_array($forum->id, $allow_forum)) {
            echo "<option value=\"{$forum->id}\">{$prefix} " . kunena_htmlspecialchars($forum->name) . "</option>";
        }
        showChildren($forum->id, $prefix . "---", $allow_forum);
    }
}
Example #2
0
function KUNENA_GetAvailableForums($catid, $action, $options = array(), $disabled, $multiple = 0)
{
    $kunena_db =& JFactory::getDBO();
    $list = JJ_categoryArray();
    $this_treename = '';
    foreach ($list as $item) {
        if ($this_treename) {
            if ($item->id != $catid && strpos($item->treename, $this_treename) === false) {
                $options[] = JHTML::_('select.option', $item->id, kunena_htmlspecialchars($item->treename));
            }
        } else {
            if ($item->id != $catid) {
                $options[] = JHTML::_('select.option', $item->id, kunena_htmlspecialchars($item->treename));
            } else {
                $this_treename = "{$item->treename}/";
            }
        }
    }
    $tag_attribs = 'class="inputbox fbs" ' . ($multiple ? ' size="5" MULTIPLE ' : ' size="1" ') . ($disabled ? " disabled " : "");
    $parent = JHTML::_('select.genericlist', $options, 'catid', $tag_attribs, 'value', 'text', $catid, 'KUNENA_AvailableForums');
    return $parent;
}
Example #3
0
        echo $fbURL;
        ?>
"> <?php 
        echo kunena_htmlspecialchars(stripslashes($item->subject));
        ?>
 </a>

                </td>

                <td class = "td-3 fbm" align="left">

                        <a  class="fb-topic-cat fbm" href = "<?php 
        echo $fbCatURL;
        ?>
"> <?php 
        echo kunena_htmlspecialchars(stripslashes($item->catname));
        ?>
</a>

                </td>

                <td class = "td-4 fbm" align="center"><?php 
        echo $item->threadhits;
        ?>
                </td>

                <td class = "td-5  fbs" align="left">
                  <div class="fb-latest-subject-date fbs">
<?php 
        echo '' . date(_DATETIME, $item->time) . '';
        ?>
Example #4
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
}
Example #5
0
 function __construct($userid, $do = '')
 {
     $this->_app = JFactory::getApplication();
     $this->my = JFactory::getUser();
     $this->do = $do;
     if ($this->do == 'login') {
         return $this->login();
     } elseif ($this->do == 'logout') {
         return $this->logout();
     }
     kimport('html.parser');
     require_once KPATH_SITE . '/lib/kunena.timeformat.class.php';
     $this->_db = JFactory::getDBO();
     $this->config = KunenaFactory::getConfig();
     if (!$userid) {
         $this->user = $this->my;
     } else {
         $this->user = JFactory::getUser($userid);
     }
     if ($this->user->id == 0 || $this->my->id == 0 && !$this->config->pubprofile) {
         $this->allow = false;
         $this->header = JText::_('COM_KUNENA_LOGIN_NOTIFICATION');
         $this->body = JText::_('COM_KUNENA_PROFILEPAGE_NOT_ALLOWED_FOR_GUESTS') . ' ' . JText::_('COM_KUNENA_NO_ACCESS');
         CKunenaTools::loadTemplate('/login.php');
         return;
     }
     $integration = KunenaFactory::getProfile();
     $activityIntegration = KunenaFactory::getActivityIntegration();
     $template = KunenaFactory::getTemplate();
     $this->params = $template->params;
     if (get_class($integration) == 'KunenaProfileNone') {
         $this->allow = false;
         $this->header = JText::_('COM_KUNENA_PROFILE_DISABLED');
         $this->body = JText::_('COM_KUNENA_PROFILE_DISABLED') . ' ' . JText::_('COM_KUNENA_NO_ACCESS');
         CKunenaTools::loadTemplate('/login.php');
         return;
     }
     $this->allow = true;
     $this->profile = KunenaFactory::getUser($this->user->id);
     if (!$this->profile->exists()) {
         $this->profile->save();
     }
     if ($this->profile->userid == $this->my->id) {
         if ($this->do != 'edit') {
             $this->editlink = CKunenaLink::GetMyProfileLink($this->profile->userid, JText::_('COM_KUNENA_EDIT'), 'nofollow', 'edit');
         } else {
             $this->editlink = CKunenaLink::GetMyProfileLink($this->profile->userid, JText::_('COM_KUNENA_BACK'), 'nofollow');
         }
     }
     $this->name = $this->user->username;
     if ($this->config->userlist_name) {
         $this->name = $this->user->name . ' (' . $this->name . ')';
     }
     if ($this->config->showuserstats) {
         if ($this->config->userlist_usertype) {
             $this->usertype = $this->user->usertype;
         }
         $this->rank_image = $this->profile->getRank(0, 'image');
         $this->rank_title = $this->profile->getRank(0, 'title');
         $this->posts = $this->profile->posts;
         $this->userpoints = $activityIntegration->getUserPoints($this->profile->userid);
         $this->usermedals = $activityIntegration->getUserMedals($this->profile->userid);
     }
     if ($this->config->userlist_joindate || CKunenaTools::isModerator($this->my->id)) {
         $this->registerdate = $this->user->registerDate;
     }
     if ($this->config->userlist_lastvisitdate || CKunenaTools::isModerator($this->my->id)) {
         $this->lastvisitdate = $this->user->lastvisitDate;
     }
     $this->avatarlink = $this->profile->getAvatarLink('kavatar', 'profile');
     $this->personalText = $this->profile->personalText;
     $this->signature = $this->profile->signature;
     $this->timezone = $this->user->getParam('timezone', $this->_app->getCfg('offset', 0));
     $this->moderator = CKunenaTools::isModerator($this->profile->userid);
     $this->admin = CKunenaTools::isAdmin($this->profile->userid);
     switch ($this->profile->gender) {
         case 1:
             $this->genderclass = 'male';
             $this->gender = JText::_('COM_KUNENA_MYPROFILE_GENDER_MALE');
             break;
         case 2:
             $this->genderclass = 'female';
             $this->gender = JText::_('COM_KUNENA_MYPROFILE_GENDER_FEMALE');
             break;
         default:
             $this->genderclass = 'unknown';
             $this->gender = JText::_('COM_KUNENA_MYPROFILE_GENDER_UNKNOWN');
     }
     if ($this->profile->location) {
         $this->locationlink = '<a href="http://maps.google.com?q=' . kunena_htmlspecialchars($this->profile->location) . '" target="_blank">' . kunena_htmlspecialchars($this->profile->location) . '</a>';
     } else {
         $this->locationlink = JText::_('COM_KUNENA_LOCATION_UNKNOWN');
     }
     $this->online = $this->profile->isOnline();
     $this->showUnusedSocial = true;
     $avatar = KunenaFactory::getAvatarIntegration();
     $this->editavatar = is_a($avatar, 'KunenaAvatarKunena') ? true : false;
     kimport('userban');
     $this->banInfo = KunenaUserBan::getInstanceByUserid($userid, true);
     $this->canBan = $this->banInfo->canBan();
     if ($this->config->showbannedreason) {
         $this->banReason = $this->banInfo->reason_public;
     }
 }
Example #6
0
    function showCss($file, $option)
    {
        $f = fopen($file, "r");
        $content = fread($f, filesize($file));
        $content = kunena_htmlspecialchars($content);
        ?>
<div class="fbfunctitle"><?php 
        echo _KUNENA_CSSEDITOR;
        ?>
</div>
    <form action = "index2.php?" method = "post" name = "adminForm" class = "adminForm" id = "adminForm">


        <table cellpadding = "4" cellspacing = "0" border = "0" width = "100%" class = "adminform">
            <tr>
	                <th colspan = "4">
					<?php 
        echo _KUNENA_PATH;
        ?>
 <?php 
        echo $file;
        ?>
            </tr>

            <tr>
                <td>
                    <textarea cols = "100" rows = "20" name = "csscontent"><?php 
        echo $content;
        ?>
</textarea>
                </td>
            </tr>

            <tr>
                <td class = "error"><?php 
        echo _KUNENA_CSSERROR;
        ?>
                </td>
            </tr>
        </table>

        <input type = "hidden" name = "file" value = "<?php 
        echo $file;
        ?>
"/>

        <input type = "hidden" name = "option" value = "<?php 
        echo $option;
        ?>
"> <input type = "hidden" name = "task" value = ""> <input type = "hidden" name = "boxchecked" value = "0">
    </form>


<?php 
    }
Example #7
0
        $published = JRequest::getVar("published", 0);
        $showdate = JRequest::getVar("showdate", "");
        $kunena_db->setQuery("UPDATE #__fb_announcement SET title='{$title}', description='{$description}', sdescription='{$sdescription}',  created=" . ($created != '' ? "'{$created}'" : "NOW()") . ", published='{$published}', showdate='{$showdate}' WHERE id={$id}");
        if ($kunena_db->query()) {
            $app->redirect(CKunenaLink::GetAnnouncementURL($fbConfig, 'show'), _ANN_SUCCESS_EDIT);
        }
    }
    if ($do == "edit") {
        $kunena_db->setQuery("SELECT * FROM #__fb_announcement WHERE id='{$id}'");
        $anns = $kunena_db->loadObjectList();
        check_dberror("Unable to load announcements.");
        $ann = $anns[0];
        $annID = $ann->id;
        $anntitle = kunena_htmlspecialchars(stripslashes($ann->title));
        $annsdescription = kunena_htmlspecialchars(stripslashes($ann->sdescription));
        $anndescription = kunena_htmlspecialchars(stripslashes($ann->description));
        $anncreated = $ann->created;
        $annpublished = $ann->published;
        $annordering = $ann->ordering;
        $annshowdate = $ann->showdate;
        $calendar = JHTML::_('calendar', $anncreated, 'created', 'addcreated');
        //$document->addCustomTag('<link rel="stylesheet" type="text/css" media="all" href="' . JURI::root() . '/includes/js/calendar/calendar-mos.css" title="green" />');
        ?>
<script type = "text/javascript">
    <!--
    function validate_form()
    {
        valid = true;

        if (document.editform.title.value == "")
        {
Example #8
0
        <th class = "th-3 <?php 
echo $boardclass;
?>
sectiontableheader"  align = "center"><?php 
echo _GEN_DATE;
?>
</th>
    </tr>
</thead>
<tbody>
    <?php 
foreach ($tree as $leaf) {
    $leaf->name = kunena_htmlspecialchars($leaf->name);
    $leaf->subject = kunena_htmlspecialchars($leaf->subject);
    $leaf->email = kunena_htmlspecialchars($leaf->email);
    //get all html out of the subject & email & name before posting:
    ?>

        <tr class="fb_threadview_row">
            <?php 
    if ($fbConfig->shownew && $kunena_my->id != 0 && !$leaf->moved) {
        if ($prevCheck < $leaf->time && sizeof($read_topics) == 0 || !in_array($leaf->thread, $read_topics)) {
            //new post
            echo '<td width="1%" class="fb_new">';
            // echo isset($fbIcons['unreadmessage']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['unreadmessage'] . '" border="0" alt="' . _GEN_UNREAD . '" title="' . _GEN_UNREAD . '"/>' : $fbConfig->newchar;
            echo '</td>';
        } else {
            //not new posts
            echo '<td width="1%" class="fb_notnew">';
            // echo isset($fbIcons['readmessage']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['readmessage'] . '" border="0" alt="' . _GEN_NOUNREAD . '" title="' . _GEN_NOUNREAD . '"/>' : $fbConfig->newchar;
Example #9
0
}
?>

                </div>
            </td>
<!-- -->

        </tr>

	<tr><td class = "fb-msgview-right-b" >
		<div class="fb_message_editMarkUp_cover">
<?php 
if ($fmessage->modified_by) {
    echo '<span class="fb_message_editMarkUp">' . _KUNENA_EDITING_LASTEDIT . ': ' . date(_DATETIME, $fmessage->modified_time) . ' ' . _KUNENA_BY . ' ' . CKunenaTools::whoisID($fmessage->modified_by) . '.';
    if ($fmessage->modified_reason) {
        echo _KUNENA_REASON . ': ' . kunena_htmlspecialchars(stripslashes($fmessage->modified_reason));
    }
    echo '</span>';
}
if ($fbConfig->reportmsg && $kunena_my->id > 1) {
    echo '<span class="fb_message_informMarkUp">' . CKunenaLink::GetReportMessageLink($catid, $msg_id, _KUNENA_REPORT) . '</span>';
}
if (isset($msg_ip)) {
    echo '<span class="fb_message_informMarkUp">' . CKunenaLink::GetMessageIPLink($msg_ip) . '</span>';
}
?>
		</div>
		<div class="fb_message_buttons_cover">
			<div class="fb_message_buttons_row">
                <?php 
//we should only show the Quick Reply section to registered users. otherwise we are missing too much information!!
Example #10
0
                                                if (is_file(KUNENA_ABSCATIMAGESPATH . $forumparent->id . "_notlogin_childsmall.gif")) {
                                                    echo "<img src=\"" . KUNENA_URLCATIMAGES . $forumparent->id . "_notlogin_childsmall.gif\" border=\"0\" class='forum-cat-image' alt=\" \" />";
                                                } else {
                                                    echo isset($fbIcons['notloginforum']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['notloginforum_childsmall'] . '" border="0" alt="' . _GEN_FORUM_NOTNEW . '" title="' . _GEN_FORUM_NOTNEW . '" />' : stripslashes($fbConfig->newchar);
                                                }
                                                ?>

                                                    <?php 
                                            }
                                            //
                                        }
                                        // end: parent read unread iconset
                                        ?>

                                                    <?php 
                                        echo CKunenaLink::GetCategoryLink('showcat', $forumparent->id, kunena_htmlspecialchars(stripslashes($forumparent->name)));
                                        echo '<span class="fb_childcount fbs">(' . $forumparent->numTopics . "/" . $forumparent->numPosts . ')</span>';
                                    }
                                    echo "</div>";
                                }
                                ?>
                                                </div>
                                            </div>

                                        <?php 
                            }
                            //get the Moderator list for display
                            $kunena_db->setQuery("SELECT * FROM #__fb_moderation AS m LEFT JOIN #__users AS u ON u.id=m.userid WHERE m.catid='{$singlerow->id}'");
                            $modslist = $kunena_db->loadObjectList();
                            check_dberror("Unable to load moderators.");
                            // moderator list
Example #11
0
    /**
     * This function will write the TextArea
     */
    function fbWriteTextarea($areaname, $html, $width, $height, $useRte, $emoticons)
    {
        // well $html is the $message to edit, generally it means in PLAINTEXT @Kunena!
        global $editmode;
        // ERROR: mixed global $editmode
        $fbConfig =& CKunenaConfig::getInstance();
        // (JJ) JOOMLA STYLE CHECK
        if ($fbConfig->joomlastyle < 1) {
            $boardclass = "fb_";
        }
        ?>

        <tr class = "<?php 
        echo $boardclass;
        ?>
sectiontableentry1">
            <td class = "fb_leftcolumn" valign = "top">
                <strong><a href = "<?php 
        echo JRoute::_(KUNENA_LIVEURLREL . '&amp;func=faq') . '#boardcode';
        ?>
" target="_new"><?php 
        @(print _COM_BOARDCODE);
        ?>
</a></strong>:
            </td>

            <td>
                <table border = "0" cellspacing = "0" cellpadding = "0" class = "fb-postbuttonset">
                    <tr>
                        <td class = "fb-postbuttons">
							<input name="speicher" type="hidden" size="30" maxlength="100" />
							<input name="previewspeicher" type="hidden" size="30" maxlength="100" />
							<img class = "fb-bbcode" title = "Bold" accesskey = "b" name = "addbbcode0" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_bold.png" alt="B" onclick = "bbfontstyle('[b]', '[/b]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_BOLD);
        ?>
')" />
							<img class = "fb-bbcode" accesskey = "i" name = "addbbcode2" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_italic.png" alt="I" onclick = "bbfontstyle('[i]', '[/i]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_ITALIC);
        ?>
')" />
							<img class = "fb-bbcode" accesskey = "u" name = "addbbcode4" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_underline.png" alt="U" onclick = "bbfontstyle('[u]', '[/u]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_UNDERL);
        ?>
')" />
							<img class = "fb-bbcode" accesskey = "st" name = "addbbcode4" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_strike.png" alt="S" onclick = "bbfontstyle('[strike]', '[/strike]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_STRIKE);
        ?>
')" />
							<img class = "fb-bbcode" accesskey = "sub" name = "addbbcode4" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_sub.png" alt="Sub" onclick = "bbfontstyle('[sub]', '[/sub]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_SUB);
        ?>
')" />
							<img class = "fb-bbcode" accesskey = "sup" name = "addbbcode4" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_sup.png" alt="Sup" onclick = "bbfontstyle('[sup]', '[/sup]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_SUP);
        ?>
')" />
							<img class = "fb-bbcode" name = "addbbcode62" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_smallcaps.png" alt="<?php 
        @(print _SMILE_SIZE);
        ?>
" onclick = "bbfontstyle('[size=' + document.postform.addbbcode22.options[document.postform.addbbcode22.selectedIndex].value + ']', '[/size]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_FONTSIZE);
        ?>
')" />
							<select id = "fb-bbcode_size" class = "<?php 
        echo $boardclass;
        ?>
slcbox" name = "addbbcode22" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_FONTSIZESELECTION);
        ?>
')">
								<option value = "1"><?php 
        @(print _SIZE_VSMALL);
        ?>
</option>
								<option value = "2"><?php 
        @(print _SIZE_SMALL);
        ?>
</option>
								<option value = "3" selected = "selected"><?php 
        @(print _SIZE_NORMAL);
        ?>
</option>
								<option value = "4"><?php 
        @(print _SIZE_BIG);
        ?>
</option>
								<option value = "5"><?php 
        @(print _SIZE_VBIG);
        ?>
</option>
							</select>
							<img id="ueberschrift" class = "fb-bbcode" name = "addbbcode20" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
color_swatch.png" alt="<?php 
        @(print _SMILE_COLOUR);
        ?>
" onclick = "javascript:change_palette();" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_COLOR);
        ?>
')" />
							<?php 
        if ($fbConfig->showspoilertag) {
            ?>
							<img class = "fb-bbcode" accesskey = "s" name = "addbbcode40" src="<?php 
            echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
            ?>
spoiler.png" alt="Spoiler" onclick = "bbfontstyle('[spoiler]', '[/spoiler]')" onmouseover = "javascript:kunenaShowHelp('<?php 
            @(print _KUNENA_EDITOR_HELPLINE_SPOILER);
            ?>
')" />
							<?php 
        }
        ?>
							<img class = "fb-bbcode" accesskey = "h" name = "addbbcode24" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
group_key.png" alt="Hide" onclick = "bbfontstyle('[hide]', '[/hide]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_HIDE);
        ?>
')" />
							<img class = "fb-bbcode" alt="" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
spacer.png" style="cursor: auto;" />
							<img class = "fb-bbcode" accesskey = "k" name = "addbbcode10" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_list_bullets.png" alt="ul" onclick = "bbfontstyle('[ul]', '[/ul]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_UL);
        ?>
')" />
							<img class = "fb-bbcode" accesskey = "o" name = "addbbcode12" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_list_numbers.png" alt="ol" onclick = "bbfontstyle('[ol]', '[/ol]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_OL);
        ?>
')" />
							<img class = "fb-bbcode" accesskey = "l" name = "addbbcode18" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_list_none.png" alt="li" onclick = "bbfontstyle('[li]', '[/li]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_LI);
        ?>
')" />
							<img class = "fb-bbcode" accesskey = "left" name = "addbbcode4" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_align_left.png" alt="left" onclick = "bbfontstyle('[left]', '[/left]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_ALIGN_LEFT);
        ?>
')" />
							<img class = "fb-bbcode" accesskey = "center" name = "addbbcode4" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_align_center.png" alt="center" onclick = "bbfontstyle('[center]', '[/center]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_ALIGN_CENTER);
        ?>
')" />
							<img class = "fb-bbcode" accesskey = "right" name = "addbbcode4" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
text_align_right.png" alt="right" onclick = "bbfontstyle('[right]', '[/right]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_ALIGN_RIGHT);
        ?>
')" />
							<img class = "fb-bbcode" alt="" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
spacer.png" style="cursor: auto;" />
							<img class = "fb-bbcode" accesskey = "q" name = "addbbcode6" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
comment.png" alt="Quote" onclick = "bbfontstyle('[quote]', '[/quote]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_QUOTE);
        ?>
')" />
							<img class = "fb-bbcode" accesskey = "c" name = "addbbcode8" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
code.png" alt="Code" onclick = "bbfontstyle('[code]', '[/code]');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_CODE);
        ?>
')" />
							<img class = "fb-bbcode" alt="" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
spacer.png" style="cursor: auto;" />
							<img class = "fb-bbcode" accesskey = "p" name = "addbbcode14" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
picture_link.png" alt="Img" onclick = "javascript:dE('image');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_IMAGELINK);
        ?>
')" />
							<img class = "fb-bbcode" accesskey = "w" name = "addbbcode16" src="<?php 
        echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
        ?>
link_url.png" alt="URL" onclick = "javascript:dE('link');" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_LINK);
        ?>
')" />
							<?php 
        if ($fbConfig->showebaytag) {
            ?>
							<img class = "fb-bbcode" accesskey = "e" name = "addbbcode20" src="<?php 
            echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
            ?>
ebay.png" alt="Ebay" onclick = "bbfontstyle('[ebay]', '[/ebay]')" onmouseover = "javascript:kunenaShowHelp('<?php 
            @(print _KUNENA_EDITOR_HELPLINE_EBAY);
            ?>
')" />
							<?php 
        }
        ?>
							<?php 
        if ($fbConfig->showvideotag) {
            ?>
								&nbsp;<span style="white-space:nowrap;">
								<a href = "javascript:dE('video');" onmouseover = "javascript:kunenaShowHelp('<?php 
            @(print _KUNENA_EDITOR_HELPLINE_VIDEO);
            ?>
')"><img  src="<?php 
            echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
            ?>
film.png" alt="video"   /></a>
                              </span>
							<?php 
        }
        ?>
                        </td>
                    </tr>
<!-- start of extendable fiels -->
					<tr><td class = "fb-postbuttons">
						<div id="fb-color_palette" style="display: none;">
							<script type="text/javascript">
								function change_palette() {dE('fb-color_palette');}
								colorPalette('h', '4%', '15px');
							</script>
						</div>

						<div id="link" style="display: none;">
							<?php 
        @(print _KUNENA_EDITOR_LINK_URL);
        ?>
<input name="url" type="text" size="40" maxlength="100" value="http://" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_LINKURL);
        ?>
')" />
							<?php 
        @(print _KUNENA_EDITOR_LINK_TEXT);
        ?>
<input name="text2" type="text" size="30" maxlength="100" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_LINKTEXT);
        ?>
')" />
							<input type="button" name="Link" accesskey = "w" value="<?php 
        @(print _KUNENA_EDITOR_LINK_INSERT);
        ?>
""
								onclick="bbfontstyle('[url=' + this.form.url.value + ']'+ this.form.text2.value,'[/url]')" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_LINKAPPLY);
        ?>
')" />
						</div>

						<div id="image" style="display: none;">
							<?php 
        @(print _KUNENA_EDITOR_IMAGE_SIZE);
        ?>
<input name="size" type="text" size="10" maxlength="10" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_IMAGELINKSIZE);
        ?>
')" />
							<?php 
        @(print _KUNENA_EDITOR_IMAGE_URL);
        ?>
<input name="url2" type="text" size="40" maxlength="250" value="http://" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_IMAGELINKURL);
        ?>
')" />
							<input type="button" name="Link" accesskey = "p" value="<?php 
        @(print _KUNENA_EDITOR_IMAGE_INSERT);
        ?>
" onclick="check_image()" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_IMAGELINKAPPLY);
        ?>
')" />
							<script type="text/javascript">
								function check_image() {
									if (document.postform.size.value == "") {
										bbfontstyle('[img]'+ document.postform.url2.value,'[/img]');
									} else {
										bbfontstyle('[img size=' + document.postform.size.value + ']'+ document.postform.url2.value,'[/img]');
									}
								}
							</script>
						</div>

						<div id="video" style="display: none;">
							<?php 
        @(print _KUNENA_EDITOR_VIDEO_SIZE);
        ?>
<input name="videosize" type="text" size="5" maxlength="5" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_VIDEOSIZE);
        ?>
')" />
							<?php 
        @(print _KUNENA_EDITOR_VIDEO_WIDTH);
        ?>
<input name="videowidth" type="text" size="5" maxlength="5" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_VIDEOWIDTH);
        ?>
')" />
							<?php 
        @(print _KUNENA_EDITOR_VIDEO_HEIGHT);
        ?>
<input name="videoheight" type="text" size="5" maxlength="5" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_VIDEOHEIGHT);
        ?>
')" /> <br />
							<?php 
        @(print _KUNENA_EDITOR_VIDEO_PROVIDER);
        ?>
							<select name = "fb_vid_code1" class = "<?php 
        echo $boardclass;
        ?>
button" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_VIDEOPROVIDER);
        ?>
')">
								<?php 
        $vid_provider = array('', 'AnimeEpisodes', 'Biku', 'Bofunk', 'Break', 'Clip.vn', 'Clipfish', 'Clipshack', 'Collegehumor', 'Current', 'DailyMotion', 'DivX,divx]http://', 'DownloadFestival', 'Flash,flash]http://', 'FlashVars,flashvars param=]http://', 'Fliptrack', 'Fliqz', 'Gametrailers', 'Gamevideos', 'Glumbert', 'GMX', 'Google', 'GooglyFoogly', 'iFilm', 'Jumpcut', 'Kewego', 'LiveLeak', 'LiveVideo', 'MediaPlayer,mediaplayer]http://', 'MegaVideo', 'Metacafe', 'Mofile', 'Multiply', 'MySpace', 'MyVideo', 'QuickTime,quicktime]http://', 'Quxiu', 'RealPlayer,realplayer]http://', 'Revver', 'RuTube', 'Sapo', 'Sevenload', 'Sharkle', 'Spikedhumor', 'Stickam', 'Streetfire', 'StupidVideos', 'Toufee', 'Tudou', 'Unf-Unf', 'Uume', 'Veoh', 'VideoclipsDump', 'Videojug', 'VideoTube', 'Vidiac', 'VidiLife', 'Vimeo', 'WangYou', 'WEB.DE', 'Wideo.fr', 'YouKu', 'YouTube');
        foreach ($vid_provider as $vid_type) {
            $vid_type = explode(',', $vid_type);
            echo '<option value = "' . (!empty($vid_type[1]) ? $vid_type[1] : strtolower($vid_type[0]) . '') . '">' . $vid_type[0] . '</option>';
        }
        ?>
							</select>
							<?php 
        @(print _KUNENA_EDITOR_VIDEO_ID);
        ?>
<input name="videoid" type="text" size="11" maxlength="11" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_VIDEOID);
        ?>
')" />
							<input type="button" name="Video" accesskey = "p" value="<?php 
        @(print _KUNENA_EDITOR_IMAGE_INSERT);
        ?>
" onclick="check_video('video1')" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_VIDEOAPPLY1);
        ?>
')" /><br />
							<?php 
        @(print _KUNENA_EDITOR_VIDEO_URL);
        ?>
<input name="videourl" type="text" size="30" maxlength="250" value="http://" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_VIDEOURL);
        ?>
')" />
							<input type="button" name="Video" accesskey = "p" value="<?php 
        @(print _KUNENA_EDITOR_IMAGE_INSERT);
        ?>
" onclick="check_video('video2')" onmouseover = "javascript:kunenaShowHelp('<?php 
        @(print _KUNENA_EDITOR_HELPLINE_VIDEOAPPLY2);
        ?>
')" />
							<script type="text/javascript">
								function check_video(art) {
									var video;
									if (document.postform.videosize.value != "") {video = " size=" + document.postform.videosize.value;}
									else {video=""}
									if (document.postform.videowidth.value != "") {video = video + " width=" + document.postform.videowidth.value;}
									if (document.postform.videoheight.value != "") {video = video + " height=" + document.postform.videoheight.value;}
									if (art=='video1'){
									if (document.postform.fb_vid_code1.value != "") {video = video + " type=" + document.postform.fb_vid_code1.options[document.postform.fb_vid_code1.selectedIndex].value;}
									bbfontstyle('[video' + video + ']'+ document.postform.videoid.value,'[/video]');}
									else {bbfontstyle('[video' + video + ']'+ document.postform.videourl.value,'[/video]');}
								}
							</script>
						</div>

						<div id="smilie" style="display: none;">
							<?php 
        $kunena_db =& JFactory::getDBO();
        $kunena_db->setQuery("SELECT code, location, emoticonbar FROM #__fb_smileys ORDER BY id");
        if ($kunena_db->query()) {
            $rowset = array();
            $set = $kunena_db->loadAssocList();
            foreach ($set as $smilies) {
                $key_exists = false;
                foreach ($rowset as $check) {
                    //checks if the smiley (location) already exists with another code
                    if ($check['location'] == $smilies['location']) {
                        $key_exists = true;
                    }
                }
                if ($key_exists == false) {
                    $rowset[] = array('code' => $smilies['code'], 'location' => $smilies['location'], 'emoticonbar' => $smilies['emoticonbar']);
                }
            }
            reset($rowset);
            foreach ($rowset as $data) {
                echo '<img class="btnImage" src="' . KUNENA_URLEMOTIONSPATH . $data['location'] . '" border="0" alt="' . $data['code'] . ' " title="' . $data['code'] . ' " onclick="bbfontstyle(\' ' . $data['code'] . ' \',\'\')" style="cursor:pointer"/>' . "\n";
            }
        }
        ?>
					</div>

					</td></tr>
<!-- end of extendable fiels -->
                    <tr>
                        <td class = "<?php 
        echo $boardclass;
        ?>
posthint">
                            <input type = "text" name = "helpbox" size = "45" class = "<?php 
        echo $boardclass;
        ?>
inputbox" maxlength = "100" value = "<?php 
        @(print _KUNENA_EDITOR_HELPLINE_HINT);
        ?>
" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>

        <tr class = "<?php 
        echo $boardclass;
        ?>
sectiontableentry2">
            <td valign = "top" class = "fb_leftcolumn">
                <strong><?php 
        @(print _MESSAGE);
        ?>
</strong>:<br />
               <b onclick = "size_messagebox(100);" style="cursor:pointer">(+)</b><b> / </b><b onclick = "size_messagebox(-100);" style="cursor:pointer">(-)</b>
                <?php 
        if ($emoticons != 1) {
            ?>

                    <br/>

                    <br/>

                    <div align = "right">
                        <table border = "0" cellspacing = "3" cellpadding = "0">
                            <tr>
                                <td colspan = "4" style = "text-align: center;">
                                    <strong><?php 
            @(print _GEN_EMOTICONS);
            ?>
</strong>
                                </td>
                            </tr>

                            <?php 
            generate_smilies();
            //the new function Smiley mod
            ?>
                        </table>
                    </div>

                <?php 
        }
        ?>
            </td>

            <td valign = "top">
                <textarea cols="60" rows="6" class = "<?php 
        echo $boardclass;
        ?>
txtarea" name = "<?php 
        echo $areaname;
        ?>
" id = "<?php 
        echo $areaname;
        ?>
"><?php 
        echo kunena_htmlspecialchars($html, ENT_QUOTES);
        ?>
</textarea>
<?php 
        if ($editmode) {
            // Moderator edit area
            ?>
     <fieldset>
     <legend><?php 
            @(print _KUNENA_EDITING_REASON);
            ?>
</legend>
        <input name="modified_reason" size="40" maxlength="200"  type="text" /><br />

     </fieldset>
<?php 
        }
        ?>
            </td>
        </tr>

<?php 
    }
Example #12
0
}
if ($func == "mylatest") {
    $document->setTitle(_KUNENA_MY_DISCUSSIONS . ' - ' . stripslashes($fbConfig->board_title));
    $query = "SELECT count(distinct tmp.thread) FROM\n\t\t\t\t(SELECT thread\n\t\t\t\t\tFROM #__fb_messages\n\t\t\t\t\tWHERE userid={$kunena_my->id} AND hold=0 AND moved=0 AND catid IN ({$fbSession->allowed})\n\t\t\t\tUNION ALL\n\t\t\t\t SELECT m.thread As thread\n\t\t\t\t\tFROM #__fb_messages AS m\n\t\t\t\t\tJOIN #__fb_favorites AS f ON m.thread = f.thread\n\t\t\t\t\tWHERE f.userid={$kunena_my->id} AND m.parent = 0 AND hold=0 and moved=0 AND catid IN ({$fbSession->allowed})) AS tmp";
} else {
    $document->setTitle(_KUNENA_ALL_DISCUSSIONS . ' - ' . stripslashes($fbConfig->board_title));
    $query = "Select count(distinct thread) FROM #__fb_messages WHERE time >'{$querytime}'" . " AND hold=0 AND moved=0 AND catid IN ({$fbSession->allowed})" . $latestcats;
    // if categories are limited apply filter
}
$kunena_db->setQuery($query);
$total = (int) $kunena_db->loadResult();
check_dberror('Unable to count total threads');
$totalpages = ceil($total / $threads_per_page);
//meta description and keywords
$metaKeys = kunena_htmlspecialchars(stripslashes(_KUNENA_ALL_DISCUSSIONS . ", {$fbConfig->board_title}, " . $app->getCfg('sitename')));
$metaDesc = kunena_htmlspecialchars(stripslashes(_KUNENA_ALL_DISCUSSIONS . " ({$page}/{$totalpages}) - {$fbConfig->board_title}"));
$document =& JFactory::getDocument();
$cur = $document->get('description');
$metaDesc = $cur . '. ' . $metaDesc;
$document =& JFactory::getDocument();
$document->setMetadata('robots', 'noindex, follow');
$document->setMetadata('keywords', $metaKeys);
$document->setDescription($metaDesc);
if ($func == "mylatest") {
    $order = "myfavorite DESC, lastid DESC";
    $query = "SELECT m.thread, MAX(m.id) as lastid, MAX(t.fav) AS myfavorite FROM (\n\t\t\tSELECT thread, 0 AS fav\n\t\t\tFROM #__fb_messages\n\t\t\tWHERE userid='{$kunena_my->id}' AND moved='0' AND hold='0' AND catid IN ({$fbSession->allowed})\n\t\t\tGROUP BY thread\n\t\tUNION ALL\n\t\t\tSELECT thread, 1 AS fav FROM #__fb_favorites WHERE userid='{$kunena_my->id}'\n\t\t) AS t\n\t\tINNER JOIN #__fb_messages AS m ON m.thread=t.thread\n\t\tWHERE m.moved='0' AND m.hold='0' AND m.catid IN ({$fbSession->allowed})\n\t\tGROUP BY thread\n\t\tORDER BY {$order}\n\t";
} else {
    $order = "lastid DESC";
    $query = "SELECT thread, MAX(id) AS lastid FROM #__fb_messages WHERE time>'{$querytime}' AND hold='0' AND moved='0' AND catid IN ({$fbSession->allowed})\n\t\tGROUP BY thread\n\t\tORDER BY {$order}\n\t";
}
$kunena_db->setQuery($query, $offset, $threads_per_page);
Example #13
0
        <image>
	        <url><?php 
echo KUNENA_URLEMOTIONSPATH;
?>
rss.gif</url>
	        <title>Powered by Kunena</title>
	        <link><?php 
echo JURI::root();
?>
</link>
	        <description>Kunena Site Syndication</description>
        </image>
<?php 
foreach ($rows as $row) {
    echo "        <item>\n";
    echo "            <title>" . _GEN_SUBJECT . ": " . stripslashes(kunena_htmlspecialchars($row->subject)) . " - " . _GEN_BY . ": " . stripslashes(kunena_htmlspecialchars($row->lastpostname)) . "</title>" . "\n";
    echo "            <link>";
    $uri =& JURI::getInstance(JURI::base());
    $itemlink = $uri->toString(array('scheme', 'host', 'port')) . CKunenaLink::GetThreadPageURL($fbConfig, 'view', $row->catid, $row->thread, ceil($row->numberposts / $fbConfig->messages_per_page), $fbConfig->messages_per_page, $row->lastpostid);
    echo $itemlink;
    echo "</link>\n";
    $words = $row->lastpostmessage;
    $words = smile::purify($words);
    echo "            <description>" . kunena_htmlspecialchars($words) . "</description>" . "\n";
    echo "            <pubDate>" . date('r', $row->lastposttime) . "</pubDate>" . "\n";
    echo "        </item>\n";
}
?>
    </channel>
</rss>
Example #14
0
                            <td class = "td-6">
                                <div class = "fb-latest-subject-date fbs">
<?php 
        echo $leaf->moved ? _KUNENA_TOPIC_MOVED_LONG : date(_DATETIME, $last_reply[$leaf->id]->time);
        ?>

<?php 
        if ($leaf->moved) {
        } else {
            ?>

<?php 
            echo _GEN_BY;
            ?>
 <?php 
            echo CKunenaLink::GetProfileLink($fbConfig, $last_reply[$leaf->id]->userid, kunena_htmlspecialchars(stripslashes($last_reply[$leaf->id]->name)));
            ?>

<?php 
        }
        ?>

    <?php 
        $tmpicon = '';
        if (!$leaf->moved) {
            $tmpicon = isset($fbIcons['latestpost']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['latestpost'] . '" border="0" alt="' . _SHOW_LAST . '" />' : '  <img src="' . KUNENA_URLEMOTIONSPATH . 'icon_newest_reply.gif" border="0"  alt="' . _SHOW_LAST . '" title="' . _SHOW_LAST . '" />';
        }
        echo CKunenaLink::GetThreadPageLink($fbConfig, 'view', $leaf->catid, $leaf->id, $threadPages, $fbConfig->messages_per_page, $tmpicon, $last_reply[$leaf->id]->id);
        ?>
                                </div>
                            </td>
Example #15
0
     $msg_aim = isset($fbIcons['msgaim']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['msgaim'] . '" border="0" alt="' . kunena_htmlspecialchars(stripslashes($userinfo->AIM)) . '" title="AIM: ' . kunena_htmlspecialchars(stripslashes($userinfo->AIM)) . '" />' : 'AIM: ' . kunena_htmlspecialchars(stripslashes($userinfo->AIM)) . '';
 }
 if ($userinfo->MSN != '') {
     $msg_msn = isset($fbIcons['msgmsn']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['msgmsn'] . '" border="0" alt="' . kunena_htmlspecialchars(stripslashes($userinfo->MSN)) . '" title="MSN: ' . kunena_htmlspecialchars(stripslashes($userinfo->MSN)) . '" />' : 'MSN: ' . kunena_htmlspecialchars(stripslashes($userinfo->MSN)) . '';
 }
 if ($userinfo->YIM != '') {
     $msg_yim = isset($fbIcons['msgyim']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['msgyim'] . '" border="0" alt="' . kunena_htmlspecialchars(stripslashes($userinfo->YIM)) . '" title="YIM: ' . kunena_htmlspecialchars(stripslashes($userinfo->YIM)) . '" />' : ' YIM: ' . kunena_htmlspecialchars(stripslashes($userinfo->YIM)) . '';
 }
 if ($userinfo->SKYPE != '') {
     $msg_skype = isset($fbIcons['msgskype']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['msgskype'] . '" border="0" alt="' . kunena_htmlspecialchars(stripslashes($userinfo->SKYPE)) . '" title="SKYPE: ' . kunena_htmlspecialchars(stripslashes($userinfo->SKYPE)) . '" />' : 'SKYPE: ' . kunena_htmlspecialchars(stripslashes($userinfo->SKYPE)) . '';
 }
 if ($userinfo->GTALK != '') {
     $msg_gtalk = isset($fbIcons['msggtalk']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['msggtalk'] . '" border="0" alt="' . kunena_htmlspecialchars(stripslashes($userinfo->GTALK)) . '" title="GTALK: ' . kunena_htmlspecialchars(stripslashes($userinfo->GTALK)) . '" />' : 'GTALK: ' . kunena_htmlspecialchars(stripslashes($userinfo->GTALK)) . '';
 }
 if ($userinfo->websiteurl != '') {
     $msg_website = isset($fbIcons['msgwebsite']) ? '<a href="http://' . kunena_htmlspecialchars(stripslashes($userinfo->websiteurl)) . '" target="_blank"><img src="' . KUNENA_URLICONSPATH . $fbIcons['msgwebsite'] . '" border="0" alt="' . kunena_htmlspecialchars(stripslashes($userinfo->websitename)) . '" title="' . kunena_htmlspecialchars(stripslashes($userinfo->websitename)) . '" /></a>' : '<a href="http://' . kunena_htmlspecialchars(stripslashes($userinfo->websiteurl)) . '" target="_blank">' . kunena_htmlspecialchars(stripslashes($userinfo->websitename)) . '</a>';
 }
 // Finish: Additional Info //
 //Show admins the IP address of the user:
 if ($is_Moderator) {
     $msg_ip = $fmessage->ip;
 }
 $fb_subject_txt = $fmessage->subject;
 $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);
Example #16
0
 function TagSingleLate(&$tag_new, &$task, $tag)
 {
     # Function replaces TAGs with corresponding
     if ($task->in_code) {
         return TAGPARSER_RET_NOTHING;
     }
     if ($task->in_noparse) {
         return TAGPARSER_RET_NOTHING;
     }
     switch (strtolower($tag->name)) {
         // Replace unclosed img tag
         case 'img':
             $task->autolink_disable--;
             # continue autolink conversion
             // kunena_htmlspecialchars($tag->options['default'], ENT_QUOTES)
             if (!isset($tag->options['name'])) {
                 break;
             }
             $tag_new = "<img class='c_img' BORDER='0' src='" . kunena_htmlspecialchars($tag->options['name'], ENT_QUOTES) . "'";
             if (isset($tag->options['width'])) {
                 $tag->options['width'] = (int) $tag->options['width'];
                 $tag_new .= " width='" . $tag->options['width'] . "'";
             }
             if (isset($tag->options['height'])) {
                 $tag->options['height'] = (int) $tag->options['height'];
                 $tag_new .= " height='" . $tag->options['height'] . "'";
             }
             if (isset($tag->options['left'])) {
                 $tag_new .= " align='left'";
             } else {
                 if (isset($tag->options['right'])) {
                     $tag_new .= " align='right'";
                 }
             }
             $tag_new .= " border='0'";
             $tag_new .= ">";
             return TAGPARSER_RET_REPLACED;
             break;
         default:
             break;
     }
     return TAGPARSER_RET_NOTHING;
 }
Example #17
0
function fbTreeRecurse($id, $indent, $list, &$children, $maxlevel = 9999, $level = 0, $type = 1)
{
    if (isset($children[$id]) && $level <= $maxlevel) {
        foreach ($children[$id] as $v) {
            $id = $v->id;
            if (KUNENA_JOOMLA_COMPAT >= '1.6') {
                $pre = '- ';
                $spacer = '- ';
            } elseif ($type) {
                $pre = '&nbsp;';
                $spacer = '...';
            } else {
                $pre = '- ';
                $spacer = '&nbsp;&nbsp;';
            }
            if ($v->parent == 0) {
                $txt = kunena_htmlspecialchars($v->name);
            } else {
                $txt = $pre . kunena_htmlspecialchars($v->name);
            }
            $pt = $v->parent;
            $list[$id] = $v;
            $list[$id]->treename = $indent . $txt;
            $list[$id]->children = !empty($children[$id]) ? count($children[$id]) : 0;
            $list[$id]->section = $v->parent == 0;
            $list = fbTreeRecurse($id, $indent . $spacer, $list, $children, $maxlevel, $level + 1, $type);
        }
    }
    return $list;
}
Example #18
0
 function getView()
 {
     // Is user allowed to read category from the URL?
     if ($this->catid && !$this->session->canRead($this->catid)) {
         return;
     }
     $this->allow = 1;
     $where[] = "a.hold IN ({$this->hold})";
     $where = implode(' AND ', $where);
     $query = "SELECT a.*, b.*, p.id AS poll_id, modified.name AS modified_name, modified.username AS modified_username\n\t\t\tFROM #__kunena_messages AS a\n\t\t\tLEFT JOIN #__kunena_messages_text AS b ON a.id=b.mesid\n\t\t\tLEFT JOIN #__users AS modified ON a.modified_by = modified.id\n\t\t\tLEFT JOIN #__kunena_polls AS p ON a.id=p.threadid\n\t\t\tWHERE a.id={$this->db->Quote($this->id)} AND {$where}";
     $this->db->setQuery($query);
     $this->first_message = $this->db->loadObject();
     // Invalid message id (deleted, on hold?)
     if (KunenaError::checkDatabaseError() || !$this->first_message) {
         return;
     }
     // Is user allowed to see the forum specified in the message?
     if (!$this->session->canRead($this->first_message->catid)) {
         $this->allow = 0;
         return;
     }
     $this->thread = $this->first_message->thread;
     // Test if this is a valid URL. If not, redirect browser to the right location
     if ($this->first_message->moved || $this->thread != $this->id || $this->catid != $this->first_message->catid) {
         $this->catid = $this->first_message->catid;
         if ($this->first_message->moved) {
             $newurl = array();
             parse_str($this->first_message->message, $newloc);
             $this->id = $newloc['id'];
             $query = "SELECT catid, thread FROM #__kunena_messages AS a WHERE a.id='{$this->id}'";
             $this->db->setQuery($query);
             $newpos = $this->db->loadObject();
             if (!$newpos) {
                 $this->allow = 0;
                 return;
             }
             if (KunenaError::checkDatabaseError()) {
                 return;
             }
             $this->thread = $newpos->thread;
             $this->catid = $newpos->catid;
         }
         // This query to calculate the page this reply is sitting on within this thread
         $query = "SELECT COUNT(*) FROM #__kunena_messages AS a WHERE a.thread={$this->db->Quote($this->thread)} AND {$where} AND a.id<={$this->db->Quote($this->id)}";
         $this->db->setQuery($query);
         $replyCount = $this->db->loadResult();
         if (KunenaError::checkDatabaseError()) {
             return;
         }
         $replyPage = $replyCount > $this->config->messages_per_page ? ceil($replyCount / $this->config->messages_per_page) : 1;
         $this->redirect = CKunenaLink::GetThreadPageURL('view', $this->catid, $this->thread, $replyPage, $this->config->messages_per_page, $this->first_message->id, false);
     }
     //Get the category name for breadcrumb
     $this->db->setQuery("SELECT * FROM #__kunena_categories WHERE id={$this->db->Quote($this->catid)}");
     $this->catinfo = $this->db->loadObject();
     if (KunenaError::checkDatabaseError()) {
         return;
     }
     //Get Parent's cat.name for breadcrumb
     $this->db->setQuery("SELECT id, name FROM #__kunena_categories WHERE id={$this->db->Quote($this->catinfo->parent)}");
     $objCatParentInfo = $this->db->loadObject();
     if (KunenaError::checkDatabaseError()) {
         return;
     }
     // START
     $this->emoticons = smile::getEmoticons(0);
     $this->prevCheck = $this->session->lasttime;
     $this->read_topics = explode(',', $this->session->readtopics);
     $showedEdit = 0;
     $this->kunena_forum_locked = $this->catinfo->locked;
     //check if topic is locked
     $this->topicLocked = $this->first_message->locked;
     if (!$this->topicLocked) {
         //topic not locked; check if forum is locked
         $this->topicLocked = $this->catinfo->locked;
     }
     $this->topicSticky = $this->first_message->ordering;
     CKunenaTools::markTopicRead($this->thread, $this->my->id);
     //update the hits counter for this topic & exclude the owner
     if ($this->my->id == 0 || $this->first_message->userid != $this->my->id) {
         $this->db->setQuery("UPDATE #__kunena_messages SET hits=hits+1 WHERE id={$this->db->Quote($this->thread)} AND parent='0'");
         $this->db->query();
         KunenaError::checkDatabaseError();
     }
     $query = "SELECT COUNT(*) FROM #__kunena_messages AS a WHERE a.thread={$this->db->Quote($this->thread)} AND {$where}";
     $this->db->setQuery($query);
     $this->total_messages = $this->db->loadResult();
     KunenaError::checkDatabaseError();
     // If page does not exist, redirect to the last page
     if ($this->total_messages <= $this->limitstart) {
         $page = ceil($this->total_messages / $this->limit);
         $this->redirect = CKunenaLink::GetThreadPageURL('view', $this->catid, $this->id, $page, $this->limit, '', false);
     }
     $maxpages = 7 - 2;
     // odd number here (show - 2)
     $totalpages = ceil($this->total_messages / $this->limit);
     $page = floor($this->limitstart / $this->limit) + 1;
     $firstpage = 1;
     if ($this->ordering == 'desc') {
         $firstpage = $totalpages;
     }
     // Get replies of current thread
     $query = "SELECT a.*, b.*, modified.name AS modified_name, modified.username AS modified_username\n\t\t\t\t\tFROM #__kunena_messages AS a\n\t\t\t\t\tLEFT JOIN #__kunena_messages_text AS b ON a.id=b.mesid\n\t\t\t\t\tLEFT JOIN #__users AS modified ON a.modified_by = modified.id\n\t\t\t\t\tWHERE a.thread={$this->db->Quote($this->thread)} AND {$where}\n\t\t\t\t\tORDER BY id {$this->ordering}";
     $this->db->setQuery($query, $this->limitstart, $this->limit);
     $this->messages = (array) $this->db->loadObjectList('id');
     KunenaError::checkDatabaseError();
     // First collect the message ids of the first message and all replies
     $messageids = array();
     $this->threaded = array();
     $userlist = array();
     foreach ($this->messages as $message) {
         $messageids[] = $message->id;
         // Threaded ordering
         if (isset($this->messages[$message->parent])) {
             $this->threaded[$message->parent][] = $message->id;
         } else {
             $this->threaded[0][] = $message->id;
         }
         $userlist[intval($message->userid)] = intval($message->userid);
         $userlist[intval($message->modified_by)] = intval($message->modified_by);
     }
     if (!isset($this->messages[$this->mesid])) {
         $this->mesid = reset($messageids);
     }
     if ($this->layout != 'view') {
         if (!isset($this->messages[$this->id])) {
             $this->messages = $this->getThreadedOrdering(0, array('edge'));
         } else {
             $this->messages = $this->getThreadedOrdering();
         }
     }
     // create a list of ids we can use for our sql
     $idstr = @join(",", $messageids);
     // Load attachments
     require_once KUNENA_PATH_LIB . '/kunena.attachments.class.php';
     $attachments = CKunenaAttachments::getInstance();
     if (is_a($attachments, 'CKunenaAttachments')) {
         $message_attachments = $attachments->get($idstr);
         // Now that we have all relevant messages in messages, asign any matching attachments
         foreach ($this->messages as $message) {
             // Mark as new
             if ($this->my->id && $this->prevCheck < $message->time && !in_array($message->thread, $this->read_topics)) {
                 $message->new = true;
             } else {
                 $message->new = false;
             }
             // Assign attachments
             if (isset($message_attachments[$message->id])) {
                 $message->attachments = $message_attachments[$message->id];
             }
         }
         // Done with attachments
     }
     $this->pagination = $this->getPagination($this->catid, $this->thread, $page, $totalpages, $maxpages);
     //meta description and keywords
     $metaKeys = kunena_htmlspecialchars("{$this->first_message->subject}, {$objCatParentInfo->name}, {$this->config->board_title}, " . JText::_('COM_KUNENA_GEN_FORUM') . ', ' . $this->app->getCfg('sitename'));
     // Create Meta Description form the content of the first message
     // better for search results display but NOT for search ranking!
     $metaDesc = KunenaParser::stripBBCode($this->first_message->message);
     $metaDesc = strip_tags($metaDesc);
     // Now remove all tags
     $metaDesc = preg_replace('/\\s+/', ' ', $metaDesc);
     // remove newlines
     $metaDesc = preg_replace('/^[^\\w0-9]+/', '', $metaDesc);
     // remove characters at the beginning that are not letters or numbers
     $metaDesc = trim($metaDesc);
     // Remove trailing spaces and beginning
     // remove multiple spaces
     while (strpos($metaDesc, '  ') !== false) {
         $metaDesc = str_replace('  ', ' ', $metaDesc);
     }
     // limit to 185 characters - google will cut off at ~150
     if (strlen($metaDesc) > 185) {
         $metaDesc = rtrim(JString::substr($metaDesc, 0, 182)) . '...';
     }
     $metaDesc = htmlspecialchars($metaDesc);
     $document =& JFactory::getDocument();
     $document->setMetadata('keywords', $metaKeys);
     $document->setDescription($metaDesc);
     $this->layout_buttons = array();
     if ($this->config->enable_threaded_layouts) {
         if ($this->layout != 'view') {
             $this->layout_buttons[] = CKunenaLink::GetThreadLayoutLink('flat', $this->catid, $this->thread, $this->mesid, CKunenaTools::showButton('layout-flat', JText::_('COM_KUNENA_BUTTON_LAYOUT_FLAT')), $this->limitstart, $this->limit, JText::_('COM_KUNENA_BUTTON_LAYOUT_FLAT_LONG'), 'nofollow', 'kicon-button kbuttonuser btn-left');
         }
         if ($this->layout != 'threaded') {
             $this->layout_buttons[] = CKunenaLink::GetThreadLayoutLink('threaded', $this->catid, $this->thread, $this->mesid, CKunenaTools::showButton('layout-threaded', JText::_('COM_KUNENA_BUTTON_LAYOUT_THREADED')), $this->limitstart, $this->limit, JText::_('COM_KUNENA_BUTTON_LAYOUT_THREADED_LONG'), 'nofollow', 'kicon-button kbuttonuser btn-left');
         }
         if ($this->layout != 'indented') {
             $this->layout_buttons[] = CKunenaLink::GetThreadLayoutLink('indented', $this->catid, $this->thread, $this->mesid, CKunenaTools::showButton('layout-indented', JText::_('COM_KUNENA_BUTTON_LAYOUT_INDENTED')), $this->limitstart, $this->limit, JText::_('COM_KUNENA_BUTTON_LAYOUT_INDENTED_LONG'), 'nofollow', 'kicon-button kbuttonuser btn-left');
         }
     }
     //Perform subscriptions check only once
     $this->cansubscribe = 0;
     if ($this->config->allowsubscriptions && $this->config->topic_subscriptions != 'disabled' && $this->my->id) {
         $this->db->setQuery("SELECT thread, future1 FROM #__kunena_subscriptions WHERE userid={$this->db->Quote($this->my->id)} AND thread={$this->db->Quote($this->thread)}");
         $fb_subscribed = $this->db->loadObject();
         KunenaError::checkDatabaseError();
         if (!$fb_subscribed) {
             $this->cansubscribe = 1;
         } elseif ($fb_subscribed->future1 == 1) {
             $query_thread = "UPDATE #__kunena_subscriptions\n\t\t\t\t\tSET future1=0 WHERE thread={$this->db->Quote($this->thread)} AND userid={$this->db->Quote($this->my->id)}";
             $this->db->setQuery($query_thread);
             $this->db->query();
         }
     }
     //Perform favorites check only once
     $fb_canfavorite = 0;
     $this->db->setQuery("SELECT MAX(userid={$this->db->Quote($this->my->id)}) AS favorited, COUNT(*) AS totalfavorited FROM #__kunena_favorites WHERE thread={$this->db->Quote($this->thread)}");
     list($this->favorited, $this->totalfavorited) = $this->db->loadRow();
     KunenaError::checkDatabaseError();
     if ($this->config->allowfavorites && $this->my->id) {
         if (!$this->favorited) {
             $fb_canfavorite = 1;
         }
     }
     //get the Moderator list for display
     $this->db->setQuery("SELECT m.*, u.* FROM #__kunena_moderation AS m INNER JOIN #__users AS u ON u.id=m.userid WHERE m.catid={$this->db->Quote($this->catid)} AND u.block=0");
     $this->modslist = $this->db->loadObjectList();
     KunenaError::checkDatabaseError();
     $this->catModerators = array();
     foreach ($this->modslist as $mod) {
         $this->catModerators[] = $mod->userid;
         $userlist[intval($mod->userid)] = intval($mod->userid);
     }
     // Prefetch all users/avatars to avoid user by user queries during template iterations
     KunenaUser::loadUsers($userlist);
     //data ready display now
     if (CKunenaTools::isModerator($this->my->id, $this->catid) || $this->topicLocked == 0) {
         //this user is allowed to reply to this topic
         $this->thread_reply = CKunenaLink::GetTopicPostReplyLink('reply', $this->catid, $this->thread, CKunenaTools::showButton('reply', JText::_('COM_KUNENA_BUTTON_REPLY_TOPIC')), 'nofollow', 'kicon-button kbuttoncomm btn-left', JText::_('COM_KUNENA_BUTTON_REPLY_TOPIC_LONG'));
     }
     // Thread Subscription
     if ($this->cansubscribe == 1) {
         // this user is allowed to subscribe - check performed further up to eliminate duplicate checks
         // for top and bottom navigation
         $this->thread_subscribe = CKunenaLink::GetTopicPostLink('subscribe', $this->catid, $this->id, CKunenaTools::showButton('subscribe', JText::_('COM_KUNENA_BUTTON_SUBSCRIBE_TOPIC')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_SUBSCRIBE_TOPIC_LONG'));
     }
     if ($this->my->id != 0 && $this->config->allowsubscriptions && $this->config->topic_subscriptions != 'disabled' && $this->cansubscribe == 0) {
         // this user is allowed to unsubscribe
         $this->thread_subscribe = CKunenaLink::GetTopicPostLink('unsubscribe', $this->catid, $this->id, CKunenaTools::showButton('subscribe', JText::_('COM_KUNENA_BUTTON_UNSUBSCRIBE_TOPIC')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_UNSUBSCRIBE_TOPIC_LONG'));
     }
     //START: FAVORITES
     if ($fb_canfavorite == 1) {
         // this user is allowed to add a favorite - check performed further up to eliminate duplicate checks
         // for top and bottom navigation
         $this->thread_favorite = CKunenaLink::GetTopicPostLink('favorite', $this->catid, $this->id, CKunenaTools::showButton('favorite', JText::_('COM_KUNENA_BUTTON_FAVORITE_TOPIC')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_FAVORITE_TOPIC_LONG'));
     }
     if ($this->my->id != 0 && $this->config->allowfavorites && $fb_canfavorite == 0) {
         // this user is allowed to unfavorite
         $this->thread_favorite = CKunenaLink::GetTopicPostLink('unfavorite', $this->catid, $this->id, CKunenaTools::showButton('favorite', JText::_('COM_KUNENA_BUTTON_UNFAVORITE_TOPIC')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_UNFAVORITE_TOPIC_LONG'));
     }
     // FINISH: FAVORITES
     if (CKunenaTools::isModerator($this->my->id, $this->catid) || !$this->kunena_forum_locked) {
         //this user is allowed to post a new topic
         $this->thread_new = CKunenaLink::GetPostNewTopicLink($this->catid, CKunenaTools::showButton('newtopic', JText::_('COM_KUNENA_BUTTON_NEW_TOPIC')), 'nofollow', 'kicon-button kbuttoncomm btn-left', JText::_('COM_KUNENA_BUTTON_NEW_TOPIC_LONG'));
     }
     if (CKunenaTools::isModerator($this->my->id, $this->catid)) {
         // offer the moderator always the move link to relocate a topic to another forum
         // and the (un)sticky bit links
         // and the (un)lock links
         if ($this->topicSticky == 0) {
             $this->thread_sticky = CKunenaLink::GetTopicPostLink('sticky', $this->catid, $this->id, CKunenaTools::showButton('sticky', JText::_('COM_KUNENA_BUTTON_STICKY_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_STICKY_TOPIC_LONG'));
         } else {
             $this->thread_sticky = CKunenaLink::GetTopicPostLink('unsticky', $this->catid, $this->id, CKunenaTools::showButton('sticky', JText::_('COM_KUNENA_BUTTON_UNSTICKY_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_UNSTICKY_TOPIC_LONG'));
         }
         if ($this->topicLocked == 0) {
             $this->thread_lock = CKunenaLink::GetTopicPostLink('lock', $this->catid, $this->id, CKunenaTools::showButton('lock', JText::_('COM_KUNENA_BUTTON_LOCK_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_LOCK_TOPIC_LONG'));
         } else {
             $this->thread_lock = CKunenaLink::GetTopicPostLink('unlock', $this->catid, $this->id, CKunenaTools::showButton('lock', JText::_('COM_KUNENA_BUTTON_UNLOCK_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_UNLOCK_TOPIC_LONG'));
         }
         $this->thread_delete = CKunenaLink::GetTopicPostLink('deletethread', $this->catid, $this->id, CKunenaTools::showButton('delete', JText::_('COM_KUNENA_BUTTON_DELETE_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_DELETE_TOPIC_LONG'));
         $this->thread_moderate = CKunenaLink::GetTopicPostReplyLink('moderatethread', $this->catid, $this->id, CKunenaTools::showButton('moderate', JText::_('COM_KUNENA_BUTTON_MODERATE_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_MODERATE'));
     }
     $this->headerdesc = nl2br(smile::smileReplace($this->catinfo->headerdesc, 0, $this->config->disemoticons, $this->emoticons));
     $tabclass = array("row1", "row2");
     $this->mmm = 0;
     $this->replydir = $this->ordering == 'DESC' ? -1 : 1;
     if ($this->replydir < 0) {
         $this->replynum = $this->total_messages - $this->limitstart + 1;
     } else {
         $this->replynum = $this->limitstart;
     }
     $this->myname = $this->config->username ? $this->my->username : $this->my->name;
     $this->allow_anonymous = !empty($this->catinfo->allow_anonymous) && $this->my->id;
     $this->anonymous = $this->allow_anonymous && !empty($this->catinfo->post_anonymous);
 }
Example #19
0
function editRank($option, $id)
{
    $kunena_db =& JFactory::getDBO();
    $kunena_db->setQuery("SELECT * FROM #__fb_ranks WHERE rank_id = '{$id}'");
    $kunena_db->query() or trigger_dberror("Unable to load ranks.");
    $ranks = $kunena_db->loadObjectList();
    check_dberror("Unable to load ranks.");
    $rank_images = collectRanks();
    $path = rankpath();
    $path = $path['live'] . DS;
    $edit_img = $filename_list = '';
    foreach ($ranks as $row) {
        foreach ($rank_images as $img) {
            $image = $path . $img;
            if ($img == $row->rank_image) {
                $selected = ' selected="selected"';
                $edit_img = $path . $img;
            } else {
                $selected = '';
            }
            if (strlen($img) > 255) {
                continue;
            }
            $filename_list .= '<option value="' . kunena_htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
        }
    }
    html_Kunena::editRank($option, KUNENA_LANGUAGE, $edit_img, $filename_list, $path, $row);
}
Example #20
0
     <?php 
if ($userinfo->websiteurl != '') {
    ?>
    <tr class ="<?php 
    echo $boardclass;
    ?>
sectiontableentry1">
      <td  class = "td-1 fbm"><b><?php 
    echo _KUNENA_MYPROFILE_WEBSITE;
    ?>
</b> </td>
      <td  class = "td-2 fbm"><a href="http://<?php 
    echo kunena_htmlspecialchars(stripslashes($userinfo->websiteurl));
    ?>
" target="_blank"><?php 
    echo kunena_htmlspecialchars(stripslashes($userinfo->websitename));
    ?>
</a></td>
    </tr>
    <?php 
}
?>
    <?php 
if (!empty($usr_signature)) {
    ?>
    <tr class ="<?php 
    echo $boardclass;
    ?>
sectiontableentry1">
      <td  class = "td-1 fbm"><b><?php 
    echo _KUNENA_MYPROFILE_SIGNATURE;
Example #21
0
        //get all message details for each subscription
        $kunena_db->setQuery("SELECT * FROM #__fb_messages WHERE id='{$subs->thread}'");
        $subdet = $kunena_db->loadObjectList();
        check_dberror("Unable to load messages.");
        foreach ($subdet as $sub) {
            $k = 1 - $k;
            echo '<tr class="' . $boardclass . '' . $tabclass[$k] . '" >';
            echo '<td class="td-1" width="54%" align="left">' . $enum . ': <a href="' . JRoute::_(KUNENA_LIVEURLREL . '&amp;func=view&amp;catid=' . $sub->catid . '&amp;id=' . $sub->id) . '">' . kunena_htmlspecialchars(stripslashes($sub->subject));
            ?>

						</a>

						</td>

						<td class = "td-2" style = "text-align:center; width:15%"> <?php 
            echo kunena_htmlspecialchars(stripslashes($sub->name));
            ?>
</td>

						<td class = "td-3" style = "text-align:center; width:25%"> <?php 
            echo '' . date(_DATETIME, $sub->time) . '';
            ?>
</td>

						<td class = "td-4" style = "text-align:center; width:5%"> <?php 
            echo $sub->hits;
            ?>
</td>

						<td class = "td-5" width = "1%">
							<input id = "cid<?php 
Example #22
0
    /**
     * 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));
            $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 
    }
Example #23
0
function editRank($option, $id)
{
    $kunena_db =& JFactory::getDBO();
    $kunena_db->setQuery("SELECT * FROM #__kunena_ranks WHERE rank_id = '{$id}'");
    $ranks = $kunena_db->loadObjectList();
    if (KunenaError::checkDatabaseError()) {
        return;
    }
    $template = KunenaFactory::getTemplate();
    $rankpath = $template->getRankPath();
    $rank_images = collect_smilies_ranks(KPATH_SITE . '/' . $rankpath);
    $edit_img = $filename_list = '';
    foreach ($ranks as $row) {
        foreach ($rank_images as $img) {
            if ($img == $row->rank_image) {
                $selected = ' selected="selected"';
                $edit_img = $template->getRankPath($img);
            } else {
                $selected = '';
            }
            if (JString::strlen($img) > 255) {
                continue;
            }
            $filename_list .= '<option value="' . kunena_htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
        }
    }
    html_Kunena::editRank($option, $edit_img, $filename_list, $rankpath, $row);
}
Example #24
0
            } else {
                $barwidth = round($toptitle->hits * 100 / $toptitlehits);
            }
            $link = JRoute::_(KUNENA_LIVEURLREL . '&amp;func=view&amp;id=' . $toptitle->id . '&amp;catid=' . $toptitle->catid);
            ?>

    <tr class = "<?php 
            echo '' . $boardclass . '' . $tabclass[$k] . '';
            ?>
">
      <td class="td-1" align="left">
       <a href = "<?php 
            echo $link;
            ?>
"><?php 
            echo kunena_htmlspecialchars(stripslashes($toptitle->subject));
            ?>
</a>
      </td>
      <td  class="td-2">
       <img class = "jr-forum-stat-bar" src = "<?php 
            echo KUNENA_TMPLTMAINIMGURL . '/images/bar.gif';
            ?>
" alt = "" height = "10" width = "<?php 
            echo $barwidth;
            ?>
%"/>
      </td>
      <td  class="td-3">
	  <?php 
            echo $toptitle->hits;
							onmouseover = "textCounter(this.form.message,this.form.counter,<?php 
echo $fbConfig->maxsig;
?>
);" onclick = "textCounter(this.form.message,this.form.counter,<?php 
echo $fbConfig->maxsig;
?>
);"
							onkeydown = "textCounter(this.form.message,this.form.counter,<?php 
echo $fbConfig->maxsig;
?>
);" onkeyup = "textCounter(this.form.message,this.form.counter,<?php 
echo $fbConfig->maxsig;
?>
);"
							rows="6" cols="60" name = "message"><?php 
echo kunena_htmlspecialchars(stripslashes($userinfo->signature), ENT_QUOTES);
?>
</textarea>

					<br/>

					<input name="speicher" type="hidden" size="30" maxlength="100">
					<img class = "fb-bbcode" title = "Bold" accesskey = "b" name = "addbbcode0" src="<?php 
echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
?>
text_bold.png" alt="B" onclick = "bbfontstyle('[b]', '[/b]');" onmouseover = "javascript:kunenaShowHelp('<?php 
@(print _KUNENA_EDITOR_HELPLINE_BOLD);
?>
')" />
					<img class = "fb-bbcode" accesskey = "i" name = "addbbcode2" src="<?php 
echo KUNENA_LIVEUPLOADEDPATH . '/editor/';
Example #26
0
 protected function moderate($modchoices = '', $modthread = false)
 {
     if (!$this->load()) {
         return false;
     }
     if ($this->moderatorProtection()) {
         return false;
     }
     if ($this->isUserBanned()) {
         return false;
     }
     if ($this->isIPBanned()) {
         return false;
     }
     require_once KUNENA_PATH_LIB . '/kunena.moderation.class.php';
     $this->moderateTopic = $modthread;
     $this->moderateMultiplesChoices = $modchoices;
     // Get list of latest messages:
     $query = "SELECT id,subject FROM #__kunena_messages WHERE catid={$this->_db->Quote($this->catid)} AND parent=0 AND hold=0 AND moved=0 AND thread!={$this->_db->Quote($this->msg_cat->thread)} ORDER BY id DESC";
     $this->_db->setQuery($query, 0, 30);
     $messagesList = $this->_db->loadObjectlist();
     if (KunenaError::checkDatabaseError()) {
         return;
     }
     // Get thread and reply count from current message:
     $query = "SELECT t.id,t.subject,COUNT(mm.id) AS replies FROM #__kunena_messages AS m\n\t\t\tINNER JOIN #__kunena_messages AS t ON m.thread=t.id\n\t\t\tLEFT JOIN #__kunena_messages AS mm ON mm.thread=m.thread AND mm.id > m.id\n\t\t\tWHERE m.id={$this->_db->Quote($this->id)}\n\t\t\tGROUP BY m.thread";
     $this->_db->setQuery($query, 0, 1);
     $this->threadmsg = $this->_db->loadObject();
     if (KunenaError::checkDatabaseError()) {
         return;
     }
     $messages = array();
     if ($this->moderateTopic) {
         $messages[] = JHTML::_('select.option', 0, JText::_('COM_KUNENA_MODERATION_MOVE_TOPIC'));
     } else {
         $messages[] = JHTML::_('select.option', 0, JText::_('COM_KUNENA_MODERATION_CREATE_TOPIC'));
     }
     $messages[] = JHTML::_('select.option', -1, JText::_('COM_KUNENA_MODERATION_ENTER_TOPIC'));
     foreach ($messagesList as $mes) {
         $messages[] = JHTML::_('select.option', $mes->id, kunena_htmlspecialchars($mes->subject));
     }
     $this->messagelist = JHTML::_('select.genericlist', $messages, 'targettopic', 'class="inputbox"', 'value', 'text', 0, 'kmod_targettopic');
     $options = array();
     $this->categorylist = CKunenaTools::KSelectList('targetcat', $options, 'class="inputbox kmove_selectbox"', false, 'kmod_categories', $this->catid);
     $this->message = $this->msg_cat;
     $this->user = KunenaFactory::getUser($this->msg_cat->userid);
     CKunenaTools::loadTemplate('/moderate/moderate.php');
 }
Example #27
0
<?php 
        if ($leaf->name) {
            echo '<span class="topic_by">';
            echo _GEN_BY . ' ' . CKunenaLink::GetProfileLink($fbConfig, $leaf->userid, $leaf->name);
            echo '</span>';
        }
        ?>
        <!-- /By -->

         <?php 
        if (strtolower($func) != 'showcat') {
            ?>
        <!-- Category -->
        <span class="topic_category">
        <?php 
            echo _KUNENA_CATEGORY . ' ' . CKunenaLink::GetCategoryLink('showcat', $leaf->catid, kunena_htmlspecialchars(stripslashes($leaf->catname)));
            ?>
        </span>
        <!-- /Category -->
        <?php 
        }
        ?>

            <!-- Views -->
        <span class="topic_views">
        <?php 
        echo _GEN_HITS;
        ?>
: <?php 
        echo (int) $hits[$leaf->id];
        ?>
Example #28
0
 function display()
 {
     if (!$this->allow) {
         echo JText::_('COM_KUNENA_NO_ACCESS');
         return;
     }
     if ($this->func == 'mylatest') {
         $this->getMyLatest();
     } else {
         if ($this->func == 'latestposts') {
             $this->getLatestPosts();
         } else {
             if ($this->func == 'latesttopics') {
                 $this->getLatestTopics();
             } else {
                 if ($this->func == 'noreplies') {
                     $this->getNoReplies();
                 } else {
                     if ($this->func == 'subscriptions') {
                         $this->getSubscriptions();
                     } else {
                         if ($this->func == 'catsubscriptions') {
                             $this->getCategoriesSubscriptions();
                         } else {
                             if ($this->func == 'favorites') {
                                 $this->getFavorites();
                             } else {
                                 if ($this->func == 'userposts') {
                                     $this->getUserPosts();
                                 } else {
                                     if ($this->func == 'owntopics') {
                                         $this->getOwnTopics();
                                     } else {
                                         if ($this->func == 'saidthankyouposts') {
                                             $this->getSaidThankYouPosts();
                                         } else {
                                             if ($this->func == 'gotthankyouposts') {
                                                 $this->getGotThankYouPosts();
                                             } else {
                                                 if ($this->func == 'unapproved') {
                                                     $this->getUnapprovedPosts();
                                                 } else {
                                                     if ($this->func == 'deleted') {
                                                         $this->getDeletedPosts();
                                                     } else {
                                                         $this->getLatest();
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     if (!$this->allow) {
         echo JText::_('COM_KUNENA_NO_ACCESS');
         return;
     }
     //meta description and keywords
     $metaKeys = $this->header . kunena_htmlspecialchars(", {$this->config->board_title}, ") . $this->app->getCfg('sitename');
     $metaDesc = $this->header . kunena_htmlspecialchars(" ({$this->page}/{$this->totalpages}) - {$this->config->board_title}");
     $cur = $this->document->get('description');
     $metaDesc = $cur . '. ' . $metaDesc;
     $this->document =& JFactory::getDocument();
     $this->document->setMetadata('robots', 'noindex, follow');
     $this->document->setMetadata('keywords', $metaKeys);
     $this->document->setDescription($metaDesc);
     $this->document->setTitle($this->title . ' - ' . $this->config->board_title);
     if (!isset($this->total)) {
         $this->total = 0;
     }
     CKunenaTools::loadTemplate('/threads/latestx.php');
 }
Example #29
0
echo $boardclass;
?>
_bt_cvr5">
<table class = "fb_blocktable<?php 
echo $objCatInfo->class_sfx;
?>
" id="fb_postmessage"  border = "0" cellspacing = "0" cellpadding = "0" width="100%">
    <thead>
        <tr>
            <th colspan = "2">
                <div class = "fb_title_cover fbm">
                    <span class = "fb_title fbl"> <?php 
echo _POST_MESSAGE;
?>
"<?php 
echo kunena_htmlspecialchars(stripslashes($objCatInfo->name));
?>
"</span>
                </div>
            </th>
        </tr>
    </thead>

    <tbody id = "fb_post_message">
        <tr class = "<?php 
echo $boardclass;
?>
sectiontableentry1">
            <td class = "fb_leftcolumn">
                <strong><?php 
echo _GEN_NAME;
Example #30
0
                    echo '</font></div>';
                }
            }
            echo "</td>";
            echo " <td class=\"td-3  fbm\" align=\"center\" >{$numtopics}</td>";
            echo " <td class=\"td-4  fbm\" align=\"center\" >{$numreplies}</td>";
            if ($numtopics != 0) {
                ?>

                        <td class = "td-5" align="left">
                            <div class = "<?php 
                echo $boardclass;
                ?>
latest-subject fbm">
                                <?php 
                echo CKunenaLink::GetThreadLink('view', $latestcatid, $latestthread, kunena_htmlspecialchars(stripslashes($latestsubject)), kunena_htmlspecialchars(stripslashes($latestsubject)), $rel = 'nofollow');
                ?>
                            </div>

                            <div class = "<?php 
                echo $boardclass;
                ?>
latest-subject-by  fbs">
<?php 
                echo _GEN_BY;
                ?>

                                <?php 
                echo CKunenaLink::GetProfileLink($fbConfig, $latestuserid, $latestname, $rel = 'nofollow');
                ?>