Página 1 de 1

Montar mi propio depósito de imágenes para la web

Publicado: Dom Dic 14, 2008 4:20 am
por Yenki
Sigo maldiciendo por no hallar un buen sitio que albergue imágenes y que sea gratuito, para que me deje ponerlas en el foro.

Conseguirlas y editarlas es mucho laburo como para que luego no se vean.

Imageshack las termina borrando tal como se ve en el tema Encuesta de Valve sobre el hardware de los jugadores y con eso inutiliza un tema
Xs.to está intermintente, y no siempre son accesibles

Siempre podría subirlas mediante ftp al sitio del foro , pero eso es complicado.

Había un buen servicio gratis, y el único latino que conocí que se llamaba godlike.cl. Pero ya no anda más.

Imagen

Ahora su dueño lanzó el script para subir imágenes y lo regala en chevereto.com, ocupa poco más de un mega.
Leo en el foro del desarrollador que algunos lo están usando :

http://chevereto.zobyhost.com/

http://img.chiled2k.net/






La idea es subirlo a un servidor y que las imágenes vayan allí.
Pero yo de eso, php, y temas aledaños no tengo ni la menor idea.

A ver si me ayudan con esto:

- así como el foro corre en www.jb2.com.ar/forojb, ¿podré subirlo y correrlo en otra carpeta del mismo dominio jb2? ( por ejemplo www.jb2.com.ar/alb-img )

La idea es no tener que registrar otro nombre de dominio para usarlo.



De última podría usar algún albergue gratuito como 000webhost.com, pero ahí se borran todo no puedo decir nada, en cambio en el servicio que pago eso no pasa.


Imagen

Publicado: Dom Dic 14, 2008 8:17 am
por math
lo voy a probar en mi maquinola y te digo bien como se usa, despues comento bien que tal va e incluso te hago probarlo en mi servidor ;)

Publicado: Dom Dic 14, 2008 5:52 pm
por Yenki
Ok Math, gracias, espero a ver qué me decís.

Por acá dicen como configurarlo.

Publicado: Dom Dic 14, 2008 11:55 pm
por math
ah joya, ya me estaba matando a aplos con un par de lineas, te comento en la semana, pero haceme acordar por msn en un par de dias ;)

Publicado: Lun Dic 15, 2008 11:01 pm
por Yenki
Ojo que algo hay que tocar en el archivo htaccess también.

Publicado: Lun Dic 14, 2009 12:37 am
por Yenki
Bueno , se cayó mi albergue de imágenes picturebay, y con ello no se ven como 800 que subí este año.
Lo que me llena de alegría :x
Si no vuelve, quedan como mil temas sin ellas ... :x :evil: :x :x




Sigo viendo scripts gratuitos para tener mi propio sitio para subir imágenes y ponerlas en este foro.


Hay uno que se llama DPI y tiene sitio web acá.

Otro que parece renombrado es Scripteen, pero me parece demasiado complejo para lo que yo necesito.


Igual mi favorito es Chevereto que ya va por la versión 1.7, ocupa menos de 1 MB
No modifica el principio del nombre de la imagen ( algunos que si les subís algo como loquesea.jpg, lo cambian a 123jkl.jpg y eso no me gusta pues no me deja conocer el nombre de la imagen original como la guardo en mi PC)
Además es código abierto.

Pero yo sigo sin saber configurarlo hay que modificar.
Como yo tengo un solo dominio , jb2.com.ar, debería andar ahí dentro en algo como www.jb2.com.ar/forojb/img-host ¿sí , no?
Pero ¿dónde declaro ese directorio para el script en su configuración?


Math, Vic o cualquiera que tenga idea me viene bien. Hay que configurar el archivo config.php.

Código: Seleccionar todo

<?

/* -----------------------------------------

  Chevereto - Script de hosting de imagenes
  Nightly Build 1.7 &#40;29/10/2009&#41;
  http&#58;//www.chevereto.com/

  Released under the GPL 2.0
  Copyright &#40;C&#41; 2008 by Rodolfo Berrios
  <inbox at rodolfoberrios dot com>

  ----------------------------------------- */

// Language //
define&#40;'LANG', 'en'&#41;; // en - English | es - Español | fa - Farsi | fr - Français | nl - Dutch | cn - ZH-CN &#40;Chinese&#41;

