当前位置: 首页>>代码示例>>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;未经允许,请勿转载。