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


PHP EBR::isSh404Enabled方法代码示例

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


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

示例1: notify

 /**
  * Notifies the site owners when a new report is made on the site
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return	
  */
 public function notify(EasyBlogPost &$post)
 {
     $config = EB::config();
     // Send notification to site admins when a new blog post is reported
     $data = array();
     $data['blogTitle'] = $post->title;
     $data['blogLink'] = $post->getExternalPermalink();
     // Get the author of this reporter
     $author = $this->getAuthor();
     $data['reporterAvatar'] = $author->getAvatar();
     $data['reporterName'] = $author->getName();
     $data['reporterLink'] = $author->getProfileLink();
     $data['reason'] = $this->reason;
     $data['reportDate'] = EB::date()->format(JText::_('DATE_FORMAT_LC2'));
     // If blog post is being posted from the back end and SH404 is installed, we should just use the raw urls.
     $app = JFactory::getApplication();
     if ($app->isAdmin() && EBR::isSh404Enabled()) {
         $data['blogLink'] = JURI::root() . 'index.php?option=com_easyblog&view=entry&id=' . $post->id;
     }
     // Set the title of the email
     $subject = JString::substr($post->title, 0, $config->get('main_mailtitle_length'));
     $subject = JText::sprintf('COM_EASYBLOG_EMAIL_TITLE_NEW_REPORT', $subject) . ' ...';
     // Get the notification library
     $notification = EB::notification();
     $recipients = array();
     // Fetch custom emails defined at the back end.
     if ($config->get('notification_blogadmin')) {
         if ($config->get('custom_email_as_admin')) {
             $notification->getCustomEmails($recipients);
         } else {
             $notification->getAdminEmails($recipients);
         }
     }
     if (!empty($recipients)) {
         $notification->send($recipients, $subject, 'post.reported', $data);
     }
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:45,代码来源:report.php

示例2: formatMessage

 /**
  * Formats the message to be published on Twitter
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return	
  */
 public function formatMessage(EasyBlogPost &$post, EasyBlogTableOAuth &$oauth)
 {
     // Get the message template to use to push to Twitter
     $content = !empty($oauth->message) ? $oauth->message : $this->config->get('main_twitter_message');
     // Default vars to search / replace
     $search = array();
     $replace = array();
     // Replace the {title} tag
     if (JString::stristr($content, '{title}') !== false) {
         $search[] = '{title}';
         $replace[] = $post->title;
     }
     // Replace the {introtext} tag
     if (JString::stristr($content, '{introtext}') !== false) {
         $search[] = '{introtext}';
         $replace[] = $post->getIntro(EASYBLOG_STRIP_TAGS);
     }
     // Replace the {category} tag
     if (JString::stristr($content, '{category}') !== false) {
         // Get the primary category of the blog post
         $category = $post->getPrimaryCategory();
         $search[] = '{category}';
         $replace[] = $category->title;
     }
     // Get the final content
     $content = JString::str_ireplace($search, $replace, $content);
     // Replace the {link} tag
     if (JString::stristr($content, '{link}') !== false) {
         // Twitter will automatically shorten urls and a link will have a maximum of 22 chars
         // which leaves us with an offset of 118 characters
         $length = 22;
         $link = EBR::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $post->id, false, true);
         // If blog post is being posted from the back end and SH404 is installed, we should just use the raw urls.
         $sh404exists = EBR::isSh404Enabled();
         if ($this->app->isAdmin() && $sh404exists) {
             $link = rtrim(JURI::root(), '/') . '/index.php?option=com_easyblog&view=entry&id=' . $post->id;
         }
         // Get the remaining length that we can use.
         $remaining = 140 - $length;
         // Split the message
         $parts = explode('{link}', $content);
         for ($i = 0; $i < count($parts); $i++) {
             $tmp =& $parts[$i];
             $tmpLength = JString::strlen($tmp);
             if ($tmpLength > $remaining) {
                 if ($remaining <= 0) {
                     $tmp = JString::substr($tmp, 0, 0);
                 } else {
                     if ($remaining < 6) {
                         $tmp = JString::substr($tmp, 0, $remaining);
                     } else {
                         $tmp = JString::substr($tmp, 0, $remaining - 3) . JText::_('COM_EASYBLOG_ELLIPSES');
                     }
                     $remaining = 0;
                 }
             } else {
                 $remaining -= $tmpLength;
             }
         }
         $content = implode($link, $parts);
     } else {
         $content = JString::substr($content, 0, 136) . JText::_('COM_EASYBLOG_ELLIPSES');
     }
     return $content;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:73,代码来源:client.php

示例3: extractPostData

 /**
  * Retrieve the extracted content of a blog post that can be formatted to Facebook
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function extractPostData(EasyBlogPost &$post)
 {
     // Prepare the result data
     $data = new stdClass();
     // Get the content's source
     $source = $this->config->get('integrations_facebook_source');
     // Get the blog content
     $data->content = $post->getIntro(true);
     // Get the blog's image to be pushed to Facebook
     $data->image = $post->getImage('thumbnail', true, true);
     // var_dump($data->image);exit;
     // If there's no blog image, try to get the image from the content
     if (!$data->image) {
         // lets get full content.
         $fullcontent = $post->getContent('entry');
         $data->image = EB::string()->getImage($fullcontent);
     }
     // If there's still no image, use author's avatar
     if (!$data->image) {
         $author = $post->getAuthor();
         $data->image = $author->getAvatar();
     }
     // if still no image. lets try to get from placeholder.
     if (!$data->image) {
         $data->image = EB::getPlaceholderImage();
     }
     // Format the content so that it respects the length
     $max = $this->config->get('integrations_facebook_blogs_length');
     // Remove adsense codes
     $data->content = EB::adsense()->strip($data->content);
     if ($max && JString::strlen($data->content) > $max) {
         $data->content = JString::substr($data->content, 0, $max) . JText::_('COM_EASYBLOG_ELLIPSES');
     }
     // Get the url to the blog
     $data->url = EBR::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $post->id, false, true);
     // If blog post is being posted from the back end and SH404 is installed, we should just use the raw urls.
     $sh404exists = EBR::isSh404Enabled();
     if ($this->app->isAdmin() && $sh404exists) {
         $data->url = EB::getExternalLink('index.php?option=com_easyblog&view=entry&id=' . $post->id);
     }
     return $data;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:50,代码来源:client.php

示例4: isSefEnabled

 /**
  * Determiens if SEF is enabled on the site
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public static function isSefEnabled()
 {
     $jConfig = EB::jConfig();
     $isSef = false;
     $isSef = EBR::isSh404Enabled();
     // If sh404sef not enabled, we need to check if joomla has it enabled
     if (!$isSef) {
         $isSef = $jConfig->get('sef');
     }
     return $isSef;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:19,代码来源:router.php

示例5: sendModerationEmail

 /**
  * Notifies the admin that a new request to join the team
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return	
  */
 public function sendModerationEmail()
 {
     // Send email to the team admin's.
     $team = EB::table('TeamBlog');
     $team->load($this->team_id);
     $notification = EB::notification();
     $emails = array();
     $config = EB::config();
     if ($config->get('custom_email_as_admin')) {
         $notification->getCustomEmails($emails);
     } else {
         $notification->getAdminEmails($emails);
     }
     $notification->getTeamAdminEmails($emails, $team->id);
     $user = EB::user($this->user_id);
     if (!$emails) {
         return false;
     }
     $data = array('teamName' => $team->title, 'teamLink' => $team->getExternalPermalink(), 'authorAvatar' => $user->getAvatar(), 'authorLink' => EBR::getRoutedURL('index.php?option=com_easyblog&view=blogger&layout=listings&id=' . $user->id, false, true), 'authorName' => $user->getName(), 'requestDate' => EB::date()->format(JText::_('DATE_FORMAT_LC1')), 'reviewLink' => EBR::getRoutedURL('index.php?option=com_easyblog&view=dashboard&layout=teamblogs', false, true));
     // If blog post is being posted from the back end and SH404 is installed, we should just use the raw urls.
     $sh404exists = EBR::isSh404Enabled();
     $app = JFactory::getApplication();
     if ($app->isAdmin() && $sh404exists) {
         $data['authorLink'] = JURI::root() . 'index.php?option=com_easyblog&view=blogger&layout=listings&id=' . $user->id;
         $data['reviewLink'] = JURI::root() . 'index.php?option=com_easyblog&view=dashboard&layout=teamblogs';
     }
     $subject = JText::sprintf('COM_EASYBLOG_TEAMBLOGS_JOIN_REQUEST', $team->title);
     return $notification->send($emails, $subject, 'team.request', $data);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:37,代码来源:teamblogrequest.php

示例6: getExternalPermalink

 /**
  * Retrieves the external permalink for this blog post
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function getExternalPermalink()
 {
     static $link = array();
     if (!isset($link[$this->id])) {
         // If blog post is being posted from the back end and SH404 is installed, we should just use the raw urls.
         $sh404 = EBR::isSh404Enabled();
         $link[$this->id] = EBR::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $this->id, true, true);
         $app = JFactory::getApplication();
         // If this is being submitted from the back end we do not want to use the sef links because the URL will be invalid
         if ($app->isAdmin() && $sh404) {
             $link[$this->id] = rtrim(JURI::root(), '/') . $link[$this->id];
         }
     }
     return $link[$this->id];
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:23,代码来源:post.php


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