define&#40;'APP_NAME', 'Demo Chevereto'&#41;; // Your image hosting name
define&#40;'TAG_LINE', 'Image Hosting'&#41;; // Your tagline &#40;for doctitles and logo&#41;

// Folders //
/* If you change this, you also must change the folders name. */
define&#40;'DIR_UP','up/'&#41;;
define&#40;'DIR_IM','images/'&#41;; // Change this to have something like /X/filename.jpg - where "X/" is the folder name. 
define&#40;'DIR_WORKING',DIR_UP.'working/'&#41;;
define&#40;'DIR_TEMP',DIR_UP.'temp/'&#41;;
define&#40;'DIR_TH','thumbs/'&#41;;

// Min-Max values -> php.ini rules the nation... //
$max_mb = '2'; // Max. image size &#40;Mbytes&#41;
$max_by = $max_mb*1048576; // &#40;bytes&#41;
$max_name = '10'; // Max. file name lenght.

// Thumbs //
$mini_ancho = '150'; // Thumb width &#40;pixels&#41;
$mini_alto = '150'; // Thumb height &#40;pixels&#41;

// Resize //
$lowres = '16'; // Min. resize value &#40;pixels&#41;
$higres = '1280'; // Max. resize value &#40;pixels&#41;

// Options //
$lim_act = true; // true&#58; Allows uploading just for your domain - false&#58; Allows upload from anywhere &#40;post from another website&#41;
$debug_mode = true; // false&#58; Debug OFF - true&#58; Debug ON.
$cut_url = true; // true&#58; Short URLs &#40;TinyURL tr.im etc.&#41; - false&#58; normal url &#40;http&#58;//mysite.com/images/image.jpg&#41;.
$cut_url_service = 'tinyurl'; // tinyurl
$cut_url_user = true; // If $cut_url = true -> true&#58; Allows your users to cut their urls &#40;preference&#41; - false&#58; Users can't choose to cut or not.
$allow_over_resize = false; // true&#58; Allows over resize images - false&#58; Don't allow over resize.


///////////////////////////////////////////////////////////////////
///// DO NOT EDIT BELOW THIS - &#40;do it if the script can't run&#41; ////
///////////////////////////////////////////////////////////////////

// SERVER ///
/* We get this values with $_SERVER. If your server doesn't resolve this values The script will not work.
   If the script doesn't work, you must change this values to be like values in the comments &#40;see the exaple below&#41; */

$DOM_SCRIPT = $_SERVER&#91;'SERVER_NAME'&#93;; // --> mysite.com
$PATH_SERVER = $_SERVER&#91;'DOCUMENT_ROOT'&#93;; // --> /public_html &#40;pssst.. NO ENDING SLASH!&#41;

	// example&#58;
	# $DOM_SCRIPT = 'mysite.com';
	# $PATH_SERVER = '/public_html'; 
	/* Btw, you can check this values by uncommenting this&#58; */
	// echo 'DOM&#58; '.$DOM_SCRIPT.' - PATH&#58; '.$PATH_SERVER;

// FTP MODE //
/* Use this if you want to upload the files through ftp php &#40;http&#58;//php.net/ftp&#41;. This is handly when your server config don't
   allow to upload files without CHMOD 777, like almost all the cPanel. Using this, you can forget the CHMOD ;&#41; */
$use_ftp = false; // true&#58; Uses ftp to upload files - false&#58; Upload without ftp.
$ftp_host = $DOM_SCRIPT; // Change this if your ftp host is not the same as your mysite.com -- example&#58; $ftp_host = 'ftp.mysite.com';
$ftp_user = ''; // valid username.
$ftp_pass = ''; // Valid password.
// NOTICE&#58; FTP user must have access to the script folder.


///////////////////////////////
/// DO NOT TOUCH BELOW THIS ///
///////////////////////////////

// PATH //
/* Uhhh.. Can't touch this!. */
$path = dirname&#40;$_SERVER&#91;'PHP_SELF'&#93;&#41;;
if &#40;strlen&#40;$path&#41;>1&#41; &#123; 
	define&#40;'PATH_SCRIPT', $path.'/'&#41;;
