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


PHP EasyBlogRouter::getEntryRoute方法代码示例

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


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

示例1: get_link

 function get_link($num)
 {
     if ($this->mode == 'com_content') {
         return $this->parent->content[$num]['id'] != 0 ? JRoute::_(ContentHelperRoute::getArticleRoute($this->parent->content[$num]['id'], $this->parent->content[$num]['cid'])) : JRoute::_('index.php?option=com_users&view=login');
     } else {
         if ($this->mode == 'com_k2') {
             //
             require_once JPATH_SITE . DS . 'components' . DS . 'com_k2' . DS . 'helpers' . DS . 'route.php';
             //
             return urldecode(JRoute::_(K2HelperRoute::getItemRoute($this->parent->content[$num]['id'] . ':' . urlencode($this->parent->content[$num]['alias']), $this->parent->content[$num]['cid'] . ':' . urlencode($this->parent->content[$num]['cat_alias']))));
         } else {
             if ($this->mode == 'com_easyblog') {
                 //
                 require_once JPATH_SITE . DS . 'components' . DS . 'com_easyblog' . DS . 'helpers' . DS . 'router.php';
                 //
                 return urldecode(JRoute::_(EasyBlogRouter::getEntryRoute($this->parent->content[$num]['id'])));
             } else {
                 return false;
             }
         }
     }
 }
开发者ID:grchis,项目名称:Site-Auto,代码行数:22,代码来源:controller.php

示例2: addTrackback

 public static function addTrackback($trackback, $blogObj, $my)
 {
     // JTable::addIncludePath( JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'tables' );
     // JModel::addIncludePath( JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'models' );
     require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'trackback.php';
     $author = EasyBlogHelper::getTable('Profile', 'Table');
     $author->setUser($my);
     if (!empty($trackback) && is_string($trackback)) {
         $trackbacks = explode(' ', $trackback);
         for ($x = 0; $x < count($trackbacks); $x++) {
             $tbl = EasyBlogHelper::getTable('TrackbackSent', 'Table');
             // check if the URL has been added to our record
             $exists = $tbl->load($trackbacks[$x], true, $blogObj->id);
             // if not exists, we need to store them
             if (!$exists) {
                 $tbl = EasyBlogHelper::getTable('TrackbackSent', 'Table');
                 $tbl->post_id = $blogObj->id;
                 $tbl->url = $trackbacks[$x];
                 $tbl->sent = 0;
                 $tbl->store();
             }
         }
     }
     // only process this part when publish blog
     if ($blogObj->published == '1') {
         // now load trackback model
         jimport('joomla.application.component.model');
         $trackbackModel = EasyBlogHelper::getModel('TrackbackSent');
         // get lists of trackback URLs based on blog ID
         $tbacks = $trackbackModel->getSentTrackbacks($blogObj->id, true);
         if (count($tbacks) > 0) {
             // loop each URL, ping if necessary
             foreach ($tbacks as $tback) {
                 $tb = new EasyBlogTrackBack($author->getName(), $author->getName(), 'UTF-8');
                 $text = empty($blogObj->intro) ? $blogObj->content : $blogObj->intro;
                 if (@$tb->ping($tback->url, EasyBlogRouter::getEntryRoute($blogObj->id), $blogObj->title, $text)) {
                     $tbl = EasyBlogHelper::getTable('TrackbackSent', 'Table');
                     $tbl->load($tback->id);
                     $new_trackbacks = array();
                     $new_trackbacks['url'] = $tback->url;
                     $new_trackbacks['post_id'] = $tback->post_id;
                     $new_trackbacks['sent'] = 1;
                     $tbl->bind($new_trackbacks);
                     $tbl->store();
                 }
             }
             //enf foreach
         }
         //end if
     }
 }
开发者ID:Tommar,项目名称:vino2,代码行数:51,代码来源:xmlrpc.php


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