本文整理汇总了PHP中CKunenaLink类的典型用法代码示例。如果您正苦于以下问题:PHP CKunenaLink类的具体用法?PHP CKunenaLink怎么用?PHP CKunenaLink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CKunenaLink类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: KunenaLatestxPagination
function KunenaLatestxPagination($func, $sel, $page, $totalpages, $maxpages)
{
$startpage = $page - floor($maxpages / 2) < 1 ? 1 : $page - floor($maxpages / 2);
$endpage = $startpage + $maxpages;
if ($endpage > $totalpages) {
$startpage = $totalpages - $maxpages < 1 ? 1 : $totalpages - $maxpages;
$endpage = $totalpages;
}
$output = '<span class="fb_pagination">' . _PAGE;
if ($startpage > 1) {
if ($endpage < $totalpages) {
$endpage--;
}
$output .= CKunenaLink::GetLatestPageLink($func, 1, 'follow', '', $sel);
if ($startpage > 2) {
$output .= "...";
}
}
for ($i = $startpage; $i <= $endpage && $i <= $totalpages; $i++) {
if ($page == $i) {
$output .= "<strong>{$i}</strong>";
} 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;
}
示例2: KunenaShowcatPagination
function KunenaShowcatPagination($catid, $page, $totalpages, $maxpages)
{
$startpage = $page - floor($maxpages / 2) < 1 ? 1 : $page - floor($maxpages / 2);
$endpage = $startpage + $maxpages;
if ($endpage > $totalpages) {
$startpage = $totalpages - $maxpages < 1 ? 1 : $totalpages - $maxpages;
$endpage = $totalpages;
}
$output = '<span class="fb_pagination">' . _PAGE;
if ($startpage > 1) {
if ($endpage < $totalpages) {
$endpage--;
}
$output .= CKunenaLink::GetCategoryPageLink('showcat', $catid, 1, 1, $rel = 'follow');
if ($startpage > 2) {
$output .= "...";
}
}
for ($i = $startpage; $i <= $endpage && $i <= $totalpages; $i++) {
if ($page == $i) {
$output .= "<strong>{$i}</strong>";
} else {
$output .= CKunenaLink::GetCategoryPageLink('showcat', $catid, $i, $i, $rel = 'follow');
}
}
if ($endpage < $totalpages) {
if ($endpage < $totalpages - 1) {
$output .= "...";
}
$output .= CKunenaLink::GetCategoryPageLink('showcat', $catid, $totalpages, $totalpages, $rel = 'follow');
}
$output .= '</span>';
return $output;
}
示例3: results
public function results() {
require_once KPATH_SITE . '/lib/kunena.link.class.php';
$model = $this->getModel('Search');
$this->app->redirect ( CKunenaLink::GetSearchURL('advsearch', $model->getState('searchwords'),
$model->getState('list.start'), $model->getState('list.limit'), $model->getUrlParams(), false) );
}
示例4: KunenaViewPagination
function KunenaViewPagination($catid, $threadid, $page, $totalpages, $maxpages)
{
$fbConfig =& CKunenaConfig::getInstance();
$startpage = $page - floor($maxpages / 2) < 1 ? 1 : $page - floor($maxpages / 2);
$endpage = $startpage + $maxpages;
if ($endpage > $totalpages) {
$startpage = $totalpages - $maxpages < 1 ? 1 : $totalpages - $maxpages;
$endpage = $totalpages;
}
$output = '<span class="fb_pagination">' . _PAGE;
if ($startpage > 1) {
if ($endpage < $totalpages) {
$endpage--;
}
$output .= CKunenaLink::GetThreadPageLink($fbConfig, 'view', $catid, $threadid, 1, $fbConfig->messages_per_page, 1, '', $rel = 'follow');
if ($startpage > 2) {
$output .= "...";
}
}
for ($i = $startpage; $i <= $endpage && $i <= $totalpages; $i++) {
if ($page == $i) {
$output .= "<strong>{$i}</strong>";
} else {
$output .= CKunenaLink::GetThreadPageLink($fbConfig, 'view', $catid, $threadid, $i, $fbConfig->messages_per_page, $i, '', $rel = 'follow');
}
}
if ($endpage < $totalpages) {
if ($endpage < $totalpages - 1) {
$output .= "...";
}
$output .= CKunenaLink::GetThreadPageLink($fbConfig, 'view', $catid, $threadid, $totalpages, $fbConfig->messages_per_page, $totalpages, '', $rel = 'follow');
}
$output .= '</span>';
return $output;
}
示例5: getInboxLink
public function getInboxLink($text)
{
if (!$text) {
$text = JText::_('COM_KUNENA_PMS_INBOX');
}
return CKunenaLink::GetHrefLink(CRoute::_('index.php?option=com_community&view=inbox'), $text, '', 'follow');
}
示例6: getUsersOnlineList
public function getUsersOnlineList($sfunc)
{
$users = $this->_getOnlineUsers($sfunc);
$onlineUsersList = array();
$totalguests = $totalhidden = 0;
foreach ($users as $user) {
if ($user->userid) {
if ($user->showOnline) {
$onlineUsersList[] = CKunenaLink::GetProfileLink($user->userid, $user->username);
} else {
$totalhidden++;
}
} else {
$totalguests++;
}
}
// Show hidden users as quests:
$totalguests += $totalhidden;
if ($totalguests > 0) {
if ($totalguests == 1) {
$onlineUsersList[] = '(' . $totalguests . ') ' . JText::_('COM_KUNENA_WHO_ONLINE_GUEST');
} else {
$onlineUsersList[] = '(' . $totalguests . ') ' . JText::_('COM_KUNENA_WHO_ONLINE_GUESTS');
}
}
return implode(', ', $onlineUsersList);
}
示例7: getInboxLink
public function getInboxLink($text)
{
if (!$text) {
$text = JText::_('COM_KUNENA_PMS_INBOX');
}
return CKunenaLink::GetSefHrefLink($this->uddeim->getLinkToBox('inbox', false), $text, '', 'follow');
}
示例8: kunenaAvatar
function kunenaAvatar($userid)
{
$kunena_user = KunenaFactory::getUser((int) $userid);
$username = $kunena_user->getName();
// Takes care of realname vs username setting
$avatarlink = $kunena_user->getAvatarLink('', $this->params->get('avatar_w'), $this->params->get('avatar_h'));
return CKunenaLink::GetProfileLink($userid, $avatarlink, $username);
}
示例9: getUserLink
/**
* adds the link for the connect param
* @since 1.7.3
* @param $user pass-by-reference
* @return void
*/
private function getUserLink(&$user)
{
$username = KunenaFactory::getUser($user['userid'])->getName();
if ($user['leapcorrection'] == $this->timeo->format('z', true) + 1) {
$subject = getSubject($username);
$db = JFactory::getDBO();
$query = "SELECT id,catid,subject,time as year FROM #__kunena_messages WHERE subject='{$subject}'";
$db->setQuery($query, 0, 1);
$post = $db->loadAssoc();
if ($db->getErrorMsg()) {
KunenaError::checkDatabaseError();
}
$catid = $this->params->get('bcatid');
$postyear = new JDate($post['year'], $this->soffset);
if (empty($post) && !empty($catid) || !empty($post) && !empty($catid) && $postyear->format('Y', true) < $this->timeo->format('Y', true)) {
$botname = $this->params->get('swkbbotname', JText::_('SW_KBIRTHDAY_FORUMPOST_BOTNAME_DEF'));
$botid = $this->params->get('swkbotid');
$time = CKunenaTimeformat::internalTime();
//Insert the birthday thread into DB
$query = "INSERT INTO #__kunena_messages (catid,name,userid,email,subject,time, ip)\n\t\t \t\tVALUES({$catid},'{$botname}',{$botid}, '','{$subject}', {$time}, '')";
$db->setQuery($query);
$db->query();
if ($db->getErrorMsg()) {
KunenaError::checkDatabaseError();
}
//What ID get our thread?
$messid = (int) $db->insertID();
//Insert the thread message into DB
$message = getMessage($username);
$query = "INSERT INTO #__kunena_messages_text (mesid,message)\n VALUES({$messid},'{$message}')";
$db->setQuery($query);
$db->query();
if ($db->getErrorMsg()) {
KunenaError::checkDatabaseError();
}
//We know the thread ID so we can update the parent thread id with it's own ID because we know it's
//the first post
$query = "UPDATE #__kunena_messages SET thread={$messid} WHERE id={$messid}";
$db->setQuery($query);
$db->query();
if ($db->getErrorMsg()) {
KunenaError::checkDatabaseError();
}
// now increase the #s in categories
CKunenaTools::modifyCategoryStats($messid, 0, $time, $catid);
$user['link'] = CKunenaLink::GetViewLink('view', $messid, $catid, '', $username);
$uri = JFactory::getURI();
if ($uri->getVar('option') == 'com_kunena') {
$app =& JFactory::getApplication();
$app->redirect($uri->toString());
}
} elseif (!empty($post)) {
$user['link'] = CKunenaLink::GetViewLink('view', $post['id'], $post['catid'], '', $username);
}
} else {
$user['link'] = CKunenaLink::GetProfileLink($user['userid']);
}
}
示例10: fbSetTimeout
function fbSetTimeout($url, $time, $script = 1)
{
$url = JRoute::_($url);
if ($script) {
echo CKunenaLink::GetAutoRedirectHTML($url, $time);
} else {
echo 'setTimeout("location=\'' . $url . '\'",$time)';
}
}
示例11: displayDefault
function displayDefault($tpl = null)
{
require_once KPATH_SITE . '/lib/kunena.link.class.php';
$kunena_stats = KunenaForumStatistics::getInstance();
$kunena_stats->loadAll();
$this->assign($kunena_stats);
$this->latestMemberLink = KunenaFactory::getUser(intval($this->lastUserId))->getLink();
$this->userlist = CKunenaLink::GetUserlistLink('', intval($this->get('memberCount')));
$this->_prepareDocument();
parent::display();
}
示例12: displayDefault
function displayDefault($tpl = null) {
$this->config = KunenaFactory::getConfig ();
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_KUNENA_STAT_FORUMSTATS') . ' - ' . $this->config->board_title);
require_once(KPATH_SITE.'/lib/kunena.link.class.php');
$kunena_stats = KunenaForumStatistics::getInstance ( );
$kunena_stats->loadAll();
$this->assign($kunena_stats);
$this->latestMemberLink = CKunenaLink::GetProfileLink($this->lastUserId);
$this->userlist = CKunenaLink::GetUserlistLink('', intval($this->get('memberCount')));
$this->statisticsURL = KunenaRoute::_('index.php?option=com_kunena&view=statistics');
parent::display ();
}
示例13: getInboxLink
public function getInboxLink ($text) {
if (!$text) $text = JText::_('COM_KUNENA_PMS_INBOX');
global $_CB_framework;
$cbpath = JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
if (file_exists($cbpath)) require_once($cbpath);
else return;
$userid = $_CB_framework->myId();
$cbUser =& CBuser::getInstance( (int) $userid );
if($cbUser === null) return;
$itemid = getCBprofileItemid();
return CKunenaLink::GetHrefLink ( cbSef ('index.php?option=com_comprofiler&task=userProfile&user=' .$userid. $itemid), $text, '', 'follow');
}
示例14: onAfterReply
public function onAfterReply($message) {
// Check for permisions of the current category - activity only if public or registered
$category = $message->getCategory();
if ($category->pub_access == 0 || $category->pub_access == - 1) {
require_once KPATH_SITE.'/lib/kunena.link.class.php';
$datareference = '<a href="' . CKunenaLink::GetMessageURL ( $message->id, $message->catid ) . '">' . $message->subject . '</a>';
if ($this->_config->alphauserpointsnumchars > 0) {
// use if limit chars for a response
if (JString::strlen ( $message->message ) > $this->_config->alphauserpointsnumchars) {
if ( $this->_getAUPversion() < '1.5.12' ) {
$ruleEnabled = AlphaUserPointsHelper::checkRuleEnabled( 'plgaup_reply_kunena' );
if ($ruleEnabled) {
AlphaUserPointsHelper::newpoints ( 'plgaup_reply_kunena', '', $message->id, $datareference );
} else {
return;
}
} elseif ( $this->_getAUPversion() >= '1.5.12' ) {
$ruleEnabled = AlphaUserPointsHelper::checkRuleEnabled( 'plgaup_kunena_topic_reply' );
if ($ruleEnabled) {
AlphaUserPointsHelper::newpoints ( 'plgaup_kunena_topic_reply', '', $message->id, $datareference );
} else {
return;
}
}
}
} else {
if ( $this->_getAUPversion() < '1.5.12' ) {
$ruleEnabled = AlphaUserPointsHelper::checkRuleEnabled( 'plgaup_reply_kunena' );
if ($ruleEnabled) {
AlphaUserPointsHelper::newpoints ( 'plgaup_reply_kunena', '', $message->id, $datareference );
} else {
return;
}
} elseif ( $this->_getAUPversion() >= '1.5.12' ) {
$ruleEnabled = AlphaUserPointsHelper::checkRuleEnabled( 'plgaup_kunena_topic_reply' );
if ($ruleEnabled) {
AlphaUserPointsHelper::newpoints ( 'plgaup_kunena_topic_reply', '', $message->id, $datareference );
} else {
return;
}
}
}
}
}
示例15: displayDefault
function displayDefault($tpl = null) {
$this->config = KunenaFactory::getConfig();
if (!$this->config->enablerss) {
JError::raiseError ( 404, JText::_ ( 'COM_KUNENA_RSS_DISABLED' ) );
}
$this->assignRef ( 'category', $this->get ( 'Category' ) );
if (! $this->category->authorise('read')) {
JError::raiseError ( 404, $this->category->getError() );
}
$this->template = KunenaTemplate::getInstance();
$this->assignRef ( 'topics', $this->get ( 'Topics' ) );
$title = JText::_('COM_KUNENA_THREADS_IN_FORUM').': '. $this->category->name;
$this->setTitle ( $title );
$metaDesc = $this->document->get ( 'description' ) . '. ' . $this->escape ( "{$this->category->name} - {$this->config->board_title}" );
$this->document->setDescription ( $metaDesc );
// Create image for feed
$image = new JFeedImage();
$image->title = $this->document->getTitle();
$image->url = $this->template->getImagePath('icons/rss.png');
$image->description = $this->document->getDescription();
$this->document->image = $image;
foreach ( $this->topics as $topic ) {
$id = $topic->last_post_id;
$page = ceil ( $topic->posts / $this->config->messages_per_page );
$description = $topic->last_post_message;
$date = new JDate($topic->last_post_time);
$userid = $topic->last_post_userid;
$username = KunenaFactory::getUser($userid)->getName($topic->last_post_guest_name);
$title = $topic->subject;
$url = CKunenaLink::GetThreadPageURL('view', $topic->category_id, $topic->id, $page, $this->config->messages_per_page, $id, true );
$category = $topic->getCategory()->name;
$this->createItem($title, $url, $description, $category, $date, $userid, $username);
}
}