} else { $output .= CKunenaLink::GetLatestPageLink($func, $i, 'follow', '', $sel); } } if ($endpage < $totalpages) { if ($endpage < $totalpages - 1) { $output .= "..."; } $output .= CKunenaLink::GetLatestPageLink($func, $totalpages, 'follow', '', $sel); } $output .= '</span>'; return $output; } if (!$kunena_my->id && $func == "mylatest") { header("HTTP/1.1 307 Temporary Redirect"); header("Location: " . htmlspecialchars_decode(CKunenaLink::GetShowLatestURL())); $app->close(); } require_once KUNENA_PATH_LIB . DS . 'kunena.authentication.php'; //resetting some things: $lockedForum = 0; $lockedTopic = 0; $topicSticky = 0; if ('' == $sel || !$kunena_my->id && $sel == 0) { /* if($kunena_my->id != 0) { $sel="0"; } // Users: show messages after last visit else { $sel="720"; } // Others: show 1 month as default */ $sel = "720"; } $show_list_time = $sel;
/** * 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(); $app =& JFactory::getApplication(); $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 { $app->enqueueMessage(_POST_NO_PUBACCESS1, 'notice'); $app->enqueueMessage(_POST_NO_PUBACCESS2, 'notice'); $app->redirect(CKunenaLink::GetShowLatestURL()); } return 0; } }