Foros del Web » Creando para Internet » Diseño web »

problema con script

Estas en el tema de problema con script en el foro de Diseño web en Foros del Web. Q tal, bueno estoy intentando rular este script, pero va a medias, me explico solo tengo el error de que una parte de la imagen ...
  #1 (permalink)  
Antiguo 04/12/2008, 07:50
 
Fecha de Ingreso: septiembre-2007
Mensajes: 136
Antigüedad: 16 años, 6 meses
Puntos: 0
problema con script

Q tal, bueno estoy intentando rular este script, pero va a medias, me explico solo tengo el error de que una parte de la imagen que subo la guarda mal, y no se que parametro falla(bueno decir que es un script para hacer de servidor para alojar imagenes)
Bueno al subir una foto la sune bien y me sale esto..



como veis el primer link que da lo da mal..

esta es la ruta de instalacion..

www.descargas007.com/movil
ahi dentro estan los archivos, lo que no entiendo es poruqe el primer link de la foto lo guarda en www.descargas007.com/movil,,,,,,,,,,ya que ahi no esta la foto, la foto la guarda en www.descargas007.com/movil/images..

ahi si por tanto los otros links que da de resultado si estn bien..

luego en la galeria mas de lo mismo...dejo cap..



si pincho en las imagenes para verlas en grande da error, ya que busca la foto en www.descargas007.com/movil, y ahi no estan...

captura ..




asi que no se si el fallo estara en alguna ruta del config.php,no se ya estoy mareado, dejo copia del archivo haber si veis algo mal..

Código:
<?

include("db.php");



$link = mysql_connect($db_server, $db_user, $db_password) or die("Could not connect");

mysql_select_db($db_name) or die("Could not select database");

$query = "SELECT * from config";

$result = mysql_query($query) or die("Query failed");

while ($row = mysql_fetch_assoc($result)) { 

        $config[$row['soption']]=$row['svalue'];

}






$site_name = $config['SiteName'];

// [email protected]

// Example: [email protected]

	$sql="select * from users where userid='1'";
	
	$result = mysql_query($sql) or die("Query failed.");
	while ($row = mysql_fetch_array($result)) 
	{
		$support_email=$row['email'];		
	}

// http://www.descargas007.com/movil

// Example:  http://www.Your-Site.com

$server_url = $config['SiteUrl'];




// thumbnail settings

$thumbnail_size_max = $config['ThumbHeight'];

$thumbnail_quality = $config['ThumbWidth'];


$server_root = $config['SiteRoot'];

$server_directory = "";

$server_save_directory = $server_directory . "/images/"; //  /folder/     





// do not change the following variables
global $server_dir;

$server_dir = $server_root . $server_save_directory;

$page_url = $server_url . $server_directory;

$image_url = $server_url . $server_save_directory;


$valid_mime_types_display = $config['Extension'];

$valid_file_ext=explode(",",$config['Extension']);


function getSize ($imageurl)
{
    if ( intval(phpversion()) < 5 )
        die ( 'PHP5 Required' );
    
    $headers = get_headers($imageurl, 1);
    return $headers['Content-Length'];
} 



// Convert a URL to the local file path and vice versa, convert a local file path to a URL.

// this sets the sytem / or \ :
strstr( PHP_OS, "WIN") ? $slash = "\\" : $slash = "/";

// This is the location of the php file that contains this
// function. Usually this request is made to files/folders
// down the directory structure, so the php file that
// contains these functions is a good "where am i"
// reference point:
$WIMPY_BASE['path']['physical'] = getcwd();
$WIMPY_BASE['path']['www'] = "http://".$_SERVER['HTTP_HOST'];

function url2filepath($theURL){
    global $WIMPY_BASE, $slash;
    $AtheFile = explode ("/", $theURL);
    $theFileName = array_pop($AtheFile);
    $AwimpyPathWWW = explode ("/", $WIMPY_BASE['path']['www']);
    $AtheFilePath = array_values (array_diff ($AtheFile, $AwimpyPathWWW));
    if($AtheFilePath){
        $theFilePath = $slash.implode($slash, $AtheFilePath).$slash.$theFileName;
    } else {
        $theFilePath = implode($slash, $AtheFilePath).$slash.$theFileName;
    }
    return ($WIMPY_BASE['path']['physical'].$theFilePath);
}

function filepath2url ($theFilepath){
    global $WIMPY_BASE, $slash;
    $AtheFile = explode ($slash, $theFilepath);
    $theFileName = array_pop($AtheFile);
    $AwimpyPathFILE = explode ($slash, $WIMPY_BASE['path']['physical']);
    $AtheFilePath = array_values (array_diff ($AtheFile, $AwimpyPathFILE));
    $thFileURL = implode("/", $AtheFilePath)."/".$theFileName;
    return ($WIMPY_BASE['path']['www']."$thFileURL");
}
?>


tambien le e dado vueltas a esto ..

en la administracion en site root tengo puesto esto..
/var/www/vhosts/descargas007.com/httpdocs/movil

y en site url esto..

http://www.descargas007.com/movil
pero si cambio esto ultimo y pongo

http://www.descargas007.com/movil/images

na tampoco chuta

Última edición por evola100; 04/12/2008 a las 08:06
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:33.