當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。