Hola.
Me gustaria saber como podria cambiar de tamaño las imagenes cuando se suban al servidor y tambien como crear miniaturas.
El codigo que recoge los datos del formulario es el siguiente:
Código PHP:
Ver original<?php
global $upload_folder_path;
if(!$current_user->data->ID)
{
wp_redirect(get_settings('home').'/index.php?page=login');
}
global $wpdb,$General;
//$_SESSION['ads_information_session'] = '';
$user_path = $_POST['hidden_image'];
$hidden_image = $_POST['hidden_image'];
foreach($_POST as $key=>$val)
{
}
if(count($_FILES['images']['name'])>0) {
$generalinfo = $General->get_general_settings();
if($generalinfo['imagepath'])
{
$imagepath = $generalinfo['imagepath'];
}else
{
$imagepath = 'products_img';
}
$destination_path = ABSPATH . "$upload_folder_path".$imagepath."/";
{
$imagepatharr = explode('/',$upload_folder_path."$imagepath"); $year_path = ABSPATH;
for($i=0;$i<count($imagepatharr);$i++) {
if($imagepatharr[$i])
{
$year_path .= $imagepatharr[$i]."/";
}
}
}
$imagepatharr = explode('/',$imagepath); $upload_path = ABSPATH . "$upload_folder_path";
mkdir($upload_path, 0777); }
for($i=0;$i<count($imagepatharr);$i++) {
if($imagepatharr[$i])
{
$year_path = ABSPATH . "$upload_folder_path".$imagepatharr[$i]."/";
{
}
@mkdir($destination_path, 0777); }
}
}
for($i=0;$i<count($_FILES['images']['name']);$i++) {
$a1 = $_FILES['images']['name'][$i];
$name = time().'_'.$ran.$i.'.'.$a2; $tmp_name = $_FILES['images']['tmp_name'][$i];
$target_path = $destination_path . str_replace(',','',$name); {
$imagepath1 = get_option( 'siteurl' ) ."/$upload_folder_path".$imagepath."/".$name;
$upload_path = get_option('upload_path');
$imagepath1 = str_replace($upload_path,'files',$imagepath1); $user_path[] = $imagepath1;
$result = 1;
}
}
}
?>
Muchas gracias.