View Single Post
  #15  
Old 01-25-2006, 12:19 PM
 
sandersdesign sandersdesign is offline
 

Member
  
Join Date: Oct 2005
Posts: 26
 

Default

hi, I seem to be having problems with implementing this mod. please visit http://www.digi-quick.com/error_message.php?access_denied&id=33


home.tpl
Code:
<?php if ($active_modules["Random_Products"]) include $xcart_dir."/modules/Random_Products/random.php"; ?> {include file="modules/Random_Products/random.tpl"} {include file="modules/Random_Products/random_image.tpl"}


random.php
Code:
<?php # # $Id: random.php,v 1.00.0.0 0 TelaFirma $ # # Random Products # if (!defined('XCART_SESSION_START')) { header("Location: ../../"); die("Access denied"); } if (!is_numeric($config["Modules"]["number_of_randomproducts"])) $config["Modules"]["number_of_randomproducts"] = 0; # # Get products data for current category and store it in an array # $cat = intval($cat); if ($cat) { $category_data = func_query_first("SELECT categoryid_path FROM $sql_tbl[categories] USE INDEX (PRIMARY) WHERE categoryid='$cat'"); $result = func_query("SELECT categoryid FROM $sql_tbl[categories] USE INDEX (pam) WHERE categoryid_path LIKE '$category_data[categoryid_path]/%' AND avail='Y'"); $cat_ids = array(); if (is_array($result)) { foreach($result as $k=>$v) { $cat_ids[] = $v["categoryid"]; } } else $cat_ids[] = $cat; $str = " AND $sql_tbl[products_categories].categoryid IN (".implode(",", $cat_ids).")"; } $order_by = "RAND()"; $search_query = $str; # # Search the products # $randoms = func_search_products($search_query, @$user_account["membership"], $order_by, $config["Modules"]["number_of_randomproducts"]); $smarty->assign("r_products",$randoms); ?>


random.tpl

Code:
{capture name=dialog} {if $r_products ne ""} {include file="customer/main/products.tpl" products=$r_products} {/if} {/capture} {include file="dialog.tpl" content=$smarty.capture.dialog extra="width=100%"}

random_image.tpl
Code:
{assign var="rand" value="0"|mt_rand:"`$config.Modules.number_of_randomproducts-1`"} {$r_products[$rand].product} <a href=product.php?productid={$r_products[$rand].productid}> {include file="product_thumbnail.tpl" productid=$r_products[$rand].productid image_x=$config.Appearance.thumbnail_width product=$r_products[$rand].product tmbn_url=$r_products[$rand].tmbn_url}</a>
__________________
www.sandersdesign.net
X-Cart Gold v4.0.16, Unix
Reply With Quote