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


PHP EasyBlogRouter::getRoutedURL方法代码示例

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


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

示例1: store

 public function store()
 {
     // @task: Load language file from the front end.
     JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT);
     $this->clear($this->draft_id);
     // @rule: Send notification to the author of the post.
     $draft = EasyBlogHelper::getTable('Draft');
     $draft->load($this->draft_id);
     $author = EasyBlogHelper::getTable('Profile');
     $author->load($draft->created_by);
     $data['blogTitle'] = $draft->title;
     $data['blogAuthor'] = $author->getName();
     $data['blogAuthorAvatar'] = $author->getAvatar();
     $data['blogEditLink'] = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=dashboard&layout=write&draft_id=' . $draft->id, false, true);
     $data['blogAuthorEmail'] = $author->user->email;
     $data['rejectMessage'] = $this->message;
     // If blog post is being posted from the back end and SH404 is installed, we should just use the raw urls.
     $sh404exists = EasyBlogRouter::isSh404Enabled();
     if (JFactory::getApplication()->isAdmin() && $sh404exists) {
         $data['blogEditLink'] = JURI::root() . 'index.php?option=com_easyblog&view=dashboard&layout=write&draft_id=' . $draft->id;
     }
     $emailTitle = JText::_('COM_EASYBLOG_EMAIL_TITLE_NEW_BLOG_REJECTED');
     $obj = new StdClass();
     $obj->unsubscribe = false;
     $obj->email = $author->user->email;
     $emails = array($obj);
     $notification = EasyBlogHelper::getHelper('Notification');
     $notification->send($emails, $emailTitle, 'email.blog.rejected', $data);
     return parent::store();
 }
开发者ID:alexinteam,项目名称:joomla3,代码行数:30,代码来源:postreject.php

示例2: getHTML

    public static function getHTML($row)
    {
        $config = EasyBlogHelper::getConfig();
        if (!$config->get('main_tweetmeme')) {
            return '';
        }
        $service = $config->get('main_tweetmeme_url');
        $style = $config->get('main_tweetmeme_style');
        $source = $config->get('main_tweetmeme_rtsource');
        $buttonSize = 'social-button-';
        switch ($style) {
            case 'normal':
                $buttonSize .= 'large';
                break;
            case 'compact':
            default:
                $buttonSize .= 'small';
                break;
        }
        $url = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $row->id, false, true);
        $title = addslashes($row->title);
        $placeholder = 'sb-' . rand();
        $html = '<div class="social-button ' . $buttonSize . ' tweetmeme"><span id="' . $placeholder . '"></span></div>';
        $html .= EasyBlogHelper::addScriptDeclarationBookmarklet('$("#' . $placeholder . '").bookmarklet("tweetMeme", {
			service: "' . $service . '",
			style: "' . $style . '",
			url: "' . $url . '",
			title: "' . $title . '",
			source: "' . $source . '"
		});');
        return $html;
    }
开发者ID:Tommar,项目名称:vino2,代码行数:32,代码来源:tweetmeme.php

示例3: addCard

 public static function addCard(&$blog, $rawIntroText)
 {
     $cfg = EasyBlogHelper::getConfig();
     // @rule: Check if user really wants to append the opengraph tags on the headers.
     if (!$cfg->get('main_twitter_cards')) {
         return false;
     }
     // Get the absolute permalink for this blog item.
     $url = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $blog->id, false, true);
     // Get the image of the blog post.
     $image = self::getImage($blog, $rawIntroText);
     // @task: Get Joomla's document object.
     $doc = JFactory::getDocument();
     // Add card definition.
     $doc->addCustomTag('<meta property="twitter:card" content="summary" />');
     $doc->addCustomTag('<meta property="twitter:url" content="' . $url . '" />');
     $doc->addCustomTag('<meta property="twitter:title" content="' . $blog->title . '" />');
     $text = EasyBlogHelper::stripEmbedTags($rawIntroText);
     $text = strip_tags($text);
     $text = str_ireplace("\r\n", "", $text);
     // Remove any " in the content as this would mess up the headers.
     $text = str_ireplace('"', '', $text);
     $maxLength = 137;
     if (!empty($maxLength)) {
         $text = JString::strlen($text) > $maxLength ? JString::substr($text, 0, $maxLength) . '...' : $text;
     }
     $text = EasyBlogStringHelper::escape($text);
     $doc->addCustomTag('<meta property="twitter:description" content="' . $text . '" />');
     if ($image) {
         $doc->addCustomTag('<meta property="twitter:image" content="' . $image . '"/> ');
     }
     return true;
 }
