示例#1
0
        JFilterOutput::objectHTMLSafe($_POST);
        $title = JRequest::getVar("title", "");
        $description = JRequest::getVar('description', '', 'string', JREQUEST_ALLOWRAW);
        $sdescription = JRequest::getVar('sdescription', '', 'string', JREQUEST_ALLOWRAW);
        $created = JRequest::getVar("created", "");
        $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()
示例#2
0
function showprf($userid, $page)
{
    $fbConfig =& CKunenaConfig::getInstance();
    $kunena_acl =& JFactory::getACL();
    $kunena_my =& JFactory::getUser();
    $kunena_db =& JFactory::getDBO();
    // ERROR: mixed global $fbIcons
    global $fbIcons;
    //Get userinfo needed later on, this limits the amount of queries
    unset($userinfo);
    $kunena_db->setQuery("SELECT a.*, b.* FROM #__fb_users AS a LEFT JOIN #__users AS b ON b.id=a.userid WHERE a.userid='{$userid}'");
    $userinfo = $kunena_db->loadObject();
    check_dberror('Unable to get user profile info.');
    if (!$userinfo) {
        $kunena_db->setQuery("SELECT * FROM #__users WHERE id='{$userid}'");
        $userinfo = $kunena_db->loadObject();
        check_dberror('Unable to get user profile info.');
        if (!$userinfo) {
            echo '<h3>' . _KUNENA_PROFILE_NO_USER . '</h3>';
            return;
        } else {
            // Check moderator status (admin is moderator)
            $aro_group = $kunena_acl->getAroGroup($userid);
            $is_admin = strtolower($aro_group->name) == 'super administrator' || strtolower($aro_group->name) == 'administrator';
            // there's no profile; set userid and moderator status.
            $kunena_db->setQuery("INSERT INTO #__fb_users (userid,moderator) VALUES ('{$userid}','{$is_admin}')");
            $kunena_db->query();
            check_dberror('Unable to create user profile.');
            $kunena_db->setQuery("SELECT a.*, b.* FROM #__fb_users AS a LEFT JOIN #__users AS b ON b.id=a.userid WHERE a.userid='{$userid}'");
            $userinfo = $kunena_db->loadObject();
            check_dberror('Unable to get user profile info.');
            // TODO: For future use
            // echo '<h3>' . _KUNENA_PROFILE_NOT_FOUND . '</h3>';
            // return;
        }
    }
    // User Hits
    $kunena_db->setQuery('UPDATE #__fb_users SET uhits=uhits+1 WHERE userid=' . $userid);
    $kunena_db->query() or trigger_dberror("Unable to update user hits.");
    // get userprofile hits
    $msg_userhits = $userinfo->uhits;
    //get the username:
    $fb_username = "";
    if ($fbConfig->username) {
        $fb_queryName = "username";
    } else {
        $fb_queryName = "name";
    }
    $fb_username = $userinfo->{$fb_queryName};
    $lists["userid"] = $userid;
    $msg_username = $fb_username;
    // $msg_username = ($fmessage->email != "" && $kunena_my->id > 0 && $fbConfig->showemail == '1') ? "<a href=\"mailto:" . $fmessage->email . "\">" . $fb_username . "</a>" : $fb_username;
    if ($fbConfig->allowavatar) {
        $Avatarname = $userinfo->username;
        if ($fbConfig->avatar_src == "jomsocial") {
            // Get CUser object
            $user =& CFactory::getUser($userid);
            $msg_avatar = '<span class="fb_avatar"><img src="' . $user->getAvatar() . '" alt="" /></span>';
        } else {
            if ($fbConfig->avatar_src == "clexuspm") {
                $msg_avatar = '<span class="fb_avatar"><img src="' . MyPMSTools::getAvatarLinkWithID($userid, "b") . '" alt="" /></span>';
            } else {
                if ($fbConfig->avatar_src == "cb") {
                    $kunenaProfile = CKunenaCBProfile::getInstance();
                    $msg_avatar = '<span class="fb_avatar">' . $kunenaProfile->showAvatar($userid, '', 0) . '</span>';
                } else {
                    $avatar = $userinfo->avatar;
                    if ($avatar != '') {
                        if (!file_exists(KUNENA_PATH_UPLOADED . DS . 'avatars/l_' . $avatar)) {
                            $msg_avatar = '<span class="fb_avatar"><img border="0" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '"  alt="" style="max-width: ' . $fbConfig->avatarwidth . 'px; max-height: ' . $fbConfig->avatarheight . 'px;" /></span>';
                        } else {
                            $msg_avatar = '<span class="fb_avatar"><img border="0" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '"  alt="" /></span>';
                        }
                    } else {
                        $msg_avatar = '<span class="fb_avatar"><img  border="0" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/nophoto.jpg"  alt="" /></span>';
                    }
                }
            }
        }
    }
    if ($fbConfig->showuserstats) {
        //user type determination
        $ugid = $userinfo->gid;
        $uIsMod = 0;
        $uIsAdm = 0;
        if ($ugid > 0) {
            //only get the groupname from the ACL if we're sure there is one
            $agrp = strtolower($kunena_acl->get_group_name($ugid, 'ARO'));
        }
        if ($ugid == 0) {
            $msg_usertype = _VIEW_VISITOR;
        } else {
            if (strtolower($agrp) == "administrator" || strtolower($agrp) == "superadministrator" || strtolower($agrp) == "super administrator") {
                $msg_usertype = _VIEW_ADMIN;
                $uIsAdm = 1;
            } elseif ($uIsMod) {
                $msg_usertype = _VIEW_MODERATOR;
            } else {
                $msg_usertype = _VIEW_USER;
            }
        }
        //done usertype determination, phew...
        //Get the max# of posts for any one user
        $kunena_db->setQuery("SELECT MAX(posts) FROM #__fb_users");
        $maxPosts = $kunena_db->loadResult();
        //# of post for this user and ranking
        $numPosts = (int) $userinfo->posts;
        //ranking
        if ($fbConfig->showranking) {
            if ($userinfo->rank != '0') {
                //special rank
                $kunena_db->setQuery("SELECT * FROM #__fb_ranks WHERE rank_id='{$userinfo->rank}'");
                $getRank = $kunena_db->loadObjectList();
                check_dberror("Unable to load ranks.");
                $rank = $getRank[0];
                $rText = $rank->rank_title;
                $rImg = KUNENA_URLRANKSPATH . $rank->rank_image;
            }
            if ($userinfo->rank == '0') {
                //post count rank
                $kunena_db->setQuery("SELECT * FROM #__fb_ranks WHERE ((rank_min <= '{$numPosts}') AND (rank_special = '0')) ORDER BY rank_min DESC", 0, 1);
                $getRank = $kunena_db->loadObjectList();
                check_dberror("Unable to load ranks.");
                $rank = $getRank[0];
                $rText = $rank->rank_title;
                $rImg = KUNENA_URLRANKSPATH . $rank->rank_image;
            }
            if ($uIsMod) {
                $rText = _RANK_MODERATOR;
                $rImg = KUNENA_URLRANKSPATH . 'rankmod.gif';
            }
            if ($uIsAdm) {
                $rText = _RANK_ADMINISTRATOR;
                $rImg = KUNENA_URLRANKSPATH . 'rankadmin.gif';
            }
            if ($fbConfig->rankimages) {
                $msg_userrankimg = '<img src="' . $rImg . '" alt="" />';
            }
            $msg_userrank = $rText;
            $useGraph = 0;
            //initialization
            if (!$fbConfig->poststats) {
                $msg_posts = '<div class="viewcover">' . "<strong>" . _POSTS . " {$numPosts}" . "</strong>" . "</div>";
                $useGraph = 0;
            } else {
                $myGraph = new phpGraph();
                //$myGraph->SetGraphTitle(_POSTS);
                $myGraph->AddValue(_POSTS, $numPosts);
                $myGraph->SetRowSortMode(0);
                $myGraph->SetBarImg(KUNENA_URLGRAPHPATH . "col" . $fbConfig->statscolor . "m.png");
                $myGraph->SetBarImg2(KUNENA_URLEMOTIONSPATH . "graph.gif");
                $myGraph->SetMaxVal($maxPosts);
                $myGraph->SetShowCountsMode(2);
                $myGraph->SetBarWidth(4);
                //height of the bar
                $myGraph->SetBorderColor("#333333");
                $myGraph->SetBarBorderWidth(0);
                $myGraph->SetGraphWidth(120);
                //should match column width in the <TD> above -5 pixels
                //$myGraph->BarGraphHoriz();
                $useGraph = 1;
            }
        }
    }
    //karma points and buttons
    if ($fbConfig->showkarma && $userid != '0') {
        $karmaPoints = $userinfo->karma;
        $karmaPoints = (int) $karmaPoints;
        $msg_karma = "<strong>" . _KARMA . ":</strong> {$karmaPoints}";
        $msg_karmaminus = '';
        $msg_karmaplus = '';
        if ($kunena_my->id != '0' && $kunena_my->id != $userid) {
            $msg_karmaminus .= "<a href=\"" . JRoute::_(KUNENA_LIVEURLREL . '&amp;func=karma&amp;do=decrease&amp;userid=' . $userid) . "\"><img src=\"";
            if (isset($fbIcons['karmaminus'])) {
                $msg_karmaminus .= KUNENA_URLICONSPATH . $fbIcons['karmaminus'];
            } else {
                $msg_karmaminus .= KUNENA_URLEMOTIONSPATH . "karmaminus.gif";
            }
            $msg_karmaminus .= "\" alt=\"Karma-\" border=\"0\" title=\"" . _KARMA_SMITE . "\" align=\"middle\" /></a>";
            $msg_karmaplus .= "<a href=\"" . JRoute::_(KUNENA_LIVEURLREL . '&amp;func=karma&amp;do=increase&amp;userid=' . $userid) . "\"><img src=\"";
            if (isset($fbIcons['karmaplus'])) {
                $msg_karmaplus .= KUNENA_URLICONSPATH . $fbIcons['karmaplus'];
            } else {
                $msg_karmaplus .= KUNENA_URLEMOTIONSPATH . "karmaplus.gif";
            }
            $msg_karmaplus .= "\" alt=\"Karma+\" border=\"0\" title=\"" . _KARMA_APPLAUD . "\" align=\"middle\" /></a>";
        }
    }
    /*let's see if we should use uddeIM integration */
    if ($fbConfig->pm_component == "uddeim" && $userid && $kunena_my->id) {
        //we should offer the user a PMS link
        //first get the username of the user to contact
        $PMSName = $userinfo->username;
        $msg_pms = "<a href=\"" . JRoute::_('index.php?option=com_uddeim&amp;task=new&recip=' . $userid) . "\"><img src=\"";
        if ($fbIcons['pms']) {
            $msg_pms .= KUNENA_URLICONSPATH . $fbIcons['pms'];
        } else {
            $msg_pms .= KUNENA_URLEMOTIONSPATH . "sendpm.gif";
        }
        $msg_pms .= "\" alt=\"" . _VIEW_PMS . "\" border=\"0\" title=\"" . _VIEW_PMS . "\" /></a>";
    }
    /*let's see if we should use myPMS2 integration */
    if ($fbConfig->pm_component == "pms" && $userid && $kunena_my->id) {
        //we should offer the user a PMS link
        //first get the username of the user to contact
        $PMSName = $userinfo->username;
        $msg_pms = "<a href=\"" . JRoute::_('index.php?option=com_pms&amp;page=new&amp;id=' . $PMSName . '&title=' . $fmessage->subject) . "\"><img src=\"";
        if ($fbIcons['pms']) {
            $msg_pms .= KUNENA_URLICONSPATH . $fbIcons['pms'];
        } else {
            $msg_pms .= KUNENA_URLEMOTIONSPATH . "sendpm.gif";
        }
        $msg_pms .= "\" alt=\"" . _VIEW_PMS . "\" border=\"0\" title=\"" . _VIEW_PMS . "\" /></a>";
    }
    // online - ofline status
    if ($userid > 0) {
        $sql = "SELECT COUNT(userid) FROM #__session WHERE userid='{$userid}'";
        $kunena_db->setQuery($sql);
        $isonline = $kunena_db->loadResult();
        if ($isonline && $userinfo->showOnline == 1) {
            $msg_online = isset($fbIcons['onlineicon']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['onlineicon'] . '" border="0" alt="' . _MODLIST_ONLINE . '" />' : '  <img src="' . KUNENA_URLEMOTIONSPATH . 'onlineicon.gif" border="0"  alt="' . _MODLIST_ONLINE . '" />';
        } else {
            $msg_online = isset($fbIcons['offlineicon']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['offlineicon'] . '" border="0" alt="' . _MODLIST_OFFLINE . '" />' : '  <img src="' . KUNENA_URLEMOTIONSPATH . 'offlineicon.gif" border="0"  alt="' . _MODLIST_OFFLINE . '" />';
        }
    }
    /* ClexusPM integration */
    if ($fbConfig->pm_component == "clexuspm") {
        //we should offer the user a PMS link
        //first get the username of the user to contact
        $PMSName = $userinfo->aid;
        $msg_pms = "<a href=\"" . JRoute::_('index.php?option=com_mypms&amp;task=new&amp;to=' . $userid . '' . $fmessage->subject) . "\"><img src=\"";
        if ($fbIcons['pms']) {
            $msg_pms .= KUNENA_URLICONSPATH . $fbIcons['pms'];
        } else {
            $msg_pms .= KUNENA_JLIVEURL . "/components/com_mypms/images/icons/message_12px.gif";
        }
        $msg_pms .= "\" alt=\"" . _VIEW_PMS . "\" border=\"0\" title=\"" . _VIEW_PMS . "\" /></a>";
        //mypms pro profile link
        $msg_profile = "<a href=\"" . MyPMSTools::getProfileLink($userid) . "\"><img src=\"";
        if ($fbIcons['userprofile']) {
            $msg_profile .= KUNENA_URLICONSPATH . $fbIcons['userprofile'];
        } else {
            $msg_profile .= KUNENA_JLIVEURL . "/components/com_mypms/images/managecontact_icon.gif";
        }
        $msg_profile .= "\" alt=\"" . _VIEW_PROFILE . "\" border=\"0\" title=\"" . _VIEW_PROFILE . "\" /></a>";
        //mypms add buddy link
        $msg_buddy = "<a href=\"" . JRoute::_('index.php?option=com_mypms&amp;user='******'&amp;task=addbuddy') . "\"><img src=\"";
        if ($fbIcons['pms2buddy']) {
            $msg_buddy .= KUNENA_URLICONSPATH . $fbIcons['pms2buddy'];
        } else {
            $msg_buddy .= KUNENA_JLIVEURL . "/components/com_mypms/images/messages/addbuddy.gif";
        }
        $msg_buddy .= "\" alt=\"" . _VIEW_ADDBUDDY . "\" border=\"0\" title=\"" . _VIEW_ADDBUDDY . "\" /></a>";
        $kunena_db->setQuery("SELECT icq, ym, msn, aim, website, location FROM #__mypms_profiles WHERE user='******'");
        $profileitems = $kunena_db->loadObjectList();
        check_dberror("Unable to load mypms_profiles.");
        foreach ($profileitems as $profileitems) {
            if ($profileitems->aim) {
                $msg_aim = "<a href=\"aim:goim?screenname=" . str_replace(" ", "+", $profileitems->aim) . "\"><img src=\"" . KUNENA_URLEMOTIONSPATH . "aim.png\" border=0 alt=\"\" /></a>";
            }
            if ($profileitems->icq) {
                $msg_icq = "<a href=\"http://www.icq.com/whitepages/wwp.php?uin=" . $profileitems->icq . "\"><img src=\"" . KUNENA_URLEMOTIONSPATH . "icq.png\" border=0 alt=\"\" /></a>";
            }
            if ($profileitems->msn) {
                $msg_msn = "<a href=\"" . JRoute::_('index.php?option=com_mypms&amp;task=showprofile&amp;user='******'/plugin/fbprofile/userinfos.php')) {
        include KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/userinfos.php';
    } else {
        include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/fbprofile/userinfos.php';
    }
    ?>

            <!-- /Kunena Profile -->
            </td>

            <td class = "<?php 
    echo $boardclass;
    ?>
profile-right" valign="top" width="74%">
            <!-- User Messages -->



            <?php 
    if (file_exists(KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/summary.php')) {
        include KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/summary.php';
    } else {
        include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/fbprofile/summary.php';
    }
    ?>

                <?php 
    if (file_exists(KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/forummsg.php')) {
        include KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/forummsg.php';
    } else {
        include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/fbprofile/forummsg.php';
    }
    ?>
            </td>
        </tr>
    </table>

    <?php 
    /*    end of function        */
}
示例#3
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);
}
示例#4
0
 function _getKunenaProperty($field)
 {
     $kunena_db =& JFactory::getDBO();
     if ($this->id == 0) {
         return FALSE;
     }
     if ($this->kunenaProperties == NULL) {
         $kunena_db->setQuery("SELECT * FROM #__fb_users WHERE userid='{$this->id}'", 0, 1);
         $this->kunenaProperties = $kunena_db->loadAssoc();
         check_dberror("Unable to load Kunena user information.");
     }
     if (array_key_exists($field, $this->kunenaProperties)) {
         return $this->kunenaProperties[$field];
     } else {
         return FALSE;
     }
 }
示例#5
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} {$forum->name}</option>";
        }
        showChildren($forum->id, $prefix . "---", $allow_forum);
    }
}
                    ?>

                            <br /> <a href = "<?php 
                    echo JRoute::_('index.php?option=com_comprofiler&amp;Itemid=117&amp;task=userAvatar');
                    ?>
