View Single Post
  #18  
Old 08-02-2004, 06:18 AM
 
mikea93449 mikea93449 is offline
 

Member
  
Join Date: Jul 2004
Posts: 22
 

Default

Hi Carrie,
Thank you for the mod, but I can't seem to get it working. Here is the complete code that I currently have for categories.tpl (including your mod):

Code:
{* $Id: categories.tpl,v 1.19.2.1 2004/03/16 12:12:16 svowl Exp $ *} {capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} {else} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} <font class=CategoriesList>{$categories[cat_num].category_name}</font> {/section} {else} {section name=cat_num loop=$subcategories} <font class=CategoriesList>{$subcategories[cat_num].category_name}</font> {/section} {* BCSE Begin *} {section name=super_idx loop=$super_subcategory} <font class=CategoriesList>{$super_subcategory[super_idx].category_name}</font> {/section} {* BCSE End *} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }

And here is the code I have currently for categories.php (including your mod). This was found in htdocs/admin. There wasn't a categories.php in the customer directory so I hope I modified the right one.

Code:
# # $Id: categories.php,v 1.18.2.3 2004/03/09 09:13:26 svowl Exp $ # require "./auth.php"; require $xcart_dir."/include/security.php"; require $xcart_dir."/include/categories.php"; if (empty($mode)) $mode = ""; # # Counts products and subcategories # if (is_array(@$subcategories)) { $smarty->assign("subcategories",$subcategories); } # # Ajust category_location array # if (is_array(@$category_location)) { reset($category_location); while(list($key,$cat_loc) = each($category_location)) $category_location[$key][1] = str_replace("home.php","categories.php",$category_location[$key][1]); if(!empty($current_category)) $location = $category_location; } # BCSE Begin if(empty($subcategories)) { $pos=strpos($current_category["category"],"/"); while(!$pos===false) { $previous_pos=$pos; $pos=strpos($current_category["category"],"/",$pos+1); } $parent = substr($current_category["category"],0,($previous_pos+$pos)); if (!empty($parent)) $cur_dir_len = strlen($parent); foreach($all_categories as $all_category) { $category=$all_category["category"]; if(!strstr($category,"/")) { $categories[]=$all_category; if(empty($parent)) { $super_subcategories[]=$all_category; } } if(!empty($parent) and substr($category,0,$cur_dir_len+1) == $parent."/" and $category!=$parent) { if(!strstr(substr($category,$cur_dir_len+1),"/")) { $all_category["category"]=ereg_replace("^.*/","",$all_category["category"]); $super_subcategories[]=$all_category; } } } if(!empty($super_subcategories)) { $smarty->assign("super_subcategory",$super_subcategories); } } # BCSE End # FEATURED PRODUCTS $f_cat = (empty ($cat) ? "0" : $cat); if ($REQUEST_METHOD=="POST") { while(list($key,$val)=each($HTTP_POST_VARS)) { if (strstr($key,"-")) { list($field,$productid)=split("-",$key); if ($field=="avail") $val="Y"; db_query("update $sql_tbl[featured_products] set avail='N', $field='$val' where productid='$productid' AND categoryid='$f_cat'"); } } if ($newproductid!="") { $newavail=($newavail=="on" ? "Y" : "N"); if ($neworder=="") { $maxorder = array_pop(func_query_first("select max(product_order) from $sql_tbl[featured_products] WHERE categoryid='$f_cat'")); $neworder=$maxorder+1; } if (func_query_first("select productid from $sql_tbl[products] where productid='$newproductid'") and array_pop(func_query_first("SELECT COUNT(*) FROM $sql_tbl[featured_products] WHERE productid='$newproductid' AND categoryid='$f_cat'")) == 0) db_query("insert into $sql_tbl[featured_products] (productid, product_order, avail, categoryid) values ('$newproductid','$neworder','$newavail', '$f_cat')"); } func_header_location("categories.php?cat=$cat"); } if ($mode == "delete") { db_query ("DELETE FROM $sql_tbl[featured_products] WHERE productid='$productid' AND categoryid='$f_cat'"); func_header_location("categories.php?cat=$cat"); } $products = func_query ("SELECT $sql_tbl[featured_products].productid, $sql_tbl[products].product, $sql_tbl[featured_products].product_order, $sql_tbl[featured_products].avail from $sql_tbl[featured_products], $sql_tbl[products] where $sql_tbl[featured_products].productid=$sql_tbl[products].productid AND $sql_tbl[featured_products].categoryid='$f_cat' order by $sql_tbl[featured_products].product_order"); $smarty->assign ("products", $products); $smarty->assign ("f_cat", $f_cat); $smarty->assign("location",@$location); $smarty->assign("main","categories"); @include $xcart_dir."/modules/gold_display.php"; $smarty->display("admin/home.tpl"); ?>

Can you see anything I have done wrong?

Thanks again for looking into this .

Mike
Reply With Quote