Forum Internet Service Backes

Bitte loggen sie sich ein oder registrieren sie sich.

Einloggen mit Benutzername, Passwort und Sitzungslänge
Erweiterte Suche  

Neuigkeiten:

Autor Thema: Sitemap erstellen  (Gelesen 3279 mal)

web334

  • Gast
Sitemap erstellen
« am: 21 November, 2007, 19:09:53 Nachmittag »

Hallo Leute
ich würde gerne eine Sitemap mit allen meinen Artikeln erstellen lassen. Funktioniert das automatisch? Wenn ja, wie? Oder was muss ich da machen?
Gespeichert

MBa

  • Member
  • ***
  • Offline Offline
  • Beiträge: 49
Re: Sitemap erstellen
« Antwort #1 am: 24 November, 2007, 18:46:08 Nachmittag »

Nur ein Lösungsansatz....
Ich habe gerade mal angefanngen....

'module/content/sitemap.php'
<?php
/* -----------------------------------------------------------------------------------------
   $Id: sitemap.php 1278 2005-10-02 07:40:25Z mz $

   XT-Commerce - community made shopping
   http://www.xt-commerce.com

   Copyright (c) 2004 XT-Commerce
   -----------------------------------------------------------------------------------------
   based on:
   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
   (c) 2002-2003 osCommerce; www.oscommerce.com
   (c) 2003  nextcommerce; www.nextcommerce.org

   Released under the GNU General Public License
   ---------------------------------------------------------------------------------------*/

$module_smarty = new Smarty;
$module_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/');

require_once(
DIR_FS_INC 'xtc_count_products_in_category.inc.php');

 
//to get category trees
 
function get_category_tree($parent_id '0'$spacing ''$exclude ''$category_tree_array ''$include_itself false$cPath '') {
if (
$parent_id == 0){ $cPath ''; } else { $cPath .= $parent_id '_'; }
   if (!
is_array($category_tree_array)) $category_tree_array = array();
   if ( (
sizeof($category_tree_array) < 1) && ($exclude != '0') ) $category_tree_array[] = array('id' => '0''text' => TEXT_TOP);

   if (
$include_itself) {
     
$category_query "select cd.categories_name from " TABLE_CATEGORIES_DESCRIPTION " cd where cd.language_id = '" $_SESSION['languages_id'] . "' and c.categories_status = '1' and cd.categories_id = '" $parent_id "'";
     
$category_query xtDBquery($category_query);
     
$category xtc_db_fetch_array($category_query,true);
     
$category_tree_array[] = array('id' => $parent_id'text' => $category['categories_name']);
   }

   
$categories_query "select c.categories_id, cd.categories_name, c.parent_id from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.categories_id = cd.categories_id and cd.language_id = '" $_SESSION['languages_id'] . "' and c.parent_id = '" $parent_id "' and c.categories_status = '1' order by c.sort_order, cd.categories_name";
   
$categories_query xtDBquery($categories_query);
   while (
$categories xtc_db_fetch_array($categories_query,true)) {
   
$products_query"select p.products_id, pd.products_name, p.products_model from " TABLE_PRODUCTS" p, " TABLE_PRODUCTS_DESCRIPTION " pd, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c where p2c.products_id=p.products_id and p2c.categories_id='".$categories['categories_id']."' and p.products_id= pd.products_id and pd.language_id = '" $_SESSION['languages_id'] . "' and p.products_status = '1' order by pd.products_name";
   
$products_query=xtDBquery($products_query);
   
$product_array=array();
   while(
$products=xtc_db_fetch_array($products_query)){
   
$product_array[]= array('id'=>$products['products_id'],
   
'name'=>$products['products_name'],
   
'model'=>$products['products_model']);
   }

     
$SEF_link xtc_href_link(FILENAME_DEFAULTxtc_category_link($categories['categories_id'],$categories['categories_name']));

     if (
$exclude != $categories['categories_id'])
      
$category_tree_array[] = array('id' => $categories['categories_id'],
      
     'text' => $spacing $categories['categories_name'],
     'link'  => $SEF_link,
     'products'=>$product_array);
      
$category_tree_array get_category_tree($categories['categories_id'], $spacing '&nbsp;&nbsp;&nbsp;'$exclude$category_tree_arrayfalse$cPath);
   }
   return 
$category_tree_array;
 }





 if (
GROUP_CHECK == 'true') {
 
$group_check "and c.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
 }

 