开发者ID:alexinteam,项目名称:joomla3,代码行数:33,代码来源:twitter.php

示例4: sendApprovalEmail

 public function sendApprovalEmail($approvalType)
 {
     $user = EasyBlogHelper::getTable('Profile');
     $user->load($this->user_id);
     $team = EasyBlogHelper::getTable('TeamBlog');
     $team->load($this->team_id);
     $template = $approvalType ? 'email.teamblog.approved' : 'email.teamblog.rejected';
     $obj = new stdClass();
     $obj->unsubscribe = false;
     $obj->email = $user->user->email;
     $emails = array($obj->email => $obj);
     $data = array('teamName' => $team->title, 'teamDescription' => $team->getDescription(), 'teamAvatar' => $team->getAvatar(), 'teamLink' => EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=teamblog&layout=listings&id=' . $this->team_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 = EasyBlogRouter::isSh404Enabled();
     if (JFactory::getApplication()->isAdmin() && $sh404exists) {
         $data['teamLink'] = JURI::root() . 'index.php?option=com_easyblog&view=teamblog&layout=listings&id=' . $team->id;
     }
     $notification = EasyBlogHelper::getHelper('Notification');
     $notification->send($emails, JText::_('COM_EASYBLOG_TEAMBLOG_JOIN_REQUEST'), $template, $data);
 }
开发者ID:alexinteam,项目名称:joomla3,代码行数:20,代码来源:teamblogrequest.php

示例5: notify

 public function notify(EasyBlogTableBlog $blog)
 {
     $config = EasyBlogHelper::getConfig();
     // Send notification to site admins when a new blog post is reported
     $data = array();
     $data['blogTitle'] = $blog->title;
     $data['blogLink'] = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $blog->id, false, true);
     // @rule: Send email notifications out to subscribers.
     $author = EasyBlogHelper::getTable('Profile');
     $author->load($this->created_by);
     $data['reporterAvatar'] = $author->getAvatar();
     $data['reporterName'] = $author->getName();
     $data['reporterLink'] = $author->getProfileLink();
     $data['reason'] = $this->reason;
     $date = EasyBlogDateHelper::dateWithOffSet($this->created);
     $data['reportDate'] = EasyBlogDateHelper::toFormat($date, '%A, %B %e, %Y');
     // If blog post is being posted from the back end and SH404 is installed, we should just use the raw urls.
     $sh404exists = EasyBlogRouter::isSh404Enabled();
     if (JFactory::getApplication()->isAdmin() && $sh404exists) {
         $data['blogLink'] = JURI::root() . 'index.php?option=com_easyblog&view=entry&id=' . $blog->id;
     }
     $emailBlogTitle = JString::substr($blog->title, 0, $config->get('main_mailtitle_length'));
     $emailTitle = JText::sprintf('COM_EASYBLOG_EMAIL_TITLE_NEW_REPORT', $emailBlogTitle) . ' ...';
     $notification = EasyBlogHelper::getHelper('Notification');
     $emails = array();
     // @rule: Fetch custom emails defined at the back end.
     if ($config->get('notification_blogadmin')) {
         if ($config->get('custom_email_as_admin')) {
             $notification->getCustomEmails($emails);
         } else {
             $notification->getAdminEmails($emails);
         }
     }
     if (!empty($emails)) {
         $notification->send($emails, $emailTitle, 'email.blog.report', $data);
     }
 }
开发者ID:alexinteam,项目名称:joomla3,代码行数:37,代码来源:report.php

