/** * 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&task=register') . '">' . _POST_NO_PUBACCESS3 . '</a><br /></p>'; } } return 0; } }
if ($fbConfig->fb_profile == "clexuspm") { $jr_profilelink = '<a href="' . JRoute::_(KUNENA_LIVEURLREL . '&func=myprofile') . '" >' . _PROFILEBOX_MYPROFILE . '</a>'; } else { $jr_profilelink = '<a href="' . JRoute::_(KUNENA_LIVEURLREL . '&func=myprofile') . '" >' . _PROFILEBOX_MYPROFILE . '</a>'; } } $jr_myposts = '<a href="' . JRoute::_(KUNENA_LIVEURLREL . '&func=showauthor&task=showmsg&auth=' . $kunena_my->id . '') . '" >' . _PROFILEBOX_SHOW_MYPOSTS . '</a>'; $jr_latestpost = JRoute::_(KUNENA_LIVEURLREL . '&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&view=frontpage'); $logoutlink = JRoute::_('index.php?option=com_community&view=frontpage'); $registerlink = JRoute::_('index.php?option=com_community&view=register'); $lostpasslink = JRoute::_('index.php?option=com_community&view=frontpage'); } else { $loginlink = JRoute::_('index.php?option=com_user&view=login'); $logoutlink = JRoute::_('index.php?option=com_user&view=login'); $registerlink = JRoute::_('index.php?option=com_user&view=register&Itemid=' . $Itemid); $lostpasslink = JRoute::_('index.php?option=com_user&view=reset&Itemid=' . $Itemid); } } if ($kunena_my->id) {