function SetPanelSettings() { // Build the breadcrumb trail to this page $parentlist = $GLOBALS['ISC_CLASS_PAGE']->GetPageParentList(); $pageid = $GLOBALS['ISC_CLASS_PAGE']->GetPageId(); if (isset($GLOBALS['ISC_CLASS_VENDORS'])) { $vendor = $GLOBALS['ISC_CLASS_VENDORS']->GetVendor(); } else { $vendor = array(); } $GLOBALS['SNIPPETS']['PageBreadcrumb'] = ''; if ($parentlist != '') { $query = sprintf("SELECT pageid, pagetitle, pagelink, pagetype, pageparentid FROM [|PREFIX|]pages WHERE pageid IN (%s) OR pageid='%d'", $parentlist, $pageid); $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $parentPages[$row['pageid']] = $row; } // Now we have the list we can generate the breadcrumb trail $parentid = $pageid; do { if (!isset($parentPages[$parentid])) { break; } $page = $parentPages[$parentid]; $GLOBALS['CatTrailName'] = isc_html_escape($page['pagetitle']); // Is it a normal page, external page or RSS feed? switch ($page['pagetype']) { case 0: case 2: case 3: // Normal Page or RSS feed $GLOBALS['CatTrailLink'] = PageLink($page['pageid'], $page['pagetitle'], $vendor); break; case 1: // External Link $GLOBALS['CatTrailLink'] = $page['pagelink']; break; } if ($parentid == $pageid) { $item = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItemCurrent"); } else { $item = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItem"); } $GLOBALS['SNIPPETS']['PageBreadcrumb'] = $item . $GLOBALS['SNIPPETS']['PageBreadcrumb']; $parentid = $page['pageparentid']; } while ($parentid != 0); } if (!empty($vendor)) { $GLOBALS['CatTrailName'] = isc_html_escape($vendor['vendorname']); $GLOBALS['CatTrailLink'] = VendorLink($vendor); $GLOBALS['SNIPPETS']['PageBreadcrumb'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItem") . $GLOBALS['SNIPPETS']['PageBreadcrumb']; } }
/** * Generates a sitemap tree for the pages model based on the pages nested set * * @param int $limit * @param int $offset * @return ISC_SITEMAP_NODE */ public function getTree($limit = null, $offset = null) { $root = new ISC_SITEMAP_ROOT(); $home = new ISC_SITEMAP_NODE(GetConfig('ShopPathNormal') . '/', GetLang('Home')); $root->appendChild($home); $set = new ISC_NESTEDSET_PAGES(); $sql = $set->generateGetTreeSql(array('pageid', 'pagetitle', 'pagetype', 'pagelink'), ISC_NESTEDSET_START_ROOT, $this->getMaximumDepth(), $limit, $offset, true, $this->_getRestrictions()); $result = $GLOBALS['ISC_CLASS_DB']->Query($sql); $previousDepth = -1; $node = $root; while ($page = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $depth = (int)$page['pagedepth']; if ($depth > $previousDepth) { $parent = $node; } else if ($depth < $previousDepth) { for ($depthCounter = $previousDepth - $depth; $depthCounter > 0; $depthCounter--) { $parent = $parent->getParent(); } } $title = $page['pagetitle']; switch ($page['pagetype']) { case '1': $url = $page['pagelink']; break; default: $url = PageLink((int)$page['pageid'], $title); break; } $node = new ISC_SITEMAP_NODE($url, $title); $parent->appendChild($node); $previousDepth = $depth; } return $root; }
public function SetPanelSettings() { if (isset($GLOBALS['ISC_CLASS_PRODUCT'])) { $vendor = GetClass('ISC_PRODUCT')->GetProductVendor(); } else { $cVendor = GetClass('ISC_VENDORS'); $vendor = $cVendor->GetVendor(); } $GLOBALS['VendorName'] = isc_html_escape($vendor['vendorname']); $GLOBALS['VendorHomeLink'] = VendorLink($vendor); $GLOBALS['VendorProductsLink'] = VendorProductsLink($vendor); // Does this vendor have any products? $query = "\n\t\t\tSELECT productid\n\t\t\tFROM [|PREFIX|]products\n\t\t\tWHERE prodvendorid='" . (int) $vendor['vendorid'] . "'\n\t\t\tLIMIT 1\n\t\t"; $hasProducts = $GLOBALS['ISC_CLASS_DB']->FetchOne($query); if (!$hasProducts) { $GLOBALS['HideVendorProductsLink'] = 'display: none'; } // Fetch out any pages belonging to this vendor to show in the menu $GLOBALS['PageLinks'] = ''; // If the customer is not logged in then they can only see pages that aren't restricted to 'customers only' $customersOnly = ''; $GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER'); if (!$GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerId()) { $customersOnly = ' AND pagecustomersonly=0'; } // Fetch any pages that this page is a parent of $query = "\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]pages\n\t\t\tWHERE pagestatus='1' AND pageparentid='0' AND pagevendorid='" . (int) $vendor['vendorid'] . "' " . $customersOnly . "\n\t\t\tORDER BY pagesort ASC, pagetitle ASC\n\t\t"; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while ($page = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $GLOBALS['PageName'] = isc_html_escape($page['pagetitle']); // Is it a normal page, external page or RSS feed? switch ($page['pagetype']) { case 0: case 2: case 3: // Normal Page or RSS feed $GLOBALS['PageLink'] = PageLink($page['pageid'], $page['pagetitle'], $vendor); break; case 1: // External Link $GLOBALS['PageLink'] = $page['pagelink']; break; } $GLOBALS['PageLinks'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('SidePageLink'); } }
function SetPanelSettings() { $pageid = $GLOBALS['ISC_CLASS_PAGE']->GetPageId(); if ($pageid == 0) { $this->DontDisplay = true; return false; } $GLOBALS['PageLinks'] = ''; // If the customer is not logged in then they can only see pages that aren't restricted to 'customers only' $customersOnly = ''; $GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER'); if (!$GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerId()) { $customersOnly = ' AND pagecustomersonly=0'; } // Are we fetching pages for a specific vendor only? $vendorOnly = ''; if (isset($GLOBALS['ISC_CLASS_VENDOR'])) { $vendor = $GLOBALS['ISC_CLASS_VENDOR']->GetVendor(); $vendorOnly = " AND pagevendorid='" . (int) $vendor['vendorid'] . "'"; } // Fetch any pages that this page is a parent of $query = "\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]pages\n\t\t\tWHERE pagestatus='1' AND pageparentid='" . (int) $pageid . "' " . $customersOnly . " " . $vendorOnly . "\n\t\t\tORDER BY pagesort ASC, pagetitle ASC\n\t\t"; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while ($page = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $GLOBALS['PageName'] = isc_html_escape($page['pagetitle']); // Is it a normal page, external page or RSS feed? switch ($page['pagetype']) { case 0: case 2: case 3: // Normal Page or RSS feed $GLOBALS['PageLink'] = PageLink($page['pageid'], $page['pagetitle']); break; case 1: // External Link $GLOBALS['PageLink'] = $page['pagelink']; break; } $GLOBALS['PageLinks'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('SidePageLink'); } if ($GLOBALS['PageLinks'] == '') { $GLOBALS['HideSubPagesList'] = 'none'; $this->DontDisplay = true; } $GLOBALS['PageTitle'] = $GLOBALS['ISC_CLASS_PAGE']->GetPageTitle(); }
private function GetPages() { header('Content-type: text/xml'); echo '<?xml version="1.0"?>'; echo '<results>'; $GLOBALS['ISC_CLASS_ADMIN_AUTH'] = GetClass('ISC_ADMIN_AUTH'); $GLOBALS['ISC_CLASS_ADMIN_PAGES'] = GetClass('ISC_ADMIN_PAGES'); $pages = $GLOBALS['ISC_CLASS_ADMIN_PAGES']->_getPagesArray(); //$GLOBALS['ISC_CLASS_LOG']->LogSystemDebug('php', 'array', var_export($pages, true)); if (!count($pages)) { echo "<error>" . GetLang('DevEditLinkerNoPages') . "</error>"; } else { foreach ($pages as $page) { if ($page['pagetype'] != 1) { $pageLink = PageLink($page['pageid'], $page['pagetitle']); } else { $pageLink = $page['pagelink']; } echo sprintf('<result title="%s" icon="images/page.gif" padding="' . ($page['depth'] * 18 + 6) . '">%s</result>', isc_html_escape($page['pagetitle']), $pageLink); } } echo '</results>'; }
/** * Build the array of searched item results for the AJAX request * * Method will build an array of searched item results for the AJAX request. Method will work with the ISC_SEARCH * class to get the results so make sure that the object is initialised and the DoSearch executed. * * Each key in the array will be the 'score' value (as a string) so it can be merged in with other results and can * then be further sorted using any PHP array sorting functions, so output would be something like this: * * EG: return = array(10, // result count * array( * "12.345" => array( * 0 => [page HTML] * 1 => [page HTML] * 2 => [page HTML] * ), * "2.784" => array( * 0 => [page HTML] * ), * "6.242" => array( * 0 => [page HTML] * 1 => [page HTML] * ) * ) * ); * * @access public * @return array An array with two values, first is total number of search results. Other is the search item results AJAX array on success, empty array on error */ static public function buildSearchResultsAJAX() { if (!isset($GLOBALS["ISC_CLASS_SEARCH"]) || !is_object($GLOBALS["ISC_CLASS_SEARCH"])) { return array(); } $totalRecords = $GLOBALS["ISC_CLASS_SEARCH"]->GetNumResults("page"); if ($totalRecords == 0) { return array(0, array()); } $results = $GLOBALS["ISC_CLASS_SEARCH"]->GetResults("page"); $ajaxArray = array(); if (!array_key_exists("results", $results) || !is_array($results["results"])) { return array(0, array()); } foreach ($results["results"] as $page) { if (!isset($page["score"])) { $page["score"] = 0; } $GLOBALS["PageTitle"] = isc_html_escape($page["pagetitle"]); if ($page["pagetype"] == 1) { $GLOBALS["PageURL"] = $page["pagelink"]; $GLOBALS["PageSmallContent"] = ""; } else { $normalContent = strip_tags($page["pagecontent"]); $smallContent = substr($normalContent, 0, 49); if (strlen($normalContent) > 50 && substr($smallContent, -1, 1) !== ".") { $smallContent .= " ..."; } $GLOBALS["PageSmallContent"] = isc_html_escape($smallContent); $vendor = array(); if (isId($page["pagevendorid"]) && trim($page["vendorfriendlyname"]) !== "") { $vendor = array( "vendorid" => $page["pagevendorid"], "vendorfriendlyname" => $page["vendorfriendlyname"] ); } $GLOBALS["PageURL"] = PageLink($page["pageid"], $page["pagetitle"], $vendor); } $sortKey = (string)$page["score"]; if (!array_key_exists($sortKey, $ajaxArray) || !is_array($ajaxArray[$sortKey])) { $ajaxArray[$sortKey] = array(); } $ajaxArray[$sortKey][] = $GLOBALS["ISC_CLASS_TEMPLATE"]->GetSnippet("SearchResultAJAXPage"); } return array($totalRecords, $ajaxArray); }
function SetPanelSettings() { $output = ""; $pages = array(); if (isset($GLOBALS['ActivePage']) && $GLOBALS['ActivePage'] == "home") { $GLOBALS['ActivePageHomeClass'] = "ActivePage"; } else { if (isset($GLOBALS['ActivePage']) && $GLOBALS['ActivePage'] == 'store') { $GLOBALS['ActivePageStoreClass'] = 'ActivePage'; } else { $GLOBALS['ActivePageHomeClass'] = ''; } } // If the customer is not logged in then they can only see pages that aren't restricted to 'customers only' $loggedIn = false; $GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER'); if ($GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerId()) { $loggedIn = true; } $pages = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('Pages'); // Now that we have all of the pages we need to show in the menu, build the menu if (count($pages) > 0 && isset($pages[0])) { foreach ($pages[0] as $page) { if ($page['pagecustomersonly'] && !$loggedIn) { continue; } $GLOBALS['PageName'] = isc_html_escape($page['pagetitle']); // Is it a normal page, external page or RSS feed? switch ($page['pagetype']) { case 0: case 2: case 3: // Normal Page or RSS feed $GLOBALS['PageLink'] = PageLink($page['pageid'], $page['pagetitle']); break; case 1: // External Link $GLOBALS['PageLink'] = $page['pagelink']; break; } if (isset($GLOBALS['ActivePage']) && $GLOBALS['ActivePage'] == $page['pageid']) { $GLOBALS['ActivePageClass'] = "ActivePage"; } else { $GLOBALS['ActivePageClass'] = ''; } // Are there any sub-pages? $GLOBALS['SubMenu'] = ''; $GLOBALS['SubMenuLinks'] = ''; $GLOBALS['HasSubMenuClass'] = ''; if (isset($pages[$page['pageid']])) { $GLOBALS['HasSubMenuClass'] = 'HasSubMenu'; foreach ($pages[$page['pageid']] as $subpage) { if ($subpage['pagecustomersonly'] && !$loggedIn) { continue; } $GLOBALS['sPageName'] = isc_html_escape($subpage['pagetitle']); // Is it a normal page, external page or RSS feed? switch ($subpage['pagetype']) { case 0: case 2: case 3: // Normal Page or RSS feed $GLOBALS['sPageLink'] = PageLink($subpage['pageid'], $subpage['pagetitle']); break; case 1: // External Link $GLOBALS['sPageLink'] = $subpage['pagelink']; break; } $GLOBALS['SubMenuLinks'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("PageSubMenu"); } $GLOBALS['SubMenu'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("PageMenuDropDown"); } $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("PageMenu"); } } $GLOBALS['SNIPPETS']['PageMenu'] = $output; }
private function EditPageStep1($MsgDesc = "", $MsgStatus = "", $IsError = false) { $GLOBALS['Message'] = ''; if($MsgDesc != "") { $GLOBALS['Message'] .= MessageBox($MsgDesc, $MsgStatus); } $GLOBALS['Message'] .= GetFlashMessageBoxes(); $pageId = (int)$_REQUEST['pageId']; $arrData = array(); if(PageExists($pageId)) { // Was the page submitted with a duplicate page name? if($IsError) { $this->_GetPageData(0, $arrData); } else { $this->_GetPageData($pageId, $arrData); } $GLOBALS['CurrentTab'] = '0'; if(isset($_REQUEST['currentTab'])) { $GLOBALS['CurrentTab'] = $_REQUEST['currentTab']; } // Does this user have permission to edit this product? if($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $arrData['pagevendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) { FlashMessage(GetLang('Unauthorized'), MSG_ERROR, 'index.php?ToDo=viewPages'); } $GLOBALS['PageId'] = (int) $pageId; $GLOBALS['SetupType'] = sprintf("SwitchType(%d);", $arrData['pagetype']); $GLOBALS['Title'] = GetLang('EditPage'); $GLOBALS['FormAction'] = "editPage2"; $GLOBALS['PageTitle'] = isc_html_escape($arrData['pagetitle']); $wysiwygOptions = array( 'id' => 'wysiwyg', 'value' => $arrData['pagecontent'] ); $GLOBALS['WYSIWYG'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor($wysiwygOptions); $GLOBALS['PageLink'] = isc_html_escape($arrData['pagelink']); $GLOBALS['PageFeed'] = isc_html_escape($arrData['pagefeed']); $GLOBALS['PageEmail'] = isc_html_escape($arrData['pageemail']); $GLOBALS['ParentPageOptions'] = $this->GetParentPageOptions($arrData['pageparentid'], $pageId, $arrData['pagevendorid']); $GLOBALS['PageKeywords'] = isc_html_escape($arrData['pagekeywords']); $GLOBALS['PageMetaTitle'] = isc_html_escape($arrData['pagemetatitle']); $GLOBALS['PageDesc'] = isc_html_escape($arrData['pagedesc']); $GLOBALS['PageSearchKeywords'] = isc_html_escape($arrData['pagesearchkeywords']); $GLOBALS['PageSort'] = (int) $arrData['pagesort']; if($arrData['pagestatus'] == 1) { $GLOBALS['Visible'] = 'checked="checked"'; } if($arrData['pagecustomersonly'] == 1) { $GLOBALS['IsCustomersOnly'] = "checked=\"checked\""; } if(is_numeric(isc_strpos($arrData['pagecontactfields'], "fullname"))) { $GLOBALS['IsContactFullName'] = 'checked="checked"'; } if(is_numeric(isc_strpos($arrData['pagecontactfields'], "companyname"))) { $GLOBALS['IsContactCompanyName'] = 'checked="checked"'; } if(is_numeric(isc_strpos($arrData['pagecontactfields'], "phone"))) { $GLOBALS['IsContactPhone'] = 'checked="checked"'; } if(is_numeric(isc_strpos($arrData['pagecontactfields'], "orderno"))) { $GLOBALS['IsContactOrderNo'] = 'checked="checked"'; } if(is_numeric(isc_strpos($arrData['pagecontactfields'], "rma"))) { $GLOBALS['IsContactRMA'] = 'checked="checked"'; } // Is this page the default home page? if($arrData['pageishomepage'] == 1) { $GLOBALS['IsHomePage'] = 'checked="checked"'; } $GLOBALS['IsVendor'] = 'false'; if(!gzte11(ISC_HUGEPRINT)) { $GLOBALS['HideVendorOption'] = 'display: none'; } else { $vendorData = $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendor(); if(isset($vendorData['vendorid'])) { $GLOBALS['HideVendorSelect'] = 'display: none'; $GLOBALS['IsVendor'] = 'true'; $GLOBALS['CurrentVendor'] = isc_html_escape($vendorData['vendorname']); } else { $GLOBALS['HideVendorLabel'] = 'display: none'; $GLOBALS['VendorList'] = $this->BuildVendorSelect($arrData['pagevendorid']); } } // Get a list of all layout files $layoutFile = 'page.html'; if($arrData['pagelayoutfile'] != '') { $layoutFile = $arrData['pagelayoutfile']; } $GLOBALS['LayoutFiles'] = GetCustomLayoutFilesAsOptions("page.html", $layoutFile); //Google website optimizer $GLOBALS['GoogleWebsiteOptimizerIntro'] = GetLang('PageGoogleWebsiteOptimizerIntro'); $GLOBALS['HideOptimizerConfigForm'] = 'display:none;'; $GLOBALS['CheckEnableOptimizer'] = ''; $GLOBALS['SkipOptimizerConfirmMsg'] = 'true'; $enabledOptimizers = GetConfig('OptimizerMethods'); if(!empty($enabledOptimizers)) { foreach ($enabledOptimizers as $id => $date) { GetModuleById('optimizer', $optimizerModule, $id); if ($optimizerModule->_testPage == 'pages' || $optimizerModule->_testPage == 'all') { $GLOBALS['SkipOptimizerConfirmMsg'] = 'false'; break; } } } if($arrData['page_enable_optimizer']) { $GLOBALS['HideOptimizerConfigForm'] = ''; $GLOBALS['CheckEnableOptimizer'] = 'Checked'; } $pageUrl = PageLink($pageId, $arrData['pagetitle']); $optimizer = getClass('ISC_ADMIN_OPTIMIZER'); $GLOBALS['OptimizerConfigForm'] = $optimizer->showPerItemConfigForm('page', $pageId, $pageUrl); $GLOBALS['SaveAndAddAnother'] = GetLang('SaveAndContinueEditing'); $this->template->display('page.form.tpl'); } else { // The news page doesn't exist FlashMessage(GetLang('PageDoesntExist'), MSG_ERROR, 'index.php?ToDo=viewPages'); } }
/** * Returns the URL for a page based on it's id * * @param integer $pageId The ID number of the page to generate the URL for */ public static function getPageUrl($pageId, $returnTitle=false) { $pageId = (int)$pageId; if($pageId < 1) { return false; } $pageQuery = $GLOBALS['ISC_CLASS_DB']->Query('select * from `[|PREFIX|]pages` where pageid=' . $pageId); $pageInfo = $GLOBALS['ISC_CLASS_DB']->Fetch($pageQuery); if(empty($pageInfo)) { return false; } if($returnTitle) { return array('title'=>$pageInfo['pagetitle'], 'url'=> PageLink($pageId, $pageInfo['pagetitle'])); } return PageLink($pageId, $pageInfo['pagetitle']); }
<?php define('NO_SESSION', true); require_once dirname(__FILE__) . '/init.php'; ob_start('ob_gzhandler'); $limit = 50000; header('Content-type: text/xml; charset: UTF-8'); echo '<?xml version="1.0" encoding="UTF-8"?>', "\n"; echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">', "\n"; $query = "\n\t\tSELECT pageid, pagetitle\n\t\tFROM [|PREFIX|]pages\n\t\tWHERE pageid != pageparentid AND pagestatus=1\n\t\tLIMIT 50000\n\t"; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $limit--; // We can't just pass ENT_QUOTES to htmlspecialchars because that converts a ' to ' rather than ' // Google sitemaps requires ' to be encoded as ' so we have to do things a little differently $url = htmlspecialchars(PageLink($row['pageid'], $row['pagetitle']), ENT_COMPAT, 'UTF-8'); $url = str_replace("'", ''', $url); echo '<url>', "\n"; echo '<loc>', $url, '</loc>', "\n"; echo '</url>', "\n"; } $query = "\n\t\tSELECT prodname\n\t\tFROM [|PREFIX|]products\n\t\tWHERE prodvisible=1\n\t\tLIMIT " . $GLOBALS['ISC_CLASS_DB']->Quote((int) $limit); $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $limit--; // We can't just pass ENT_QUOTES to htmlspecialchars because that converts a ' to ' rather than ' // Google sitemaps requires ' to be encoded as ' so we have to do things a little differently $url = htmlspecialchars(ProdLink($row['prodname']), ENT_COMPAT, 'UTF-8'); $url = str_replace("'", ''', $url); echo '<url>', "\n"; echo '<loc>', $url, '</loc>', "\n";
$query = " SELECT pageid, pagetitle FROM [|PREFIX|]pages WHERE pageid != pageparentid AND pagestatus = 1 AND pagetype != 1 LIMIT 50000 "; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $limit--; $url = makeSafeUrl(PageLink($row['pageid'], $row['pagetitle'])); echo '<url>',"\n"; echo '<loc>',$url,'</loc>',"\n"; echo '</url>',"\n"; } $query = " SELECT prodname FROM [|PREFIX|]products WHERE prodvisible=1 LIMIT ".$GLOBALS['ISC_CLASS_DB']->Quote((int)$limit); $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $limit--;