本文整理匯總了PHP中MakeURLNormal函數的典型用法代碼示例。如果您正苦於以下問題:PHP MakeURLNormal函數的具體用法?PHP MakeURLNormal怎麽用?PHP MakeURLNormal使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MakeURLNormal函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _convertURL
private function _convertURL()
{
if ($GLOBALS['EnableSEOUrls'] == 1 && !empty($GLOBALS['PathInfo'])) {
// checking seo is enabled and pathinfo is not empty as pathinfo will be set only when redirected to index page
$count_pathinfo = count($GLOBALS['PathInfo']);
// to get the count of the parameter, i.e if its odd, query string is applied.
if ($count_pathinfo % 2 == 0) {
$_REQUEST['search_query'] = MakeURLNormal($GLOBALS['PathInfo'][1]);
for ($i = 0; $i < count($GLOBALS['PathInfo']); $i += 2) {
if ($GLOBALS['PathInfo'][$i + 1] != '') {
$_REQUEST[$GLOBALS['PathInfo'][$i]] = MakeURLNormal($GLOBALS['PathInfo'][$i + 1]);
}
}
} else {
$_REQUEST['search_query'] = MakeURLNormal($GLOBALS['PathInfo'][0]);
for ($i = 1; $i < count($GLOBALS['PathInfo']); $i += 2) {
if ($GLOBALS['PathInfo'][$i + 1] != '') {
$_REQUEST[$GLOBALS['PathInfo'][$i]] = MakeURLNormal($GLOBALS['PathInfo'][$i + 1]);
}
}
}
} else {
// this condition is entered when seo is disabled. also in redefine search this will be accessed.
foreach ($_GET as $key => $value) {
$_GET[$key] = MakeURLNormal($value);
$_REQUEST[$key] = MakeURLNormal($value);
}
}
}
示例2: _SetPageData
/**
* Load up the details for the page to be displayed.
*
* @param integer $PageId The ID number for the current page which should correspond to a row in the database
*
* @return void Doesn't return anything
*/
public function _SetPageData($PageId=0)
{
if((int)$PageId === 0) {
if(isset($_REQUEST['pageid'])) {
$_REQUEST['page_id'] = $_REQUEST['pageid'];
}
if(isset($_REQUEST['page_id'])) {
$pageid = (int)$_REQUEST['page_id'];
$query = sprintf("select * from [|PREFIX|]pages where pageid='%d'", $GLOBALS['ISC_CLASS_DB']->Quote($pageid));
}
else if(isset($GLOBALS['PathInfo'][1])) {
$page = preg_replace('#\.html$#i', '', $GLOBALS['PathInfo'][1]);
$page = $GLOBALS['ISC_CLASS_DB']->Quote(MakeURLNormal($page));
$query = sprintf("select * from [|PREFIX|]pages where pagetitle='%s'", $page);
}
else {
$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');
$GLOBALS['ISC_CLASS_404']->HandlePage();
exit;
}
}
else {
$query = sprintf("select * from [|PREFIX|]pages where pageid='%d'", $GLOBALS['ISC_CLASS_DB']->Quote($PageId));
}
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$row = $GLOBALS['ISC_CLASS_DB']->Fetch($result);
if (!is_array($row) || empty($row)) {
$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');
$GLOBALS['ISC_CLASS_404']->HandlePage();
die();
}
$row['pagecontent'] = $this->LoadPredefinedPages($row['pagecontent']);
$GLOBALS['ActivePage'] = $row['pageid'];
$this->_pagerow = &$row;
$this->_pageid = $row['pageid'];
$this->_pagetype = $row['pagetype'];
$this->_pagetitle = $row['pagetitle'];
$this->_pagefeed = $row['pagefeed'];
$this->_pagedesc = $row['pagedesc'];
$this->_pagesearchkeywords = $row['pagesearchkeywords'];
$this->_pagecontent = $row['pagecontent'];
$this->_pagekeywords = $row['pagekeywords'];
$this->_pagemetatitle = $row['pagemetatitle'];
$this->_pageparentlist = $row['pageparentlist'];
$this->_page_enable_optimizer = $row['page_enable_optimizer'];
$this->setLayoutFile($row['pagelayoutfile']);
// If the customer is not logged in and this page is set to customers only, then show an error message
$GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');
if($row['pagecustomersonly'] == 1 && !$GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerId()) {
$GLOBALS['ErrorMessage'] = sprintf(GetLang('ForbiddenToAccessPage'), $GLOBALS['ShopPathNormal']);
$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("error");
$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
exit;
}
}
示例3: HandlePage
public function HandlePage()
{
$action = '';
/*if ($GLOBALS['EnableSEOUrls'] == 1 and count($GLOBALS['PathInfo']) > 0 ){
if (isset ($GLOBALS['PathInfo'][1])) {
$_REQUEST['action'] = $GLOBALS['PathInfo'][1];
}
else
{
$_REQUEST['action'] = $GLOBALS['PathInfo'][0];
}
}*/
if (count($GLOBALS['PathInfo']) > 0) {
if (isset($GLOBALS['PathInfo'][1])) {
$_REQUEST['action'] = $GLOBALS['PathInfo'][1];
} else {
$_REQUEST['action'] = $GLOBALS['PathInfo'][0];
}
}
$params = array();
for ($i = 1; $i < count($GLOBALS['PathInfo']); $i += 2) {
if ($GLOBALS['PathInfo'][$i + 1] != '') {
$params[$GLOBALS['PathInfo'][$i]] = MakeURLNormal($GLOBALS['PathInfo'][$i + 1]);
}
}
$number_of_days = 730;
$date_of_expiry = time() + 60 * 60 * 24 * $number_of_days;
if (isset($params['make'])) {
setcookie("last_search_selection[make]", $params['make'], $date_of_expiry, "/");
if (isset($params['model'])) {
setcookie("last_search_selection[model]", $params['model'], $date_of_expiry, "/");
}
}
if (isset($params['year'])) {
setcookie("last_search_selection[year]", $params['year'], $date_of_expiry, "/");
}
if (isset($_REQUEST['action'])) {
$action = isc_strtolower($_REQUEST['action']);
}
switch ($action) {
case "savesweepstakes":
$this->SaveSweepstakes();
break;
case "successsweepstakes":
$this->successSweepstakes();
break;
default:
$this->ClearanceList();
}
}
示例4: _SetPageData
function _SetPageData()
{
if (isset($_REQUEST['newsid'])) {
$newsid = (int) $_REQUEST['newsid'];
} else {
$newsid = preg_replace('#\\.html$#i', '', $GLOBALS['PathInfo'][1]);
$newsid = $GLOBALS['ISC_CLASS_DB']->Quote(MakeURLNormal($newsid));
}
$query = sprintf("select * from [|PREFIX|]news where newsid='%d'", $GLOBALS['ISC_CLASS_DB']->Quote($newsid));
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
if ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$this->_newsid = $row['newsid'];
$this->_newstitle = $row['newstitle'];
$this->_newscontent = $row['newscontent'];
$this->_newsdate = $row['newsdate'];
}
}
示例5: _SetOfferData
public function _SetOfferData()
{
$productid = $_GET['product'];
if ($productid == 0) {
if (isset($_REQUEST['product'])) {
$product = $_REQUEST['product'];
} else {
if (isset($GLOBALS['PathInfo'][1])) {
$product = preg_replace('#\\.html$#i', '', $GLOBALS['PathInfo'][1]);
} else {
$product = '';
}
}
$product = $GLOBALS['ISC_CLASS_DB']->Quote(MakeURLNormal($product));
$productSQL = sprintf("prodname='%s'", $product);
} else {
$productSQL = sprintf("productid='%s'", (int) $productid);
}
// $query = "SELECT * FROM [|PREFIX|]products where $productSQL";
$query = "SELECT p.*, b.brandname FROM [|PREFIX|]products p LEFT JOIN [|PREFIX|]brands b ON ( b.brandid = p.prodbrandid ) WHERE {$productSQL}";
// echo "SELECT * FROM [|PREFIX|]products where $productSQL";exit;
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
if ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$this->_product = $row;
$this->_prodid = $row['productid'];
$this->_prodbrand = $row['brandname'];
$this->_partnumber = $row['prodcode'];
$this->_prodtitle = $row['prodname'];
// $this->_prodprice = $GLOBALS['ISC_CLASS_OFFER']->GetCalculatedPrice();
}
$tplquery = $GLOBALS['ISC_CLASS_DB']->Query("SELECT * FROM [|PREFIX|]coupon_settings where templateid = 1");
if ($tplrow = $GLOBALS['ISC_CLASS_DB']->Fetch($tplquery)) {
$GLOBALS['OfferTitle'] = $tplrow['title_msg'];
$GLOBALS['OfferHeader'] = $tplrow['header_msg'];
$GLOBALS['OfferFooter'] = $tplrow['footer_msg'];
$this->_emailids = $tplrow['emailids'];
$this->_message = $tplrow['email_template'];
}
$GLOBALS['productid'] = $this->_prodid;
$GLOBALS['prodbrand'] = $this->_prodbrand . "/" . $this->_partnumber;
$GLOBALS['prodtitle'] = $this->_prodtitle;
$GLOBALS['prodprice'] = $this->GetCalculatedPrice();
$GLOBALS['formatprice'] = strip_tags($this->GetCalculatedPrice());
$GLOBALS['states'] = $this->states();
}
示例6: ShowVendorPage
/**
* Show the page containing a web page set up by a particular vendor.
*/
public function ShowVendorPage()
{
if (isset($_REQUEST['pageid'])) {
$pageWhere = " pageid='" . (int) $_REQUEST['pageid'] . "'";
} else {
$page = preg_replace('#\\.html$#i', '', $GLOBALS['PathInfo'][2]);
$page = MakeURLNormal($page);
$pageWhere = " LOWER(pagetitle)='" . $GLOBALS['ISC_CLASS_DB']->Quote(isc_strtolower($page)) . "'";
}
$query = "\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]pages\n\t\t\tWHERE " . $pageWhere . " AND pagevendorid='" . (int) $this->vendor['vendorid'] . "' AND pagestatus='1'\n\t\t";
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$page = $GLOBALS['ISC_CLASS_DB']->Fetch($result);
if (!isset($page['pageid'])) {
$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');
$GLOBALS['ISC_CLASS_404']->HandlePage();
exit;
}
// Otherwise show the page
$GLOBALS['ISC_CLASS_PAGE'] = new ISC_PAGE($page['pageid'], false, $page);
$GLOBALS['ISC_CLASS_PAGE']->HandlePage();
exit;
}
示例7: dirname
<?php
include dirname(__FILE__) . "/init.php";
$make = MakeURLNormal($_GET['make']);
$model = MakeURLNormal($_GET['model']);
$year = $_GET['year'];
// echo $make.$model.$year;
/*$make = "chevrolet";
$model = "c10 pickup";
$year = "1971"; */
$resultbed = $GLOBALS["ISC_CLASS_DB"]->Query("SELECT DISTINCT bedsize FROM [|PREFIX|]product_mmy pm, [|PREFIX|]cabbed_table cb where pm.make = '" . $make . "' and pm.model = '" . $model . "' and pm.year = '" . $year . "' AND cb.ymm_id = pm.id");
$optionbed = '<select name="bedsize" id="bedsize" onclick=checkYMM()>';
$optionbed .= '<option value="">--Select bed size--</option>';
while ($row = $GLOBALS["ISC_CLASS_DB"]->Fetch($resultbed)) {
$bedsize = $row['bedsize'];
$optionbed .= "<option value='{$bedsize}'>" . $bedsize . "</option>";
}
$optionbed .= '</select>';
$resultcab = $GLOBALS["ISC_CLASS_DB"]->Query("SELECT DISTINCT cabsize FROM [|PREFIX|]product_mmy pm, [|PREFIX|]cabbed_table cb where pm.make = '" . $make . "' and pm.model = '" . $model . "' and pm.year = '" . $year . "' AND cb.ymm_id = pm.id");
$optioncab = '<select name="cabsize" id="cabsize" onclick=checkYMM()>';
$optioncab .= '<option value="">--Select cab size--</option>';
while ($row1 = $GLOBALS["ISC_CLASS_DB"]->Fetch($resultcab)) {
$cabsize = $row1['cabsize'];
$optioncab .= "<option value='{$cabsize}'>" . $cabsize . "</option>";
}
$optioncab .= '</select>';
echo $optionbed . '~' . $optioncab;
exit;
示例8: fn_saveYMMDetails
function fn_saveYMMDetails($CustID)
{
$searchyear = $_REQUEST['searchyear'];
$searchmake = MakeURLNormal($_REQUEST['searchmake']);
$searchmodel = MakeURLNormal($_REQUEST['searchmodel']);
$cabsize = $_REQUEST['cabsize'];
$bedsize = $_REQUEST['bedsize'];
$query = "SELECT * FROM [|PREFIX|]user_ymm WHERE \n\t\t\t\t\t\t\t\tuser_id='" . $CustID . "' AND \n\t\t\t\t\t\t\t\tyear='" . $searchyear . "' AND \n\t\t\t\t\t\t\t\tmake='" . $searchmake . "' AND \n\t\t\t\t\t\t\t\tmodel='" . $searchmodel . "' AND \n\t\t\t\t\t\t\t\tcab_size='" . $cabsize . "' AND \n\t\t\t\t\t\t\t\tbed_size='" . $bedsize . "'";
$result = $GLOBALS["ISC_CLASS_DB"]->Query($query);
$NumGroups = $GLOBALS["ISC_CLASS_DB"]->CountResult($result);
if ($NumGroups > 0) {
return false;
} else {
$query = "INSERT INTO [|PREFIX|]user_ymm(user_id,year,make,model,cab_size,bed_size) VALUES('{$CustID}','{$searchyear}','{$searchmake}','{$searchmodel}','{$cabsize}','" . $bedsize . "')";
$GLOBALS["ISC_CLASS_DB"]->Query($query);
return true;
}
}
示例9: SetPanelSettings
public function SetPanelSettings()
{
$prodid = $GLOBALS['ProductId'];
# When there is no complementary item, the tab wount be shown.
$make = '';
$model = '';
$year = '';
if ($GLOBALS['EnableSEOUrls'] == 0) {
if (isset($_REQUEST['make']) && $_REQUEST['make'] != '') {
$make = MakeURLNormal($_REQUEST['make']);
}
if (isset($_REQUEST['model']) && $_REQUEST['model'] != '') {
$model = MakeURLNormal($_REQUEST['model']);
}
if (isset($_REQUEST['year']) && $_REQUEST['year'] != '') {
$year = $_REQUEST['year'];
}
} else {
if (count($GLOBALS['PathInfo']) > 0) {
foreach ($GLOBALS['PathInfo'] as $key => $value) {
if (eregi('make=', $value)) {
$make = MakeURLNormal(substr($value, strpos($value, '=') + 1));
} else {
if (eregi('model=', $value)) {
$model = MakeURLNormal(substr($value, strpos($value, '=') + 1));
} else {
if (eregi('year=', $value)) {
$year = substr($value, strpos($value, '=') + 1);
}
}
}
}
}
}
$where = '';
if ($make != '') {
$where .= "and (prodmake = '" . $make . "' or prodmake = 'NON-SPEC VEHICLE')";
}
if ($model != '') {
$where .= " and (prodmodel = '" . $model . "' or prodmodel = 'ALL')";
}
if ($year != '') {
$where .= " and (({$year} between prodstartyear and prodendyear) or (prodstartyear = 'ALL'and prodendyear = 'ALL'))";
}
$result = $GLOBALS["ISC_CLASS_DB"]->Query("SELECT id,productid FROM [|PREFIX|]import_variations where productid = '" . $prodid . "' {$where} order by id");
$impvariationid = array();
while ($improw = $GLOBALS["ISC_CLASS_DB"]->Fetch($result)) {
$impvariationid[] = $improw['id'];
}
$impid = implode("','", $impvariationid);
$impquery = $GLOBALS["ISC_CLASS_DB"]->Query("SELECT complementaryitems FROM [|PREFIX|]application_data where variationid in('" . $impid . "') ");
$impquery1 = $GLOBALS["ISC_CLASS_DB"]->Query("SELECT complementaryitems FROM [|PREFIX|]application_data where variationid in('" . $impid . "') and complementaryitems != '' ");
$cntoriginal1 = '';
if ($row1 = $GLOBALS["ISC_CLASS_DB"]->Fetch($impquery1)) {
$compitems1 = $row1['complementaryitems'] . ",";
$comp1 = substr($compitems1, 0, -1);
$temp1 = $comp1;
$temp1 = htmlspecialchars_decode($temp1);
preg_match_all('/\\[([^\\]]+)\\]/', $temp1, $matches1);
$compexplode1 = $matches1[1];
$cntproducts1 = count($compexplode1);
/*$arraycnt1 = array_count_values($compexplode1);
asort($arraycnt1);
$compunique1 = array_keys($arraycnt1);
rsort($compunique1);
$cntproducts1 = count($compunique1);*/
$originalarray1 = array();
$tempArr = array();
$tempArr1 = array();
# Checking whether the SKU are valid and present in the db -- Baskaran
for ($i = 0; $i < $cntproducts1; $i++) {
$split1 = split(",", $compexplode1[$i]);
$sku1 = $GLOBALS["ISC_CLASS_DB"]->Query("SELECT productid, prodname, prodcode, proddescfeature, imagefile, brandname, catname FROM [|PREFIX|]brands b, [|PREFIX|]categories c, [|PREFIX|]products p LEFT JOIN [|PREFIX|]product_images i ON p.productid = i.imageprodid AND i.imageisthumb = '1' WHERE prodcode = '" . $split1[0] . "' AND p.prodbrandid = b.brandid AND p.prodcatids = c.categoryid AND p.prodvisible = '1'");
if ($GLOBALS["ISC_CLASS_DB"]->countResult($sku1) == 1 and $split1[0] != '0') {
if (in_array($split1[0], $tempArr)) {
continue;
}
$originalarray1[] = $split1[0] . "," . $split1[1] . "," . $split1[2];
$tempArr[] = $split1[0];
} else {
if ($GLOBALS["ISC_CLASS_DB"]->countResult($sku1) != 1 and $split1[0] == '0') {
if (in_array($split1[0], $tempArr1)) {
continue;
}
$originalarray1[] = $split1[0] . "," . $split1[1] . "," . $split1[2];
$tempArr1[] = $split1[0];
}
}
}
$cntoriginal1 = count($originalarray1);
}
if ($cntoriginal1 == 0 or $cntoriginal1 == '') {
// if($GLOBALS["ISC_CLASS_DB"]->countResult($impquery) == 0) {
$this->DontDisplay = true;
return;
} else {
$compitems = '';
if ($row = $GLOBALS["ISC_CLASS_DB"]->Fetch($impquery)) {
$compitems = $row['complementaryitems'] . ",";
$comp = substr($compitems, 0, -1);
//.........這裏部分代碼省略.........
示例10: SetPanelSettings
public function SetPanelSettings()
{
$path = GetConfig('ShopPath');
$params = array();
for ($i = 1; $i < count($GLOBALS['PathInfo']); $i += 2) {
if ($GLOBALS['PathInfo'][$i + 1] != '') {
$params[$GLOBALS['PathInfo'][$i]] = MakeURLNormal($GLOBALS['PathInfo'][$i + 1]);
}
}
$catg_qry = "select * from [|PREFIX|]categories where catvisible=1 order by catparentid ASC , CHAR_LENGTH(catname) DESC";
$catg_res = $GLOBALS['ISC_CLASS_DB']->Query($catg_qry);
$catgoryname = array();
// array for category names
while ($catg_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($catg_res)) {
$catgoryname[$catg_arr['categoryid']]['catname'] = $catg_arr['catname'];
$catgoryname[$catg_arr['categoryid']]['catparentid'] = $catg_arr['catparentid'];
}
$GLOBALS['categories_all'] = $catgoryname;
@($lastSelection = $_COOKIE['last_search_selection']);
if (!isset($params['make']) && isset($lastSelection['make']) && $lastSelection['make'] != "") {
$params['make'] = $lastSelection['make'];
if (!isset($params['model']) && isset($lastSelection['model']) && $lastSelection['model'] != "") {
$params['model'] = $lastSelection['model'];
}
}
if (!isset($params['year']) && isset($lastSelection['year']) && $lastSelection['year'] != "") {
$params['year'] = $lastSelection['year'];
}
$where = '';
if (isset($params['make'])) {
$where .= "AND ( v.prodmake = '" . $params['make'] . "' OR v.prodmake = 'NON-SPEC VEHICLE' ) ";
}
if (isset($params['model'])) {
$where .= "AND ( v.prodmodel = '" . $params['model'] . "' OR v.prodmodel = 'ALL' ) ";
}
if (isset($params['year'])) {
$year = $params['year'];
$where .= "AND ( {$year} between v.prodstartyear and v.prodendyear OR v.prodstartyear = 'ALL' ) ";
}
/*if( !isset($params['make']) || !isset($params['model']) || !isset($params['year']) )
{*/
$GLOBALS['UniversalCat'] = isset($params['catuniversal']) ? $params['catuniversal'] : 0;
$GLOBALS['YearList'] = $this->getYMMOptions($params, 'year');
$GLOBALS['MakeList'] = $this->getYMMOptions($params, 'make');
$GLOBALS['ModelList'] = $this->getYMMOptions($params, 'model');
$GLOBALS['YMMTable'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ClearanceYMMOptions");
//}
$GLOBALS['ClearanceResults'] = "<div style='float:left'>" . $GLOBALS['YMMTable'] . "</div>";
$mmy_links = $this->GetYMMLinks($params);
$query = $GLOBALS['ISC_CLASS_DB']->Query("SELECT * FROM [|PREFIX|]discounts WHERE discountname = 'Clearance' and discountenabled = 1 LIMIT 0 , 1 ");
$flag = '0';
if ($GLOBALS['ISC_CLASS_DB']->CountResult($query) == 1) {
$crow = $GLOBALS['ISC_CLASS_DB']->Fetch($query);
$catid = unserialize($crow['configdata']);
if (array_key_exists("var_catids", $catid)) {
$flag = '1';
$category_id = $catid['var_catids'];
} else {
$flag = '2';
$brand_id = $catid['var_brandids'];
$series_id = $catid['var_seriesids'];
}
}
if ($flag == '1') {
# For Category -- Baskaran
$clearance_qry = "select c.catname , c.categoryid , c.catuniversal , c.catimagealt , c.featurepoints , group_concat(DISTINCT brandname separator '~') as brandname , group_concat(DISTINCT p.brandseriesid separator '~') as seriesids , min(fp.prodfinalprice) as prodminprice , max(fp.prodfinalprice) as prodmaxprice , c.catimagefile as imagefile , c.cathoverimagefile , p.proddesc , prodwarranty , bs.seriesname , p.brandseriesid , count(distinct p.productid) as totalproducts,floor(SUM(p.prodratingtotal)/SUM(p.prodnumratings)) AS prodavgrating from [|PREFIX|]products p LEFT JOIN [|PREFIX|]import_variations AS v ON v.productid = p.productid LEFT JOIN [|PREFIX|]categoryassociations ca on ca.productid = p.productid LEFT JOIN [|PREFIX|]categories c on c.categoryid = ca.categoryid and c.catvisible = 1 LEFT JOIN [|PREFIX|]brands b on prodbrandid = b.brandid LEFT JOIN [|PREFIX|]brand_series AS bs ON bs.seriesid = p.brandseriesid LEFT JOIN [|PREFIX|]product_images pi ON (p.productid=pi.imageprodid AND pi.imageisthumb=1) LEFT JOIN [|PREFIX|]product_finalprice fp ON p.productid = fp.productid WHERE 1=1 AND c.categoryid IN ({$category_id}) AND p.prodvisible='1' {$where} group by c.categoryid ORDER BY c.catdeptid ASC, c.catsort ASC, c.catname ASC";
$catquery = $GLOBALS['ISC_CLASS_DB']->Query($clearance_qry);
$cnt = $GLOBALS['ISC_CLASS_DB']->CountResult($catquery);
if ($cnt > '0') {
while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($catquery)) {
$cat_id = $row['categoryid'];
$category_rating = 0;
$cat_rating_res = $GLOBALS['ISC_CLASS_DB']->Query("SELECT floor(SUM(p.prodratingtotal)/SUM(p.prodnumratings))AS prodavgrating FROM [|PREFIX|]categoryassociations c INNER JOIN [|PREFIX|]products p on c.productid=p.productid where c.categoryid = '{$cat_id}'");
$cat_rating_arr = $GLOBALS['ISC_CLASS_DB']->FetchOne($cat_rating_res);
if (isset($cat_rating_arr['prodavgrating'])) {
$category_rating = (int) $cat_rating_arr['prodavgrating'];
}
$parentid = $GLOBALS['categories_all'][$row['categoryid']]['catparentid'];
if ($parentid != 0) {
if (isset($GLOBALS['categories_all'][$parentid])) {
// if parent catg is not visible
$mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$parentid]['catname'])) . $mmy_links;
} else {
$mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$row['categoryid']]['catname'])) . $mmy_links;
}
} else {
$mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$row['categoryid']]['catname'])) . $mmy_links;
}
$subcatg_link = $this->LeftCatLink($mmy_links_modified, 'subcategory', $row['catname']);
$link = "<a href='" . $subcatg_link . "'>";
$tiplink = "<a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "' title=''><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a>";
$imagelink = "<a class='thickbox' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "' title='' onmouseover='createtip(" . $row['categoryid'] . ")' onmouseout='UnTip()'>";
if (isset($row['imagefile']) && !empty($row['imagefile'])) {
// $images = explode("~",$row['imagefile']);
// for($j=0;$j<count($images);$j++) {
// if(!empty($images[$j])) {
$imagefile = "{$imagelink}<img src='{$path}/category_images/" . $row['imagefile'] . "' alt='" . isc_html_escape($row['catimagealt']) . "' title='" . isc_html_escape($row['catimagealt']) . "'></a>";
$imagefile .= "<span id='span" . $row['categoryid'] . "' style='display:none'>" . $tiplink . "</span>";
// break;
// }
//.........這裏部分代碼省略.........
示例11: SetCategoryData
public function SetCategoryData()
{
// Retrieve the query string variables. Can't use the $_GET array
// because of SEO friendly links in the URL
SetPGQVariablesManually();
// Grab the page sort details
if (isset($_REQUEST['category'])) {
$GLOBALS['CategoryPath'] = isc_html_escape($_REQUEST['category']);
$path = explode("/", $_REQUEST['category']);
}
else {
$GLOBALS['URL'] = implode("/", $GLOBALS['PathInfo']);
$path = $GLOBALS['PathInfo'];
array_shift($path);
}
$this->SetSort();
$this->SetCatPath($path);
$arrCats = $this->_catpath;
for ($i = 0; $i < count($arrCats); $i++) {
$arrCats[$i] = MakeURLNormal($arrCats[$i]);
}
if (!isset($arrCats[0])) {
$arrCats[0] = '';
}
// The first category *MUST* have a parent ID of 0 or it's invalid
$parentCat = 0;
// Because of the way SEO friendly links work at the moment, we need to loop through
// the category path to check each level is valid. Ideally we'd store the built category
// URL in the database and check based on that.
for($i = 0; $i < count($arrCats); ++$i) {
if(empty($arrCats[$i])) {
continue;
}
$query = "
SELECT
*
FROM
[|PREFIX|]categories
WHERE
catname = '".$GLOBALS['ISC_CLASS_DB']->quote($arrCats[$i])."' AND
catparentid = '".(int)$parentCat."' AND
catvisible = 1
";
$result = $GLOBALS['ISC_CLASS_DB']->query($query);
$category = $GLOBALS['ISC_CLASS_DB']->fetch($result);
// Supplied category could not be found. They've followed an incorrect link so show the 404 page.
if(!$category) {
$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');
$GLOBALS['ISC_CLASS_404']->HandlePage();
exit;
}
// Add this category to the breadcrumb/trail
$this->SetTrail(array($category['categoryid'], $category['catname']));
$parentCat = $category['categoryid'];
}
if (!empty($category)) {
// $category contains the details of the actual category we're viewing
$this->Data = $category;
$this->SetId($category['categoryid']);
$this->SetName($category['catname']);
$this->SetDesc($category['catdesc']);
$this->SetLayoutFile($category['catlayoutfile']);
$this->SetCatPageTitle($category['catpagetitle']);
$this->SetMetaKeywords($category['catmetakeywords']);
$this->SetMetaDesc($category['catmetadesc']);
$this->SetSearchKeywords($category['catsearchkeywords']);
$this->SetEnableOptimizer($category['cat_enable_optimizer']);
} else {
// Reached /categories/ directly with no additional path.
// This is the root category
}
// Do we have permission to access this category?
if(!CustomerGroupHasAccessToCategory($this->_catid)) {
$noPermissionsPage = GetClass('ISC_403');
$noPermissionsPage->HandlePage();
exit;
}
$GLOBALS['CatTrail'] = $this->GetTrail();
// Find the number of products in the category
$this->loadCats = $this->GetId();
// This product should show products from this category, but if there are none
// show them from any child categories too
if(GetConfig('CategoryListingMode') == 'emptychildren') {
// Load up how many products there are in the current category, if none, load from children too
//.........這裏部分代碼省略.........
示例12: SetPanelSettings
function SetPanelSettings()
{
$path = GetConfig('ShopPath');
$output = "";
$GLOBALS['SITEPATH'] = $path;
$GLOBALS['ProductMMYHeader1'] = "Make";
$GLOBALS['ProductMMYHeader2'] = "Model";
$GLOBALS['ProductMMYHeader'] = "Year";
$model_srch_param = "search_query=";
$year_srch_param = "search_query=";
// Here this was applied earlier "search_query=&year=&column=year"
$make_srch_param = "search_query=";
$GLOBALS['mousedefaultpointer'] = "mousedefaultpointer";
$GLOBALS['ModelJS'] = "";
$GLOBALS['FLAGCLEARANCE'] = 0;
//wirror_20101124: show the ymm options by searching condition
$GLOBALS['ISC_CLASS_NEWSEARCH'] = GetClass('ISC_NEWSEARCH');
$params = $GLOBALS['ISC_CLASS_NEWSEARCH']->_searchterms;
if (!empty($_COOKIE['last_search_selection']['year'])) {
$params['year'] = $_COOKIE['last_search_selection']['year'];
}
if (!empty($_COOKIE['last_search_selection']['make'])) {
$params['make'] = $_COOKIE['last_search_selection']['make'];
}
if (!empty($_COOKIE['last_search_selection']['model'])) {
$params['model'] = $_COOKIE['last_search_selection']['model'];
}
if ($GLOBALS['ProductIds']) {
$this->productImpVariations = ISC_PRODUCT::GetImpVariationForYMM($GLOBALS['ProductIds'], '', $params['year'], $params['make'], $params['model']);
}
//$GLOBALS['FLAGCLEARANCE'] = 2;
//$params = array();
// johnny change '$i=1' to '$i=0'
for ($i = 0; $i < count($GLOBALS['PathInfo']); $i += 2) {
if ($GLOBALS['PathInfo'][$i + 1] != '') {
$params[$GLOBALS['PathInfo'][$i]] = MakeURLNormal($GLOBALS['PathInfo'][$i + 1]);
}
}
if (isset($params['make'])) {
$_COOKIE['last_search_selection']['make'] = $params['make'];
if (isset($params['model'])) {
$_COOKIE['last_search_selection']['model'] = $params['model'];
}
}
if (isset($params['year'])) {
$_COOKIE['last_search_selection']['year'] = $params['year'];
}
$GLOBALS['REMOVEURL'] = $GLOBALS['ShopPath'] . "/clearance/";
$this->YMMSelectors($params);
$GLOBALS['REMOVEURL'] = $this->GetRemoveUrl();
if (!empty($_COOKIE['last_search_selection']['year']) || !empty($params['year'])) {
$GLOBALS['YearName'] = empty($_COOKIE['last_search_selection']['year']) ? $params['year'] : $_COOKIE['last_search_selection']['year'];
$model_srch_param .= "&year=" . $GLOBALS['YearName'];
$make_srch_param .= "&year=" . $GLOBALS['YearName'];
}
if (!empty($_COOKIE['last_search_selection']['make']) || !empty($params['make'])) {
$GLOBALS['MakeName'] = strtoupper(empty($_COOKIE['last_search_selection']['make']) ? $params['make'] : $_COOKIE['last_search_selection']['make']);
$year_srch_param .= "&make=" . MakeURLSafe(strtolower($GLOBALS['MakeName']));
$model_srch_param .= "&make=" . MakeURLSafe(strtolower($GLOBALS['MakeName']));
$make_srch_param .= "&make=&column=make";
if (isset($GLOBALS['ISC_CLASS_CLEARANCE'])) {
$make_srch_param .= "&clearance=1";
}
$make_srch_param .= "&getymms=1";
$GLOBALS['MakeJS'] = "getvalueswithajax('prod_make','{$make_srch_param}');";
$model_srch_param .= "&column=model";
if (isset($GLOBALS['ISC_CLASS_CLEARANCE'])) {
$model_srch_param .= "&clearance=1";
}
$model_srch_param .= "&getymms=1";
$GLOBALS['ModelJS'] .= "getvalueswithajax('prod_model','{$model_srch_param}');checkanimate('prod_model')";
$GLOBAL['mousedefaultpointer'] = "";
if (!empty($_COOKIE['last_search_selection']['model']) || !empty($params['model'])) {
$GLOBALS['ModelName'] = strtoupper(empty($_COOKIE['last_search_selection']['model']) ? $params['model'] : $_COOKIE['last_search_selection']['model']);
$year_srch_param .= "&model=" . MakeURLSafe(strtolower($GLOBALS['ModelName']));
}
} else {
$make_srch_param .= "&make=&column=make";
if (isset($GLOBALS['ISC_CLASS_CLEARANCE'])) {
$make_srch_param .= "&clearance=1";
}
$make_srch_param .= "&getymms=1";
$GLOBALS['MakeJS'] = "getvalueswithajax('prod_make','{$make_srch_param}');";
}
$year_srch_param .= "&column=year";
if (isset($GLOBALS['ISC_CLASS_CLEARANCE'])) {
$year_srch_param .= "&clearance=1";
}
$year_srch_param .= "&getymms=1";
$GLOBALS['YearJS'] = "getvalueswithajax('prod_year','{$year_srch_param}');";
$GLOBALS['Dynimage'] = "imgHdrDropDownIconright.gif";
//$GLOBALS['dynid'] = "prod_year";
$GLOBALS['id'] = "prod_year";
$GLOBALS['yearid'] = "mmy_year";
$GLOBALS['DynFilterArrow'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideProductFilterImage");
//$GLOBALS['dynid'] = "prod_make";
$GLOBALS['id1'] = "prod_make";
$GLOBALS['makeid'] = "mmy_make";
$GLOBALS['DynFilterArrow1'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideProductFilterImage");
//$GLOBALS['dynid'] = "prod_model";
//.........這裏部分代碼省略.........
示例13: GetYmmsForDialogPage
public function GetYmmsForDialogPage()
{
$ymmtype = strtolower(MakeURLNormal(isset($_GET['ymmtype']) ? $_GET['ymmtype'] : ""));
$year = strtolower(MakeURLNormal(isset($_GET['year']) ? $_GET['year'] : ""));
$make = strtolower(MakeURLNormal(isset($_GET['make']) ? $_GET['make'] : ""));
$model = strtolower(MakeURLNormal(isset($_GET['model']) ? $_GET['model'] : ""));
$productId = isset($_GET['productId']) ? (int) $_GET['productId'] : 0;
$isDialogPQVQ = isset($_GET['isDialogPQVQ']) ? (int) $_GET['isDialogPQVQ'] : 0;
$output = "";
$array_str = $impvaritions = array();
if ($productId) {
$impvaritions = ISC_PRODUCT::GetImpVariationForYMM($productId, $ymmtype, '', '', '');
}
foreach (array('make', 'model', 'year') as $column) {
$tmp = '';
$array_str[$column] = "<option value=''>--select {$column}--</option>";
$ymms_array = $this->getResultArray($column, $year, $make, $model, $productId);
if ($column == 'model' and empty($ymms_array)) {
$ymms_array = $this->getResultArray($column, "", $make, $model, $productId);
}
switch ($column) {
case 'year':
$tmp = $year;
break;
case 'make':
$tmp = $make;
break;
default:
$tmp = $model;
break;
}
foreach ($ymms_array as $value) {
$selected = "";
if ($tmp == strtolower($value)) {
$selected = "selected";
}
if (empty($impvaritions) && !ISC_PRODUCT::CheckYMMUseVariation($value, $impvaritions, $column)) {
continue;
}
$array_str[$column] .= "<option value='" . strtoupper($value) . "' {$selected}>{$value}</option>";
}
//alandy_2012-2-20 add redirct option.
if ($isDialogPQVQ == 1) {
$array_str[$column] .= "<option value=1>My " . ucwords($column) . " Not Showing Here</option>";
}
}
if ($ymmtype == "make") {
$output = $array_str['model'] . '~' . $array_str['year'];
} elseif ($ymmtype == "year") {
$output = $array_str['make'] . '~' . $array_str['model'];
} elseif ($ymmtype == "model") {
$output = $array_str['year'];
} else {
}
return $output;
}
示例14: _SetProductData
public function _SetProductData($productid=0)
{
if ($productid == 0) {
// Retrieve the query string variables. Can't use the $_GET array
// because of SEO friendly links in the URL
SetPGQVariablesManually();
if (isset($_REQUEST['product'])) {
$product = $_REQUEST['product'];
}
else if(isset($GLOBALS['PathInfo'][1])) {
$product = preg_replace('#\.html$#i', '', $GLOBALS['PathInfo'][1]);
}
else {
$product = '';
}
$product = $GLOBALS['ISC_CLASS_DB']->Quote(MakeURLNormal($product));
$productSQL = sprintf("p.prodname='%s'", $product);
}
else {
$productSQL = sprintf("p.productid='%s'", (int)$productid);
}
$query = "
SELECT p.*, FLOOR(prodratingtotal/prodnumratings) AS prodavgrating, pi.*, ".GetProdCustomerGroupPriceSQL().",
(SELECT COUNT(fieldid) FROM [|PREFIX|]product_customfields WHERE fieldprodid=p.productid) AS numcustomfields,
(SELECT COUNT(reviewid) FROM [|PREFIX|]reviews WHERE revstatus='1' AND revproductid=p.productid AND revstatus='1') AS numreviews,
(SELECT brandname FROM [|PREFIX|]brands WHERE brandid=p.prodbrandid) AS prodbrandname,
(SELECT COUNT(imageid) FROM [|PREFIX|]product_images WHERE imageprodid=p.productid) AS numimages,
(SELECT COUNT(discountid) FROM [|PREFIX|]product_discounts WHERE discountprodid=p.productid) AS numbulkdiscounts
FROM [|PREFIX|]products p
LEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb=1 AND p.productid=pi.imageprodid)
WHERE ".$productSQL;
if(!isset($_COOKIE['STORESUITE_CP_TOKEN'])) {
// ISC-1073: don't check visibility if we are on control panel
$query .= " AND p.prodvisible='1'";
}
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$row = $GLOBALS['ISC_CLASS_DB']->Fetch($result);
if (!$row) {
return;
}
$this->_product = $row;
$this->_prodid = $row['productid'];
$this->_prodname = $row['prodname'];
$this->_prodsku = $row['prodcode'];
$this->_prodthumb = $row['imagefile'];
$this->_proddesc = $row['proddesc'];
$this->_prodimages = $row['numimages'];
$this->_prodprice = $row['prodprice'];
$this->_prodretailprice = $row['prodretailprice'];
$this->_prodsaleprice = $row['prodsaleprice'];
$this->_prodfixedshippingcost = $row['prodfixedshippingcost'];
$this->_prodbrandname = $row['prodbrandname'];
$this->_prodweight = $row['prodweight'];
$this->_prodavgrating = (int)$row['prodavgrating'];
$this->_prodcalculatedprice = $row['prodcalculatedprice'];
$this->_prodoptionsrequired = $row['prodoptionsrequired'];
$this->_prodnumreviews = $row['numreviews'];
$this->_prodavailability = $row['prodavailability'];
$this->_prodnumcustomfields = $row['numcustomfields'];
$this->_prodnumbulkdiscounts = $row['numbulkdiscounts'];
$this->_prodeventdatelimited = $row['prodeventdatelimited'];
$this->_prodeventdaterequired = $row['prodeventdaterequired'];
$this->_prodeventdatefieldname = $row['prodeventdatefieldname'];
$this->_prodeventdatelimitedtype = $row['prodeventdatelimitedtype'];
$this->_prodeventdatelimitedstartdate = $row['prodeventdatelimitedstartdate'];
$this->_prodeventdatelimitedenddate = $row['prodeventdatelimitedenddate'];
$this->_prodcondition = $row['prodcondition'];
$this->_prodshowcondition = $row['prodshowcondition'];
$this->_prodoptimizerenabled = $row['product_enable_optimizer'];
$this->_prodvariationid = $row['prodvariationid'];
$this->_prodminqty = $row['prodminqty'];
$this->_prodmaxqty = $row['prodmaxqty'];
$this->_upc = $row['upc'];
$this->_disable_google_checkout = $row['disable_google_checkout'];
$videoQuery = 'select * from `[|PREFIX|]product_videos` where video_product_id=' . (int)$this->_prodid . ' order by `video_sort_order` asc';
$videoResource = $GLOBALS['ISC_CLASS_DB']->Query($videoQuery);
$this->_prodvideos = array();
while($videoRow = $GLOBALS['ISC_CLASS_DB']->Fetch($videoResource)) {
$this->_prodvideos[] = $videoRow;
}
$this->_prodrelatedproducts = $row['prodrelatedproducts'];
$this->setLayoutFile($row['prodlayoutfile']);
$this->_prodpagetitle = $row['prodpagetitle'];
$this->_prodmetakeywords = $row['prodmetakeywords'];
$this->_prodmetadesc = $row['prodmetadesc'];
$this->_prodinvtrack = $row['prodinvtrack'];
$this->_prodcurrentinv = $row['prodcurrentinv'];
//.........這裏部分代碼省略.........
示例15: OrderAddProduct
/**
* Add a product to the order that's being created/edited.
*/
private function OrderAddProduct()
{
if (!isset($_REQUEST['cartItemId']) && !isset($_REQUEST['productId']) || !isset($_REQUEST['orderSession'])) {
exit;
}
$cartOptions = array('updateQtyIfExists' => false);
if (isset($_REQUEST['EventDate'])) {
$cartOptions['EventDate'] = isc_gmmktime(0, 0, 0, $_REQUEST['EventDate']['Mth'], $_REQUEST['EventDate']['Day'], $_REQUEST['EventDate']['Yr']);
}
if (isset($_REQUEST['ordcustid']) && $_REQUEST['ordcustid'] != 0) {
$customerClass = GetClass('ISC_CUSTOMER');
$customer = $customerClass->GetCustomerInfo($_REQUEST['ordcustid']);
if (isset($customer['custgroupid'])) {
$cartOptions['customerGroup'] = $customer['custgroupid'];
}
} else {
if (isset($_REQUEST['custgroupid']) && $_REQUEST['custgroupid'] != 0) {
$cartOptions['customerGroup'] = (int) $_REQUEST['custgroupid'];
}
}
if (isset($_REQUEST['variationId'])) {
$variationId = $_REQUEST['variationId'];
} else {
$variationId = 0;
}
if (isset($_REQUEST['customerGroup'])) {
$orderDetails['customerGroup'] = (int) $_REQUEST['customerGroup'];
}
/* -- Added below condition to check if YMM values coming from dropdown, then need to decode - starts */
if (isset($_REQUEST['ymmID']) && $_REQUEST['ymmID'] == 0) {
if (isset($_REQUEST['ymmmake'])) {
$_REQUEST['ymmmake'] = MakeURLNormal($_REQUEST['ymmmake']);
}
if (isset($_REQUEST['ymmmodel'])) {
$_REQUEST['ymmmodel'] = MakeURLNormal($_REQUEST['ymmmodel']);
}
}
/* -- ends -- */
$productFields = $this->BuildProductConfigurableFieldData();
$orderClass = GetClass('ISC_ADMIN_ORDERS');
$rowId = $orderClass->GetCartApi($_REQUEST['orderSession'])->AddItem($_REQUEST['productId'], $_REQUEST['quantity'], $variationId, $productFields, $_REQUEST['cartItemId'], $cartOptions);
if ($rowId === false) {
$errors = implode("\n", $orderClass->GetCartApi()->GetErrors());
if (!$errors) {
$errors = GetLang('ErrorAddingProductToOrder');
}
$response = array('error' => $errors);
} else {
$product = $orderClass->GetCartApi()->GetProductInCart($rowId);
$catquery = " SELECT DISTINCT c.categoryid, p.brandseriesid\n FROM isc_categories c \n LEFT JOIN isc_categoryassociations ca ON c.categoryid = ca.categoryid \n LEFT JOIN isc_products p ON ca.productid = p.productid AND p.prodvisible='1'\n WHERE p.productid= " . $product['product_id'] . "";
$relcats = array();
$brandseries = 0;
$catresult = $GLOBALS['ISC_CLASS_DB']->Query($catquery);
while ($catrow = $GLOBALS['ISC_CLASS_DB']->Fetch($catresult)) {
$relcats[] = $catrow['categoryid'];
$brandseries = $catrow['brandseriesid'];
}
if ($product['data']['prodsaleprice'] > 0 && $product['data']['prodsaleprice'] < $product['product_price']) {
$product['product_price'] = $product['data']['prodsaleprice'];
} else {
$product['discount_price'] = CalculateDiscountPrice($product['product_price'], $product['product_price'], $relcats[0], $brandseries);
$orderClass->GetCartApi()->SetItemValue($rowId, 'discount_price', $product['discount_price']);
// $product['product_price'] = CalculateDiscountPrice($product['product_price'], $product['product_price'], $relcats[0], $brandseries);
}
$product['vendorprefix'] = $orderClass->GetProductVendorprefix($product['product_id']);
$orderClass->GetCartApi()->SetItemValue($rowId, 'product_price', $product['product_price']);
$response = array('productRow' => $orderClass->GenerateOrderItemRow($rowId, $product), 'orderSummary' => $orderClass->GenerateOrderSummaryTable(), 'productRowId' => $rowId);
if ($_REQUEST['cartItemId'] != $rowId) {
$response['removeRow'] = (string) $_REQUEST['cartItemId'];
}
}
if (isset($_REQUEST['ajaxFormUpload'])) {
echo '<textarea>' . isc_json_encode($response) . '</textarea>';
exit;
}
echo isc_json_encode($response);
exit;
}