本文整理汇总了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;
}
}
}
}
示例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
}
}