示例#1
0
文件: post.php 项目: kaantunc/MYK-BOR
/**
 * Checks if a user has postpermission in given thread
 * @param database object
 * @param int
 * @param int
 * @param boolean
 * @param boolean
 */
function hasPostPermission($kunena_db, $catid, $id, $userid, $pubwrite, $ismod)
{
    $fbConfig =& CKunenaConfig::getInstance();
    $topicLock = 0;
    if ($id != 0) {
        $kunena_db->setQuery("SELECT thread FROM #__fb_messages WHERE id='{$id}'");
        $topicID = $kunena_db->loadResult();
        $lockedWhat = _GEN_TOPIC;
        if ($topicID != 0) {
            $sql = "SELECT locked FROM #__fb_messages WHERE id='{$topicID}'";
        } else {
            $sql = "SELECT locked FROM #__fb_messages WHERE id='{$id}'";
        }
        $kunena_db->setQuery($sql);
        $topicLock = $kunena_db->loadResult();
    }
    if ($topicLock == 0) {
        //topic not locked; check if forum is locked
        $kunena_db->setQuery("SELECT locked FROM #__fb_categories WHERE id='{$catid}'");
        $topicLock = $kunena_db->loadResult();
        $lockedWhat = _GEN_FORUM;
    }
    if (($userid != 0 || $pubwrite) && ($topicLock == 0 || $ismod)) {
        return 1;
    } else {
        //user is not allowed to write a post
        if ($topicLock) {
            echo "<p align=\"center\">{$lockedWhat} " . _POST_LOCKED . "<br />";
            echo _POST_NO_NEW . "<br /><br /></p>";
        } else {
            echo "<p align=\"center\">";
            echo _POST_NO_PUBACCESS1 . "<br />";
            echo _POST_NO_PUBACCESS2 . "<br /><br />";
            if ($fbConfig->fb_profile == 'cb') {
                echo '<a href="' . CKunenaCBProfile::getRegisterURL() . '">' . _POST_NO_PUBACCESS3 . '</a><br /></p>';
            } else {
                echo '<a href="' . JRoute::_('index.php?option=com_registration&amp;task=register') . '">' . _POST_NO_PUBACCESS3 . '</a><br /></p>';
            }
        }
        return 0;
    }
}
示例#2
0
    if ($fbConfig->fb_profile == "clexuspm") {
        $jr_profilelink = '<a href="' . JRoute::_(KUNENA_LIVEURLREL . '&amp;func=myprofile') . '" >' . _PROFILEBOX_MYPROFILE . '</a>';
    } else {
        $jr_profilelink = '<a href="' . JRoute::_(KUNENA_LIVEURLREL . '&amp;func=myprofile') . '" >' . _PROFILEBOX_MYPROFILE . '</a>';
    }
}
$jr_myposts = '<a href="' . JRoute::_(KUNENA_LIVEURLREL . '&amp;func=showauthor&amp;task=showmsg&amp;auth=' . $kunena_my->id . '') . '" >' . _PROFILEBOX_SHOW_MYPOSTS . '</a>';
$jr_latestpost = JRoute::_(KUNENA_LIVEURLREL . '&amp;func=latest');
?>

<?php 
// AFTER LOGIN AREA
if ($fbConfig->fb_profile == 'cb') {
    $loginlink = CKunenaCBProfile::getLoginURL();
    $logoutlink = CKunenaCBProfile::getLogoutURL();
    $registerlink = CKunenaCBProfile::getRegisterURL();
    $lostpasslink = CKunenaCBProfile::getLostPasswordURL();
} else {
    if ($fbConfig->fb_profile == 'jomsocial') {
        $loginlink = JRoute::_('index.php?option=com_community&amp;view=frontpage');
        $logoutlink = JRoute::_('index.php?option=com_community&amp;view=frontpage');
        $registerlink = JRoute::_('index.php?option=com_community&amp;view=register');
        $lostpasslink = JRoute::_('index.php?option=com_community&amp;view=frontpage');
    } else {
        $loginlink = JRoute::_('index.php?option=com_user&amp;view=login');
        $logoutlink = JRoute::_('index.php?option=com_user&amp;view=login');
        $registerlink = JRoute::_('index.php?option=com_user&amp;view=register&amp;Itemid=' . $Itemid);
        $lostpasslink = JRoute::_('index.php?option=com_user&amp;view=reset&amp;Itemid=' . $Itemid);
    }
}
if ($kunena_my->id) {