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


PHP EB::easydiscuss方法代码示例

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


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

示例1: html

 public function html(EasyBlogPost &$blog)
 {
     // Determines if the comment plugin is enabled
     $enabled = JPluginHelper::isEnabled('content', 'easydiscuss');
     if (!$enabled) {
         return;
     }
     // Determines if EasyDiscuss exists
     if (!EB::easydiscuss()->exists()) {
         return;
     }
     $articleParams = new stdClass();
     $this->app = JFactory::getApplication();
     $result = $this->app->triggerEvent('onDisplayComments', array(&$blog, &$articleParams));
     if (isset($result[0]) || isset($result[1])) {
         // There could be komento running on the site
         if (isset($result[1]) && $result[1]) {
             $output = $result[1];
         } else {
             $output = $result[0];
         }
         return $output;
     }
     return;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:25,代码来源:easydiscuss.php

示例2: getLink

 /**
  * Retrieves the profile link
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return	
  */
 public function getLink()
 {
     if (!EB::easydiscuss()->exists()) {
         return parent::getLink();
     }
     $link = DiscussRouter::_('index.php?option=com_easydiscuss&view=profile&id=' . $this->profile->id, false);
     return $link;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:16,代码来源:client.php

示例3: getAvatar

 public function getAvatar($profile)
 {
     $easydiscuss = EB::easydiscuss();
     if (!$easydiscuss->exists()) {
         return false;
     }
     $user = DiscussHelper::getTable('Profile');
     $user->load($profile->id);
     $avatar = $user->getAvatar();
     return $avatar;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:11,代码来源:client.php

示例4: store

 /**
  * Override the parents implementation of storing a profile
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function store($updateNulls = false)
 {
     $isNew = empty($this->id) ? true : false;
     $state = parent::store($updateNulls);
     $my = JFactory::getUser();
     // If the user is updating their own profile
     if ($my->id == $this->id) {
         JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT);
         // @rule: Integrations with EasyDiscuss
         EB::easydiscuss()->log('easyblog.update.profile', $this->id, JText::_('COM_EASYBLOG_EASYDISCUSS_HISTORY_UPDATE_PROFILE'));
         EB::easydiscuss()->addPoint('easyblog.update.profile', $this->id);
         EB::easydiscuss()->addBadge('easyblog.update.profile', $this->id);
     }
     return $state;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:23,代码来源:profile.php

示例5: store

 /**
  * Override parent's implementation of store
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function store($updateNulls = false)
 {
     if (!$this->created) {
         $this->created = EB::date()->toSql();
     }
     // Generate an alias if alias is empty
     if (!$this->alias) {
         $this->alias = EBR::normalizePermalink($this->title);
     }
     $my = JFactory::getUser();
     // Add point integrations for new categories
     if ($this->id == 0 && $my->id > 0) {
         EB::loadLanguages();
         // Integrations with EasyDiscuss
         EB::easydiscuss()->log('easyblog.new.category', $my->id, JText::sprintf('COM_EASYBLOG_EASYDISCUSS_HISTORY_NEW_CATEGORY', $this->title));
         EB::easydiscuss()->addPoint('easyblog.new.category', $my->id);
         EB::easydiscuss()->addBadge('easyblog.new.category', $my->id);
         // AlphaUserPoints
         EB::aup()->assign('plgaup_easyblog_add_category', '', 'easyblog_add_category_' . $this->id, JText::sprintf('COM_EASYBLOG_AUP_NEW_CATEGORY_CREATED', $this->title));
         // JomSocial integrations
         EB::jomsocial()->assignPoints('com_easyblog.category.add', $my->id);
         // Assign EasySocial points
         EB::easysocial()->assignPoints('category.create', $my->id);
     }
     // Figure out the proper nested set model
     if ($this->id == 0 && $this->lft == 0) {
         // No parent id, we use the current lft,rgt
         if ($this->parent_id) {
             $left = $this->getLeft($this->parent_id);
             $this->lft = $left;
             $this->rgt = $this->lft + 1;
             // Update parent's right
             $this->updateRight($left);
             $this->updateLeft($left);
         } else {
             $this->lft = $this->getLeft() + 1;
             $this->rgt = $this->lft + 1;
         }
     }
     if ($this->id == 0) {
         // new cats. we need to store the ordering.
         $this->ordering = $this->getOrdering($this->parent_id) + 1;
     }
     $isNew = !$this->id ? true : false;
     $state = parent::store();
     return $state;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:55,代码来源:category.php

示例6: delete

 /**
  * Overrides the parent's delete method
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function delete($pk = null)
 {
     // Try to delete the comment item first
     $state = parent::delete($pk);
     // Get the current logged in user
     $my = JFactory::getUser();
     // Remove comment's stream
     $this->removeStream();
     if ($this->created_by != 0 && $this->published == '1') {
         // Get the blog post
         $post = $this->getBlog();
         // Load language
         EB::loadLanguages();
         $config = EB::config();
         // Integrations with EasyDiscuss
         EB::easydiscuss()->log('easyblog.delete.comment', $this->created_by, JText::sprintf('COM_EASYBLOG_EASYDISCUSS_HISTORY_DELETE_COMMENT', $post->title));
         EB::easydiscuss()->addPoint('easyblog.delete.comment', $this->created_by);
         EB::easydiscuss()->addBadge('easyblog.delete.comment', $this->created_by);
         // AlphaUserPoints
         EB::aup()->assign('plgaup_easyblog_delete_comment', $this->created_by, JText::_('COM_EASYBLOG_AUP_COMMENT_DELETED'));
         // Assign EasySocial points
         EB::easysocial()->assignPoints('comments.remove', $this->created_by);
         // Deduct points from the comment author
         EB::jomsocial()->assignPoints('com_easyblog.comments.remove', $this->created_by);
         // Deduct points from the blog post author
         if ($my->id != $post->created_by) {
             // Deduct EasySocial points
             EB::easysocial()->assignPoints('comments.remove.author', $post->created_by);
             // JomSocial
             EB::jomsocial()->assignPoints('com_easyblog.comments.removeblogger', $post->created_by);
             // AUP
             EB::aup()->assignPoints('plgaup_easyblog_delete_comment_blogger', $post->created_by, JText::sprintf('COM_EASYBLOG_AUP_COMMENT_DELETED_BLOGGER', $url, $post->title));
         }
     }
     return $state;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:44,代码来源:comment.php

示例7: deleteOtherRelations

 /**
  * Delete all other relations with the post
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function deleteOtherRelations()
 {
     // Delete relationships from jomsocial stream
     EB::jomsocial()->removePostStream($this);
     EB::jomsocial()->assignPoints('com_easyblog.blog.remove', $this->created_by);
     // Deduct points from respective systems
     EB::easydiscuss()->log('easyblog.delete.blog', $this->created_by, JText::sprintf('COM_EASYBLOG_EASYDISCUSS_HISTORY_DELETE_BLOG', $this->title));
     EB::easydiscuss()->addPoint('easyblog.delete.blog', $this->created_by);
     EB::easydiscuss()->addBadge('easyblog.delete.blog', $this->created_by);
     // Integrations with EasySocial
     EB::easysocial()->assignPoints('blog.remove', $this->created_by);
     EB::easysocial()->removePostStream($this);
     // Integrations with AUP
     EB::aup()->assignPoints('plgaup_easyblog_delete_blog', $this->created_by, JText::sprintf('COM_EASYBLOG_AUP_BLOG_DELETED', $this->title));
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:23,代码来源:post.php

示例8: store

 /**
  * Saves a new rating item
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function store($updateNulls = false)
 {
     $config = EB::config();
     $state = parent::store();
     if ($this->type == 'entry' && $this->created_by) {
         // Load the post item
         $post = EB::post($this->uid);
         // Get the author of the post
         $author = $post->getAuthor();
         // Get the link to the post
         $link = $post->getExternalPermalink();
         // Notify EasySocial users that someone rated their post
         EB::easysocial()->notifySubscribers($post, 'ratings.add');
         // Assign EasySocial points
         EB::easysocial()->assignPoints('blog.rate');
         EB::easysocial()->assignPoints('blog.rated', $post->created_by);
         // Assign badge for users that report blog post.
         // Only give points if the viewer is viewing another person's blog post.
         EB::easysocial()->assignBadge('blog.rate', JText::_('COM_EASYBLOG_EASYSOCIAL_BADGE_RATED_BLOG'));
         // Assign points for AUP
         EB::aup()->assign('plgaup_easyblog_rate_blog', '', 'easyblog_rating', JText::_('COM_EASYBLOG_AUP_BLOG_RATED'));
         // Add notifications for EasyDiscuss
         // Add notifications
         // EB::jomsocial()->addNotification(JText::sprintf('COM_EASYBLOG_JOMSOCIAL_NOTIFICATIONS_NEW_RATING_FOR_YOUR_BLOG', str_replace("administrator/","", $author->getProfileLink()), $author->getName() , $link  , $blog->title), 'easyblog_new_blog' , $target , $author , $link);
         // Add notifications for easydiscuss
         if ($config->get('integrations_jomsocial_notification_rating')) {
             $target = array($post->created_by);
             EB::easydiscuss()->addNotification($post, JText::sprintf('COM_EASYBLOG_EASYDISCUSS_NOTIFICATIONS_NEW_RATING_FOR_YOUR_BLOG', $author->getName(), $post->title), EBLOG_NOTIFICATIONS_TYPE_RATING, array($post->created_by), $this->created_by, $link);
         }
     }
     return $state;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:40,代码来源:ratings.php


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