&#125; else &#123;
	define&#40;'PATH_SCRIPT', $path&#41;;
&#125;

// URL //
/* Uhhh... Uhhh.. Can't touch this!. */
define&#40;'URL_SCRIPT', 'http&#58;//'.$DOM_SCRIPT.PATH_SCRIPT&#41;;

?>
Imagen

Publicado: Lun Dic 14, 2009 8:35 am
por Lole_JPS
Por lo poco que vi, deberias hacer lo siguiente:

create una carpeta en tu servidor que se llame "chereveto" (por poner un ejemplo nomas) y subite ahi todo lo que esta en la carpeta upload, previamente modificando el config.php

(lo que tenes que editar del config.php en principio es solo esto):

Código: Seleccionar todo

// Language //
define&#40;'LANG', 'en'&#41;; // en - English | es - Español | fa - Farsi | fr - Français | nl - Dutch | cn - ZH-CN &#40;Chinese&#41;

define&#40;'APP_NAME', 'Demo Chevereto'&#41;; // Your image hosting name
define&#40;'TAG_LINE', 'Image Hosting'&#41;; // Your tagline &#40;for doctitles and logo&#41;

// Folders //
/* If you change this, you also must change the folders name. */
define&#40;'DIR_UP','up/'&#41;;
define&#40;'DIR_IM','images/'&#41;; // Change this to have something like /X/filename.jpg - where "X/" is the folder name. 
define&#40;'DIR_WORKING',DIR_UP.'working/'&#41;;
define&#40;'DIR_TEMP',DIR_UP.'temp/'&#41;;
define&#40;'DIR_TH','thumbs/'&#41;;

// Min-Max values -> php.ini rules the nation... //
$max_mb = '2'; // Max. image size &#40;Mbytes&#41;
$max_by = $max_mb*1048576; // &#40;bytes&#41;
$max_name = '10'; // Max. file name lenght.

// Thumbs //
$mini_ancho = '150'; // Thumb width &#40;pixels&#41;
$mini_alto = '150'; // Thumb height &#40;pixels&#41;

// Resize //
$lowres = '16'; // Min. resize value &#40;pixels&#41;
$higres = '1280'; // Max. resize value &#40;pixels&#41;

// Options //
$lim_act = true; // true&#58; Allows uploading just for your domain - false&#58; Allows upload from anywhere &#40;post from another website&#41;
$debug_mode = true; // false&#58; Debug OFF - true&#58; Debug ON.
$cut_url = true; // true&#58; Short URLs &#40;TinyURL tr.im etc.&#41; - false&#58; normal url &#40;http&#58;//mysite.com/images/image.jpg&#41;.
$cut_url_service = 'tinyurl'; // tinyurl
$cut_url_user = true; // If $cut_url = true -> true&#58; Allows your users to cut their urls &#40;preference&#41; - false&#58; Users can't choose to cut or not.
$allow_over_resize = false; // true&#58; Allows over resize images - false&#58; Don't allow over resize.
pero solo si queres customizar.

ahora lo importante esta aca:

Código: Seleccionar todo

define&#40;'DIR_IM','images/'&#41;; // Change this to have something like /X/filename.jpg - where "X/" is the folder name. 
esto segun entiendo define un directorio virtual con el cual vas a poder hacer referencia a las imagenes que subas.

entonces tenemos la carpeta fisica "chereveto" que te digo que la hagas para separar los archivos del script de los archivos de tu pagina (hay archivos con el mismo nombre seguramente, ej index.php), y por el otro lado la carpeta virtual "images" si es que no le cambias el nombre.

entonces, tendrias que poner en el navegador lo siguiente: "http://www.jb2.com.ar/chereveto" y deberia traerte la pagina de carga de imagenes.

y, las url de las imagenes deberian quedar "http://www.jb2.com.ar/chereveto/images/xxxxx.jpg"


Espero que te sirva.

EDIT: ahora que veo pareciera que el foro esta en una carpeta que no es la raiz, no deberia afectarte para lo que puse arriba ya que seguramente en el raiz hay un index.php apuntando al index.php dentro de "/forojb"

Publicado: Lun Dic 14, 2009 3:20 pm
por Yenki
Muchas Gracias Lole, voy a probar eso.