"><?php 
                    echo _SET_NEW_AVATAR;
                    ?>
</a>

                    <?php 
                }
            } else {
                $kunena_db->setQuery("SELECT avatar FROM #__fb_users WHERE userid='{$kunena_my->id}'");
                $avatar = $kunena_db->loadResult();
                check_dberror("Unable to load Kunena Avatar.");
                if ($avatar != "") {
                    if (!file_exists(KUNENA_PATH_UPLOADED . DS . 'avatars/l_' . $avatar)) {
                        $msg_avatar = '<img src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '" alt="" style="max-width: ' . $fbConfig->avatarlargewidth . 'px; max-height: ' . $fbConfig->avatarlargeheight . 'px;" />';
                    } else {
                        $msg_avatar = '<img src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/l_' . $avatar . '" alt="" />';
                    }
                    echo $msg_avatar;
                    ?>

                                <br />

                                <input type = "checkbox" value = "1" name = "deleteAvatar"/><i> <?php 
                    echo _USER_DELETEAV;
                    ?>
</i>
示例#7
0
 function getAllowedForums($uid = 0, $gid = 0, &$kunena_acl)
 {
     $kunena_db =& JFactory::getDBO();
     function _has_rights(&$kunena_acl, $gid, $access, $recurse)
     {
         if ($gid == $access) {
             return 1;
         }
         if ($recurse) {
             $childs = $kunena_acl->get_group_children($access, 'ARO', 'RECURSE');
             return is_array($childs) and in_array($gid, $childs);
         }
         return 0;
     }
     $catlist = '';
     $query = "SELECT c.id, c.pub_access, c.pub_recurse, c.admin_access, c.admin_recurse, c.moderated" . ",(m.userid IS NOT NULL) AS ismod FROM #__fb_categories c" . " LEFT JOIN #__fb_moderation m ON c.id=m.catid AND m.userid='{$uid}' WHERE published='1'";
     $kunena_db->setQuery($query);
     $rows = $kunena_db->loadObjectList();
     check_dberror("Unable to load category list.");
     if ($rows) {
         foreach ($rows as $row) {
             if ($gid == 24 || $gid == 25 or $row->moderated and $row->ismod or $row->pub_access == 0 or $row->pub_access == -1 and $uid > 0 or $row->pub_access > 0 and _has_rights($kunena_acl, $gid, $row->pub_access, $row->pub_recurse) or $row->admin_access > 0 and _has_rights($kunena_acl, $gid, $row->admin_access, $row->admin_recurse)) {
                 $catlist .= ($catlist == '' ? '' : ',') . $row->id;
             }
         }
     }
     return $catlist;
 }
示例#8
0
    $totalpages = ceil($total / $threads_per_page);
    echo $pagination = KunenaLatestxPagination($func, $sel, $page, $totalpages, $maxpages);
    echo '</td>';
}
?>

		</tr>
	</table>
  <!-- F: List Actions -->
<?php 
if (count($threadids) > 0) {
    //get all readTopics in an array
    $readTopics = "";
    $kunena_db->setQuery("SELECT readtopics FROM #__fb_sessions WHERE userid='{$kunena_my->id}'");
    $readTopics = $kunena_db->loadResult();
    check_dberror('Unable to load read topics.');
    if (count($readTopics) == 0) {
        $readTopics = "0";
    }
    //make sure at least something is in there..
    //make it into an array
    $read_topics = explode(',', $readTopics);
    if (file_exists(KUNENA_ABSTMPLTPATH . '/flat.php')) {
        include KUNENA_ABSTMPLTPATH . '/flat.php';
    } else {
        include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'flat.php';
    }
    ?>
<!-- B: List Actions -->
	<table class="fb_list_actions" border="0" cellpadding="0" cellspacing="0" width="100%">
		<tr>
示例#9
0
 function GetLatestPageAutoRedirectURL($fbConfig, $pid, $limit, $catid = 0)
 {
     $kunena_db =& JFactory::getDBO();
     // First determine the thread, latest post and number of posts for the post supplied
     $where = '';
     if ($catid > 0) {
         $where .= " AND a.catid = {$catid} ";
     }
     $kunena_db->setQuery("SELECT a.thread AS thread, MAX(a.id) AS latest_id, MAX(a.catid) AS catid, COUNT(*) AS totalmessages\n                             FROM #__fb_messages AS a,\n                                (SELECT MAX(thread) AS thread FROM #__fb_messages WHERE id='{$pid}') AS b\n                             WHERE a.thread = b.thread AND a.hold='0' {$where}\n                             GROUP BY a.thread");
     $result = $kunena_db->loadObject();
     check_dberror("Unable to retrieve latest post.");
     if (!is_object($result)) {
         return htmlspecialchars_decode(JRoute::_(KUNENA_LIVEURLREL . '&amp;func=showcat&amp;catid=' . $catid));
     }
     // Now Calculate the number of pages for this particular thread
     $catid = $result->catid;
     $threadPages = ceil($result->totalmessages / $limit);
     // Finally build output block
     return htmlspecialchars_decode(CKunenaLink::GetThreadPageURL($fbConfig, 'view', $catid, $result->thread, $threadPages, $limit));
 }
示例#10
0
function ReportMessage($id, $catid, $reporter, $reason, $text, $type)
{
    $kunena_my =& JFactory::getUser();
    $kunena_db =& JFactory::getDBO();
    $fbConfig =& CKunenaConfig::getInstance();
    if (!$kunena_my->id) {
        JError::raiseError(403, JText::_("ALERTNOTAUTH"));
        return;
    }
    if (!empty($reason) && !empty($text)) {
        $kunena_db->setQuery("SELECT a.*, b.mesid, b.message AS msg_text FROM #__fb_messages AS a" . " LEFT JOIN #__fb_messages_text AS b ON b.mesid = a.id" . " WHERE a.id='{$id}'");
        $row = $kunena_db->loadObject();
        $kunena_db->setQuery("SELECT username FROM #__users WHERE id={$row->userid}");
        $baduser = $kunena_db->loadResult();
        $kunena_db->setQuery("SELECT username FROM #__users WHERE id={$reporter}");
        $sender = $kunena_db->loadResult();
        if ($reason) {
            $subject = "[" . stripslashes($fbConfig->board_title) . " " . _GEN_FORUM . "] " . _KUNENA_REPORT_MSG . ": " . $reason;
        } else {
            $subject = "[" . stripslashes($fbConfig->board_title) . " " . _GEN_FORUM . "] " . _KUNENA_REPORT_MSG . ": " . stripslashes($row->subject);
        }
        jimport('joomla.environment.uri');
        $uri =& JURI::getInstance(JURI::base());
        $msglink = $uri->toString(array('scheme', 'host', 'port')) . str_replace('&amp;', '&', JRoute::_(KUNENA_LIVEURLREL . "&amp;func=view&amp;catid=" . $row->catid . "&amp;id=" . $row->id) . '#' . $row->id);
        $message = "" . _KUNENA_REPORT_RSENDER . " " . $sender;
        $message .= "\n";
        $message .= "" . _KUNENA_REPORT_RREASON . " " . $reason;
        $message .= "\n";
        $message .= "" . _KUNENA_REPORT_RMESSAGE . " " . $text;
        $message .= "\n\n";
        $message .= "" . _KUNENA_REPORT_POST_POSTER . " " . $baduser;
        $message .= "\n";
        $message .= "" . _KUNENA_REPORT_POST_SUBJECT . " " . stripslashes($row->subject);
        $message .= "\n";
        $message .= "" . _KUNENA_REPORT_POST_MESSAGE . "\n-----\n" . stripslashes($row->msg_text);
        $message .= "\n-----\n\n";
        $message .= "" . _KUNENA_REPORT_POST_LINK . " " . $msglink;
        $message .= "\n\n\n\n** Powered by Kunena! - http://www.Kunena.com **";
        $message = strtr($message, array('&#32;' => ''));
        //get category moderators
        $kunena_db->setQuery("SELECT userid FROM #__fb_moderation WHERE catid={$row->catid}");
        $mods = $kunena_db->loadObjectList();
        check_dberror("Unable to load moderators.");
        //get admins
        $kunena_db->setQuery("SELECT id FROM #__users WHERE gid >= 24");
        $admins = $kunena_db->loadObjectList();
        check_dberror("Unable to load admin.");
        switch ($type) {
            default:
            case '0':
                SendReporttoMail($sender, $subject, $message, $msglink, $mods, $admins);
                break;
            case '1':
                SendReporttoPM($reporter, $subject, $message, $msglink, $mods, $admins);
                break;
        }
        echo '<div align="center">' . _KUNENA_REPORT_SUCCESS;
        echo CKunenaLink::GetAutoRedirectHTML(JRoute::_(KUNENA_LIVEURLREL . '&amp;func=view&amp;catid=' . $catid . '&amp;id=' . $id) . '#' . $id, 3500);
    } else {
        echo '<div align="center">';
        if (empty($reason)) {
            echo _POST_FORGOT_SUBJECT;
        } else {
            if (empty($text)) {
                echo _POST_FORGOT_MESSAGE;
            }
        }
    }
    echo '<br /><br />';
    echo '<a href="' . JRoute::_(KUNENA_LIVEURLREL . '&amp;func=view&amp;catid=' . $catid . '&amp;id=' . $id) . '#' . $id . '">' . _POST_SUCCESS_VIEW . '</a><br />';
    echo '<a href="' . JRoute::_(KUNENA_LIVEURLREL . '&amp;func=showcat&amp;catid=' . $catid) . '">' . _POST_SUCCESS_FORUM . '</a><br />';
    echo '</div>';
}
示例#11
0
 /**
  * Get top categories
  * @return array
  */
 function get_top_categories()
 {
     $kunena_db =& JFactory::getDBO();
     $kunena_db->setQuery('SELECT catid,COUNT(id) as totalmsg FROM #__fb_messages' . ' GROUP BY c.id ORDER BY catid LIMIT 5');
     $results = $kunena_db->loadObjectList();
     check_dberror("Unable to load messages.");
     if (count($results) > 0) {
         $ids = implode(',', $results);
         $kunena_db->setQuery('SELECT name FROM #__fb_categories WHERE id IN (' . $ids . ') ORDER BY catid');
         $names = $kunena_db->loadResultArray();
         $i = 0;
         foreach ($results as $result) {
             $result->name = $names[$i++];
         }
     } else {
         $results = array();
     }
     return $results;
 }
示例#12
0
/**
 *  Function to print the pathway
 *  @param object    database object
 *  @param object    category object
 *  @param int        the post id
 *  @param boolean    set title
 */
function KUNENA_get_pathway(&$kunena_db, $obj_fb_cat, $bool_set_title, $obj_post = 0)
{
    global $fbIcons;
    $document =& JFactory::getDocument();
    $fbConfig =& CKunenaConfig::getInstance();
    //Get the Category's parent category name for breadcrumb
    $kunena_db->setQuery("SELECT name, id FROM #__fb_categories WHERE id='" . $obj_fb_cat->getParent()) . "'";
    $objCatParentInfo = $kunena_db->loadObject();
    check_dberror("Unable to load categories.");
    //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='" . $obj_fb_cat->getId() . "'");
    $modslist = $kunena_db->loadObjectList();
    check_dberror("Unable to load moderators.");
    //    echo '<div class="fb_pathway">';
    // List of Forums
    // show folder icon
    $return = '<img src="' . KUNENA_URLIMAGESPATH . 'folder.gif" border="0" alt="' . _GEN_FORUMLIST . '" style="vertical-align: middle;" />&nbsp;';
    // link to List of Forum Categories
    $return .= '&nbsp;' . fb_Link::GetKunenaLink(_GEN_FORUMLIST) . '<br />';
    // List of    Categories
    if ($objCatParentInfo) {
        if ($bool_set_title) {
            $document->setTitle(stripslashes($objCatParentInfo->name) . ' - ' . stripslashes($obj_fb_cat->getName()) . ' - ' . stripslashes($fbConfig->board_title));
        }
        // show lines
        $return .= '&nbsp;<img src="' . KUNENA_URLIMAGESPATH . 'tree-end.gif" alt="|-" border="0" style="vertical-align: middle;" />';
        $return .= '&nbsp;<img src="' . KUNENA_URLIMAGESPATH . 'folder.gif" alt="' . $objCatParentInfo->name . '" border="0" style="vertical-align: middle;" />&nbsp;';
        // link to Category
        $return .= '&nbsp;' . fblink::GetCategoryLink('listcat', $objCatParentInfo->id, $objCatParentInfo->name) . '<br />';
        $return .= '&nbsp;<img src="' . KUNENA_URLIMAGESPATH . 'tree-blank.gif" alt="| " border="0" style="vertical-align: middle;" />';
    } else {
        if ($bool_set_title) {
            $document->setTitle(stripslashes($obj_fb_cat->getName()) . ' - ' . stripslashes($fbConfig->board_title));
        }
    }
    // Forum
    // show lines
    $return .= '&nbsp;<img src="' . KUNENA_URLIMAGESPATH . 'tree-end.gif" alt="|-" border="0" style="vertical-align: middle;" />';
    $return .= '&nbsp;<img src="' . KUNENA_URLIMAGESPATH . 'folder.gif" alt="+" border="0" style="vertical-align: middle;" />&nbsp;';
    // Link to forum
    $return .= '&nbsp;' . fbLink::GetCategoryLink('listcat', $obj_fb_cat->getId(), $obj_fb_cat->getName());
    //check if this forum is locked
    if ($obj_fb_cat->getLocked()) {
        $return .= isset($fbIcons['forumlocked']) ? '&nbsp;&nbsp;<img src="' . KUNENA_URLICONSPATH . $fbIcons['forumlocked'] . '" border="0" alt="' . _GEN_LOCKED_FORUM . '" title="' . _GEN_LOCKED_FORUM . '"/>' : '    <img src="' . KUNENA_URLIMAGESPATH . 'lock.gif"    border="0" width="13" height="13" alt="' . _GEN_LOCKED_FORUM . '" title="' . _GEN_LOCKED_FORUM . '">';
    }
    // check if this forum is reviewed
    if ($obj_fb_cat->getReview()) {
        $return .= isset($fbIcons['forumreviewed']) ? '&nbsp;&nbsp;<img src="' . KUNENA_URLICONSPATH . $fbIcons['forumreviewed'] . '" border="0" alt="' . _GEN_REVIEWED . '" title="' . _GEN_REVIEWED . '"/>' : '    <img src="' . KUNENA_URLIMAGESPATH . 'review.gif" border="0" width="15" height="15" alt="' . _GEN_REVIEWED . '" title="' . _GEN_REVIEWED . '">';
    }
    //check if this forum is moderated
    if ($obj_fb_cat->getModerated()) {
        $return .= isset($fbIcons['forummoderated']) ? '&nbsp;&nbsp;<img src="' . KUNENA_URLICONSPATH . $fbIcons['forummoderated'] . '" border="0" alt="' . _GEN_MODERATED . '" title="' . _GEN_MODERATED . '"/>' : '    <img src="' . KUNENA_URLEMOTIONSPATH . 'moderate.gif" border="0"  alt="' . _GEN_MODERATED . '" title="' . _GEN_MODERATED . '"/>';
        $text = '';
        if (count($modslist) > 0) {
            foreach ($modslist as $mod) {
                $text = $text . ', ' . $mod->username;
            }
            $return .= '&nbsp;(' . _GEN_MODERATORS . ': ' . ltrim($text, ",") . ')';
        }
    }
    if ($obj_post != 0) {
        if ($bool_set_title) {
            $document->setTitle(stripslashes($obj_post->subject) . ' - ' . stripslashes($fbConfig->board_title));
        }
        // Topic
        // show lines
        $return .= '<br />&nbsp;<img src="' . KUNENA_URLIMAGESPATH . 'tree-blank.gif" alt="| " border="0" style="vertical-align: middle;" />';
        $return .= '&nbsp;<img src="' . KUNENA_URLIMAGESPATH . 'tree-blank.gif" alt="| " border="0" style="vertical-align: middle;" />';
        $return .= '&nbsp;<img src="' . KUNENA_URLIMAGESPATH . 'tree-end.gif" alt="|-" border="0" style="vertical-align: middle;" />';
        $return .= '&nbsp;<img src="' . KUNENA_URLIMAGESPATH . 'folder.gif" alt="+" border="0" style="vertical-align: middle;" />&nbsp;';
        $return .= '&nbsp;<b>' . $obj_post->subject . '</b>';
        // Check if the Topic is locked?
        if ((int) $obj_post->locked != 0) {
            $return .= '&nbsp;<img src="' . KUNENA_URLIMAGESPATH . 'lock.gif"    border="0" width="13" height="13" alt="' . _GEN_LOCKED_TOPIC . '" title="' . _GEN_LOCKED_TOPIC . '"/>';
        }
    }
    //    echo '</div>';
    return $return;
}
示例#13
0
 public function load($KunenaUser = null)
 {
     $tables = CKunenaTables::getInstance();
     if ($tables->check($this->GetConfigTableName())) {
         $this->_db->setQuery("SELECT * FROM " . $this->GetConfigTableName());
         $config = $this->_db->loadAssoc();
         check_dberror("Unable to load configuration table.");
         if ($config != null) {
             $this->bind($config);
         }
     }
     // Check for user specific overrides
     if (is_object($KunenaUser)) {
         // overload the settings with user specific ones
         $this->DoUserOverrides($KunenaUser);
         // Now the variables of the class contain the global settings
         // overloaded with the user specific ones
         // No other code changes required to support user specific settings.
     }
 }
示例#14
0
     $fireinfo = isset($fbIcons['forummoderated']) ? ' <img src="' . KUNENA_URLICONSPATH . $fbIcons['forummoderated'] . '" border="0" alt="' . _GEN_MODERATED . '" title="' . _GEN_MODERATED . '"/>' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'review.gif" border="0"  alt="' . _GEN_MODERATED . '" title="' . _GEN_MODERATED . '">';
     $moderatedForum = 1;
 }
 for ($i = 0; $i < $jr_forum_count; $i++) {
     if ($i == $jr_forum_count - 1) {
         echo '<div class="path-element-last">' . $jr_path_menu[$i] . $fireinfo . '</div>';
     } else {
         echo '<div class="path-element">' . $jr_path_menu[$i] . '</div>';
     }
 }
 //get viewing
 $fb_queryName = $fbConfig->username ? "username" : "name";
 $query = "SELECT w.userid, u.id, u.{$fb_queryName} AS username, k.showOnline FROM #__fb_whoisonline AS w LEFT JOIN #__users AS u ON u.id=w.userid LEFT JOIN #__fb_users AS k ON k.userid=w.userid WHERE w.link like '%" . addslashes($_SERVER['REQUEST_URI']) . "%' GROUP BY w.userid ORDER BY u.{$fb_queryName} ASC";
 $kunena_db->setQuery($query);
 $users = $kunena_db->loadObjectList();
 check_dberror("Unable to load who is online.");
 $total_viewing = count($users);
 if ($sfunc == "userprofile") {
     echo _USER_PROFILE;
     echo $username;
 } else {
     echo "<div class=\"path-element-users\">({$total_viewing} " . _KUNENA_PATHWAY_VIEWING . ")&nbsp;";
     $totalguest = 0;
     $lastone = end($users);
     $divider = ', ';
     foreach ($users as $user) {
         if ($user->userid != 0) {
             if ($user == $lastone && !$totalguest) {
                 $divider = '';
             }
             if ($user->showOnline > 0) {
示例#15
0
function com_install()
{
    $kunena_db = JFactory::getDBO();
    // Determine MySQL version from phpinfo
    $kunena_db->setQuery("SELECT VERSION() as mysql_version");
    $mysqlversion = $kunena_db->loadResult();
    //before we do anything else we want to check for minimum system requirements
    if (version_compare(phpversion(), KUNENA_MIN_PHP, ">=") && version_compare($mysqlversion, KUNENA_MIN_MYSQL, ">")) {
        //change fb menu icon
        $kunena_db->setQuery("SELECT id FROM #__components WHERE admin_menu_link = 'option=com_kunena'");
        $id = $kunena_db->loadResult();
        check_dberror("Unable to find component.");
        //add new admin menu images
        $kunena_db->setQuery("UPDATE #__components SET admin_menu_img  = 'components/com_kunena/images/kunenafavicon.png'" . ",   admin_menu_link = 'option=com_kunena' " . "WHERE id='" . $id . "'");
        $kunena_db->query();
        check_dbwarning("Unable to set admin menu image.");
        //install & upgrade class
        $fbupgrade = new fx_Upgrade("com_kunena", "kunena.install.upgrade.xml", "fb_", "install", false);
        // Start Installation/Upgrade
        $fbupgrade->doUpgrade();
        // THIS PROCEDURE IS UNTRANSLATED!
        ?>

<style>
.fbscs {
	margin: 0;
	padding: 0;
	list-style: none;
}

.fbscslist {
	list-style: none;
	padding: 5px 10px;
	margin: 3px 0;
	border: 1px solid #66CC66;
	background: #D6FEB8;
	display: block;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #333;
}

.fbscslisterror {
	list-style: none;
	padding: 5px 10px;
	margin: 3px 0;
	border: 1px solid #FF9999;
	background: #FFCCCC;
	display: block;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #333;
}
</style>

<div style="border: 1px solid #ccc; background: #FBFBFB; padding: 10px; text-align: left; margin: 10px 0;">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="20%" valign="top" style="padding: 10px;"><a
			href="index.php?option=com_kunena"><img
			src="components/com_kunena/images/kunena.logo.png" alt="Kunena"
			border="0"></a></td>

		<td width="80%" valign="top" style="padding: 10px;">
		<div style="clear: both; text-align: left; padding: 0 20px;">
		<ul class="fbscs">
		<?php 
        //
        // We might want to make the file copy below part of the install as well
        //
        jimport('joomla.filesystem.folder');
        $ret = JFolder::copy(JPATH_ROOT . DS . "components" . DS . "com_kunena" . DS . "kunena.files.distribution", JPATH_ROOT . DS . "images" . DS . "fbfiles", '', true);
        if ($ret !== true) {
            ?>

			<li class="fbscslisterror">
			<div
				style="border: 1px solid #FF6666; background: #FFCC99; padding: 10px; text-align: left; margin: 10px 0;">
			<img src='images/publish_x.png' align='absmiddle' />
			Creation/permission setting of the following directories failed: <br />
			<pre> <?php 
            echo JPATH_ROOT;
            ?>
/images/fbfiles/
			<?php 
            echo JPATH_ROOT;
            ?>
/images/fbfiles/avatars
			<?php 
            echo JPATH_ROOT;
            ?>
/images/fbfiles/avatars/gallery (you have to put avatars inside if you want to use it)
			<?php 
            echo JPATH_ROOT;
            ?>
/images/fbfiles/category_images
			<?php 
            echo JPATH_ROOT;
            ?>
/images/fbfiles/files
			<?php 
            echo JPATH_ROOT;
            ?>
/images/fbfiles/images
</pre> a) You can copy the contents of _kunena.files.distribution under
			components/com_kunena to your Joomla root, under images/ folder.

			<br />
			b) If you already have the contents there, but Kunena installation
			was not able to make them writable, then please do it manually.</div>

			</li>

			<?php 
        }
        ?>
		</ul>
		</div>

		<div
			style="border: 1px solid #FFCC99; background: #FFFFCC; padding: 20px; margin: 20px; clear: both;">
		<strong>I N S T A L L : <font color="green">Successful</font> </strong>
		<br />
		<br />
		<strong>php version: <font color="green"><?php 
        echo phpversion();
        ?>
</font> (Required &gt;= <?php 
        echo KUNENA_MIN_PHP;
        ?>
)</strong>
		<br />
		<strong>mysql version: <font color="green"><?php 
        echo $mysqlversion;
        ?>
</font> (Required &gt; <?php 
        echo KUNENA_MIN_MYSQL;
        ?>
)</strong>
		</div>

		<?php 
    } else {
        // Minimum version requirements not satisfied
        ?>
<style>
.fbscs {
	margin: 0;
	padding: 0;
	list-style: none;
}

.fbscslist {
	list-style: none;
	padding: 5px 10px;
	margin: 3px 0;
	border: 1px solid #66CC66;
	background: #D6FEB8;
	display: block;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #333;
}

.fbscslisterror {
	list-style: none;
	padding: 5px 10px;
	margin: 3px 0;
	border: 1px solid #FF9999;
	background: #FFCCCC;
	display: block;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #333;
}
</style>

<div style="border: 1px solid #ccc; background: #FBFBFB; padding: 10px; text-align: left; margin: 10px 0;">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="20%" valign="top" style="padding: 10px;"><a
			href="index.php?option=com_kunena"><img
			src="components/com_kunena/images/kunena.logo.png" alt="Kunena"
			border="0"></a></td>

		<td width="80%" valign="top" style="padding: 10px;">

		<div
			style="border: 1px solid #FFCC99; background: #FFFFCC; padding: 20px; margin: 20px; clear: both;">
		<strong>I N S T A L L : <font color="red">F A I L E D - Minimum Version Requirements not satisfied</font> </strong>
		<br />
		<br />
		<strong>php version: <font color="<?php 
        echo version_compare(phpversion(), KUNENA_MIN_PHP, '>=') ? 'green' : 'red';
        ?>
"><?php 
        echo phpversion();
        ?>
</font> (Required &gt;= <?php 
        echo KUNENA_MIN_PHP;
        ?>
)</strong>
		<br />
		<strong>mysql version: <font color="<?php 
        echo version_compare($mysqlversion, KUNENA_MIN_MYSQL, '>') ? 'green' : 'red';
        ?>
"><?php 
        echo $mysqlversion;
        ?>
</font> (Required &gt; <?php 
        echo KUNENA_MIN_MYSQL;
        ?>
)</strong>
		</div>

		<?php 
    }
    // Rest of footer
    ?>
		<div
			style="border: 1px solid #99CCFF; background: #D9D9FF; padding: 20px; margin: 20px; clear: both;">
		<strong>Thank you for using Kunena!</strong> <br />

		Kunena Forum Component <em>for Joomla! </em> &copy; by <a
			href="http://www.Kunena.com" target="_blank">www.Kunena.com</a>.
		All rights reserved.</div>
		</td>
	</tr>
</table>
</div>
	<?php 
}
示例#16
0
文件: view.php 项目: kaantunc/MYK-BOR
     $msg_profile .= KUNENA_URLICONSPATH . $fbIcons['userprofile'];
 } else {
     $msg_profile .= KUNENA_JLIVEURL . "/components/com_mypms/images/managecontact_icon.gif";
 }
 $msg_profile .= "\" alt=\"" . _VIEW_PROFILE . "\" border=\"0\" title=\"" . _VIEW_PROFILE . "\" /></a>";
 //mypms add buddy link
 $msg_buddy = "<a href=\"" . JRoute::_('index.php?option=com_mypms&amp;user='******'&amp;task=addbuddy') . "\"><img src=\"";
 if ($fbIcons['pms2buddy']) {
     $msg_buddy .= KUNENA_URLICONSPATH . $fbIcons['pms2buddy'];
 } else {
     $msg_buddy .= KUNENA_JLIVEURL . "/components/com_mypms/images/messages/addbuddy.gif";
 }
 $msg_buddy .= "\" alt=\"" . _VIEW_ADDBUDDY . "\" border=\"0\" title=\"" . _VIEW_ADDBUDDY . "\" /></a>";
 $kunena_db->setQuery("SELECT icq, ym, msn, aim, website, location FROM #__mypms_profiles WHERE user='******'");
 $profileitems = $kunena_db->loadObjectList();
 check_dberror("Unable to load mypms profile.");
 foreach ($profileitems as $profileitems) {
     if ($profileitems->aim) {
         $msg_aim = "<a href=\"aim:goim?screenname=" . str_replace(" ", "+", kunena_htmlspecialchars($profileitems->aim)) . "\"><img src=\"" . KUNENA_URLEMOTIONSPATH . "aim.png\" border=0 alt=\"\" /></a>";
     }
     if ($profileitems->icq) {
         $msg_icq = "<a href=\"http://www.icq.com/whitepages/wwp.php?uin=" . kunena_htmlspecialchars($profileitems->icq) . "\"><img src=\"" . KUNENA_URLEMOTIONSPATH . "icq.png\" border=0 alt=\"\" /></a>";
     }
     if ($profileitems->msn) {
         $msg_msn = "<a href=\"" . JRoute::_('index.php?option=com_mypms&amp;task=showprofile&amp;user=' . $PMSName) . "\"><img src=\"" . KUNENA_URLEMOTIONSPATH . "msn.png\" border=0 alt=\"\" /></a>";
     }
     if ($profileitems->ym) {
         $msg_yahoo = "<a href=\"http://edit.yahoo.com/config/send_webmesg?.target=" . kunena_htmlspecialchars($profileitems->ym) . "&.src=pg\"><img src=\"http://opi.yahoo.com/online?u=" . kunena_htmlspecialchars($profileitems->ym) . "&m=g&t=0\" border=0 alt=\"\" /></a>";
     }
     if ($profileitems->location) {
         $msg_loc = kunena_htmlspecialchars($profileitems->location);
示例#17
0
文件: post.php 项目: kaantunc/MYK-BOR
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
}
示例#18
0
 /**
  * function to retrieve the emoticons out of the database
  *
  * @author Niels Vandekeybus <*****@*****.**>
  * @version 1.0
  * @since 2005-04-19
  * @param boolean $grayscale
  *            determines wether to return the grayscale or the ordinary emoticon
  * @param boolean  $emoticonbar
  *            only list emoticons to be displayed in the emoticonbar (currently unused)
  * @return array
  *             array consisting of emoticon codes and their respective location (NOT the entire img tag)
  */
 function getEmoticons($grayscale, $emoticonbar = 0)
 {
     $kunena_db =& JFactory::getDBO();
     $grayscale == 1 ? $column = "greylocation" : ($column = "location");
     $sql = "SELECT code, `{$column}` FROM #__fb_smileys";
     if ($emoticonbar == 1) {
         $sql .= " WHERE emoticonbar='1'";
     }
     $kunena_db->setQuery($sql);
     $smilies = $kunena_db->loadObjectList();
     check_dberror("Unable to load smilies.");
     $smileyArray = array();
     foreach ($smilies as $smiley) {
         // We load all smileys in array, so we can sort them
         $smileyArray[$smiley->code] = '' . KUNENA_URLEMOTIONSPATH . $smiley->{$column};
         // This makes sure that for example :pinch: gets translated before :p
     }
     if ($emoticonbar == 0) {
         // don't sort when it's only for use in the emoticonbar
         array_multisort(array_keys($smileyArray), SORT_DESC, $smileyArray);
         reset($smileyArray);
     }
     return $smileyArray;
 }
示例#19
0
     check_dberror("Unable to load read topics.");
     /* Mark all these topics read */
     $kunena_db->setQuery("SELECT thread FROM #__fb_messages WHERE catid='{$catid}' AND thread NOT IN ('{$allreadyRead}') GROUP BY thread");
     $readForum = $kunena_db->loadObjectList();
     check_dberror("Unable to load messages.");
     $readTopics = '--';
     foreach ($readForum as $rf) {
         $readTopics = $readTopics . ',' . $rf->thread;
     }
     $readTopics = str_replace('--,', '', $readTopics);
     if ($allreadyRead != "") {
         $readTopics = $readTopics . ',' . $allreadyRead;
     }
     $kunena_db->setQuery("UPDATE #__fb_sessions set readtopics='{$readTopics}' WHERE userid={$kunena_my->id}");
     $kunena_db->query();
     check_dberror('Unable to update readtopics in session table.');
     $app->redirect(htmlspecialchars_decode(JRoute::_(KUNENA_LIVEURLREL . '&amp;func=showcat&amp;catid=' . $catid)), _GEN_FORUM_MARKED);
     break;
     #########################################################################################
 #########################################################################################
 case 'karma':
     include KUNENA_PATH_LIB . DS . 'kunena.karma.php';
     break;
     #########################################################################################
 #########################################################################################
 case 'bulkactions':
     switch ($do) {
         case "bulkDel":
             CKunenaTools::fbDeletePosts($is_Moderator, $return);
             break;
         case "bulkMove":
示例#20
0
 function get_search_forums(&$catids, $childforums = 1)
 {
     $fbSession =& CKunenaSession::getInstance();
     $kunena_db =& JFactory::getDBO();
     $kunena_my =& JFactory::getUser();
     /* get allowed forums */
     $allowed_string = '';
     if ($fbSession->allowed && $fbSession->allowed != 'na') {
         $allowed_string = "id IN ({$fbSession->allowed})";
     } else {
         $allowed_string = "published='1' AND pub_access='0'";
     }
     $kunena_db->setQuery("SELECT id, parent FROM #__fb_categories WHERE {$allowed_string}");
     $allowed_forums = $kunena_db->loadAssocList('id');
     check_dberror("Unable to get public categories.");
     $allow_list = array();
     foreach ($allowed_forums as $forum) {
         // Children list: parent => array(child1, child2, ...)
         $allow_list[$forum['parent']][] = $forum['id'];
     }
     $catids = split(',', $catids);
     $result = array();
     if (count($catids) > 0 && !in_array(0, $catids)) {
         // Algorithm:
         // Start with selected categories and pop them from the catlist one by one
         // Every popped item in the catlist will be added into result list
         // For every category: push all its children into the catlist
         while ($cur = array_pop($catids)) {
             $result[$cur] = $cur;
             if (array_key_exists($cur, $allow_list)) {
                 foreach ($allow_list[$cur] as $forum) {
                     if (!in_array($forum, $catids)) {
                         array_push($catids, $forum);
                     }
                 }
             }
         }
         $search_forums = implode(",", $result);
     } else {
         $search_forums = implode(",", array_keys($allowed_forums));
     }
     return $search_forums;
 }
示例#21
0
function dofreePDF($kunena_db)
{
    global $aro_group;
    $app =& JFactory::getApplication();
    $kunena_acl =& JFactory::getACL();
    $kunena_my =& JFactory::getUser();
    $fbConfig =& CKunenaConfig::getInstance();
    require_once KUNENA_PATH_LIB . DS . 'kunena.authentication.php';
    $is_Mod = 0;
    $catid = JRequest::getInt('catid', 2);
    if (!$is_admin) {
        $kunena_db->setQuery("SELECT userid FROM #__fb_moderation WHERE catid='{$catid}' AND userid='{$kunena_my->id}'");
        if ($kunena_db->loadResult()) {
            $is_Mod = 1;
        }
    } else {
        $is_Mod = 1;
    }
    //superadmins always are
    if (!$is_Mod) {
        //get all the info on this forum:
        $kunena_db->setQuery("SELECT id, pub_access, pub_recurse, admin_access, admin_recurse FROM #__fb_categories WHERE id='{$catid}'");
        $row = $kunena_db->loadObjectList();
        check_dberror("Unable to load category detail.");
        $allow_forum = explode(',', CKunenaTools::getAllowedForums($kunena_my->id, $aro_group->id, $kunena_acl));
    }
    if ($is_Mod || in_array($catid, $allow_forum)) {
        $id = JRequest::getInt('id', 1);
        $catid = JRequest::getInt('catid', 2);
        //first get the thread id for the current post to later on determine the parent post
        $kunena_db->setQuery("SELECT thread FROM #__fb_messages WHERE id='{$id}' AND catid='{$catid}'");
        $threadid = $kunena_db->loadResult();
        //load topic post and details
        $kunena_db->setQuery("SELECT a.*, b.* FROM #__fb_messages AS a, #__fb_messages_text AS b WHERE a.thread='{$threadid}' AND a.catid='{$catid}' AND a.parent='0' AND a.id=b.mesid");
        $row = $kunena_db->loadObjectList();
        check_dberror("Unable to load message details.");
        if (file_exists(KUNENA_ROOT_PATH . DS . 'includes/class.ezpdf.php')) {
            include KUNENA_ROOT_PATH . DS . 'includes/class.ezpdf.php';
            $pdf = new Cezpdf('a4', 'P');
            //A4 Portrait
        } elseif (class_exists('JDocument')) {
            $pdf = new fbpdfwrapper();
        } else {
            echo 'No supported pdf class found!';
            exit;
        }
        if (empty($row)) {
            //if the messages doesn't exist don't need to continue
            //Doesn't work Fatal error: Call to undefined method CKunenaLink::GetKunenaURL()
            //$app->redirect ( CKunenaLink::GetKunenaURL(true), _KUNENA_PDF_NOT_GENERATED_MESSAGE_DELETED );
        } else {
            $mes_text = $row[0]->message;
            filterHTML($mes_text);
            $pdf->ezSetCmMargins(2, 1.5, 1, 1);
            $pdf->selectFont('./fonts/Helvetica.afm');
            //choose font
            $all = $pdf->openObject();
            $pdf->saveState();
            $pdf->setStrokeColor(0, 0, 0, 1);
            // footer
            $pdf->line(10, 40, 578, 40);
            $pdf->line(10, 822, 578, 822);
            $pdf->addText(30, 34, 6, $fbConfig->board_title . ' - ' . $app->getCfg('sitename'));
            $strtmp = _KUNENA_PDF_VERSION;
            $strtmp = str_replace('%version%', "NEW VERSION GOES HERE", $strtmp);
            // TODO: fxstein - Need to change version handling
            $pdf->addText(250, 34, 6, $strtmp);
            $strtmp = _KUNENA_PDF_DATE;
            $strtmp = str_replace('%date%', date('j F, Y, H:i', CKunenaTools::fbGetShowTime()), $strtmp);
            $pdf->addText(450, 34, 6, $strtmp);
            $pdf->restoreState();
            $pdf->closeObject();
            $pdf->addObject($all, 'all');
            $pdf->ezSetDy(30);
            $txt0 = $row[0]->subject;
            $pdf->ezText($txt0, 14);
            $pdf->ezText(_VIEW_POSTED . " " . $row[0]->name . " - " . date(_DATETIME, $row[0]->time), 8);
            $pdf->ezText("_____________________________________", 8);
            //$pdf->line( 10, 780, 578, 780 );
            $txt3 = "\n";
            $txt3 .= stripslashes($mes_text);
            $pdf->ezText($txt3, 10);
            $pdf->ezText("\n============================================================================\n\n", 8);
            //now let's try to see if there's more...
            $kunena_db->setQuery("SELECT a.*, b.* FROM #__fb_messages AS a, #__fb_messages_text AS b WHERE a.catid='{$catid}' AND a.thread='{$threadid}' AND a.id=b.mesid AND a.parent!='0' ORDER BY a.time ASC");
            $replies = $kunena_db->loadObjectList();
            check_dberror("Unable to load messages & detail.");
            $countReplies = count($replies);
            if ($countReplies > 0) {
                foreach ($replies as $reply) {
                    $mes_text = $reply->message;
                    filterHTML($mes_text);
                    $txt0 = $reply->subject;
                    $pdf->ezText($txt0, 14);
                    $pdf->ezText(_VIEW_POSTED . " " . $reply->name . " - " . date(_DATETIME, $reply->time), 8);
                    $pdf->ezText("_____________________________________", 8);
                    $txt3 = "\n";
                    $txt3 .= stripslashes($mes_text);
                    $pdf->ezText($txt3, 10);
                    $pdf->ezText("\n============================================================================\n\n", 8);
                }
            }
            $pdf->ezStream();
        }
    } else {
        echo "You don't have access to this resource.";
    }
}
示例#22
0
文件: view.php 项目: kaantunc/MYK-BOR
        ?>
	<!-- F: List Actions Bottom -->

	<!-- B: Category List Bottom -->

<table class="fb_list_bottom" border = "0" cellspacing = "0" cellpadding = "0" width="100%">
    <tr>
      <td class="fb_list_moderators">

                    <!-- Mod List -->

                        <?php 
        //get the Moderator list for display
        $kunena_db->setQuery("SELECT m.*, u.* FROM #__fb_moderation AS m LEFT JOIN #__users AS u ON u.id=m.userid WHERE m.catid={$catid}");
        $modslist = $kunena_db->loadObjectList();
        check_dberror("Unable to load moderators.");
        ?>

                        <?php 
        if (count($modslist) > 0) {
            ?>
        <div class = "fbbox-bottomarea-modlist">
          <?php 
            echo '' . _GEN_MODERATORS . ": ";
            $mod_cnt = 0;
            foreach ($modslist as $mod) {
                if ($mod_cnt) {
                    echo ', ';
                }
                $mod_cnt++;
                echo CKunenaLink::GetProfileLink($fbConfig, $mod->userid, $fbConfig->username ? $mod->username : $mod->name);
示例#23
0
if (count($dse_groupid)) {
    $group_id = $dse_groupid[0]->gid;
} else {
    $group_id = 0;
}
$query = "SELECT COUNT(*) FROM #__fb_messages WHERE hold='0' AND userid='{$userid}' AND catid IN ({$fbSession->allowed})";
$kunena_db->setQuery($query);
$total = count($kunena_db->loadObjectList());
check_dberror("Unable to load messages.");
if ($total <= $limit) {
    $limitstart = 0;
}
$query = "SELECT a.*, b.id AS category, b.name AS catname, c.hits AS threadhits FROM #__fb_messages AS a, #__fb_categories AS b, #__fb_messages AS c, #__fb_messages_text AS d" . " WHERE a.catid=b.id AND a.thread=c.id AND a.id=d.mesid AND a.hold='0' AND a.userid='{$userid}' AND a.catid IN ({$fbSession->allowed}) ORDER BY time DESC";
$kunena_db->setQuery($query, $limitstart, $limit);
$items = $kunena_db->loadObjectList();
check_dberror("Unable to load messages.");
jimport('joomla.html.pagination');
$pageNav = new JPagination($total, $limitstart, $limit);
if (count($items) > 0) {
    $tabclass = array("sectiontableentry1", "sectiontableentry2");
    $k = 0;
    foreach ($items as $item) {
        $k = 1 - $k;
        if (!isset($item->created)) {
            $item->created = "";
        }
        $fbURL = JRoute::_("index.php?option=com_kunena&amp;func=view" . KUNENA_COMPONENT_ITEMID_SUFFIX . "&amp;catid=" . $item->catid . "&amp;id=" . $item->id . "#" . $item->id);
        $fbCatURL = JRoute::_("index.php?option=com_kunena" . KUNENA_COMPONENT_ITEMID_SUFFIX . "&amp;func=showcat&amp;catid=" . $item->catid);
        ?>

            <tr class = "<?php 
示例#24
0
    function editUserProfile($user, $subslist, $selectRank, $selectPref, $selectMod, $selectOrder, $uid, $modCats)
    {
        $fbConfig =& CKunenaConfig::getInstance();
        $kunena_db =& JFactory::getDBO();
        //fill the variables needed later
        $signature = $user->signature;
        $username = $user->name;
        $avatar = $user->avatar;
        $ordering = $user->ordering;
        //that's what we got now; later the 'future_use' columns can be used..
        $csubslist = count($subslist);
        //        include_once ('components/com_kunena/bb_adm.js');
        ?>

        <form action = "index2.php?option=<?php 
        echo $option;
        ?>
" method = "POST" name = "adminForm">
            <table border = 0 cellspacing = 0 width = "100%" align = "center" class = "adminheading">
                <tr>
                    <th colspan = "3" class = "user">
<?php 
        echo _KUNENA_PROFFOR;
        ?>
 <?php 
        echo $username;
        ?>
                    </th>
                </tr>
            </table>

            <table border = 0 cellspacing = 0 width = "100%" align = "center" class = "adminlist">
                <tr>
                    <th colspan = "3" class = "title">
<?php 
        echo _KUNENA_GENPROF;
        ?>

                </tr>

                <tr>
                    <td width = "150" class = "contentpane"><?php 
        echo _KUNENA_PREFOR;
        ?>
                    </td>

                    <td align = "left" valign = "top" class = "contentpane">
<?php 
        echo $selectOrder;
        ?>
                    </td>

                    <td>&nbsp;

                    </td>
                </tr>

                         <tr>
                    <td width = "150" class = "contentpane"><?php 
        echo _KUNENA_RANKS;
        ?>
                    </td>

                    <td align = "left" valign = "top" class = "contentpane">
<?php 
        echo $selectRank;
        ?>
                    </td>

                    <td>&nbsp;

                    </td>
                </tr>



                            <td width = "150" valign = "top" class = "contentpane">
<?php 
        echo _GEN_SIGNATURE;
        ?>
:
<?php 
        /*
        // FIXME: bbcode broken
        
                <br/> <?php echo $fbConfig->maxsig; ?>
        
                <input readonly type = text name = rem size = 3 maxlength = 3 value = "" class = "inputbox"> <?php echo _CHARS; ?><br/>
        <?php echo _HTML_YES; ?>
        */
        ?>
                            </td>

                            <td align = "left" valign = "top" class = "contentpane">
                                <textarea rows = "6"
                                    class = "inputbox"
                                    onMouseOver = "textCounter(this.form.message,this.form.rem,<?php 
        echo $fbConfig->maxsig;
        ?>
);"
                                    onClick = "textCounter(this.form.message,this.form.rem,<?php 
        echo $fbConfig->maxsig;
        ?>
);"
                                    onKeyDown = "textCounter(this.form.message,this.form.rem,<?php 
        echo $fbConfig->maxsig;
        ?>
);"
                                    onKeyUp = "textCounter(this.form.message,this.form.rem,<?php 
        echo $fbConfig->maxsig;
        ?>
);" cols = "50" type = "text" name = "message"><?php 
        echo html_entity_decode_utf8(stripslashes($signature));
        ?>
</textarea>

<?php 
        /*
        // FIXME: bbcode broken
                                        <br/>
        
                                        <input type = "button" class = "button" accesskey = "b" name = "addbbcode0" value = " B " style = "font-weight:bold; width: 30px" onClick = "bbstyle(0)" onMouseOver = "helpline('b')"/>
        
                                        <input type = "button" class = "button" accesskey = "i" name = "addbbcode2" value = " i " style = "font-style:italic; width: 30px" onClick = "bbstyle(2)" onMouseOver = "helpline('i')"/>
        
                                        <input type = "button" class = "button" accesskey = "u" name = "addbbcode4" value = " u " style = "text-decoration: underline; width: 30px" onClick = "bbstyle(4)" onMouseOver = "helpline('u')"/>
        
                                        <input type = "button" class = "button" accesskey = "p" name = "addbbcode14" value = "Img" style = "width: 40px" onClick = "bbstyle(14)" onMouseOver = "helpline('p')"/>
        
                                        <input type = "button" class = "button" accesskey = "w" name = "addbbcode16" value = "URL" style = "text-decoration: underline; width: 40px" onClick = "bbstyle(16)" onMouseOver = "helpline('w')"/>
        
                                        <br/><?php echo _KUNENA_COLOR; ?>:
        
                <select name = "addbbcode20" onChange = "bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver = "helpline('s')">
                    <option style = "color:black;  background-color: #FAFAFA" value = ""><?php echo _COLOUR_DEFAULT; ?></option>
        
                    <option style = "color:red;    background-color: #FAFAFA" value = "#FF0000"><?php echo _COLOUR_RED; ?></option>
        
                    <option style = "color:blue;   background-color: #FAFAFA" value = "#0000FF"><?php echo _COLOUR_BLUE; ?></option>
        
                    <option style = "color:green;  background-color: #FAFAFA" value = "#008000"><?php echo _COLOUR_GREEN; ?></option>
        
                    <option style = "color:yellow; background-color: #FAFAFA" value = "#FFFF00"><?php echo _COLOUR_YELLOW; ?></option>
        
                    <option style = "color:orange; background-color: #FAFAFA" value = "#FF6600"><?php echo _COLOUR_ORANGE; ?></option>
                </select>
        <?php echo _SMILE_SIZE; ?>:
        
                <select name = "addbbcode22" onChange = "bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onMouseOver = "helpline('f')">
                    <option value = "1"><?php echo _SIZE_VSMALL; ?></option>
        
        
                    <option value = "2"><?php echo _SIZE_SMALL; ?></option>
        
                    <option value = "3" selected><?php echo _SIZE_NORMAL; ?></option>
        
                    <option value = "4"><?php echo _SIZE_BIG; ?></option>
        
                    <option value = "5"><?php echo _SIZE_VBIG; ?></option>
                </select>
        
                <a href = "javascript: bbstyle(-1)"onMouseOver = "helpline('a')"><small><?php echo _BBCODE_CLOSA; ?></small></a>
        
                <br/>
        
                <input type = "text" name = "helpbox" size = "45" maxlength = "100" style = "width:400px; font-size:8px" class = "options" value = "<?php echo _BBCODE_HINT;?>"/>
        */
        ?>
                            </td>

                            <?php 
        if ($fbConfig->allowavatar) {
            ?>

                                <td class = "contentpane" align = "center">
<?php 
            echo _KUNENA_UAVATAR;
            ?>
<br/>

<?php 
            if ($avatar != '') {
                echo '<img src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '" ><br />';
                echo '<input type="hidden" value="' . $avatar . '" name="avatar">';
            } else {
                echo "<em>" . _KUNENA_NS . "</em><br />";
                echo '<input type="hidden" value="$avatar" name="avatar">';
            }
            ?>
                                </td>

                            <?php 
        } else {
            echo "<td>&nbsp;</td>";
            echo '<input type="hidden" value="" name="avatar">';
        }
        ?>
                        </tr>

                        <tr>
                            <td colspan = "2" class = "contentpane">
                                <input type = "checkbox" value = "1" name = "deleteSig"><i><?php 
        echo _KUNENA_DELSIG;
        ?>
</i>
                            </td>

                            <?php 
        if ($fbConfig->allowavatar) {
            ?>

                                <td class = "contentpane">
                                    <input type = "checkbox" value = "1" name = "deleteAvatar"><i><?php 
            echo _KUNENA_DELAV;
            ?>
</i>
                                </td>

                            <?php 
        } else {
            echo "<td>&nbsp;</td>";
        }
        ?>
                        </tr>

                        <tr cellspacing = "3" colspan = "2">
                            &nbsp;

                            </td>
                        </tr>
            </table>

        <table border = 0 cellspacing = 0 width = "100%" align = "center" class = "adminform">
            <tr>
                <th colspan = "2" class = "title">
<?php 
        echo _KUNENA_MOD_NEW;
        ?>

            </td>
            </tr>
                        </tr>

                        <tr>


    <td width = "150" class = "contentpane">
    <?php 
        echo _KUNENA_ISMOD;
        ?>

                    <?php 
        //admins are always moderators
        if (CKunenaTools::isModOrAdmin($uid)) {
            echo _KUNENA_ISADM;
            ?>
 <input type = "hidden" name = "moderator" value = "1">
                    <?php 
        } else {
            echo $selectMod;
        }
        ?>
                        </td>
                        <td>
<?php 
        echo $modCats;
        ?>
                        </td>
                        </tr>

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

            <input type = "hidden" name = "task" value = ""/>

            <input type = "hidden" name = "option" value = "com_kunena"/>
        </form>

        <table border = 0 cellspacing = 0 width = "100%" align = "center" class = "adminform">
            <tr>
                <th colspan = "2" class = "title">
<?php 
        echo _KUNENA_SUBFOR;
        ?>
 <?php 
        echo $username;
        ?>

            </td>
            </tr>

            <?php 
        $enum = 1;
        //reset value
        $k = 0;
        //value for alternating rows
        if ($csubslist > 0) {
            foreach ($subslist as $subs) {
                //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 subscription messages.");
                foreach ($subdet as $sub) {
                    $k = 1 - $k;
                    echo "<tr class=\"row{$k}\">";
                    echo "  <td>{$enum}: " . html_entity_decode_utf8(stripslashes($sub->subject)) . " by " . html_entity_decode_utf8(stripslashes($sub->name));
                    echo "  <td>&nbsp;</td>";
                    echo "</tr>";
                    $enum++;
                }
            }
        } else {
            echo "<tr><td class=\"message\">" . _KUNENA_NOSUBS . "</td></tr>";
        }
        echo "</table>";
    }
示例#25
0
    /**
     * Main upgrade function. Processes XML file
     */
    function doUpgrade()
    {
        require_once KUNENA_ROOT_PATH . DS . 'includes/domit/xml_domit_lite_include.php';
        if (!$this->silent) {
            ?>
			<script language=JavaScript>
			function showDetail(srcElement) {
				var targetID, srcElement, targetElement, imgElementID, imgElement;
				targetID = srcElement.id + "_details";
				imgElementID = srcElement.id + "_img";

				targetElement = document.getElementById(targetID);
				imgElement = document.getElementById(imgElementID);
				if (targetElement.style.display == "none") {
					targetElement.style.display = "";
					imgElement.src = "images/collapseall.png";
				} else {
					targetElement.style.display = "none";
					imgElement.src = "images/expandall.png";
				}
			}
			</script>
			<style>
			.details {
				font-family: courier;
				background-color: #EEEEEE;
				border: 1px dashed #BBBBBB;
				padding-left: 10px;
				margin-left: 20px;
				margin-top: 5px;
			</style>
			<?php 
        }
        $componentBaseDir = KUNENA_ROOT_PATH_ADMIN . DS . 'components/';
        $this->_upgradeDir = $componentBaseDir . $this->component . DS . $this->subdir;
        //get current version, check if version table exists
        $createVersionTable = 1;
        $upgrade = null;
        // Legacy enabler
        // Versions prior to 1.0.5 did not came with a version table inside the database
        // this would make the installer believe this is a fresh install. We need to perform
        // a 'manual' check if this is going to be an upgrade and if so create that table
        // and write a dummy version entry to force an upgrade.
        $kunena_db =& JFactory::getDBO();
        $kunena_db->setQuery("SHOW TABLES LIKE " . $kunena_db->quote($kunena_db->getPrefix() . 'fb_messages'));
        $kunena_db->query();
        check_dberror("Unable to search for messages table.");
        if ($kunena_db->getNumRows()) {
            // fb tables exist, now lets see if we have a version table
            $kunena_db->setQuery("SHOW TABLES LIKE " . $kunena_db->quote($this->versionTable));
            $createVersionTable = $kunena_db->loadResult();
            $createVersionTable = empty($createVersionTable);
            check_dberror("Unable to search for version table.");
            if ($createVersionTable) {
                //version table does not exist - this is a pre 1.0.5 install - lets create
                $this->createVersionTable();
                // insert dummy version entry to force upgrade
                $this->insertDummyVersion();
                $createVersionTable = 0;
            }
        }
        if (!$createVersionTable) {
            // lets see if we need to update the version table layout from it original
            $currentVersion = $this->getLatestVersion($this->versionTable);
            if (!is_object($currentVersion)) {
                // version table exisits, but we cannot retrieve the latest version
                // in this case we assume the table layout might have changed
                // backup old table and create new version table
                $this->backupVersionTable();
                $this->dropVersionTable();
                $this->createVersionTable();
                // insert dummy version info to start with
                $this->insertDummyVersion();
            }
            //check for latest version and date entry
            $currentVersion = $this->getLatestVersion($this->versionTable);
            if (!$currentVersion->version && !$currentVersion->versiondate) {
                //there was an error in retrieving the version and date, goto install mode
                $upgrade = 0;
            } else {
                //OK, no error, there is a version table and it also contains version and date information, switching to upgrade mode
                $upgrade = 1;
            }
        }
        //Create version table
        if ($createVersionTable == 1) {
            if (!$this->createVersionTable()) {
                $this->_error = "DB function failed with error number <b>" . $kunena_db->_errorNum . "</b><br/>";
                $this->_error .= $kunena_db->getErrorMsg();
                $img = "publish_x.png";
                $this->_return = false;
            } else {
                $img = "tick.png";
            }
            if (!$this->silent) {
                ?>
				<table class="adminlist">
				<tr>
					<td>Creating version table</td>
					<td width="20"><a href="#" onMouseOver="return overlib('<?php 
                echo $this->_error;
                ?>
', BELOW, RIGHT,WIDTH,300);" onmouseout="return nd();" ><img src="images/<?php 
                echo $img;
                ?>
" border="0"></a></td>
				</tr>
				</table>
				<?php 
            }
        }
        //initiate XML doc
        $xmlDoc = new DOMIT_Lite_Document();
        $xmlDoc->loadXML($this->_upgradeDir . DS . $this->xmlFileName, false, true);
        //load root element and check XML version (for future use)
        $root =& $xmlDoc->documentElement;
        $comUpgradeVersion = $root->getAttribute("version");
        //here comes the real stuff
        if ($upgrade == 0) {
            $installElement =& $root->firstChild;
            $version = $installElement->getAttribute("version");
            $versiondate = $installElement->getAttribute("versiondate");
            $build = $installElement->getAttribute("build");
            $versionname = $installElement->getAttribute("versionname");
            if (!$this->silent) {
                ?>
				<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
				<script  type="text/javascript" src="<?php 
                echo JURI::root();
                ?>
/includes/js/overlib_mini.js"></script>
				<table class="adminlist">
					<tr>
						<th colspan="2">Installing "<?php 
                echo $this->component;
                ?>
" (Version: <?php 
                echo $version;
                ?>
 / Date: <?php 
                echo $versiondate;
                ?>
 / Build: <?php 
                echo $build;
                ?>
 / VersionName: <?php 
                echo $versionname;
                ?>
 )</th>
					</tr>
				<?php 
            }
            //install mode, run install queries
            $installElement = $root->getElementsByPath('install', 1);
            if (!is_null($installElement)) {
                $this->processNode($installElement, 1);
            }
            if (!$this->silent) {
                ?>
				</table>
				<?php 
            }
            //Store version info and date in database
            $this->insertVersionData($version, $versiondate, $build, $versionname);
        } else {
            if (!$this->silent) {
                ?>
				<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
				<script  type="text/javascript" src="<?php 
                echo JURI::root();
                ?>
/includes/js/overlib_mini.js"></script>
				<table class="adminlist">
					<tr>
						<th colspan="2">Upgrading "<?php 
                echo $this->component;
                ?>
" (Version: <?php 
                echo @$currentVersion->version;
                ?>
 / Version Date: <?php 
                echo @$currentVersion->versiondate;
                ?>
 / Install Date: <?php 
                echo @$currentVersion->installdate;
                ?>
 / Build: <?php 
                echo @$currentVersion->build;
                ?>
 / Version Name: <?php 
                echo @$currentVersion->versionname;
                ?>
)</th>
					</tr>
				<?php 
            }
            //upgrade mode
            $upgradeElement = $root->getElementsByPath('upgrade', 1);
            if (!is_null($upgradeElement)) {
                //walk through the versions
                $numChildrenMain =& $upgradeElement->childCount;
                $childNodesMain =& $upgradeElement->childNodes;
                for ($k = 0; $k < $numChildrenMain; $k++) {
                    $versionElement =& $childNodesMain[$k];
                    $version = $versionElement->getAttribute("version");
                    $versiondate = $versionElement->getAttribute("versiondate");
                    $build = $versionElement->getAttribute("build");
                    $versionname = $versionElement->getAttribute("versionname");
                    //when legacy version exists, just compare version, if date exists as well, compare date
                    if ($currentVersion->versiondate && $versiondate > $currentVersion->versiondate or version_compare($version, $currentVersion->version, '>') or version_compare($version, $currentVersion->version, '==') && $build > $currentVersion->build) {
                        //these instructions are for a newer version than the currently installed version
                        if (!$this->silent) {
                            ?>
							<tr>
								<td colspan="2">&nbsp;</td>
							</tr>
							<tr>
								<th colspan="2">Version: <?php 
                            echo $version;
                            ?>
 (Version Date: <?php 
                            echo $versiondate;
                            ?>
, Build: <?php 
                            echo $build;
                            ?>
, Version Name: <?php 
                            echo $versionname;
                            ?>
)</th>
							</tr>
							<?php 
                        }
                        //Store version info and date in database
                        $this->insertVersionData($version, $versiondate, $build, $versionname);
                        $added_version = 1;
                        $this->processNode($versionElement, $k);
                    }
                    //end if version newer check
                }
                //end version element loop
                if (!isset($added_version)) {
                    $this->insertVersionData($version, $versiondate, $build, $versionname);
                }
            }
            //end if !is_null($upgradeElement)
            if (!$this->silent) {
                ?>
				</table>
				<?php 
            }
        }
        //end main if upgrade or not
        return $this->_return;
    }
示例#26
0
    <tbody id = "recentposts_tbody">
        <tr>
            <td valign = "top">
                <?php 
// find messages
$sq1 = $category ? "AND msg2.catid in ({$category})" : "";
if ($fbConfig->latestsinglesubject) {
    $sq2 = "SELECT msg1.* FROM (SELECT msg2.* FROM #__fb_messages msg2" . " WHERE msg2.hold='0' AND moved='0' AND msg2.catid IN ({$fbSession->allowed}) {$sq1} ORDER BY msg2.time" . ($fbConfig->latestreplysubject ? " DESC" : "") . ") msg1" . " GROUP BY msg1.thread";
} else {
    $sq2 = "SELECT msg2.* FROM #__fb_messages msg2" . " WHERE msg2.hold='0' AND moved='0' AND msg2.catid IN ({$fbSession->allowed}) {$sq1}";
}
$query = " SELECT u.id, IFNULL(u.username, '" . _KUNENA_GUEST . "') AS username, IFNULL(u.name,'" . _KUNENA_GUEST . "') AS name," . " msg.subject, msg.id AS fbid, msg.catid, from_unixtime(msg.time) AS date," . " thread.hits AS hits, msg.locked, msg.topic_emoticon, msg.parent, cat.id AS catid, cat.name AS catname" . " FROM ({$sq2}) msg" . " LEFT JOIN #__users u ON u.id = msg.userid" . " LEFT JOIN #__fb_categories cat ON cat.id = msg.catid" . " LEFT JOIN #__fb_messages thread ON thread.id = msg.thread" . " ORDER BY msg.time DESC";
$kunena_db->setQuery($query, 0, $count);
$rows = $kunena_db->loadObjectList();
check_dberror("Unable to load recent messages.");
// cycle through the returned rows displaying them in a table
// with links to the content item
// escaping in and out of php is now permitted
$numitems = count($rows);
if ($numitems > $count_per_page) {
    include_once KUNENA_PATH_TEMPLATE_DEFAULT . DS . "plugin/recentposts/function.tabber.php";
    $tabs = new my_tabs(1, 1);
    $tabs->my_pane_start('mod_fb_last_subjects-pane');
    $tabs->my_tab_start(1, 1);
}
$i = 0;
$tabid = 1;
$k = 2;
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr  class = \"fb_sth\" >";