本文整理汇总了PHP中DJClassifiedsSEO::getURLfromSlug方法的典型用法代码示例。如果您正苦于以下问题:PHP DJClassifiedsSEO::getURLfromSlug方法的具体用法?PHP DJClassifiedsSEO::getURLfromSlug怎么用?PHP DJClassifiedsSEO::getURLfromSlug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DJClassifiedsSEO
的用法示例。
在下文中一共展示了DJClassifiedsSEO::getURLfromSlug方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DJClassifiedsBuildRoute
function DJClassifiedsBuildRoute(&$query)
{
$segments = array();
$app = JFactory::getApplication();
$menu = $app->getMenu('site');
$par = JComponentHelper::getParams('com_djclassifieds');
if (empty($query['Itemid'])) {
$menuItem = $menu->getActive();
} else {
$menuItem = $menu->getItem($query['Itemid']);
}
$option = empty($menuItem->component) ? null : $menuItem->component;
$mView = empty($menuItem->query['view']) ? null : $menuItem->query['view'];
$mLayout = empty($menuItem->query['layout']) ? null : $menuItem->query['layout'];
$mCatid = empty($menuItem->query['cid']) ? null : (int) $menuItem->query['cid'];
$mId = empty($menuItem->query['id']) ? null : (int) $menuItem->query['id'];
$view = !empty($query['view']) ? $query['view'] : null;
$layout = !empty($query['layout']) ? $query['layout'] : null;
$cid = !empty($query['cid']) ? $query['cid'] : null;
$id = !empty($query['id']) ? $query['id'] : null;
$se = !empty($query['se']) ? $query['se'] : null;
$uid = !empty($query['uid']) ? $query['uid'] : null;
$order = !empty($query['order']) ? $query['order'] : null;
$menuDefault = $menu->getDefault();
// JoomSEF bug workaround
if (isset($query['start']) && isset($query['limitstart'])) {
if ((int) $query['limitstart'] != (int) $query['start'] && (int) $query['start'] > 0) {
// let's make it clear - 'limitstart' has higher priority than 'start' parameter,
// however ARTIO JoomSEF doesn't seem to respect that.
$query['start'] = $query['limitstart'];
unset($query['limitstart']);
}
}
// JoomSEF workaround - end
if ($view && $option == 'com_djclassifieds') {
if ($view == 'item') {
if ($view != $mView) {
$segments[] = $par->get('seo_view_item', 'ad');
}
unset($query['view']);
if ($view == $mView && intval($id) > 0 && intval($id) == $mId) {
unset($query['id']);
unset($query['cid']);
} else {
if ($mView == 'items' && intval($id) > 0) {
if (intval($cid) != intval($mCatid)) {
$segments[] = DJClassifiedsSEO::getURLfromSlug($cid);
}
$segments[] = DJClassifiedsSEO::getURLfromSlug($id);
unset($query['id']);
unset($query['cid']);
}
}
} else {
if ($view == 'items') {
if ($view != $mView) {
$segments[] = $par->get('seo_view_items', 'ads');
}
if ($cid === null) {
$cid = '0:all';
}
if (intval($cid) != intval($mCatid)) {
//$segments[] = $cid;
$segments[] = DJClassifiedsSEO::getURLfromSlug($cid);
}
unset($query['cid']);
} elseif ($query['view'] == 'edititem') {
if ($view != $mView) {
$segments[] = $par->get('seo_view_edititem', 'edititem');
}
if (isset($query['id'])) {
$segments[] = $query['id'];
unset($query['id']);
}
} elseif ($query['view'] == 'additem') {
if ($view != $mView) {
$segments[] = $par->get('seo_view_additem', 'additem');
}
} elseif ($query['view'] == 'useritems') {
if ($view != $mView) {
$segments[] = $par->get('seo_view_useritems', 'useritems');
}
} elseif ($query['view'] == 'categories') {
if ($view != $mView) {
$segments[] = $par->get('seo_view_categories', 'categories');
}
} elseif ($query['view'] == 'payment') {
$segments[] = 'payment';
} elseif ($query['view'] == 'points') {
$segments[] = 'points';
} elseif ($query['view'] == 'userpoints') {
$segments[] = 'userpoints';
} elseif ($query['view'] == 'renewitem') {
$segments[] = 'renewitem';
if (isset($query['id'])) {
$segments[] = $query['id'];
unset($query['id']);
}
} else {
if ($view == 'profile') {
//.........这里部分代码省略.........