示例6: processEmails

 /**
  * Process email notifications
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function processEmails($isModerated = false, $blog)
 {
     $config = EB::config();
     // Fix contents of comments.
     $content = $this->comment;
     // Initialize what we need
     $commentAuthor = $this->name;
     $commentAuthorEmail = $this->email;
     $commentAuthorAvatar = JURI::root() . 'components/com_easyblog/assets/images/default_blogger.png';
     // Get the date object
     $date = EB::date();
     // Format the date
     $commentDate = $date->format(JText::_('DATE_FORMAT_LC3'));
     $teamLink = '';
     if (isset($blog->team)) {
         $teamLink = '&team=' . $blog->team;
     }
     // Get the author data
     if ($this->created_by != 0) {
         $user = $this->getAuthor();
         $commentAuthor = $user->getName();
         $commentAuthorEmail = $user->user->email;
         $commentAuthorAvatar = $user->getAvatar();
     }
     $blogAuthor = EB::user($blog->created_by);
     $data = array('blogTitle' => $blog->title, 'blogIntro' => $blog->intro, 'blogContent' => $blog->content, 'blogLink' => EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry' . $teamLink . '&id=' . $blog->id, false, true), 'commentTitle' => empty($comment->title) ? '-' : $comment->title, 'commentContent' => $content, 'commentAuthor' => $commentAuthor, 'commentAuthorAvatar' => $commentAuthorAvatar, 'commentDate' => $commentDate, 'commentLink' => EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry' . $teamLink . '&id=' . $blog->id, false, true) . '#comment-' . $this->id);
     // Get a list of emails
     $emails = array();
     // Get the notification library
     $notification = EB::notification();
     if ($isModerated) {
         $hashkey = EB::table('HashKeys');
         $hashkey->uid = $this->id;
         $hashkey->type = 'comments';
         $hashkey->store();
         // Generate the approval and reject links
         $data['approveLink'] = EBR::getRoutedURL('index.php?option=com_easyblog&task=comments.approve&key=' . $hashkey->key, false, true);
         $data['rejectLink'] = EBR::getRoutedURL('index.php?option=com_easyblog&task=comments.reject&key=' . $hashkey->key, false, true);
         // Send email notification to admin.
         if ($config->get('custom_email_as_admin')) {
             $notification->getCustomEmails($emails);
         } else {
             $notification->getAdminEmails($emails);
         }
         // @rule: Send email notification to blog authors.
         if ($config->get('notification_commentmoderationauthor')) {
             $obj = new stdClass();
             $obj->unsubscribe = false;
             $obj->email = $blogAuthor->user->email;
             $emails[$blogAuthor->user->email] = $obj;
         }
         $notification->send($emails, JText::_('COM_EASYBLOG_NEW_COMMENT_ADDED_MODERATED_TITLE'), 'comment.moderate', $data);
         return true;
     }
     if (!$isModerated) {
         // Get a list of admin emails
         $notification->getAdminNotificationEmails($emails);
         // Send notification to blog authors.
         if ($config->get('notification_commentauthor')) {
             $obj = new stdClass();
             $obj->unsubscribe = false;
             $obj->email = $blogAuthor->user->email;
             $emails[$blogAuthor->user->email] = $obj;
         }
         // Send notifications to blog subscribers
         if ($config->get('main_subscription') && $blog->subscription == '1' && $config->get('notification_commentsubscriber')) {
             $notification->getBlogSubscriberEmails($emails, $blog->id);
         }
         // Do not send to the person that commented on the blog post.
         unset($emails[$commentAuthorEmail]);
         if (!$emails) {
             return false;
         }
         // Send the emails now.
         $subject = JText::sprintf('COM_EASYBLOG_NEW_COMMENT_ADDED_IN_POST', $blog->title);
         $notification->send($emails, $subject, 'comment.new', $data);
         return true;
     }
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:87,代码来源:comment.php

示例7: getUnsubscribeLink

 public static function getUnsubscribeLink($subdata, $external = false, $isAllType = false, $email = '')
 {
     $easyblogItemId = EasyBlogRouter::getItemId('latest');
     if ($isAllType && $email) {
         $types = array();
         $ids = array();
         $created = array();
         foreach ($subdata as $type => $id) {
             $types[] = $type;
             $tmpId = explode('|', $id);
             $ids[] = $tmpId[0];
             $created[] = $tmpId[1];
         }
         $stype = implode(',', $types);
         $sid = implode(',', $ids);
         $screated = implode(',', $created);
         $unsubdata = base64_encode("type=" . $stype . "\r\nsid=" . $sid . "\r\nuid=" . $email . "\r\ntoken=" . $screated);
     } else {
         $unsubdata = base64_encode("type=" . $subdata->type . "\r\nsid=" . $subdata->id . "\r\nuid=" . $subdata->user_id . "\r\ntoken=" . md5($subdata->id . $subdata->created));
     }
     return EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&task=subscription.unsubscribe&data=' . $unsubdata . '&Itemid=' . $easyblogItemId, false, $external);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:22,代码来源:easyblog.php

示例8: addTeamSubscription

 function addTeamSubscription($teamId, $email, $userId = '0', $fullname = '')
 {
     $config = EasyBlogHelper::getConfig();
     $acl = EasyBlogACLHelper::getRuleSet();
     $my = JFactory::getUser();
     $teamTbl = EasyBlogHelper::getTable('Teamblog', 'Table');
     $teamTbl->load($teamId);
     $gid = EasyBlogHelper::getUserGids($userId);
     $isMember = $teamTbl->isMember($userId, $gid);
     if ($teamTbl->allowSubscription($teamTbl->access, $userId, $isMember, $acl->rules->allow_subscription)) {
         $date = EasyBlogHelper::getDate();
         $subscriber = EasyBlogHelper::getTable('TeamSubscription', 'Table');
         $subscriber->team_id = $teamId;
         $subscriber->email = $email;
         if ($userId != '0') {
             $subscriber->user_id = $userId;
         }
         $subscriber->fullname = $fullname;
         $subscriber->created = $date->toMySQL();
         $state = $subscriber->store();
         if ($state) {
             // lets send confirmation email to subscriber.
             $helper = EasyBlogHelper::getHelper('Subscription');
             $template = $helper->getTemplate();
             $template->uid = $subscriber->id;
             $template->utype = 'teamsubscription';
             $template->user_id = $subscriber->user_id;
             $template->uemail = $email;
             $template->ufullname = $fullname;
             $template->ucreated = $subscriber->created;
             $template->targetname = $teamTbl->title;
             $template->targetlink = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=teamblog&layout=listings&id=' . $teamId, false, true);
             $helper->addMailQueue($template);
         }
     }
 }
开发者ID:Tommar,项目名称:vino2,代码行数:36,代码来源:teamblogs.php

示例9: getUrl

    private function getUrl(&$article, $context) {

        $uri = "";
        $url = JURI::getInstance();
        $domain= $url->getScheme() ."://" . $url->getHost();
        
        switch($this->currentOption) {
            case "com_content":
            	
            	// It's an implementation of "com_myblog"
            	// I don't know why but $option contains "com_content" for a value
            	// I hope it will be fixed in the future versions of "com_myblog"
            	if(strcmp($context, "com_myblog") != 0) {
                	$uri = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug), false);
                	break;
            	}
            	
            case "com_myblog":
                $uri = $article->permalink;
                break;    
                
                
            case "com_k2":
                $uri = $article->link;
                break;
                
            case "com_virtuemart":
                $uri = $article->link;
                break;
                
            case "com_jevents":
                // Display buttons only in the description
                if (is_a($article, "jIcalEventRepeat")) { 
                    $uri = $this->getCurrentURI($url);
                };
                
                break;

            case "com_easyblog":
            	$uri	= EasyBlogRouter::getRoutedURL( 'index.php?option=com_easyblog&view=entry&id=' . $article->id , false , false );
                break;

            case "com_vipportfolio":
                $uri = JRoute::_($article->link, false);
                break;
                    
            case "com_zoo":
                $uri = $this->getCurrentURI($url);
                break;
                
            case "com_jshopping":
                $uri = $this->getCurrentURI($url);
                break;

            case "com_hikashop":
                $uri = $article->link;
                break;
                
            case "com_vipquotes":
                $uri = $article->link;
                break;
                
            default:
                $uri = "";
                break;   
        }
        
        return $domain.$uri;
        
    }
开发者ID:sergy444,项目名称:joomla,代码行数:70,代码来源:itpsocialbuttons.php

示例10: submitForm


//.........这里部分代码省略.........
             $theme = new CodeThemes();
             $theme->set('message', JText::_('COM_EASYBLOG_SUBSCRIPTION_EMAIL_INVALID_ERROR'));
             $theme->set('type', $type);
             $theme->set('id', $id);
             $options = EasyBlogHelper::getHelper('DialogOptions')->set('title', JText::_('COM_EASYBLOG_SUBSCRIPTION_ERROR_DIALOG_TITLE'))->set('content', $theme->fetch('ajax.dialog.subscribe.error.php'))->toObject();
             $ejax->dialog($options);
             return $ejax->send();
         }
     }
     if (JString::trim($fullname) == '') {
         $theme = new CodeThemes();
         $theme->set('message', JText::_('COM_EASYBLOG_SUBSCRIPTION_NAME_EMPTY_ERROR'));
         $theme->set('type', $type);
         $theme->set('id', $id);
         $options = EasyBlogHelper::getHelper('DialogOptions')->set('title', JText::_('COM_EASYBLOG_SUBSCRIPTION_ERROR_DIALOG_TITLE'))->set('content', $theme->fetch('ajax.dialog.subscribe.error.php'))->toObject();
         $ejax->dialog($options);
         return $ejax->send();
     }
     if ($register && $my->id == 0) {
         if (JString::trim($username) == '') {
             $theme = new CodeThemes();
             $theme->set('message', JText::_('COM_EASYBLOG_SUBSCRIPTION_USERNAME_EMPTY_ERROR'));
             $theme->set('type', $type);
             $theme->set('id', $id);
             $options = EasyBlogHelper::getHelper('DialogOptions')->set('title', JText::_('COM_EASYBLOG_SUBSCRIPTION_ERROR_DIALOG_TITLE'))->set('content', $theme->fetch('ajax.dialog.subscribe.error.php'))->toObject();
             $ejax->dialog($options);
             return $ejax->send();
         }
         $registor = EasyBlogHelper::getRegistor();
         $options = array('username' => $username, 'email' => $email);
         $validate = $registor->validate($options);
         if ($validate !== true) {
             $theme = new CodeThemes();
             $theme->set('message', $validate);
             $theme->set('type', $type);
             $theme->set('id', $id);
             $options = EasyBlogHelper::getHelper('DialogOptions')->set('title', JText::_('COM_EASYBLOG_SUBSCRIPTION_ERROR_DIALOG_TITLE'))->set('content', $theme->fetch('ajax.dialog.subscribe.error.php'))->toObject();
             $ejax->dialog($options);
             return $ejax->send();
         } else {
             $options['fullname'] = $fullname;
             $newId = $registor->addUser($options);
             if (!is_numeric($newId)) {
                 // registration failed.
                 $msg = $newId;
             } else {
                 $userId = $newId;
             }
         }
     }
     // Real logic operation goes here.
     $method = 'subscribe' . ucfirst($type);
     // @rule: Process mailchimp subscriptions here.
     EasyBlogHelper::getHelper('Mailchimp')->subscribe($email, $fullname);
     if (!$this->{$method}($id, $userId, $email, $fullname)) {
         $theme = new CodeThemes();
         $theme->set('message', JText::_('COM_EASYBLOG_SUBSCRIPTION_ALREADY_SUBSCRIBED_ERROR'));
         $theme->set('type', $type);
         $theme->set('id', $id);
         $options = EasyBlogHelper::getHelper('DialogOptions')->set('title', JText::_('COM_EASYBLOG_SUBSCRIPTION_ERROR_DIALOG_TITLE'))->set('content', $theme->fetch('ajax.dialog.subscribe.error.php'))->toObject();
         $ejax->dialog($options);
         return $ejax->send();
     }
     // message
     if ($register && is_numeric($newId)) {
         $message = JText::sprintf('COM_EASYBLOG_YOU_SUCCESSFULLY_SUBSCRIBED_AND_REGISTERED_AS_MEMBER');
     } else {
         $message = JText::sprintf('COM_EASYBLOG_SUBSCRIPTION_SUBSCRIBED_SUCCESS', $email);
     }
     $theme = new CodeThemes();
     $theme->set('message', $message);
     $options = EasyBlogHelper::getHelper('DialogOptions')->set('title', JText::_('COM_EASYBLOG_SUBSCRIPTION_SUCCESS_DIALOG_TITLE'))->set('content', $theme->fetch('ajax.dialog.subscribe.success.php'))->toObject();
     $ejax->dialog($options);
     // Send email to notify admin upon successful subscriptions
     $user = EasyBlogHelper::getTable('Profile');
     $user->load($userId);
     $date = EasyBlogDateHelper::getDate();
     $subscriberName = $my->id == 0 ? $post['esfullname'] : $user->getName();
     $data = array('title' => JText::_('COM_EASYBLOG_SUBSCRIPTION_SUCCESS_DIALOG_TITLE'), 'subscriber' => $subscriberName, 'subscriberLink' => EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=blogger&layout=listings&id=' . $user->id, false, true), 'subscriberAvatar' => $user->getAvatar(), 'subscriberDate' => EasyBlogDateHelper::toFormat($date, '%A, %B %e, %Y'), 'type' => $type);
     if ($type == 'entry') {
         $data['reviewLink'] = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $id, false, true);
     }
     if ($type == 'category') {
         $data['reviewLink'] = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=categories&layout=listings&id=' . $id, false, true);
     }
     $emailTitle = JText::_('COM_EASYBLOG_NEW') . ' ' . JText::_('COM_EASYBLOG_SUBSCRIPTION_TYPE_' . strtoupper($type)) . ' ' . strtolower(JText::_('COM_EASYBLOG_SUBSCRIPTION'));
     $emails = array();
     $notification = EasyBlogHelper::getHelper('Notification');
     $config = EasyBlogHelper::getConfig();
     // @rule: if custom_email_as_admin is enabled, use custom email as admin email
     if ($config->get('custom_email_as_admin')) {
         // @rule: Send to custom email addresses
         $notification->getCustomEmails($emails);
     } else {
         // @rule: Send to administrator's on the site.
         $notification->getAdminEmails($emails);
     }
     $notification->send($emails, $emailTitle, 'email.subscriptions', $data);
     return $ejax->send();
 }
开发者ID:Tommar,项目名称:vino2,代码行数:101,代码来源:view.ejax.php

示例11: share

 /**
  * Shares a story through 3rd party oauth clients
  *
  * @param	TableBlog	$blog	A blog table object
  * @param	string		$type	The type of oauth client
  *
  * @return	boolean		True on success and false otherwise.
  **/
 public function share($blog, $type, $useCentralized = false)
 {
     JTable::addIncludePath(EBLOG_TABLES);
     $oauth = EasyBlogHelper::getTable('Oauth', 'Table');
     $oauths = array();
     $config = EasyBlogHelper::getConfig();
     // @rule: Process centralized notifications, be it a page or an account update
     if ($useCentralized) {
         $userId = $config->get('integrations_' . strtolower($type) . '_centralized_userid');
         $message = $config->get('integrations_' . JString::strtolower($type) . '_centralized_auto_post');
         $auto = $config->get('integrations_' . JString::strtolower($type) . '_centralized_auto_post');
         $oauth->loadByUser($userId, $type);
         // For legacy fix prior to 3.0, we need to set system=1
         if ($oauth->id && !$oauth->system) {
             $oauth->system = 1;
             $oauth->store();
         }
         // @task: Now we try to load the real object
         $oauth->loadSystemByType($type);
         if ($oauth->id) {
             $oauths[] = $oauth;
         }
     } else {
         if ($config->get('integrations_' . JString::strtolower($type) . '_centralized_and_own')) {
             JTable::addIncludePath(EBLOG_TABLES);
             $oauth = EasyBlogHelper::getTable('Oauth', 'Table');
             $oauth->loadByUser($blog->created_by, $type);
             $oauths[] = $oauth;
         }
     }
     $key = $config->get('integrations_' . $type . '_api_key');
     $secret = $config->get('integrations_' . $type . '_secret_key');
     // @rule: Set callback URLs
     $callback = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&controller=oauth&task=grant&type=' . $type, false, true);
     if ($oauths) {
         foreach ($oauths as $oauth) {
             // Skip processing anything that does not have an access token
             if (!$oauth->access_token) {
                 continue;
             }
             $acl = EasyBlogACLHelper::getRuleSet($blog->created_by);
             $rule = 'update_' . $type;
             // @task: If entry is already shared or automatic postings is disabled do not share this entry.
             if ($oauth->isShared($blog->id, $useCentralized) || !$acl->rules->{$rule} && !EasyBlogHelper::isSiteAdmin()) {
                 continue;
             }
             // @rule: Retrieve the consumer object for this oauth client.
             $consumer = EasyBlogOauthHelper::getConsumer($type, $key, $secret, $callback);
             $consumer->setAccess($oauth->access_token);
             if ($consumer->share($blog, $oauth->message, $oauth, $useCentralized)) {
                 // @task: mark this as sent!
                 $oauthPost = EasyBlogHelper::getTable('OauthPost', 'Table');
                 $oauthPost->loadByOauthId($blog->id, $oauth->id);
                 $date = EasyBlogHelper::getDate();
                 $oauthPost->post_id = $blog->id;
                 $oauthPost->oauth_id = $oauth->id;
                 $oauthPost->created = $date->toMySQL();
                 $oauthPost->modified = $date->toMySQL();
                 $oauthPost->sent = $date->toMySQL();
                 $oauthPost->store();
             }
         }
     }
     return true;
 }
