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


PHP KunenaForumTopicHelper::favorite方法代码示例

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


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

示例1: unfavorite

	function unfavorite() {
		$app = JFactory::getApplication ();
		if (! JRequest::checkToken ()) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
			$this->redirectBack ();
		}

		$topics = KunenaForumTopicHelper::getTopics(array_keys(JRequest::getVar('topics', array ( 0 ), 'post', 'array')));
		if ( KunenaForumTopicHelper::favorite(array_keys($topics), 0) ) {
			$app->enqueueMessage ( JText::_('COM_KUNENA_USER_UNFAVORITE_YES') );
		} else {
			$app->enqueueMessage ( JText::_('COM_KUNENA_POST_NO_UNFAVORITED_TOPIC') );
		}
		$this->redirectBack ();
	}
开发者ID:rich20,项目名称:Kunena,代码行数:15,代码来源:topics.php

示例2: _unfavAll

 /**
  * Delete all users favorites
  *
  * @param moscomprofilerUser $user
  * @param string             $prefix
  */
 function _unfavAll($user, $forum)
 {
     global $_CB_database;
     if ($forum->prefix != 'kunena' || $forum->prefix == 'kunena' && !class_exists('KunenaForum')) {
         $query = 'DELETE FROM ' . $_CB_database->NameQuote('#__' . $forum->prefix . '_favorites') . "\n WHERE " . $_CB_database->NameQuote('userid') . " = " . (int) $user->id;
         $_CB_database->setQuery($query);
         if (!$_CB_database->query()) {
             trigger_error('CBForum-unfavAll SQL error' . $_CB_database->stderr(true), E_USER_WARNING);
         }
     } elseif (class_exists('KunenaForumTopicHelper')) {
         $threads = array_keys(array_pop(KunenaForumTopicHelper::getLatestTopics(false, 0, 0, array('user' => (int) $user->id, 'favorited' => true))));
         if ($threads) {
             KunenaForumTopicHelper::favorite($threads, 0, (int) $user->id);
         }
     }
 }
开发者ID:rogatnev-nikita,项目名称:cloudinterpreter,代码行数:22,代码来源:cb.simpleboardtab.model.php

示例3: unfavorite

 function unfavorite()
 {
     if (!JSession::checkToken('post')) {
         $this->app->enqueueMessage(JText::_('COM_KUNENA_ERROR_TOKEN'), 'error');
         $this->setRedirectBack();
         return;
     }
     $ids = array_keys(JRequest::getVar('topics', array(), 'post', 'array'));
     // Array of integer keys
     JArrayHelper::toInteger($ids);
     $topics = KunenaForumTopicHelper::getTopics($ids);
     if (KunenaForumTopicHelper::favorite(array_keys($topics), 0)) {
         $this->app->enqueueMessage(JText::_('COM_KUNENA_USER_UNFAVORITE_YES'));
     } else {
         $this->app->enqueueMessage(JText::_('COM_KUNENA_POST_NO_UNFAVORITED_TOPIC'));
     }
     $this->setRedirectBack();
 }
开发者ID:russelljuwai,项目名称:Kunena-Forum,代码行数:18,代码来源:topics.php

示例4: unFavorite

 /**
  * Un-favorite a post
  *
  * @param  string|int   $postid  Forum Post id
  * @param  UserTable    $user    Viewed at User
  * @param  PluginTable  $plugin  Current Plugin
  * @return boolean               Result
  */
 public static function unFavorite($postid, $user, $plugin)
 {
     if (!class_exists('KunenaForumTopicHelper')) {
         return false;
     }
     if ($postid == 'all') {
         $ids = array_keys(array_pop(KunenaForumTopicHelper::getLatestTopics(false, 0, 0, array('user' => (int) $user->id, 'favorited' => true))));
     } else {
         $ids = array((int) $postid);
     }
     if (!$ids || !KunenaForumTopicHelper::favorite($ids, 0, (int) $user->id)) {
         return false;
     }
     return true;
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:23,代码来源:kunena20.php


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