本文整理匯總了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') {
//.........這裏部分代碼省略.........