当前位置: 首页>>代码示例>>PHP>>正文


PHP DJClassifiedsSEO::getIDfromURL方法代码示例

本文整理汇总了PHP中DJClassifiedsSEO::getIDfromURL方法的典型用法代码示例。如果您正苦于以下问题:PHP DJClassifiedsSEO::getIDfromURL方法的具体用法?PHP DJClassifiedsSEO::getIDfromURL怎么用?PHP DJClassifiedsSEO::getIDfromURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DJClassifiedsSEO的用法示例。


在下文中一共展示了DJClassifiedsSEO::getIDfromURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DJClassifiedsParseRoute

function DJClassifiedsParseRoute($segments)
{
    $app = JFactory::getApplication();
    $menu = $app->getMenu();
    $activemenu = $menu->getActive();
    $par = JComponentHelper::getParams('com_djclassifieds');
    $catalogViews = array($par->get('seo_view_item', 'ad'), $par->get('seo_view_items', 'ads'), $par->get('seo_view_edititem', 'edititem'), $par->get('seo_view_additem', 'additem'), $par->get('seo_view_useritems', 'useritems'), $par->get('seo_view_categories', 'categories'), $par->get('seo_view_profile', 'profile'), $par->get('seo_view_peofileefit', 'profileedit'));
    $query = array();
    $temp = array();
    if (count($segments)) {
        //if (!in_array($segments[0], $catalogViews)) {
        if ($activemenu) {
            $temp = array();
            $temp[0] = $activemenu->query['view'];
            switch ($temp[0]) {
                case 'item':
                    $temp[1] = @$activemenu->query['cid'];
                    $temp[2] = @$activemenu->query['id'];
                    /*foreach ($segments as $k=>$v) {
                          $temp[$k+1] = $v;
                      }*/
                    break;
                case 'items':
                    $temp[1] = @$activemenu->query['cid'];
                    if (isset($activemenu->query['layout'])) {
                        $temp[2] = @$activemenu->query['layout'];
                    }
                    /*foreach ($segments as $k=>$v) {
                          $temp[$k+1] = $v;
                      }*/
                    break;
                case 'edititem':
                    $temp[1] = @$activemenu->query['id'];
                    /*foreach ($segments as $k=>$v) {
                          $temp[$k+1] = $v;
                      }*/
                    break;
            }
            //$segments = $temp;
        }
        // }
        if (isset($segments[0])) {
            if ($segments[0] == str_ireplace('-', ':', $par->get('seo_view_item', 'ad')) || $segments[0] == 'item') {
                $query['view'] = 'item';
                if (isset($segments[2])) {
                    $query['id'] = DJClassifiedsSEO::getIDfromURL($segments[2]);
                    $query['cid'] = DJClassifiedsSEO::getIDfromURL($segments[1]);
                } else {
                    if (isset($segments[1])) {
                        $query['id'] = DJClassifiedsSEO::getIDfromURL($segments[1]);
                    }
                    if (isset($temp[1])) {
                        if ($temp[0] == 'items') {
                            $query['cid'] = $temp[1];
                        }
                    }
                }
            } else {
                if ($segments[0] == str_ireplace('-', ':', $par->get('seo_view_items', 'ads')) || $segments[0] == 'items') {
                    $query['view'] = 'items';
                    if (isset($segments[1])) {
                        $query['cid'] = DJClassifiedsSEO::getIDfromURL($segments[1]);
                    }
                } else {
                    if ($segments[0] == str_ireplace('-', ':', $par->get('seo_view_edititem', 'edititem')) || $segments[0] == 'edititem') {
                        $query['view'] = 'edititem';
                        if (isset($segments[1])) {
                            $query['id'] = DJClassifiedsSEO::getIDfromURL($segments[1]);
                        }
                    } else {
                        if ($segments[0] == str_ireplace('-', ':', $par->get('seo_view_additem', 'additem')) || $segments[0] == 'additem') {
                            $query['view'] = 'additem';
                        } else {
                            if ($segments[0] == str_ireplace('-', ':', $par->get('seo_view_useritems', 'useritems')) || $segments[0] == 'useritems') {
                                $query['view'] = 'useritems';
                            } else {
                                if ($segments[0] == str_ireplace('-', ':', $par->get('seo_view_categories', 'categories')) || $segments[0] == 'categories') {
                                    $query['view'] = 'categories';
                                } else {
                                    if ($segments[0] == 'payment') {
                                        $query['view'] = 'payment';
                                        if (isset($segments[1])) {
                                            $query['id'] = DJClassifiedsSEO::getIDfromURL($segments[1]);
                                        }
                                    } else {
                                        if ($segments[0] == 'points') {
                                            $query['view'] = 'points';
                                        } else {
                                            if ($segments[0] == 'userpoints') {
                                                $query['view'] = 'userpoints';
                                            } else {
                                                if ($segments[0] == 'renewitem') {
                                                    $query['view'] = 'renewitem';
                                                    if (isset($segments[1])) {
                                                        $query['id'] = DJClassifiedsSEO::getIDfromURL($segments[1]);
                                                    }
                                                } else {
                                                    if ($segments[0] == str_ireplace('-', ':', $par->get('seo_view_profile', 'profile')) || $segments[0] == 'profile') {
                                                        $query['view'] = 'profile';
                                                        if (isset($segments[1])) {
//.........这里部分代码省略.........
开发者ID:politik86,项目名称:test2,代码行数:101,代码来源:router.php


注:本文中的DJClassifiedsSEO::getIDfromURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。