开发者ID:Tommar,项目名称:vino2,代码行数:73,代码来源:socialshare.php

示例12: addSiteSubscription

 function addSiteSubscription($email, $userId = '0', $fullname = '')
 {
     $config = EasyBlogHelper::getConfig();
     $acl = EasyBlogACLHelper::getRuleSet();
     $my = JFactory::getUser();
     if ($acl->rules->allow_subscription || empty($my->id) && $config->get('main_allowguestsubscribe')) {
         $date = EasyBlogHelper::getDate();
         $subscription = EasyBlogHelper::getTable('SiteSubscription');
         $subscription->email = $email;
         if ($userId) {
             $subscription->user_id = $userId;
         }
         $subscription->fullname = $fullname;
         $subscription->created = EasyBlogHelper::getDate()->toMySQL();
         $state = $subscription->store();
         if ($state) {
             // lets send confirmation email to subscriber.
             $helper = EasyBlogHelper::getHelper('Subscription');
             $template = $helper->getTemplate();
             $template->uid = $subscription->id;
             $template->utype = 'sitesubscription';
             $template->user_id = $subscription->user_id;
             $template->uemail = $email;
             $template->ufullname = $fullname;
             $template->ucreated = $subscription->created;
             $template->targetname = $config->get('main_title');
             $template->targetlink = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=latest', false, true);
             $helper->addMailQueue($template);
         }
         return $state;
     }
 }
