|
8#
楼主 |
发表于 2010-6-22 15:51:52
|
只看该作者
<?php
if (!defined('IN_CONTEXT')) die('access violation error!');
$cols = $p_cols;
?>
<div class="newprod">
<div class="newprod_top"></div>
<div class="newprod_con">
<script type="text/javascript" language="javascript">
<!--
function updatecartstate(response) {
var o_result = _eval_json(response);
if (!o_result) {
return addprodfailed(response);
}
if (o_result.result == "ERROR") {
alert(o_result.errmsg);
return false;
} else if (o_result.result == "OK") {
$("#disp_n_prds").html(o_result.n_prds);
alert("<?php _e('The product has been added to cart!'); ?>");
return true;
} else {
return on_failure(response);
}
}
function addprodfailed(response) {
alert("<?php _e('Request failed!'); ?>");
return false;
}
function add2cart(p_id) {
var p_num = document.getElementById("prod_num_" + p_id).value;
_ajax_request("mod_cart", "addtocart",
{ p_id: p_id, p_num: p_num }, updatecartstate, addprodfailed);
}
//-->
</script>
<?php
$n_prd = sizeof($products);
if ($n_prd > 0){
?>
<table class="media_grid" cellspacing="4" width="100%">
<?php
for ($i = 0; $i < $n_prd; $i++) {
if ($i % $cols == 0) {
echo '<tr>';
}
?>
<td>
<div class="newprod_list">
<div class="newprod_pic"><a href="<?php echo $products[$i]->feature_img; ?>" class="thickbox"><img src="<?php echo $products[$i]->feature_smallimg;?>" /></a></div>
<div class="newprod_xx" onclick="location.href='index.php?<?php echo Html::xuriquery('mod_product', 'view', array('p_id' => $products[$i]->id)); ?>'"></div>
<div class="newprod_name"><a href="index.php?<?php echo Html::xuriquery('mod_product', 'view', array('p_id' => $products[$i]->id)); ?>" target="_blank"><?php echo $products[$i]->name?></a></div>
</div> </td>
<?php
if (($i % $cols) == ($cols - 1)) {
echo '</tr>';
}
}
if ($i % $cols != 0) {
for ($j = 0; $j < ($cols - $i); $j++) {
echo '<td width="'.intval(100 / $cols).'%"> </td>';
}
echo '</tr>';
}
?>
</table>
<?php } ?>
</div>
<div class="list_bot"></div>
</div>
<div class="blankbar"></div>
这个是 现在模板的代码,你帮的看一下。太出口免费、
谢谢了, |
|