本文整理汇总了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])) {
//.........这里部分代码省略.........