1.修改 admin/featured.php <?php case 'pre_add_confirmation': // check for blank or existing featured $pre_add_products_id=$_POST['pre_add_products_id']; $pre_add_products_id2=explode(',',$pre_add_products_id); foreach($pre_add_products_id2 as $key=>$val) { $sql = "select products_id from " . TABLE_PRODUCTS . " where products_id='" . (int)$val . "'"; $check_featured = $db->Execute($sql); if ($check_featured->RecordCount() == 1) { $sql = "select products_id from " . TABLE_FEATURED . " where products_id='" . (int)$val . "'"; $check_featured = $db->Execute($sql); if ($check_featured->RecordCount() < 1) { // add empty featured $featured_date_available = ((zen_db_prepare_input($_POST['start']) == '') ? '0001-01-01' : zen_date_raw($_POST['start'])); $expires_date = ((zen_db_prepare_input($_POST['end']) == '') ? '0001-01-01' : zen_date_raw($_POST['end'])); $products_id = zen_db_prepare_input($val); $db->Execute("insert into " . TABLE_FEATURED . " (products_id, featured_date_added, expires_date, status, featured_date_available) values ('" . (int)$products_id . "', now(), '" . zen_db_input($expires_date) . "', '1', '" . zen_db_input($featured_date_available) . "')"); } } } break; ?>
function zen_set_field_length_1000($max=50, $override=false) { $field_length= 1000; switch (true) { case (($override == false and $field_length > $max)): $length= 'size = "' . ($max+1) . '" maxlength= "' . $field_length . '"'; break; default: $length= 'size = "' . ($field_length+1) . '" maxlength = "' . $field_length . '"'; break; } return $length; }
|