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


PHP EasyBlogHelper::addJomSocialActivityBlog方法代码示例

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


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

示例1: store


//.........这里部分代码省略.........
     $inputFilter->attrBlacklist = $filterAttributes;
     if (count($filterTags) > 0 && !empty($filterTags[0]) || count($filterAttributes) > 0 && !empty($filterAttributes[0])) {
         $this->intro = $inputFilter->clean($this->intro);
         $this->content = $inputFilter->clean($this->content);
     }
     // @rule: Process badword filters for content here.
     $blockedWord = EasyBlogHelper::getHelper('String')->hasBlockedWords($this->intro . $this->content);
     if ($blockedWord !== false) {
         $this->setError(JText::sprintf('COM_EASYBLOG_BLOG_POST_CONTAIN_BLOCKED_WORDS', $blockedWord));
         return false;
     }
     // @rule: Test for the empty-ness
     if (empty($this->intro) && empty($this->content)) {
         $this->setError(JText::_('COM_EASYBLOG_DASHBOARD_SAVE_CONTENT_ERROR'));
     }
     // alway set this to false no matter what! TODO: remove this column.
     $this->ispending = '0';
     $state = parent::store();
     $source = JRequest::getVar('blog_contribute_source', 'easyblog');
     // @trigger: onBeforeSave
     $this->triggerAfterSave();
     // if this is blog edit, then we should see the column isnew to determine
     // whether the post is really new or not.
     if (!$isNew) {
         $isNew = $this->isnew;
     }
     // @task: If auto featured is enabled, we need to feature the blog post automatically since the blogger is featured.
     if ($config->get('main_autofeatured', 0) && EasyBlogHelper::isFeatured('blogger', $this->created_by) && !EasyBlogHelper::isFeatured('post', $this->id)) {
         EasyBlogHelper::makeFeatured('post', $this->id);
     }
     // @task: This is when the blog is either created or updated.
     if ($source == 'easyblog' && $state && $this->published == POST_ID_PUBLISHED && $log) {
         // @rule: Add new stream item in jomsocial
         EasyBlogHelper::addJomSocialActivityBlog($this, $isNew);
         // @rule: Log new stream item into EasyBlog
         $activity = new stdClass();
         $activity->actor_id = $this->created_by;
         $activity->target_id = '0';
         $activity->context_type = 'post';
         $activity->context_id = $this->id;
         $activity->verb = $isNew ? 'add' : 'update';
         $activity->uuid = $this->title;
         EasyBlogHelper::activityLog($activity);
     }
     if ($source == 'easyblog' && $state && $this->published == POST_ID_PUBLISHED && $isNew && $log) {
         // @rule: Send email notifications out to subscribers.
         $author = EasyBlogHelper::getTable('Profile');
         $author->load($this->created_by);
         // @rule: Ping pingomatic
         if ($config->get('main_pingomatic')) {
             if (!EasyBlogHelper::getHelper('Pingomatic')->ping($this->title, EasyBlogHelper::getExternalLink('index.php?option=com_easyblog&view=entry&id=' . $this->id, true))) {
                 EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_DASHBOARD_SAVE_PINGOMATIC_ERROR'), 'error');
             }
         }
         // Assign EasySocial points
         $easysocial = EasyBlogHelper::getHelper('EasySocial');
         $easysocial->assignPoints('blog.create', $this->created_by);
         // @rule: Add userpoints for jomsocial
         if ($config->get('main_jomsocial_userpoint')) {
             $path = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'userpoints.php';
             if (JFile::exists($path)) {
                 require_once $path;
                 CUserPoints::assignPoint('com_easyblog.blog.add', $this->created_by);
             }
         }
         $link = $this->getExternalBlogLink('index.php?option=com_easyblog&view=entry&id=' . $this->id);
开发者ID:alexinteam,项目名称:joomla3,代码行数:67,代码来源:blogs.php

示例2: addJomsocialActivities

 public static function addJomsocialActivities($blog, $isNew)
 {
     EasyBlogHelper::addJomSocialActivityBlog($blog, $isNew);
 }
开发者ID:Tommar,项目名称:vino2,代码行数:4,代码来源:xmlrpc.php

示例3: import


//.........这里部分代码省略.........
                 $fiConnector = new EasyBlogConnectorsHelper();
                 $fiConnector->addUrl($feedItemUrl);
                 $fiConnector->execute();
                 $fiContent = $fiConnector->getResult($feedItemUrl);
                 // to ensure the leading no text before the <?xml> tag
                 $pattern = '/(.*?)<html/is';
                 $replacement = '<html';
                 $fiContent = preg_replace($pattern, $replacement, $fiContent, 1);
                 if (!empty($fiContent)) {
                     $fiContent = EasyBlogHelper::getHelper('string')->forceUTF8($fiContent);
                     $readability = new Readability($fiContent);
                     $readability->debug = false;
                     $readability->convertLinksToFootnotes = false;
                     $result = $readability->init();
                     if ($result) {
                         $content = $readability->getContent()->innerHTML;
                         //$content	= EasyBlogHelper::getHelper( 'string' )->fixUTF8( $content );
                         $content = EasyBlogFeedsHelper::tidyContent($content);
                         if (stristr(html_entity_decode($content), '<!DOCTYPE html') === false) {
                             $text = $content;
                             $text = $this->_processRelLinktoAbs($text, $feedPath);
                         }
                     }
                 }
             }
             // strip un-allowed html tag.
             $text = strip_tags($text, $params->get('allowed', $defaultAllowedHTML));
             // Append original source link into article if necessary
             if ($params->get('sourceLinks')) {
                 JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT);
                 $text .= '<div><a href="' . $item->get_link() . '" target="_blank">' . JText::_('COM_EASYBLOG_FEEDS_ORIGINAL_LINK') . '</a></div>';
             }
             if ($feedObj->author) {
                 $feedAuthor = $item->get_author();
                 if (!empty($feedAuthor)) {
                     $authorName = $feedAuthor->get_name();
                     $authorEmail = $feedAuthor->get_email();
                     if (!empty($authorName)) {
                         // Store it as copyright column instead
                         $text .= '<div>' . JText::sprintf('COM_EASYBLOG_FEEDS_ORIGINAL_AUTHOR', $authorName) . '</div>';
                     } else {
                         if (!empty($authorEmail)) {
                             $authorArr = explode(' ', $authorEmail);
                             if (isset($authorArr[1])) {
                                 $authorName = $authorArr[1];
                                 $authorName = str_replace(array('(', ')'), '', $authorName);
                                 $text .= '<div>' . JText::sprintf('COM_EASYBLOG_FEEDS_ORIGINAL_AUTHOR', $authorName) . '</div>';
                             }
                         }
                     }
                 }
             }
             if ($feedObj->item_content == 'intro') {
                 $blogObj->intro = $text;
             } else {
                 $blogObj->content = $text;
             }
             $creationDate = $mydate;
             $blogObj->created = $mydate;
             $blogObj->modified = $mydate;
             $blogObj->title = $item->get_title();
             if (empty($blogObj->title)) {
                 $blogObj->title = $this->_getTitleFromLink($item->get_link());
             }
             $blogObj->title = EasyBlogStringHelper::unhtmlentities($blogObj->title);
             $blogObj->permalink = EasyBlogHelper::getPermalink($blogObj->title);
             $blogObj->publish_up = $mydate;
             $blogObj->isnew = !$feedObj->item_published ? true : false;
             $blog = EasyBlogHelper::getTable('blog');
             $blog->bind($blogObj);
             if ($feedObj->item_published) {
                 $blog->notify();
             }
             if ($blog->store()) {
                 $myCnt++;
                 //update the history with blog id
                 if (!empty($newHistoryId)) {
                     $tmpHistory = EasyBlogHelper::getTable('FeedHistory');
                     $tmpHistory->load($newHistoryId);
                     $tmpHistory->post_id = $blog->id;
                     $tmpHistory->store();
                 }
                 $itemMigrated++;
                 if ($feedObj->item_published) {
                     //insert activity here.
                     EasyBlogHelper::addJomSocialActivityBlog($blog, true, true);
                     // Determines if admin wants to auto post this item to the social sites.
                     if ($params->get('autopost')) {
                         $allowed = array(EBLOG_OAUTH_LINKEDIN, EBLOG_OAUTH_FACEBOOK, EBLOG_OAUTH_TWITTER);
                         // @rule: Process centralized options first
                         // See if there are any global postings enabled.
                         $blog->autopost($allowed, $allowed);
                     }
                 }
             }
             //end if
         }
     }
     return $itemMigrated;
 }
开发者ID:Tommar,项目名称:vino2,代码行数:101,代码来源:feeds.php


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