$categories_query "select c.categories_image, c.categories_id, cd.categories_name FROM " TABLE_CATEGORIES " c left join "
      
TABLE_CATEGORIES_DESCRIPTION ." cd on c.categories_id = cd.categories_id WHERE c.categories_status = '1' and cd.language_id = ".$_SESSION['languages_id']
      .
" and c.parent_id = '0' ".$group_check." order by c.sort_order ASC";

 
// db Cache
 
$categories_query xtDBquery($categories_query);
 
$module_content = array();
 while (
$categories xtc_db_fetch_array($categories_query,true)) {
    
$products_query"select p.products_id, pd.products_name, p.products_model from " TABLE_PRODUCTS" p, " TABLE_PRODUCTS_DESCRIPTION " pd, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c where p2c.products_id=p.products_id and p2c.categories_id='".$categories['categories_id']."' and p.products_id= pd.products_id and pd.language_id = '" $_SESSION['languages_id'] . "' and p.products_status = '1' order by pd.products_name";
   
$products_query=xtDBquery($products_query);
   
$product_array=array();
   
$product_array=array();
   while(
$products=xtc_db_fetch_array($products_query)){
   
$product_array[]= array('id'=>$products['products_id'],
   
'name'=>$products['products_name'],
   
'model'=>$products['products_model']);
   }
   
$SEF_link xtc_href_link(FILENAME_DEFAULTxtc_category_link($categories['categories_id'],$categories['categories_name']));

   
$module_content[]=array('ID'  => $categories['categories_id'],
                           
'CAT_NAME'  => $categories['categories_name'],
                           
'CAT_IMAGE' => DIR_WS_IMAGES 'categories/' $categories['categories_image'],
                           
'CAT_LINK'  => $SEF_link,
   'PRODUCTS'=>$product_array,
   
   'SCATS'  => get_category_tree($categories['categories_id'], '',0));
 }

 
// if there's sth -> assign it
 
if (sizeof($module_content)>=1)
 {
 
$module_smarty->assign('language'$_SESSION['language']);
 
$module_smarty->assign('module_content',$module_content);
 
// set cache ID
 
if (!CacheCheck()) {
 
$module_smarty->caching 0;
 echo 
$module_smarty->fetch(CURRENT_TEMPLATE.'/module/sitemap.html');
 } else {
 
$module_smarty->caching 1;
 
$module_smarty->cache_lifetime=CACHE_LIFETIME;
 
$module_smarty->cache_modified_check=CACHE_CHECK;
 
$cache_id $GET['cPath'].$_SESSION['language'].$_SESSION['customers_status']['customers_status_name'].$_SESSION['currency'];
 echo 
$module_smarty->fetch(CURRENT_TEMPLATE.'/module/sitemap.html',$cache_id);
 }
 }
?>


Nun musst Du noch im Template bei der sitemap.html
{debug}
reinschreiben, damit Du weisst, wie die neuen Variablen heißen. (Es geht ein popup auf)
Dann noch die Produkte irgendwie mit smarty ausgeben.

Gruppenchek, ab 18 Kontrolle usw. fehlen.
Gespeichert

web334

  • Gast
Re: Sitemap erstellen
« Antwort #2 am: 24 November, 2007, 19:43:33 Nachmittag »

Vielen herzlichen dank für deine Unterstützung.
Ich werde mich mal daran versuchen
Wünsche dir noch ein schönes Wochenende und noch ein dickes Danke
Gespeichert