Werbung / Banner buchen
Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: 2. Kategoriebox erstellen

    Hot-Tips

    • Frisch an Board
    • Beiträge: 94
    2. Kategoriebox erstellen
    Antwort #45 am: 15. Mai 2010, 18:27:46
    Code: PHP  [Auswählen]
    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: xtc_show_category.inc.php 1262 2005-09-30 10:00:32Z mz $

       XT-Commerce - community made shopping
       <a target="_blank" href="http://www.%28%28%20Wir%20dulden%20keine%20kommerziellen%20Werbelinks%20-%20Bitte%20Forenregeln%20beachten%21%20%29%29" rel="nofollow">http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte Forenregeln beachten! ))</a>

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(categories.php,v 1.23 2002/11/12); <a target="_blank" href="http://www.oscommerce.com" rel="nofollow">http://www.oscommerce.com</a>
       (c) 2003      nextcommerce (xtc_show_category.inc.php,v 1.4 2003/08/13); <a target="_blank" href="http://www.nextcommerce.org" rel="nofollow">http://www.nextcommerce.org</a>

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


    function xtc_show_category_section($counter) {
            global $foo, $categories_section_string, $id;

        // image for first level
        $img_1='<img src="templates/'.CURRENT_TEMPLATE.'/img/icon_arrow_02.gif" alt="" /> ';

            for ($a=0; $a<$foo[$counter]['level']; $a++) {

          if ($foo[$counter]['level']=='1') {
          $categories_section_string .= " - ";
          }

        }
            if ($foo[$counter]['level']=='') {
                    if (strlen($categories_section_string)=='0') {
                            $categories_section_string .='<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td valign="top" class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">';
                    } else {
                            $categories_section_string .= '</td></tr></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td valign="top" class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">';
                    }
                            $categories_string .= $img_1;
                    if (trim($foo[$counter]['name']) != '' ) $categories_section_string .= '<b><a class="cat" href="';
            } else {
                    if (trim($foo[$counter]['name']) != '' ) $categories_section_string .= '<a  href="';
            }

            $cPath_new=xtc_category_link($counter,$foo[$counter]['name']);

            if (trim($foo[$counter]['name']) != '' ) {
                    $categories_section_string .= xtc_href_link(FILENAME_DEFAULT, $cPath_new);
                    $categories_section_string .= '">';
        }

             Anzeigen der Kategoriebezeichnung
            if ($foo[$counter]['level']=='1') {
                    $categories_section_string .= ' - ';
            }

            $categories_section_string .= $foo[$counter]['name'];

            if ( ($id) && (in_array($counter, $id)) ) {
                            $categories_section_string .= '</b><b>';
            }

            if (SHOW_COUNTS == 'true') {
                    $products_in_category = xtc_count_products_in_category($counter);
                    if ($products_in_category> 0) {
                            if (trim($foo[$counter]['name']) != '' ) $categories_section_string .= ' (' . $products_in_category . ')';
                    }
            }

            if ($foo[$counter]['level']=='') {
                    if (trim($foo[$counter]['name']) != '' ) $categories_section_string .= '</a>';
            } else {
                    if (trim($foo[$counter]['name']) != '' ) $categories_section_string .= '</a>';
                    if ($foo[$counter]['level']=='1') {
                            $categories_section_string .='';
                    }
            }

            if ($foo[$counter]['next_id']) {
                    xtc_show_category_section($foo[$counter]['next_id']);
            } else {
                    $categories_section_string .= '</td></tr></table>';
            }
    }
    ?></b>

    Hot-Tips

    • Frisch an Board
    • Beiträge: 94
    2. Kategoriebox erstellen
    Antwort #46 am: 15. Mai 2010, 19:08:22
    Wenn die nicht funktioniert, dann musst Du selber mal schauen, bzw. schauen lassen, wo das Problem liegt!

    Code: PHP  [Auswählen]
    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: xtc_show_category.inc.php 1262 2005-09-30 10:00:32Z mz $

       XT-Commerce - community made shopping
       <a target="_blank" href="http://www.%28%28%20Wir%20dulden%20keine%20kommerziellen%20Werbelinks%20-%20Bitte%20Forenregeln%20beachten%21%20%29%29" rel="nofollow">http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte Forenregeln beachten! ))</a>

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(categories.php,v 1.23 2002/11/12); <a target="_blank" href="http://www.oscommerce.com" rel="nofollow">http://www.oscommerce.com</a>
       (c) 2003      nextcommerce (xtc_show_category.inc.php,v 1.4 2003/08/13); <a target="_blank" href="http://www.nextcommerce.org" rel="nofollow">http://www.nextcommerce.org</a>

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


    function xtc_show_category_section($counter) {
            global $foo, $categories_section_string, $id;

        // image for first level
        $img_1='<img src="templates/'.CURRENT_TEMPLATE.'/img/icon_arrow_02.gif" alt="" /> ';

            for ($a=0; $a<$foo[$counter]['level']; $a++) {

          if ($foo[$counter]['level']=='1') {
          $categories_section_string .= " - ";
          }

        }
            if ($foo[$counter]['level']=='') {
                    if (strlen($categories_section_string)=='0') {
                            $categories_section_string .='<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td valign="top" class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">';
                    } else {
                            $categories_section_string .= '</td></tr></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td valign="top" class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">';
                    }

                            $categories_string .= $img_1;
                    if (trim($foo[$counter]['name']) != '' ) $categories_section_string .= '<b><a class="cat" href="';
            } else {
                    if (trim($foo[$counter]['name']) != '' ) $categories_section_string .= '<a  href="';
            }

            $cPath_new=xtc_category_link($counter,$foo[$counter]['name']);

            if (trim($foo[$counter]['name']) != '' ) {
                    $categories_section_string .= xtc_href_link(FILENAME_DEFAULT, $cPath_new);
                    $categories_section_string .= '">';
            }
            if ( ($id) && (in_array($counter, $id)) ) {
          $categories_section_string .= '</b><b>';
        }

             //Anzeigen der Kategoriebezeichnung
            $categories_section_string .= $foo[$counter]['name'];

        if ( ($id) && (in_array($counter, $id)) ) {
          $categories_section_string .= '</b>';
        }

        if ($foo[$counter]['level']=='') {
        $categories_section_string .= '</a>';
        } else {
        $categories_section_string .= '</a>';
        }

            if (SHOW_COUNTS == 'true') {
                    $products_in_category = xtc_count_products_in_category($counter);
                    if ($products_in_category> 0) {
                            if (trim($foo[$counter]['name']) != '' ) $categories_section_string .= ' (' . $products_in_category . ')';
                    }
            }

            $categories_section_string .= '</tr><tr><td><img height="1" src="templates/'.CURRENT_TEMPLATE.'/img/pixel_trans.gif" alt="" />';

            if ($foo[$counter]['next_id']) {
                    xtc_show_category_section($foo[$counter]['next_id']);
            } else {
                    $categories_section_string .= '</td></tr></table>';
            }
    }

    ?>

    monozwerg

    • Neu im Forum
    • Beiträge: 16
    2. Kategoriebox erstellen
    Antwort #47 am: 15. Mai 2010, 19:37:32
    jetzt ist der pfeil komplett weg..hmmm schon komisch kann doch jezt nur noch an der verlinkung liegen, kann ich das bild nicht einfach neu verlinken?

    xarnu

    • Mitglied
    • Beiträge: 128
    2. Kategoriebox erstellen
    Antwort #48 am: 17. September 2010, 05:07:10
    Ich möchte auch eine zweite Kategoriebox erstellen und komme mit meinem gekauftem Script nicht weiter.

    Die erste Box klappt soweit SUPER, nur die zweite Box macht mir probs.
    Kann mir einer Hilfestellung bei den beiden Scripten geben?

    xtc_show_category_dyna_section.inc.php:

    Code: PHP  [Auswählen]
    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: xtc_show_category.inc.php 1262 2005-09-30 10:00:32Z mz $

       XT-Commerce - community made shopping
       http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte <a href="index.php?topic=3013.0">Forenregeln</a> beachten! ))

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(categories.php,v 1.23 2002/11/12); www.oscommerce.com
       (c) 2003      nextcommerce (xtc_show_category.inc.php,v 1.4 2003/08/13); www.nextcommerce.org

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


            function show_category_dyna($cat){
                    //require_once (DIR_FS_INC.'xtc_get_category_path.inc.php');
                    $active_cat = '';
                    if (isset ($_GET['cat'])) {
                            $site = explode('_', $_GET['cat']);
                            $cID = $site[0];
                            $cID = str_replace('c', '', $cID);
                            $cPath_old = xtc_get_category_path($cID);
                            $active_cat = explode('_', $cPath_old);
                    } elseif (xtc_not_null($_GET['cPath'])) {
                            $cPath_array = explode("_",$_GET['cPath']);
                            $active_cat = $cPath_array[(sizeof($cPath_array) - 1)];
                    } else {
                            $active_cat = 0;
                    }
                    // top level
                    $string ="";
                    $get_level_number=0;
                    if (isset ($_GET['info'])) {
                            $product = explode('_', $_GET['info']);
                            $pID = $product[0];
                            $pID = str_replace('p', '', $pID);
                            $cat_query = xtc_db_query("SELECT categories_id FROM ".TABLE_PRODUCTS_TO_CATEGORIES." WHERE products_id='".(int) $pID."' and categories_id != '0'");
                            $catData = xtc_db_fetch_array($cat_query);
                            if ($catData['categories_id'])
                                    $active_cat = $catData['categories_id'];
                    }
                    for($i=0; $i <count($cat->Subcategories);$i++){
                            if(count($cat->Subcategories[$i]->Subcategories)> 0){
                                    $string .= '<div class="menuitem submenuheader">' . $cat->Subcategories[$i]->Name.'</div>';
                                    $string .= '<div class="submenu">';
                                    $string .= display_subcategories($cat->Subcategories[$i]->Subcategories,$active_cat);
                                    $string .= "</div>";
                                    $get_level_number++;
                            }
                            else{
                                    // no subcategory, display link
                                    $products_in_category = xtc_count_products_in_category($cat->Subcategories[$i]->Categories_ID);
                            if ($products_in_category> 0) {
                                            $cPath_new = xtc_category_link($cat->Subcategories[$i]->Categories_ID,
                                                    $cat->Subcategories[$i]->Name);

                                            if ($cID == $cat->Subcategories[$i]->Categories_ID)
                                                    $link =  '<a class="menuitem_active" href="' . xtc_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
                                            else
                                                    $link =  '<a class="menuitem" href="' . xtc_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
                                            $string .= $link . $cat->Subcategories[$i]->Name . "</a>";
                            }
                            }
                    }
                    return $string;
            }
            function display_subcategories($cats,$active_cat){
                    $retstring = "";
                    foreach($cats as $subcat){
                            if(count($subcat->Subcategories)> 0){
                                    $retstring .= '<div class="submenuitem subsubmenuheader">' . $subcat->Name.'</div>';
                                    $retstring .= '<div class="subsubmenu">';
                                    $retstring .= display_subsubcategories($subcat->Subcategories,$active_cat);
                                    $retstring .= "</div>";
                                    $get_level_number++;
                            } else {
                                    $products_in_category = xtc_count_products_in_category($subcat->Categories_ID);
                            if ($products_in_category> 0) {
                                            $cPath_new = xtc_category_link($subcat->Categories_ID,$subcat->Name);
                                            if ($active_cat == $subcat->Categories_ID)
                                                    $link =  '<a class="menuitem_active" href="' . xtc_href_link(FILENAME_DEFAULT, $cPath_new) . '">';// Wenn aktuelle Kategorie gleich der Kategorie in der Anzeige ist
                                            else
                                                    $link =  '<a href="' . xtc_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
                                            $retstring .= "" . $link . $subcat->Name . "</a>";
                            }
                            }
                    }
                    return $retstring;
            }
            function display_subsubcategories($cats,$active_cat){
                    $retstring = "";
                    foreach($cats as $subcat){
                            $products_in_category = xtc_count_products_in_category($subcat->Categories_ID);
                            if ($products_in_category> 0) {
                            $cPath_new = xtc_category_link($subcat->Categories_ID,$subcat->Name);

                            if ($active_cat == $subcat->Categories_ID)
                                    $link =  '<a class="menuitem_active"  href="' . xtc_href_link(FILENAME_DEFAULT, $cPath_new) . '">';// Wenn aktuelle Kategorie gleich der Kategorie in der Anzeige ist
                            else
                                    $link =  '<a href="' . xtc_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
                            $retstring .= "" . $link . $subcat->Name . "</a>";
                            }
                    }
                    return $retstring;
            }

    ?>
     
    und meine dyna_categories_section.php

    Code: PHP  [Auswählen]
    <?php

    /* -----------------------------------------------------------------------------------------
       $Id: categories.php 1302 2005-10-12 16:21:29Z mz $  

       XT-Commerce - community made shopping
       http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte <a href="index.php?topic=3013.0">Forenregeln</a> beachten! ))

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(categories.php,v 1.23 2002/11/12); www.oscommerce.com
       (c) 2003      nextcommerce (categories.php,v 1.10 2003/08/17); www.nextcommerce.org

       Released under the GNU General Public License
       -----------------------------------------------------------------------------------------
       Third Party contributions:
       Enable_Disable_Categories 1.3                Autor: Mikel Williams | mikel@ladykatcostumes.com

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


    class Category{
            var $Name;
            var $Categories_ID;
            var $Subcategories = array();
            function Category($name, $id){
                    $this->Name = $name;
                    $this->Categories_ID = $id;

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

                    // lookup Subcategories
                    $tmpquery = "SELECT c.categories_id, cd.categories_name FROM ".TABLE_CATEGORIES." c, "
                  .TABLE_CATEGORIES_DESCRIPTION." cd WHERE c.categories_status = '1' and c.section = '1' and c.parent_id = '"
                            .$this->Categories_ID ."' ".$group_check." and c.categories_id = cd.categories_id and cd.language_id='"
                            .$_SESSION['languages_id']."' order by sort_order, cd.categories_name";
                    $tmpresult = xtc_db_query($tmpquery);
                    while($tmpdata = xtc_db_fetch_array($tmpresult)){
                            $this->Subcategories[] = new Category($tmpdata['categories_name'], $tmpdata['categories_id']);
                    }
            }
    }

    $start = microtime();
    $box_smarty = new smarty;
    $box_content = '';

    $box_smarty->assign('language', $_SESSION['language']);
    // set cache ID
    if (!CacheCheck()) {
            $cache=false;
            $box_smarty->caching = 0;
    } else {
            $cache=true;
            $box_smarty->caching = 1;
            $box_smarty->cache_lifetime = CACHE_LIFETIME;
            $box_smarty->cache_modified_check = CACHE_CHECK;
            $cache_id = $_SESSION['language'].$_SESSION['customers_status']['customers_status_id'].$cPath;
    }

    if(!$box_smarty->is_cached(CURRENT_TEMPLATE.'/boxes/box_categories.html', $cache_id) || !$cache){
            $box_smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/');

            // include needed functions
            require_once (DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/source/inc/xtc_show_category_dyna.inc.php');
            require_once (DIR_FS_INC.'xtc_has_category_subcategories.inc.php');
            require_once (DIR_FS_INC.'xtc_count_products_in_category.inc.php');

            $tree = new Category("ROOT",0);
            $categories_string .= show_category_dyna($tree);
            //$categories_string .= "";
            $box_smarty->assign('BOX_CONTENT', $categories_string);

            // set cache ID
            if (!$cache) {
                    $box_categories = $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_categories_section.html');
            } else {
                    $box_categories = $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_categories_section.html', $cache_id);
            }
    }
    $smarty->assign('box_CATEGORIES', $box_categories);
    ?>
     

    xarnu

    • Mitglied
    • Beiträge: 128
    2. Kategoriebox erstellen
    Antwort #49 am: 18. September 2010, 15:23:40
    Hab's hinbekommen.

    gero01

    • Mitglied
    • Beiträge: 239
    2. Kategoriebox erstellen
    Antwort #50 am: 06. Februar 2011, 13:50:27

    hmpf99

    • Fördermitglied
    • Beiträge: 76
    2. Kategoriebox erstellen
    Antwort #51 am: 30. März 2011, 09:33:28
    Hallo und guten Tag!

    Ich habe das Modul gerade eingebaut und bekomme die neue Box auch auf der Startseite angezeigt. Was mir aber noch fehlt, ist die Anzeige im Admin.

    Wo kann ich denn jetzt eine Kategorie in die 2. Box umsetzen?

    Happy Day und Dank, Frank

    w4t3r

    • Frisch an Board
    • Beiträge: 61
    Re: 2. Kategoriebox erstellen
    Antwort #52 am: 21. April 2012, 16:25:16
    Hi,

    danke für das Super script, ist es noch möglich für die einzelnen Kategorien verschiedene Hintergrundbilder im Header der Kateogriebox zu nutzen?

    mfg

    w4t3r

    • Frisch an Board
    • Beiträge: 61
    Re: 2. Kategoriebox erstellen
    Antwort #53 am: 26. April 2012, 20:18:04
    hm kann mir da keiner helfen?

    Zoralina

    • Neu im Forum
    • Beiträge: 11
    Re: 2. Kategoriebox erstellen
    Antwort #54 am: 15. November 2012, 15:34:52
    hallo, ich habe die Dateien ergänzt/ hochgeladen.
    Im Admin unter Kategorien- und Artikelverwaltung kann ich bei den Kategorien nun aussuchen, ob eine neue Kategorie "Standard" oder "Sektion 1" sein soll. Leider wird die Auswahl hier nicht gespeichert (alle anderen Optionen der Kategorieverwaltung kann ich dort schon ändern). Was kann das sein?

    danke und Gruß

    Zoralina

    • Neu im Forum
    • Beiträge: 11
    Re: 2. Kategoriebox erstellen
    Antwort #55 am: 15. November 2012, 17:23:31
    sorry, hab es selbst hingekriegt...
    54 Antworten
    32722 Aufrufe
    03. Mai 2017, 21:22:04 von Knut
    0 Antworten
    1887 Aufrufe
    12. Oktober 2011, 10:30:12 von wilite
    0 Antworten
    1975 Aufrufe
    11. April 2011, 12:34:02 von m1
    2 Antworten
    3141 Aufrufe
    09. Juni 2011, 19:37:53 von RossiRat