當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DJClassifiedsSEO::getURLfromSlug方法代碼示例

本文整理匯總了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') {
//.........這裏部分代碼省略.........
開發者ID:politik86,項目名稱:test2,代碼行數:101,代碼來源:router.php


注:本文中的DJClassifiedsSEO::getURLfromSlug方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。