<?php
/* --------------------------------------------------------------
GMSitemap.php 2008-07-30 gambio
Gambio OHG
http://www.gambio.de
Copyright (c) 2008 Gambio OHG
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
*/
/*
* class to show visual sitemap
*/
class GMSitemap {
/*
* -> object for SEF Urls
*/
var $gmSEOBoost;
/*
* default & empty constructor
*/
function GMSitemap() {
$this->gmSEOBoost = MainFactory::create_object('GMSEOBoost');
return;
}
/*
* main function to get the sitemap
*/
function get() {
/*
* get cats
*/
if (GROUP_CHECK == 'true') {
$group_check = " AND c.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
}
$gm_query = xtc_db_query("
SELECT
c.categories_id AS id,
cd.categories_name AS name,
c.parent_id
FROM " .
TABLE_CATEGORIES . " c
LEFT JOIN " .
TABLE_CATEGORIES_DESCRIPTION . " cd
ON
c.categories_id = cd.categories_id
WHERE
cd.language_id = '" . (int) $_SESSION['languages_id'] . "'
AND
c.parent_id = '0'
AND
c.categories_status = '1' " .
$group_check . "
ORDER BY
c.sort_order, cd.categories_name
");
$gm_tree = '<ul>';
while($gm_array = xtc_db_fetch_array($gm_query)) {
$gm_sub_tree = $this->get_tree($gm_array['id']);
if(!empty($gm_sub_tree)) {
$gm_help = '<li class="parent"><h2>' . $this->get_cat_link($gm_array['id'], $gm_array['name']) . '</h2>' . $gm_sub_tree . '</li>';
} else {
$gm_help = '<li class="parent"><h2>' . $this->get_cat_link($gm_array['id'], $gm_array['name']) . '</h2></li>';
}
$gm_tree .= $gm_help;
$gm_help = '';
}
/*
* get contents
*/
if (GROUP_CHECK == 'true') {
$group_check = "and group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
if($this->gmSEOBoost->boost_content) {
$group_query = "content_id AS id,";
} else {
$group_query = "content_group AS id,";
}
$gm_query = xtc_db_query(
"SELECT
" . $group_query . "
content_title,
gm_link
FROM " .
TABLE_CONTENT_MANAGER . "
WHERE
languages_id='" . (int) $_SESSION['languages_id'] . "'
AND
file_flag!=4 " .
$group_check . "
AND
content_status=1
ORDER BY
sort_order
");
while ($content_data = xtc_db_fetch_array($gm_query)) {
$SEF_parameter = '';
if($this->gmSEOBoost->boost_content) {
$link = xtc_href_link($this->gmSEOBoost->get_boosted_content_url($content_data['id'], $_SESSION['languages_id']));
} else {
if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
$SEF_parameter = '&content=' . xtc_cleanName($content_data['content_title']);
}
$link = xtc_href_link(FILENAME_CONTENT, 'coID=' . $content_data['id'] . $SEF_parameter);
}
if(empty($content_data['gm_link'])){
$gm_tree .= '<li><h2><a href="' . $link . '">'.htmlspecialchars($content_data['content_title']).'</a></h2></li>';
}
}
$gm_tree .= '</ul>';
return $gm_tree;
}
/*
* read cats
*/
function get_tree($id) {
if (GROUP_CHECK == 'true') {
$group_check = " AND c.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
}
$gm_query = xtc_db_query("
SELECT
c.categories_id AS id,
cd.categories_name AS name
FROM " .
TABLE_CATEGORIES . " c
LEFT JOIN " .
TABLE_CATEGORIES_DESCRIPTION . " cd
ON
c.categories_id = cd.categories_id
WHERE
cd.language_id = '" . (int) $_SESSION['languages_id'] . "'
AND
c.parent_id = '" . (int)$id . "'
AND
c.categories_status = '1'" .
$group_check . "
ORDER BY
c.sort_order, cd.categories_name
");
while($gm_array = xtc_db_fetch_array($gm_query)) {
$gm_sub_tree = $this->get_tree($gm_array['id']);
if(!empty($gm_sub_tree)) {
$gm_help = '<ul><li>' . $this->get_cat_link($gm_array['id'], $gm_array['name']). $gm_sub_tree . '</li></ul>';
} else {
$gm_help = '<ul><li>' . $this->get_cat_link($gm_array['id'], $gm_array['name']) . '</li></ul>';
}
$gm_tree .= $gm_help;
$gm_help = '';
}
return $gm_tree;
}
/*
* create sef-cat-link
*/
function get_cat_link($id, $name) {
if($this->gmSEOBoost->boost_categories) {
return '<a href="' . xtc_href_link($this->gmSEOBoost->get_boosted_category_url($id, $_SESSION['languages_id'])) . '">' . htmlspecialchars($name) . '</a>' . gm_count_products_in_category($id);
} else {
return '<a href="' . xtc_href_link(FILENAME_DEFAULT, xtc_category_link($id, $name)) . '">' . htmlspecialchars($name) . '</a>' . gm_count_products_in_category($id);
}
}
}
?>| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| csstidy/ | 2013-11-12 21:03 | 125.89 KB | 76129f60960:kunden | dxwrx-rx-r | |
| lib/ | 2013-11-12 21:03 | 601.96 KB | 76129f60960:kunden | dxwrx-rx-r | |
| ErrorHandler.php | 2013-11-12 21:03 | 10.34 KB | 76129f60960:kunden | -xw-x----- | |
| FileLog.php | 2013-11-12 21:02 | 2.93 KB | 76129f60960:kunden | -xw-x----- | |
| GMAltText.php | 2013-11-12 21:03 | 2.94 KB | 76129f60960:kunden | -xw-x----- | |
| GMAttributesCalculator.php | 2013-11-12 21:03 | 4.65 KB | 76129f60960:kunden | -xw-x----- | |
| GMCSSMonitor.php | 2013-11-12 21:03 | 13.19 KB | 76129f60960:kunden | -xw-x----- | |
| GMCSSOptimizer.php | 2013-11-12 21:03 | 32.87 KB | 76129f60960:kunden | -xw-x----- | |
| GMCat.php | 2013-11-12 21:03 | 9.08 KB | 76129f60960:kunden | -xw-x----- | |
| GMCounter.php | 2013-11-12 21:03 | 17.05 KB | 76129f60960:kunden | -xw-x----- | |
| GMEbay.php | 2013-11-12 21:02 | 9.16 KB | 76129f60960:kunden | -xw-x----- | |
| GMGMotion.php | 2013-11-12 21:02 | 24.31 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintCartManager.php | 2013-11-12 21:03 | 14.66 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintConfiguration.php | 2013-11-12 21:03 | 2.17 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintContentManager.php | 2013-11-12 21:02 | 8.79 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintElements.php | 2013-11-12 21:03 | 15.79 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintFileManager.php | 2013-11-12 21:02 | 6.06 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintOrderElements.php | 2013-11-12 21:03 | 7.46 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintOrderManager.php | 2013-11-12 21:03 | 6.27 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintOrderSurfaces.php | 2013-11-12 21:03 | 6.41 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintOrderSurfacesManager.php | 2013-11-12 21:03 | 4.86 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintProductManager.php | 2013-11-12 21:02 | 4.55 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintSurfaces.php | 2013-11-12 21:03 | 9.99 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintSurfacesGroupsManager.php | 2013-11-12 21:03 | 1.96 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintSurfacesManager.php | 2013-11-12 21:03 | 9.62 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintWishlistManager.php | 2013-11-12 21:03 | 14.81 KB | 76129f60960:kunden | -xw-x----- | |
| GMJSON.php | 2013-11-12 21:03 | 2.44 KB | 76129f60960:kunden | -xw-x----- | |
| GMJanolaw.php | 2013-11-12 21:03 | 3.76 KB | 76129f60960:kunden | -xw-x----- | |
| GMLangFileMaster.php | 2013-11-12 21:03 | 965 B | 76129f60960:kunden | -xw-x----- | |
| GMLightboxControl.php | 2013-11-12 21:03 | 691 B | 76129f60960:kunden | -xw-x----- | |
| GMLogoManager.php | 2013-11-12 21:03 | 6.78 KB | 76129f60960:kunden | -xw-x----- | |
| GMMeta.php | 2013-11-12 21:02 | 8.29 KB | 76129f60960:kunden | -xw-x----- | |
| GMProduct.php | 2013-11-12 21:03 | 2.37 KB | 76129f60960:kunden | -xw-x----- | |
| GMSEOBoost.php | 2013-11-12 21:03 | 25.63 KB | 76129f60960:kunden | -xw-x----- | |
| GMSitemap.php | 2013-11-12 21:03 | 5.32 KB | 76129f60960:kunden | -xw-x----- | |
| GMStatusbar.php | 2013-11-12 21:02 | 2.46 KB | 76129f60960:kunden | -xw-x----- | |
| GMTSWidget.php | 2013-11-12 21:03 | 4.93 KB | 76129f60960:kunden | -xw-x----- | |
| GMTabTokenizer.php | 2013-11-12 21:03 | 2.81 KB | 76129f60960:kunden | -xw-x----- | |
| GMTracker.php | 2013-11-12 21:03 | 3.49 KB | 76129f60960:kunden | -xw-x----- | |
| JSON.php | 2013-11-12 21:03 | 39.98 KB | 76129f60960:kunden | -xw-x----- | |
| application_top.php | 2013-11-12 21:03 | 34.02 KB | 76129f60960:kunden | -xw-x----- | |