當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EasyBlogHelper::removeFeatured方法代碼示例

本文整理匯總了PHP中EasyBlogHelper::removeFeatured方法的典型用法代碼示例。如果您正苦於以下問題:PHP EasyBlogHelper::removeFeatured方法的具體用法?PHP EasyBlogHelper::removeFeatured怎麽用?PHP EasyBlogHelper::removeFeatured使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在EasyBlogHelper的用法示例。


在下文中一共展示了EasyBlogHelper::removeFeatured方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: toggleFeatured

 /**
  * Toggle featured bloggers.
  *
  * @since	3.5
  * @access	public
  */
 public function toggleFeatured()
 {
     // Check for request forgeries
     JRequest::checkToken() or jexit('Invalid Token');
     // @task: Check for acl rules.
     $this->checkAccess('user');
     $mainframe = JFactory::getApplication();
     $records = JRequest::getVar('cid', '');
     $message = '';
     $task = JRequest::getVar('task');
     if (empty($records)) {
         $mainframe->enqueueMessage(JText::_('COM_EASYBLOG_INVALID_BLOGGER_ID'), 'error');
         $mainframe->redirect('index.php?option=com_easyblog&view=users');
         $mainframe->close();
     }
     foreach ($records as $record) {
         if ($task == 'unfeature') {
             EasyBlogHelper::removeFeatured(EBLOG_FEATURED_BLOGGER, $record);
             $message = JText::_('COM_EASYBLOG_BLOGGER_UNFEATURED_SUCCESSFULLY');
         } else {
             EasyBlogHelper::makeFeatured(EBLOG_FEATURED_BLOGGER, $record);
             $message = JText::_('COM_EASYBLOG_BLOGGER_FEATURED_SUCCESSFULLY');
         }
     }
     $mainframe->enqueueMessage($message, 'message');
     $mainframe->redirect('index.php?option=com_easyblog&view=users');
     $mainframe->close();
 }
開發者ID:alexinteam,項目名稱:joomla3,代碼行數:34,代碼來源:users.php

示例2: removeFeaturedx

 /**
  * Remove an item as featured
  *
  * @param	string	$type	The type of this item
  * @param	int		$postId	The unique id of the item
  *
  * @return	string	Json string
  **/
 function removeFeaturedx($type, $postId)
 {
     $ajax = new Ejax();
     $acl = EB::acl();
     EasyBlogHelper::removeFeatured($type, $postId);
     $idName = '';
     $message = '';
     switch ($type) {
         case 'blogger':
             $idName = '#blogger_title_' . $postId;
             $message = JText::_('COM_EASYBLOG_BLOGGER_UNFEATURED');
             break;
         case 'teamblog':
             $idName = '#teamblog_title_' . $postId;
             $message = JText::_('COM_EASYBLOG_TEAMBLOG_UNFEATURED');
             break;
         case 'post':
         default:
             $idName = '#title_' . $postId;
             $message = JText::_('COM_EASYBLOG_BLOG_UNFEATURED');
             break;
     }
     $ajax->script('$("' . $idName . '").removeClass("featured-item");');
     $ajax->alert($message, JText::_('COM_EASYBLOG_INFO'), '450', 'auto');
     $ajax->send();
     return;
 }
開發者ID:knigherrant,項目名稱:decopatio,代碼行數:35,代碼來源:view.ajax.php

示例3: removeFeatured

 /**
  * Remove an item as featured
  *
  * @param	string	$type	The type of this item
  * @param	int		$postId	The unique id of the item
  *
  * @return	string	Json string
  **/
 function removeFeatured($type, $postId)
 {
     $ajax = new Ejax();
     $acl = EasyBlogACLHelper::getRuleset();
     // Only super admins can feature items
     if (!EasyBlogHelper::isSiteAdmin() && !$acl->rules->feature_entry) {
         $ajax->alert(JText::_('COM_EASYBLOG_NOT_ALLOWED'), '', '450');
         $ajax->send();
         return;
     }
     EasyBlogHelper::removeFeatured($type, $postId);
     $idName = '';
     $message = '';
     switch ($type) {
         case 'blogger':
             $idName = '#blogger_title_' . $postId;
             $message = JText::_('COM_EASYBLOG_BLOGGER_UNFEATURED');
             break;
         case 'teamblog':
             $idName = '#teamblog_title_' . $postId;
             $message = JText::_('COM_EASYBLOG_TEAMBLOG_UNFEATURED');
             break;
         case 'post':
         default:
             $idName = '#title_' . $postId;
             $message = JText::_('COM_EASYBLOG_BLOG_UNFEATURED');
             break;
     }
     $ajax->script('$("' . $idName . '").removeClass("featured-item");');
     $ajax->alert($message, JText::_('COM_EASYBLOG_INFO'), '450', 'auto');
     $ajax->send();
     return;
 }
開發者ID:Tommar,項目名稱:vino2,代碼行數:41,代碼來源:view.ejax.php


注:本文中的EasyBlogHelper::removeFeatured方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。