开发者ID:Tommar,项目名称:vino2,代码行数:32,代码来源:subscription.php

示例13: processTrackbacks

 public function processTrackbacks()
 {
     JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT);
     if (!class_exists('EasyBlogModelTrackbackSent')) {
         JLoader::import('trackbacksent', EBLOG_ROOT . DIRECTORY_SEPARATOR . 'models');
     }
     $model = JModel::getInstance('TrackbackSent', 'EasyBlogModel');
     // get lists of trackback URLs based on blog ID
     $trackbacks = $model->getSentTrackbacks($this->id, true);
     require_once EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'trackback.php';
     require_once EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'router.php';
     if (!$trackbacks) {
         return false;
     }
     foreach ($trackbacks as $trackback) {
         $author = EasyBlogHelper::getTable('Profile');
         $author->load($this->created_by);
         $tb = new EasyBlogTrackBack($author->getName(), $author->getName(), 'UTF-8');
         $text = empty($this->intro) ? $this->content : $this->intro;
         $url = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $this->id, false, true);
         if ($tb->ping($trackback->url, $url, $this->title, $text)) {
             $table = EasyBlogHelper::getTable('TrackbackSent');
             $table->load($trackback->id);
             $table->markSent();
         }
     }
     return true;
 }
开发者ID:alexinteam,项目名称:joomla3,代码行数:28,代码来源:blogs.php

示例14: getCategoryLink

 public function getCategoryLink($blog)
 {
     return EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=categories&layout=listings&id=' . $blog->category_id . $this->getItemId(), false, true);
 }
开发者ID:Tommar,项目名称:vino2,代码行数:4,代码来源:mightytouch.php

示例15:

		</h3>

			<b><?php 
        echo $this->formatDate('%b %d %Y', $post->created);
        ?>
</b> -
			<?php 
        echo $post->content;
        ?>
...
			<br />
		<a href="<?php 
        echo EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $post->id);
        ?>
"  class="search-permalink"><?php 
        echo EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $post->id, false, true);
        ?>
</a>
	</li>
	<?php 
    }
    ?>
</ul>

<?php 
    if ($pagination->getPagesLinks()) {
        ?>
<div class="eblog-pagination"><?php 
        echo $pagination->getPagesLinks();
        ?>
</div>
开发者ID:Tommar,项目名称:vino2,代码行数:31,代码来源:blog.search.item.php


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