本文整理汇总了PHP中EasyBlogRouter::getCategoryPermalink方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogRouter::getCategoryPermalink方法的具体用法?PHP EasyBlogRouter::getCategoryPermalink怎么用?PHP EasyBlogRouter::getCategoryPermalink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogRouter
的用法示例。
在下文中一共展示了EasyBlogRouter::getCategoryPermalink方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shRemoveFromGETVarsList
shRemoveFromGETVarsList('view');
}
if (isset($layout)) {
if ($layout == 'statistic') {
if (!empty($idname)) {
$title[] = $idname;
$add_idname = false;
shRemoveFromGETVarsList('id');
}
$title[] = JText::_('COM_EASYBLOG_SH404_LAYOUT_' . JString::strtoupper($layout));
if (!empty($stat)) {
$title[] = $stat;
shRemoveFromGETVarsList('stat');
}
if (!empty($catid)) {
$title[] = EasyBlogRouter::getCategoryPermalink($catid);
shRemoveFromGETVarsList('catid');
}
if (!empty($tagid)) {
$title[] = EasyBlogRouter::getTagPermalink($tagid);
shRemoveFromGETVarsList('tagid');
}
} else {
$translatedStr = JText::_('COM_EASYBLOG_SH404_LAYOUT_' . JString::strtoupper($layout));
if (stristr($translatedStr, 'COM_EASYBLOG_SH404_LAYOUT_') === false) {
$title[] = $translatedStr;
}
}
shRemoveFromGETVarsList('layout');
}
// minor fix when id shouldn't get remove. @2011-06-16 - sam.
示例2: create
/**
* Creates the SEF Advance URL out of the request
* Input: $string, string, The request URL (index.php?option=com_example&Itemid=$Itemid)
* Output: $sefstring, string, SEF Advance URL ($var1/$var2/)
**/
function create($string)
{
global $database;
if (empty($database)) {
// Joomla! 1.5 native
$database = EasyBlogHelper::db();
}
// $string == "index.php?option=com_mydir&Itemid=$Itemid
// &catid=$catid&id=$id"
$sefstring = '';
// $itemid = '';
// if (preg_match('/&Itemid=/i',$string))
// {
// $temp = explode('&Itemid=', $string);
// $temp = explode('&', $temp[1]);
// $itemid = $temp[0];
// }
$config = EasyBlogHelper::getConfig();
if (preg_match('/&view=/i', $string)) {
$temp = explode('&view=', $string);
$temp = explode('&', $temp[1]);
$view = $temp[0];
if ($view != 'entry' || $config->get('main_sef') != 'simple') {
$sefstring .= sefencode($view) . '/';
}
}
if (preg_match('/&id=/i', $string)) {
$id = sef_easyblog::getVarValue('id', $string);
JTable::addIncludePath(JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'tables');
$idname = '';
if (!empty($id) && isset($view)) {
switch ($view) {
case 'entry':
$idname = EasyBlogRouter::getBlogSefPermalink($id);
break;
case 'blogger':
$idname = EasyBlogRouter::getBloggerPermalink($id);
break;
case 'categories':
$idname = EasyBlogRouter::getCategoryPermalink($id);
break;
case 'tags':
$idname = EasyBlogRouter::getTagPermalink($id);
break;
case 'teamblog':
$idname = EasyBlogRouter::getTeamBlogPermalink($id);
break;
default:
$idname = '';
}
}
$idname = empty($idname) ? $id : $idname;
}
if (preg_match('/&controller=/i', $string)) {
$temp = explode('&controller=', $string);
$temp = explode('&', $temp[1]);
$controller = $temp[0];
$sefstring .= '?controller=' . $controller;
if (preg_match('/&task=/i', $string)) {
$temp = explode('&task=', $string);
$temp = explode('&', $temp[1]);
$task = $temp[0];
$sefstring .= '&task=' . $task;
}
if (preg_match('/&tmpl=/i', $string)) {
$temp = explode('&tmpl=', $string);
$temp = explode('&', $temp[1]);
$tmpl = $temp[0];
$sefstring .= '&tmpl=' . $tmpl;
}
if (preg_match('/&browse=/i', $string)) {
$temp = explode('&browse=', $string);
$temp = explode('&', $temp[1]);
$browse = $temp[0];
$sefstring .= '&browse=' . $browse;
}
if (preg_match('/&from=/i', $string)) {
$temp = explode('&from=', $string);
$temp = explode('&', $temp[1]);
$from = $temp[0];
$sefstring .= '&from=' . $from;
}
if (preg_match('/&status=/i', $string)) {
$temp = explode('&status=', $string);
$temp = explode('&', $temp[1]);
$from = $temp[0];
$sefstring .= '&status=' . $from;
}
if (preg_match('/&blogId=/i', $string)) {
$temp = explode('&blogId=', $string);
$temp = explode('&', $temp[1]);
$from = $temp[0];
$sefstring .= '&blogId=' . $from;
}
}
//.........这里部分代码省略.........
示例3: getCustomPermalink
public static function getCustomPermalink(&$data)
{
$cfg = EasyBlogHelper::getConfig();
$custom = $cfg->get('main_sef_custom');
$date = EasyBlogHelper::getDate($data->created);
// @task: If the user didn't enter any values for the custom sef, we'll just load the default one which is the 'date' based
if (empty($custom)) {
return $date->toFormat('%Y') . '/' . $date->toFormat('%m') . '/' . $date->toFormat('%d') . '/' . $data->permalink;
}
// @task: Break all parts separated by /
$pieces = explode('/', $custom);
if (!$pieces) {
$date = EasyBlogHelper::getDate($data->created);
return $date->toFormat('%Y') . '/' . $date->toFormat('%m') . '/' . $date->toFormat('%d') . '/' . $data->permalink;
}
$result = array();
foreach ($pieces as $piece) {
// @task: Replace %year_num%
$piece = str_ireplace('%year_num%', $date->toFormat('%Y'), $piece);
// @task: Replace %month_num%
$piece = str_ireplace('%month_num%', $date->toFormat('%m'), $piece);
// @task: Replace %day_num%
$piece = str_ireplace('%day_num%', $date->toFormat('%d'), $piece);
// @task: Replace %day%
$piece = str_ireplace('%day%', $date->toFormat('%A'), $piece);
// @task: Replace %month%
$piece = str_ireplace('%month%', $date->toFormat('%b'), $piece);
// @task: Replace %blog_id%
$piece = str_ireplace('%blog_id%', $data->id, $piece);
// @task: Replace %category%
$piece = str_ireplace('%category%', EasyBlogRouter::getCategoryPermalink($data->category_id), $piece);
// @task: Replace %category_id%
$piece = str_ireplace('%category_id%', $data->category_id, $piece);
$result[] = $piece;
}
$url = implode('/', $result);
$url .= '/' . $data->permalink;
return $url;
}
示例4: EasyBlogBuildRoute
function EasyBlogBuildRoute(&$query)
{
JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT);
$segments = array();
$config = EasyBlogHelper::getConfig();
if (isset($query['view']) && $query['view'] == 'entry' && isset($query['id'])) {
if ($config->get('main_sef') != 'simple') {
$segments[] = EasyBlogSEFTranslation::_($query['view']);
}
$segments[] = EasyBlogRouter::getBlogSefPermalink($query['id']);
unset($query['id']);
unset($query['view']);
}
if (isset($query['view']) && $query['view'] == 'categories' && isset($query['id'])) {
$segments[] = EasyBlogSEFTranslation::_($query['view']);
if ($config->get('main_sef') != 'simple') {
if (isset($query['layout'])) {
$segments[] = EasyBlogSEFTranslation::_($query['layout']);
}
}
$segments[] = EasyBlogRouter::getCategoryPermalink($query['id']);
unset($query['id']);
unset($query['view']);
unset($query['layout']);
}
if (isset($query['view']) && $query['view'] == 'tags' && isset($query['id']) && isset($query['layout'])) {
$segments[] = EasyBlogSEFTranslation::_($query['view']);
$segments[] = EasyBlogSEFTranslation::_($query['layout']);
$segments[] = EasyBlogRouter::getTagPermalink($query['id']);
unset($query['id']);
unset($query['view']);
unset($query['layout']);
}
if (isset($query['view']) && $query['view'] == 'teamblog' && isset($query['id'])) {
$segments[] = EasyBlogSEFTranslation::_($query['view']);
if (isset($query['layout'])) {
if ($query['layout'] == "statistic") {
$segments[] = EasyBlogRouter::getTeamBlogPermalink($query['id']);
$segments[] = EasyBlogSEFTranslation::_($query['layout']);
$segments[] = EasyBlogSEFTranslation::_($query['stat']);
if ($query['stat'] == 'category') {
$segments[] = EasyBlogRouter::getCategoryPermalink($query['catid']);
unset($query['catid']);
}
if ($query['stat'] == 'tag') {
$segments[] = EasyBlogRouter::getTagPermalink($query['tagid']);
unset($query['tagid']);
}
} else {
$segments[] = EasyBlogSEFTranslation::_($query['layout']);
$segments[] = EasyBlogRouter::getTeamBlogPermalink($query['id']);
}
} else {
$segments[] = EasyBlogRouter::getTeamBlogPermalink($query['id']);
}
unset($query['id']);
unset($query['stat']);
unset($query['layout']);
unset($query['view']);
}
if (isset($query['view']) && $query['view'] == 'blogger' && isset($query['id'])) {
$segments[] = EasyBlogSEFTranslation::_($query['view']);
if (isset($query['layout'])) {
if ($query['layout'] == "statistic") {
$segments[] = EasyBlogRouter::getBloggerPermalink($query['id']);
$segments[] = EasyBlogSEFTranslation::_($query['layout']);
$segments[] = $query['stat'];
if ($query['stat'] == 'category') {
$segments[] = EasyBlogRouter::getCategoryPermalink($query['catid']);
unset($query['catid']);
}
if ($query['stat'] == 'tag') {
$segments[] = EasyBlogRouter::getTagPermalink($query['tagid']);
unset($query['tagid']);
}
} else {
$segments[] = EasyBlogSEFTranslation::_($query['layout']);
$segments[] = EasyBlogRouter::getBloggerPermalink($query['id']);
}
} else {
$segments[] = EasyBlogRouter::getBloggerPermalink($query['id']);
}
unset($query['id']);
unset($query['stat']);
unset($query['view']);
unset($query['layout']);
}
if (isset($query['view']) && $query['view'] == 'dashboard' && isset($query['layout'])) {
$segments[] = EasyBlogSEFTranslation::_($query['view']);
$segments[] = EasyBlogSEFTranslation::_($query['layout']);
if (isset($query['filter'])) {
$segments[] = $query['filter'];
unset($query['filter']);
}
if (isset($query['postType'])) {
$segments[] = $query['postType'];
unset($query['postType']);
}
unset($query['view']);
unset($query['layout']);
//.........这里部分代码省略.........