当前位置: 首页>>代码示例>>PHP>>正文


PHP CKunenaLink::GetPostNewTopicLink方法代码示例

本文整理汇总了PHP中CKunenaLink::GetPostNewTopicLink方法的典型用法代码示例。如果您正苦于以下问题:PHP CKunenaLink::GetPostNewTopicLink方法的具体用法?PHP CKunenaLink::GetPostNewTopicLink怎么用?PHP CKunenaLink::GetPostNewTopicLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CKunenaLink的用法示例。


在下文中一共展示了CKunenaLink::GetPostNewTopicLink方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isset

    ?>
    <!-- bottom nav -->

    <table border = "0" cellspacing = "0" class = "jr-bottomnav" cellpadding = "0">
        <tr>
            <td class = "jr-topnav-left">
                <?php 
    //go to top
    echo '<a name="forumbottom" />';
    echo CKunenaLink::GetSamePageAnkerLink('forumtop', isset($fbIcons['toparrow']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['toparrow'] . '" border="0" alt="' . _GEN_GOTOTOP . '" title="' . _GEN_GOTOTOP . '"/>' : _GEN_GOTOTOP);
    ?>

                <?php 
    if ($is_Moderator || $forumLocked == 0 && ($kunena_my->id > 0 || $fbConfig->pubwrite)) {
        //this user is allowed to post a new topic:
        echo CKunenaLink::GetPostNewTopicLink($catid, isset($fbIcons['new_topic']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['new_topic'] . '" alt="' . _GEN_POST_NEW_TOPIC . '" title="' . _GEN_POST_NEW_TOPIC . '" border="0" />' : _GEN_POST_NEW_TOPIC);
    }
    echo '</td><td class="jr-topnav-right">';
    //pagination 2
    if (count($messages[0]) > 0) {
        echo '<div class="jr-pagenav">' . _PAGE;
        if ($page - 2 > 1) {
            echo ' ' . CKunenaLink::GetCategoryPageLink('showcat', $catid, 1, 1, $rel = 'follow', $class = 'jr-pagenav-nb');
        }
        for ($i = $page - 2 <= 0 ? 1 : $page - 2; $i <= $page + 2 && $i <= ceil($total / $threads_per_page); $i++) {
            if ($page == $i) {
                echo "<div class=\"jr-pagenav-nb-act\"> {$i}</div>";
            } else {
                echo ' ' . CKunenaLink::GetCategoryPageLink('showcat', $catid, $i, $i, $rel = 'follow', $class = 'jr-pagenav-nb');
            }
        }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:31,代码来源:showcat.php

示例2: getView


//.........这里部分代码省略.........
         }
         if ($this->layout != 'indented') {
             $this->layout_buttons[] = CKunenaLink::GetThreadLayoutLink('indented', $this->catid, $this->thread, $this->mesid, CKunenaTools::showButton('layout-indented', JText::_('COM_KUNENA_BUTTON_LAYOUT_INDENTED')), $this->limitstart, $this->limit, JText::_('COM_KUNENA_BUTTON_LAYOUT_INDENTED_LONG'), 'nofollow', 'kicon-button kbuttonuser btn-left');
         }
     }
     //Perform subscriptions check only once
     $this->cansubscribe = 0;
     if ($this->config->allowsubscriptions && $this->config->topic_subscriptions != 'disabled' && $this->my->id) {
         $this->db->setQuery("SELECT thread, future1 FROM #__kunena_subscriptions WHERE userid={$this->db->Quote($this->my->id)} AND thread={$this->db->Quote($this->thread)}");
         $fb_subscribed = $this->db->loadObject();
         KunenaError::checkDatabaseError();
         if (!$fb_subscribed) {
             $this->cansubscribe = 1;
         } elseif ($fb_subscribed->future1 == 1) {
             $query_thread = "UPDATE #__kunena_subscriptions\n\t\t\t\t\tSET future1=0 WHERE thread={$this->db->Quote($this->thread)} AND userid={$this->db->Quote($this->my->id)}";
             $this->db->setQuery($query_thread);
             $this->db->query();
         }
     }
     //Perform favorites check only once
     $fb_canfavorite = 0;
     $this->db->setQuery("SELECT MAX(userid={$this->db->Quote($this->my->id)}) AS favorited, COUNT(*) AS totalfavorited FROM #__kunena_favorites WHERE thread={$this->db->Quote($this->thread)}");
     list($this->favorited, $this->totalfavorited) = $this->db->loadRow();
     KunenaError::checkDatabaseError();
     if ($this->config->allowfavorites && $this->my->id) {
         if (!$this->favorited) {
             $fb_canfavorite = 1;
         }
     }
     //get the Moderator list for display
     $this->db->setQuery("SELECT m.*, u.* FROM #__kunena_moderation AS m INNER JOIN #__users AS u ON u.id=m.userid WHERE m.catid={$this->db->Quote($this->catid)} AND u.block=0");
     $this->modslist = $this->db->loadObjectList();
     KunenaError::checkDatabaseError();
     $this->catModerators = array();
     foreach ($this->modslist as $mod) {
         $this->catModerators[] = $mod->userid;
         $userlist[intval($mod->userid)] = intval($mod->userid);
     }
     // Prefetch all users/avatars to avoid user by user queries during template iterations
     KunenaUser::loadUsers($userlist);
     //data ready display now
     if (CKunenaTools::isModerator($this->my->id, $this->catid) || $this->topicLocked == 0) {
         //this user is allowed to reply to this topic
         $this->thread_reply = CKunenaLink::GetTopicPostReplyLink('reply', $this->catid, $this->thread, CKunenaTools::showButton('reply', JText::_('COM_KUNENA_BUTTON_REPLY_TOPIC')), 'nofollow', 'kicon-button kbuttoncomm btn-left', JText::_('COM_KUNENA_BUTTON_REPLY_TOPIC_LONG'));
     }
     // Thread Subscription
     if ($this->cansubscribe == 1) {
         // this user is allowed to subscribe - check performed further up to eliminate duplicate checks
         // for top and bottom navigation
         $this->thread_subscribe = CKunenaLink::GetTopicPostLink('subscribe', $this->catid, $this->id, CKunenaTools::showButton('subscribe', JText::_('COM_KUNENA_BUTTON_SUBSCRIBE_TOPIC')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_SUBSCRIBE_TOPIC_LONG'));
     }
     if ($this->my->id != 0 && $this->config->allowsubscriptions && $this->config->topic_subscriptions != 'disabled' && $this->cansubscribe == 0) {
         // this user is allowed to unsubscribe
         $this->thread_subscribe = CKunenaLink::GetTopicPostLink('unsubscribe', $this->catid, $this->id, CKunenaTools::showButton('subscribe', JText::_('COM_KUNENA_BUTTON_UNSUBSCRIBE_TOPIC')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_UNSUBSCRIBE_TOPIC_LONG'));
     }
     //START: FAVORITES
     if ($fb_canfavorite == 1) {
         // this user is allowed to add a favorite - check performed further up to eliminate duplicate checks
         // for top and bottom navigation
         $this->thread_favorite = CKunenaLink::GetTopicPostLink('favorite', $this->catid, $this->id, CKunenaTools::showButton('favorite', JText::_('COM_KUNENA_BUTTON_FAVORITE_TOPIC')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_FAVORITE_TOPIC_LONG'));
     }
     if ($this->my->id != 0 && $this->config->allowfavorites && $fb_canfavorite == 0) {
         // this user is allowed to unfavorite
         $this->thread_favorite = CKunenaLink::GetTopicPostLink('unfavorite', $this->catid, $this->id, CKunenaTools::showButton('favorite', JText::_('COM_KUNENA_BUTTON_UNFAVORITE_TOPIC')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_UNFAVORITE_TOPIC_LONG'));
     }
     // FINISH: FAVORITES
     if (CKunenaTools::isModerator($this->my->id, $this->catid) || !$this->kunena_forum_locked) {
         //this user is allowed to post a new topic
         $this->thread_new = CKunenaLink::GetPostNewTopicLink($this->catid, CKunenaTools::showButton('newtopic', JText::_('COM_KUNENA_BUTTON_NEW_TOPIC')), 'nofollow', 'kicon-button kbuttoncomm btn-left', JText::_('COM_KUNENA_BUTTON_NEW_TOPIC_LONG'));
     }
     if (CKunenaTools::isModerator($this->my->id, $this->catid)) {
         // offer the moderator always the move link to relocate a topic to another forum
         // and the (un)sticky bit links
         // and the (un)lock links
         if ($this->topicSticky == 0) {
             $this->thread_sticky = CKunenaLink::GetTopicPostLink('sticky', $this->catid, $this->id, CKunenaTools::showButton('sticky', JText::_('COM_KUNENA_BUTTON_STICKY_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_STICKY_TOPIC_LONG'));
         } else {
             $this->thread_sticky = CKunenaLink::GetTopicPostLink('unsticky', $this->catid, $this->id, CKunenaTools::showButton('sticky', JText::_('COM_KUNENA_BUTTON_UNSTICKY_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_UNSTICKY_TOPIC_LONG'));
         }
         if ($this->topicLocked == 0) {
             $this->thread_lock = CKunenaLink::GetTopicPostLink('lock', $this->catid, $this->id, CKunenaTools::showButton('lock', JText::_('COM_KUNENA_BUTTON_LOCK_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_LOCK_TOPIC_LONG'));
         } else {
             $this->thread_lock = CKunenaLink::GetTopicPostLink('unlock', $this->catid, $this->id, CKunenaTools::showButton('lock', JText::_('COM_KUNENA_BUTTON_UNLOCK_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_UNLOCK_TOPIC_LONG'));
         }
         $this->thread_delete = CKunenaLink::GetTopicPostLink('deletethread', $this->catid, $this->id, CKunenaTools::showButton('delete', JText::_('COM_KUNENA_BUTTON_DELETE_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_DELETE_TOPIC_LONG'));
         $this->thread_moderate = CKunenaLink::GetTopicPostReplyLink('moderatethread', $this->catid, $this->id, CKunenaTools::showButton('moderate', JText::_('COM_KUNENA_BUTTON_MODERATE_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_MODERATE'));
     }
     $this->headerdesc = nl2br(smile::smileReplace($this->catinfo->headerdesc, 0, $this->config->disemoticons, $this->emoticons));
     $tabclass = array("row1", "row2");
     $this->mmm = 0;
     $this->replydir = $this->ordering == 'DESC' ? -1 : 1;
     if ($this->replydir < 0) {
         $this->replynum = $this->total_messages - $this->limitstart + 1;
     } else {
         $this->replynum = $this->limitstart;
     }
     $this->myname = $this->config->username ? $this->my->username : $this->my->name;
     $this->allow_anonymous = !empty($this->catinfo->allow_anonymous) && $this->my->id;
     $this->anonymous = $this->allow_anonymous && !empty($this->catinfo->post_anonymous);
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:101,代码来源:view.php

示例3: __construct


//.........这里部分代码省略.........
     KunenaError::checkDatabaseError();
     $this->totalpages = ceil($this->total / $threads_per_page);
     $query = "SELECT t.id, MAX(m.id) AS lastid FROM #__kunena_messages AS t\n\tINNER JOIN #__kunena_messages AS m ON t.id = m.thread\n\tWHERE t.parent='0' AND t.hold IN ({$hold}) AND t.catid={$this->db->Quote($this->catid)} AND m.hold IN ({$hold}) AND m.catid={$this->db->Quote($this->catid)}\n\tGROUP BY m.thread ORDER BY t.ordering DESC, lastid DESC";
     $this->db->setQuery($query, $offset, $threads_per_page);
     $threadids = $this->db->loadResultArray();
     KunenaError::checkDatabaseError();
     $idstr = implode(",", $threadids);
     $this->messages = array();
     $this->threads = array();
     $this->highlight = 0;
     $routerlist = array();
     if (count($threadids) > 0) {
         $query = "SELECT a.*, j.id AS userid, t.message AS message, l.myfavorite, l.favcount, l.attachments,\n\t\t\t\t\t\t\tl.msgcount, l.lastid, l.lastid AS lastread, 0 AS unread, j.username, j.name AS uname, u.avatar, c.id AS catid, c.name AS catname, c.class_sfx\n\tFROM (\n\t\tSELECT m.thread, MAX(f.userid='{$this->my->id}') AS myfavorite, COUNT(DISTINCT f.userid) AS favcount, COUNT(a.mesid) AS attachments,\n\t\t\tCOUNT(DISTINCT m.id) AS msgcount, MAX(m.id) AS lastid, MAX(m.time) AS lasttime\n\t\tFROM #__kunena_messages AS m";
         if ($this->config->allowfavorites) {
             $query .= " LEFT JOIN #__kunena_favorites AS f ON f.thread = m.thread";
         } else {
             $query .= " LEFT JOIN #__kunena_favorites AS f ON f.thread = 0";
         }
         $query .= "\n\t\tLEFT JOIN #__kunena_attachments AS a ON a.mesid = m.thread\n\t\tWHERE m.hold IN ({$hold}) AND m.thread IN ({$idstr})\n\t\tGROUP BY thread\n\t) AS l\n\tINNER JOIN #__kunena_messages AS a ON a.thread = l.thread\n\tINNER JOIN #__kunena_messages_text AS t ON a.thread = t.mesid\n\tLEFT JOIN #__users AS j ON j.id = a.userid\n\tLEFT JOIN #__kunena_users AS u ON u.userid = j.id\n\tLEFT JOIN #__kunena_categories AS c ON c.id = a.catid\n\tWHERE (a.parent='0' OR a.id=l.lastid)\n\tORDER BY ordering DESC, lastid DESC";
         $this->db->setQuery($query);
         $this->messages = $this->db->loadObjectList('id');
         KunenaError::checkDatabaseError();
         // collect user ids for avatar prefetch when integrated
         $userlist = array();
         foreach ($this->messages as $message) {
             if ($message->parent == 0) {
                 $this->threads[$message->thread] = $message;
                 $routerlist[$message->id] = $message->subject;
                 if ($message->ordering) {
                     $this->highlight++;
                 }
             }
             if ($message->id == $message->lastid) {
                 $this->lastreply[$message->thread] = $message;
             }
             $userlist[intval($message->userid)] = intval($message->userid);
             $userlist[intval($message->modified_by)] = intval($message->modified_by);
         }
         require_once KUNENA_PATH . '/router.php';
         KunenaRouter::loadMessages($routerlist);
         if ($this->config->shownew && $this->my->id) {
             $readlist = $this->session->readtopics;
             $this->db->setQuery("SELECT thread, MIN(id) AS lastread, SUM(1) AS unread FROM #__kunena_messages " . "WHERE hold IN ({$hold}) AND moved='0' AND thread NOT IN ({$readlist}) AND thread IN ({$idstr}) AND time>{$this->db->Quote($this->prevCheck)} GROUP BY thread");
             $msgidlist = $this->db->loadObjectList();
             KunenaError::checkDatabaseError();
             foreach ($msgidlist as $msgid) {
                 $this->messages[$msgid->thread]->lastread = $msgid->lastread;
                 $this->messages[$msgid->thread]->unread = $msgid->unread;
             }
         }
     }
     //Perform subscriptions check
     $kunena_cansubscribecat = 0;
     if ($this->config->allowsubscriptions && $this->config->category_subscriptions != 'disabled' && ("" != $this->my->id || 0 != $this->my->id)) {
         if ($this->objCatInfo->subscribeid == '') {
             $kunena_cansubscribecat = 1;
         }
     }
     //meta description and keywords
     $metaKeys = kunena_htmlspecialchars(JText::_('COM_KUNENA_CATEGORIES') . ", {$objCatParentInfo->name}, {$this->objCatInfo->name}, {$this->config->board_title}, " . $this->app->getCfg('sitename'));
     $metaDesc = kunena_htmlspecialchars("{$this->objCatInfo->description} ({$this->page}/{$this->totalpages})");
     $document =& JFactory::getDocument();
     $cur = $document->get('description');
     $metaDesc = $cur . '. ' . $metaDesc;
     $document =& JFactory::getDocument();
     $document->setMetadata('keywords', $metaKeys);
     $document->setDescription($metaDesc);
     $this->headerdesc = $this->objCatInfo->headerdesc;
     if (CKunenaTools::isModerator($this->my->id, $this->catid) || !$this->kunena_forum_locked) {
         //this user is allowed to post a new topic:
         $this->forum_new = CKunenaLink::GetPostNewTopicLink($this->catid, CKunenaTools::showButton('newtopic', JText::_('COM_KUNENA_BUTTON_NEW_TOPIC')), 'nofollow', 'kicon-button kbuttoncomm btn-left', JText::_('COM_KUNENA_BUTTON_NEW_TOPIC_LONG'));
     }
     if ($this->my->id != 0 && $this->total) {
         $this->forum_markread = CKunenaLink::GetCategoryActionLink('markthisread', $this->catid, CKunenaTools::showButton('markread', JText::_('COM_KUNENA_BUTTON_MARKFORUMREAD')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_MARKFORUMREAD_LONG'));
     }
     // Thread Subscription
     if ($kunena_cansubscribecat == 1) {
         // this user is allowed to subscribe - check performed further up to eliminate duplicate checks
         // for top and bottom navigation
         $this->thread_subscribecat = CKunenaLink::GetCategoryActionLink('subscribecat', $this->catid, CKunenaTools::showButton('subscribe', JText::_('COM_KUNENA_BUTTON_SUBSCRIBE_CATEGORY')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_SUBSCRIBE_CATEGORY_LONG'));
     }
     if ($this->my->id != 0 && $this->config->allowsubscriptions && $this->config->category_subscriptions != 'disabled' && $kunena_cansubscribecat == 0) {
         // this user is allowed to unsubscribe
         $this->thread_subscribecat = CKunenaLink::GetCategoryActionLink('unsubscribecat', $this->catid, CKunenaTools::showButton('subscribe', JText::_('COM_KUNENA_BUTTON_UNSUBSCRIBE_CATEGORY')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_UNSUBSCRIBE_CATEGORY_LONG'));
     }
     //get the Moderator list for display
     $this->db->setQuery("SELECT * FROM #__kunena_moderation AS m INNER JOIN #__users AS u ON u.id=m.userid WHERE m.catid={$this->db->Quote($this->catid)} AND u.block=0");
     $this->modslist = $this->db->loadObjectList();
     KunenaError::checkDatabaseError();
     foreach ($this->modslist as $mod) {
         $userlist[intval($mod->userid)] = intval($mod->userid);
     }
     // Prefetch all users/avatars to avoid user by user queries during template iterations
     if (!empty($userlist)) {
         KunenaUser::loadUsers($userlist);
     }
     $this->columns = CKunenaTools::isModerator($this->my->id, $this->catid) ? 6 : 5;
     $this->showposts = 0;
     $this->actionDropdown[] = JHTML::_('select.option', '', JText::_('COM_KUNENA_BULK_CHOOSE_ACTION'));
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:101,代码来源:showcat.php

示例4: buttons

	function buttons() {
		$catid = $this->state->get('item.catid');
		$id = $this->state->get('item.id');

		// Subscribe topic
		if ($this->usertopic->subscribed) {
			// this user is allowed to unsubscribe
			$this->topic_subscribe = CKunenaLink::GetTopicPostLink ( 'unsubscribe', $catid, $id, $this->getButton ( 'subscribe', JText::_('COM_KUNENA_BUTTON_UNSUBSCRIBE_TOPIC') ), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_UNSUBSCRIBE_TOPIC_LONG') );
		} elseif ($this->topic->authorise('subscribe')) {
			// this user is allowed to subscribe
			$this->topic_subscribe = CKunenaLink::GetTopicPostLink ( 'subscribe', $catid, $id, $this->getButton ( 'subscribe', JText::_('COM_KUNENA_BUTTON_SUBSCRIBE_TOPIC') ), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_SUBSCRIBE_TOPIC_LONG') );
		}

		// Favorite topic
		if ($this->usertopic->favorite) {
			// this user is allowed to unfavorite
			$this->topic_favorite = CKunenaLink::GetTopicPostLink ( 'unfavorite', $catid, $id, $this->getButton ( 'favorite', JText::_('COM_KUNENA_BUTTON_UNFAVORITE_TOPIC') ), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_UNFAVORITE_TOPIC_LONG') );
		} elseif ($this->topic->authorise('favorite')) {
			// this user is allowed to add a favorite
			$this->topic_favorite = CKunenaLink::GetTopicPostLink ( 'favorite', $catid, $id, $this->getButton ( 'favorite', JText::_('COM_KUNENA_BUTTON_FAVORITE_TOPIC') ), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_FAVORITE_TOPIC_LONG') );
		}

		// Reply topic
		if ($this->topic->authorise('reply')) {
			// this user is allowed to reply to this topic
			$this->topic_reply = CKunenaLink::GetTopicPostReplyLink ( 'reply', $catid, $this->topic->id, $this->getButton ( 'reply', JText::_('COM_KUNENA_BUTTON_REPLY_TOPIC') ), 'nofollow', 'kicon-button kbuttoncomm btn-left', JText::_('COM_KUNENA_BUTTON_REPLY_TOPIC_LONG') );
		}

		// New topic
		if ($this->category->authorise('topic.create')) {
			//this user is allowed to post a new topic
			$this->topic_new = CKunenaLink::GetPostNewTopicLink ( $catid, $this->getButton ( 'newtopic', JText::_('COM_KUNENA_BUTTON_NEW_TOPIC') ), 'nofollow', 'kicon-button kbuttoncomm btn-left', JText::_('COM_KUNENA_BUTTON_NEW_TOPIC_LONG') );
		}

		// Moderator specific stuff
		if ($this->category->authorise('moderate')) {
			if (!$this->topic->ordering) {
				$this->topic_sticky = CKunenaLink::GetTopicPostLink ( 'sticky', $catid, $id, $this->getButton ( 'sticky', JText::_('COM_KUNENA_BUTTON_STICKY_TOPIC') ), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_STICKY_TOPIC_LONG') );
			} else {
				$this->topic_sticky = CKunenaLink::GetTopicPostLink ( 'unsticky', $catid, $id, $this->getButton ( 'sticky', JText::_('COM_KUNENA_BUTTON_UNSTICKY_TOPIC') ), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_UNSTICKY_TOPIC_LONG') );
			}

			if (!$this->topic->locked) {
				$this->topic_lock = CKunenaLink::GetTopicPostLink ( 'lock', $catid, $id, $this->getButton ( 'lock', JText::_('COM_KUNENA_BUTTON_LOCK_TOPIC') ), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_LOCK_TOPIC_LONG') );
			} else {
				$this->topic_lock = CKunenaLink::GetTopicPostLink ( 'unlock', $catid, $id, $this->getButton ( 'lock', JText::_('COM_KUNENA_BUTTON_UNLOCK_TOPIC') ), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_UNLOCK_TOPIC_LONG') );
			}
			$this->topic_delete = CKunenaLink::GetTopicPostLink ( 'deletethread', $catid, $id, $this->getButton ( 'delete', JText::_('COM_KUNENA_BUTTON_DELETE_TOPIC') ), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_DELETE_TOPIC_LONG') );
			$this->topic_moderate = CKunenaLink::GetTopicPostReplyLink ( 'moderatethread', $catid, $id, $this->getButton ( 'moderate', JText::_('COM_KUNENA_BUTTON_MODERATE_TOPIC') ), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_MODERATE') );
		}
	}
开发者ID:GoremanX,项目名称:Kunena-2.0,代码行数:51,代码来源:view.html.php

示例5: displayDefault

	function displayDefault($tpl = null) {
		$this->Itemid = $this->get ( 'Itemid' );
		$this->assignRef ( 'category', $this->get ( 'Category' ) );
		if (! $this->category->authorise('read')) {
				$this->setError($this->category->getError());
		}

		$this->assignRef ( 'topics', $this->get ( 'Topics' ) );
		$this->assignRef ( 'total', $this->get ( 'Total' ) );
		$this->assignRef ( 'topicActions', $this->get ( 'TopicActions' ) );
		$this->assignRef ( 'actionMove', $this->get ( 'ActionMove' ) );
		$this->assignRef ( 'moderators', $this->get ( 'Moderators' ) );

		$this->assignRef ( 'message_ordering', $this->get ( 'MessageOrdering' ) );
		$this->assignRef ( 'categories', $this->get ( 'Categories' ) );
		$this->assignRef ( 'pending',  $this->get ( 'UnapprovedCount' ) );
		$this->sections = isset($this->categories[0]) ? $this->categories[0] : array();

		$this->headerText = $this->title = JText::_('COM_KUNENA_THREADS_IN_FORUM').': '. $this->category->name;

		// Is user allowed to post new topic?
		$this->newTopicHtml = '';
		if ($this->category->getNewTopicCategory()->exists()) {
			$this->newTopicHtml = CKunenaLink::GetPostNewTopicLink ( $this->category->id, $this->getButton ( 'newtopic', JText::_('COM_KUNENA_BUTTON_NEW_TOPIC') ), 'nofollow', 'kicon-button kbuttoncomm btn-left', JText::_('COM_KUNENA_BUTTON_NEW_TOPIC_LONG') );
		}

		// Is user allowed to mark forums as read?
		$this->markReadHtml = '';
		if ($this->me->exists() && $this->total) {
			$this->markReadHtml = CKunenaLink::GetCategoryActionLink ( 'markread', $this->category->id, $this->getButton ( 'markread', JText::_('COM_KUNENA_BUTTON_MARKFORUMREAD') ), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_MARKFORUMREAD_LONG') );
		}

		$this->subscribeCatHtml = '';
		// Is user allowed to subscribe category?
		if ($this->category->authorise ( 'subscribe', null, true )) {
			// FIXME: add into library:
			$db = JFactory::getDBO();
			$query = "SELECT subscribed
				FROM #__kunena_user_categories
				WHERE user_id={$db->Quote($this->me->userid)} AND category_id={$db->Quote($this->category->id)}";
			$db->setQuery ( $query );
			$subscribed = $db->loadResult ();
			if (KunenaError::checkDatabaseError()) return;

			if (!$subscribed) {
				$this->subscribeCatHtml = CKunenaLink::GetCategoryActionLink ( 'subscribe', $this->category->id, $this->getButton ( 'subscribe', JText::_('COM_KUNENA_BUTTON_SUBSCRIBE_CATEGORY') ), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_SUBSCRIBE_CATEGORY_LONG') );
			} else {
				$this->subscribeCatHtml = CKunenaLink::GetCategoryActionLink ( 'unsubscribe', $this->category->id, $this->getButton ( 'subscribe', JText::_('COM_KUNENA_BUTTON_UNSUBSCRIBE_CATEGORY') ), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_UNSUBSCRIBE_CATEGORY_LONG') );
			}
		}

		$errors = $this->getErrors();
		if ($errors) {
			$this->displayNoAccess($errors);
			return;
		}

		//meta description and keywords
		$page = intval ( $this->state->get('list.start') / $this->state->get('list.limit') ) + 1;
		$pages = intval ( $this->category->getTopics() / $this->state->get('list.limit') ) + 1;

		$parentCategory = $this->category->getParent();
		$metaKeys = $this->escape ( JText::_('COM_KUNENA_CATEGORIES') . ", {$parentCategory->name}, {$this->category->name}, {$this->config->board_title}, " . JFactory::getApplication()->getCfg ( 'sitename' ) );
		$metaDesc = $this->document->get ( 'description' ) . '. ' . $this->escape ( "{$parentCategory->name} ({$page}/{$pages}) - {$this->category->name} - {$this->config->board_title}" );
		$this->document->setMetadata ( 'keywords', $metaKeys );
		$this->document->setDescription ( $metaDesc );

		$this->setTitle( JText::sprintf('COM_KUNENA_VIEW_CATEGORY_DEFAULT', $this->category->name) . " ({$page}/{$pages})" );

		$this->display ($tpl);
	}
开发者ID:rich20,项目名称:Kunena,代码行数:71,代码来源:view.html.php


注:本文中的CKunenaLink::GetPostNewTopicLink方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。