$CONSTANTS[REF_WHATS_NEW], __status => "dealer", __filter => "dealer", __limit => $CONSTANTS[WHATS_NEW_COUNT], __rows => 1, __order => "rand", ) ); } else { $tmp0 = get_feature_items( array( ref_feature => $CONSTANTS[REF_WHATS_NEW], ref_status => $CONSTANTS[ITEM_ENABLE], __filter => "available", __limit => $CONSTANTS[WHATS_NEW_COUNT], __rows => 1, __order => "rand", ) ); } if (!is_array($tmp0)) { if ($account[ref_account_group] == $CONSTANTS[DEALER_GROUP]) { $tmp0 = get_items( array( __status => "dealer", __filter => "1", __category_filter => "dealer", __order => "rand", __limit => $CONSTANTS[WHATS_NEW_COUNT], ) ); } else { $tmp0 = get_items( array( ref_status => $CONSTANTS[ITEM_ENABLE], __filter => "1", __category_filter => "available", __order => "rand", __limit => $CONSTANTS[WHATS_NEW_COUNT], ) ); } } if (is_array($tmp0)) { $form_ = create_mcolumn_list($form, array(col_count => $CONSTANTS[WHATS_NEW_COLUMNS])); $tmp0_ = create_mrows_list($tmp0, array(col_count => $CONSTANTS[WHATS_NEW_COLUMNS], "print_box" => "print_whats_new_box", "print_box2" => "print_whats_new_box_empty")); $form_[rows] = $tmp0_; $rec[whats_new] = print_list_form($form_, "fetch"); } # Special List if ($account[ref_account_group] == $CONSTANTS[DEALER_GROUP]) { $tmp1 = get_feature_items( array( ref_feature => $CONSTANTS[REF_SPECIAL], __status => "dealer", __filter => "dealer", __limit => $CONSTANTS[SPECIAL_COUNT], __rows => 1, __order => "rand" ) ); } else { $tmp1 = get_feature_items( array( ref_feature => $CONSTANTS[REF_SPECIAL], ref_status => $CONSTANTS[ITEM_ENABLE], __filter => "available", __limit => $CONSTANTS[SPECIAL_COUNT], __rows => 1, __order => "rand" ) ); } if (!is_array($tmp1)) { if ($account[ref_account_group] == $CONSTANTS[DEALER_GROUP]) { $tmp1 = get_items( array( __status => "dealer", __filter => "1", __category_filter => "dealer", __order => "rand", __limit => $CONSTANTS[SPECIAL_COUNT] ) ); } else { $tmp1 = get_items( array( ref_status => $CONSTANTS[ITEM_ENABLE], __filter => "1", __category_filter => "available", __order => "rand", __limit => $CONSTANTS[SPECIAL_COUNT] ) ); } } if (is_array($tmp1)) { $form1_ = create_mcolumn_list($form1, array(col_count => $CONSTANTS[SPECIAL_COLUMNS])); $tmp1_ = create_mrows_list($tmp1, array(col_count => $CONSTANTS[SPECIAL_COLUMNS], "print_box" => "print_special_box", "print_box2" => "print_special_box_empty")); $form1_[rows] = $tmp1_; $rec[special] = print_list_form($form1_, "fetch"); } $tmp2 = get_news_list(array(ref_news_status => $CONSTANTS[NEWS_ACTIVE], __limit => $CONSTANTS[NEWS_INDEX_COUNT], __rows => 1)); if (is_array($tmp2)) { $form2_ = create_mcolumn_list($form2, array(col_count => $CONSTANTS[NEWS_INDEX_COLUMNS])); $tmp2_ = create_mrows_list($tmp2, array(col_count => $CONSTANTS[NEWS_INDEX_COLUMNS], "print_box" => "print_news_box", "print_box2" => "print_news_box_empty")); $form2_[rows] = $tmp2_; $rec[news] = print_list_form($form2_, "fetch"); } $tmp3 = get_content(array("id" => $CONSTANTS[CONTENT_STOP_WORRY_INDEX]), array()); if (is_array($tmp3)) { $rec[stop_worry] = parse_file("stop_worry.tpl", $tmp3); } else { $rec[stop_worry] = ""; } return parse_file("default.tpl", $rec); } function print_whats_new_box($rec) { global $CONSTANTS, $http_path, $img_path, $account; // $rec[link_http] = "product-".replace_name($rec[name])."-".$rec[id].".html"; if ($rec[link_http]) { if (!file_exists($rec[link_http])) { $rec[link_http] = "$http_path/item.php?id=$rec[id]"; } else { $rec[link_http] = urlencode($rec[link_http]); } } else { $rec[link_http] = "$http_path/item.php?id=$rec[id]"; } if ($rec[price] || ($account[ref_account_group] == $CONSTANTS[DEALER_GROUP])) { if ($rec[ref_image]) { $item_tpl = "whats_new_list_price_col1.tpl"; } else { $item_tpl = "whats_new_list_price_col1_noimage.tpl"; } } else { if ($rec[ref_image]) { $item_tpl = "whats_new_list_col1.tpl"; } else { $item_tpl = "whats_new_list_col1_noimage.tpl"; } } $rec[count] = $CONSTANTS[DEFAULT_ITEM_QTY]; return print_item_box($rec, $item_tpl); } function print_whats_new_box_empty($rec) { $tpl = define_tpl(array(main => "whats_new_list_col2.tpl")); return print_tpl($tpl, "fetch"); } function print_special_box($rec) { global $CONSTANTS, $http_path, $img_path, $account; if ($rec[link_http]) { if (!file_exists($rec[link_http])) { $rec[link_http] = "$http_path/item.php?id=$rec[id]"; } else { $rec[link_http] = urlencode($rec[link_http]); } } else { $rec[link_http] = "$http_path/item.php?id=$rec[id]"; } // $rec[link_http] = "product-".replace_name($rec[name])."-".$rec[id].".html"; if ($rec[price] || ($account[ref_account_group] == $CONSTANTS[DEALER_GROUP])) { if ($rec[ref_image]) { $item_tpl = "special_list_price_col1.tpl"; } else { $item_tpl = "special_list_price_col1_noimage.tpl"; } } else { if ($rec[ref_image]) { $item_tpl = "special_list_col1.tpl"; } else { $item_tpl = "special_list_col1_noimage.tpl"; } } $rec[count] = $CONSTANTS[DEFAULT_ITEM_QTY]; return print_item_box($rec, $item_tpl); } function print_special_box_empty($rec) { $tpl = define_tpl(array(main => "special_list_col2.tpl")); return print_tpl($tpl, "fetch"); } function print_news_box($rec) { global $CONSTANTS, $http_path, $img_path, $account; $tpl = define_tpl(array(main => "news_list_col1.tpl")); if ($rec[ref_image]) { $rec[image] = parse_file("news_list_img.tpl", $rec); } else { $rec[image] = ""; } foreach ($rec as $key => $value) { $key_ = strtoupper($key); $tpl->assign(array($key_ => $value)); } return print_tpl($tpl, "fetch"); } function print_news_box_empty($rec) { $tpl = define_tpl(array(main => "news_list_col2.tpl")); return print_tpl($tpl, "fetch"); } ?>