Página 2 de 3

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 19 Jul 2009, 10:43
por Kasios
Estoy seguro que hice todo al pie de la letra. mmm No se que quisiste decir con ''utf-8 sin bom" ...


mira asi lo modifique con mis datos:

Código: Seleccionar todo

 <?php
    // phpBB 3.0.x auto-generated configuration file
    // Do not change anything in this file!
    $dbms = 'mysqli';
    $dbhost = 'mysql.webcindario.com';
    $dbport = '';
    $dbname = 'animedia'; //Database Name - Nombre de la Base de Datos
    $dbuser = 'animedia';       //Database User - Usuario de la Base de Datos
    $dbpasswd = 'machete';            //Database Password - Password del Usuario de la Base de Datos
    $table_prefix = 'phpbb_';        //Database Table Prefix - Prefijo de Tabla de la Base de Datos
    $acm_type = 'file';
    $load_extensions = '';

    @define('PHPBB_INSTALLED', true);
    @define('DEBUG', true);
    // @define('DEBUG_EXTRA', true);
    ?>
La contrasela es falsa claro, solo queria que vieran que si lo hice como dijeron. y si, me queda claro que miarroba es muy malo, pero cuando intento descargar el foro en Zip de la base de datos no se puede bajar, si no ya me hubiese pasado a 00webhost, incluso cree la cuenta. Ahoita lo primordial es que el foro funcione, asi no pierdo los usuarios que habian ni nada. Luego vere como me las ingenio para cambiarme a 00webhost. :wink:

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 19 Jul 2009, 12:45
por HuanManwe
Para hacer la copia de seguridad de la base de datos no te aconsejo que lo hagas comprimida en gzip, sino sin comprimir. Sigue esta guía.

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 02:48
por Kasios
Bien. Yo sigo con mi problema, de veras disculpen si he hecho que me ayuden en todo esto y sin saber si se va a apoder arreglar, pero se los agradezco de veras, ustedes me han ayudado mas que los de miarroba, de veras se los agradezco, si esto se soluciona mis usuarios y yo les haremos una estatua XD.

Debido a que no pude descargar toda la base de datos en un solo archivo, en mi@ me dijeron que bajara tabla por tabla. y eso hice:
Spoiler
Imagen
Ahora ya tengo todos los archivos SQL en mi computadora, pero viendo la guia de traslado de la base de datos, imagino que tendre que importar tambien tabla por tabla. Bueno, creo que lo haré ahora mismo a ver como me sale. Inmediatamente me voy a 00Webhost para ver como se maneja todo por ahi jeje. :lee

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 03:15
por jakk
Para mi opinion los hay mejores que 000webhost , como ya dije en otro post es mi opinion basandome en mi experiencia en 00webhost , aunque si es verdad es que muy dificil encontrar un servidor gratuito que vaya bien , ultimamente zymic iba vastante bien , aunque no permiten archivos htacess

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 03:45
por Kasios
Mi foro Aparecio!!!!!! SiiiiI!!!!! Que feliz estoy XDDDDDD :cerveza: . Solo que tiene un pequeño desperfecto: No se pueden ver ninguno de los avatares de los usuarios...que raro.
Estoy mas que feliz y solo quiero agradecerles a todos los que me ayudaron con este problema, en especial a HuanManwe y a ahh72_DEU De verdad, el 10 de septiembre cumplimos un año, habra una mension honorifica para ustedes ahi y se los voy a mostrar jajaja.

Justo cuando estaba trasladando mi foro, bueno. Alguien me puede decir si 000webhost es bueno? por que ya estaba comenzando el paso 7 de la guia de traslado jeje. Siempre me voy a trasladar Mi@ me ha decepcionado.

Muchas gracias por ayudarme!!!!! :ok:

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 04:25
por jakk
Los avatares se guardan en images en la carpeta upload_avatar , entra por ftp y mira si estan alli , que es donde deverian estar

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 07:04
por Kasios
mmmm ya entre pero solo aparece el mio en la carpeta de los avatares... y lo peor que ni el mio que esta ahi se muertra...habre dañado algun archivo? :shock:

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 15:33
por ahh72
mira por si acaso en tu ACP en la configuracion de avatares y ve a que carpeta esta direccionandolo, podria ser eso o en otro caso quiza al borrar pues eliminaste toda tu galeria de avatares y las que los usuarios cargaron manualmente.
Estoy mas que feliz y solo quiero agradecerles a todos los que me ayudaron con este problema, en especial a HuanManwe y a ahh72_DEU De verdad, el 10 de septiembre cumplimos un año, habra una mension honorifica para ustedes ahi y se los voy a mostrar jajaja.
estoy aprendiendo tambien en tema de foros de web pero algunas cosas se me hacen faciles puesto que soy analista de sistemas pero nunca he tenido experiencia en estos temas :oops:
no te preocupes que todos estamos aqui para ayudar en todo lo que se pueda y claro si esta en nuestra capacidad poder hacerlo :lol:


saludos

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 16:18
por HuanManwe
Kasios escribió:mmmm ya entre pero solo aparece el mio en la carpeta de los avatares... y lo peor que ni el mio que esta ahi se muertra...habre dañado algun archivo? :shock:
Mira en tu base de datos, tabla phpbb_config y mira el valor que hay en estas dos tablas (normalmente aparecen en la segunda página):
avatar_gallery_path images/avatars/gallery
avatar_path images/avatars/upload

Luego mira en el ftp de tu web a ver si están en su sitio los archivos, y si no lo están bájalos del ftp de miarroba y cópialos tal cual en el del nuevo servidor.

Por cierto, ¿puedes decirnos la dirección de tu nuevo foro?

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 17:16
por Kasios
eso esta bien, incluso en el foro pude editar esas opciones. Mira que cuando le doy a las propiedades en el espacio de mi avatar me dice que tiene esta direccion:

Código: Seleccionar todo

http://animedia.webcindario.com/phpBB3/download/file.php?avatar=2_1248102873.png
...Aun no me he cambiado a 000webhost, me quede en el paso 7 jeje, pero si me voy a cambiar cuando haya arreglado lo de los avatares.

Saludos amigo. :ok:

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 17:42
por ahh72
Kasios escribió:Mira que cuando le doy a las propiedades en el espacio de mi avatar me dice que tiene esta direccion:

http://animedia.webcindario.com/phpBB3/ ... 102873.png
pues algo anda mal porque cuando deseo ver la imagen me sale este error:
No se puede mostrar la imagen “http://animedia.webcindario.com/phpBB3/ ... 102873.png” porque contiene errores.

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 17:53
por HuanManwe
el punto 7 trata sobre los permisos a dar sobre los directorios y archivos que se te indican. ¿Tienes algún problema con eso? Es simple si usas el filezilla o algún otro cliente ftp.

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 21:40
por Kasios
Como pueden ver en esta imagen, en las opciones de Avatar de mi foro lo configure de esta forma:
Spoiler
Imagen
Ahora, la carpeta Upload esta casi vacia, solo tiene un archivo index y un .htaccess. Acabo de encontrar que en la carpeta "Download" hay un archivo que se llama file.php, que contiene comandos que tienen que ver con los avatares, este es el codigo, no hay necesidad de que lean todo, en las primeras lineas se ve que habla sobre GET_AVATAR o algo asi:

Código: Seleccionar todo

<?php
/**
*
* @package phpBB3
* @version $Id: file.php 8514 2008-04-21 10:54:41Z acydburn $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);

if (isset($_GET['avatar']))
{
	require($phpbb_root_path . 'config.' . $phpEx);

	if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
	{
		exit;
	}

	require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
	require($phpbb_root_path . 'includes/cache.' . $phpEx);
	require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
	require($phpbb_root_path . 'includes/constants.' . $phpEx);

	$db = new $sql_db();
	$cache = new cache();

	// Connect to DB
	if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false))
	{
		exit;
	}
	unset($dbpasswd);

	// worst-case default
	$browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : 'msie 6.0';

	$config = $cache->obtain_config();
	$filename = $_GET['avatar'];
	$avatar_group = false;
	if ($filename[0] === 'g')
	{
		$avatar_group = true;
		$filename = substr($filename, 1);
	}

	// '==' is not a bug - . as the first char is as bad as no dot at all
	if (strpos($filename, '.') == false)
	{
		header('HTTP/1.0 403 Forbidden');
		if (!empty($cache))
		{
			$cache->unload();
		}
		$db->sql_close();
		exit;
	}

	$ext		= substr(strrchr($filename, '.'), 1);
	$stamp		= (int) substr(stristr($filename, '_'), 1);
	$filename	= (int) $filename;

	// let's see if we have to send the file at all
	$last_load 	=  isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime(trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) : false;
	if (strpos(strtolower($browser), 'msie 6.0') === false)
	{
		if ($last_load !== false && $last_load <= $stamp)
		{
			if (@php_sapi_name() === 'CGI')
			{
				header('Status: 304 Not Modified', true, 304);
			}
			else
			{
				header('HTTP/1.0 304 Not Modified', true, 304);
			}
			// seems that we need those too ... browsers
			header('Pragma: public');
			header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
			exit();
		}
		else
		{
			header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $stamp) . ' GMT');
		}
	}

	if (!in_array($ext, array('png', 'gif', 'jpg', 'jpeg')))
	{
		// no way such an avatar could exist. They are not following the rules, stop the show.
		header("HTTP/1.0 403 Forbidden");
		if (!empty($cache))
		{
			$cache->unload();
		}
		$db->sql_close();
		exit;
	}

	if (!$filename)
	{
		// no way such an avatar could exist. They are not following the rules, stop the show.
		header("HTTP/1.0 403 Forbidden");
		if (!empty($cache))
		{
			$cache->unload();
		}
		$db->sql_close();
		exit;
	}

	send_avatar_to_browser(($avatar_group ? 'g' : '') . $filename . '.' . $ext, $browser);

	if (!empty($cache))
	{
		$cache->unload();
	}
	$db->sql_close();
	exit;
}

// implicit else: we are not in avatar mode
include($phpbb_root_path . 'common.' . $phpEx);

$download_id = request_var('id', 0);
$mode = request_var('mode', '');
$thumbnail = request_var('t', false);

// Start session management, do not update session page.
$user->session_begin(false);
$auth->acl($user->data);
$user->setup('viewtopic');

if (!$download_id)
{
	trigger_error('NO_ATTACHMENT_SELECTED');
}

if (!$config['allow_attachments'] && !$config['allow_pm_attach'])
{
	trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
}
	
if ($config['allow_attachments'] && ($user->data['points'] < $config['points_cost_attachment']))
{
trigger_error('ATTACHMENT_MINI_POSTS');
}


$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id
	FROM ' . ATTACHMENTS_TABLE . "
	WHERE attach_id = $download_id";
$result = $db->sql_query_limit($sql, 1);
$attachment = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$cost = $config['points_cost_attachment'];

substract_points($user->data['user_id'], $cost);
 	

if (!$attachment)
{
	trigger_error('ERROR_NO_ATTACHMENT');
}

if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachment['in_message'] && !$config['allow_pm_attach']))
{
	trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
}

$row = array();

if ($attachment['is_orphan'])
{
	// We allow admins having attachment permissions to see orphan attachments...
	$own_attachment = ($auth->acl_get('a_attach') || $attachment['poster_id'] == $user->data['user_id']) ? true : false;

	if (!$own_attachment || ($attachment['in_message'] && !$auth->acl_get('u_pm_download')) || (!$attachment['in_message'] && !$auth->acl_get('u_download')))
	{
		trigger_error('ERROR_NO_ATTACHMENT');
	}

	// Obtain all extensions...
	$extensions = $cache->obtain_attach_extensions(true);
}
else
{
	if (!$attachment['in_message'])
	{
		//
		$sql = 'SELECT p.forum_id, f.forum_password, f.parent_id
			FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
			WHERE p.post_id = ' . $attachment['post_msg_id'] . '
				AND p.forum_id = f.forum_id';
		$result = $db->sql_query_limit($sql, 1);
		$row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		// Global announcement?
		$f_download = (!$row) ? $auth->acl_getf_global('f_download') : $auth->acl_get('f_download', $row['forum_id']);

		if ($auth->acl_get('u_download') && $f_download)
		{
			if ($row && $row['forum_password'])
			{
				// Do something else ... ?
				login_forum_box($row);
			}
		}
		else
		{
			trigger_error('SORRY_AUTH_VIEW_ATTACH');
		}
	}
	else
	{
		$row['forum_id'] = false;
		if (!$auth->acl_get('u_pm_download'))
		{
			header('HTTP/1.0 403 Forbidden');
			trigger_error('SORRY_AUTH_VIEW_ATTACH');
		}

		// Check if the attachment is within the users scope...
		$sql = 'SELECT user_id, author_id
			FROM ' . PRIVMSGS_TO_TABLE . '
			WHERE msg_id = ' . $attachment['post_msg_id'];
		$result = $db->sql_query($sql);

		$allowed = false;
		while ($user_row = $db->sql_fetchrow($result))
		{
			if ($user->data['user_id'] == $user_row['user_id'] || $user->data['user_id'] == $user_row['author_id'])
			{
				$allowed = true;
				break;
			}
		}
		$db->sql_freeresult($result);

		if (!$allowed)
		{
			header('HTTP/1.0 403 Forbidden');
			trigger_error('ERROR_NO_ATTACHMENT');
		}
	}

	// disallowed?
	$extensions = array();
	if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions))
	{
		trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
	}
}

if (!download_allowed())
{
	header('HTTP/1.0 403 Forbidden');
	trigger_error($user->lang['LINKAGE_FORBIDDEN']);
}

$download_mode = (int) $extensions[$attachment['extension']]['download_mode'];

// Fetching filename here to prevent sniffing of filename
$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype
	FROM ' . ATTACHMENTS_TABLE . "
	WHERE attach_id = $download_id";
$result = $db->sql_query_limit($sql, 1);
$attachment = $db->sql_fetchrow($result);
$db->sql_freeresult($result);

if (!$attachment)
{
	trigger_error('ERROR_NO_ATTACHMENT');
}

$attachment['physical_filename'] = basename($attachment['physical_filename']);
$display_cat = $extensions[$attachment['extension']]['display_cat'];

if (($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$user->optionget('viewimg'))
{
	$display_cat = ATTACHMENT_CATEGORY_NONE;
}

if ($display_cat == ATTACHMENT_CATEGORY_FLASH && !$user->optionget('viewflash'))
{
	$display_cat = ATTACHMENT_CATEGORY_NONE;
}

if ($thumbnail)
{
	$attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
}
else if (($display_cat == ATTACHMENT_CATEGORY_NONE || $display_cat == ATTACHMENT_CATEGORY_IMAGE) && !$attachment['is_orphan'])
{
	// Update download count
	$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
		SET download_count = download_count + 1
		WHERE attach_id = ' . $attachment['attach_id'];
	$db->sql_query($sql);
}

if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && strpos(strtolower($user->browser), 'msie') !== false)
{
	wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);
}
else
{
	// Determine the 'presenting'-method
	if ($download_mode == PHYSICAL_LINK)
	{
		// This presenting method should no longer be used
		if (!@is_dir($phpbb_root_path . $config['upload_path']))
		{
			trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']);
		}

		redirect($phpbb_root_path . $config['upload_path'] . '/' . $attachment['physical_filename']);
		exit;
	}
	else
	{
		send_file_to_browser($attachment, $config['upload_path'], $display_cat);
		exit;
	}
}


/**
* A simplified function to deliver avatars
* The argument needs to be checked before calling this function.
*/
function send_avatar_to_browser($file, $browser)
{
	global $config, $phpbb_root_path;

	$prefix = $config['avatar_salt'] . '_';
	$image_dir = $config['avatar_path'];

	// Adjust image_dir path (no trailing slash)
	if (substr($image_dir, -1, 1) == '/' || substr($image_dir, -1, 1) == '\\')
	{
		$image_dir = substr($image_dir, 0, -1) . '/';
	}
	$image_dir = str_replace(array('../', '..\\', './', '.\\'), '', $image_dir);

	if ($image_dir && ($image_dir[0] == '/' || $image_dir[0] == '\\'))
	{
		$image_dir = '';
	}
	$file_path = $phpbb_root_path . $image_dir . '/' . $prefix . $file;

	if ((@file_exists($file_path) && @is_readable($file_path)) && !headers_sent())
	{
		header('Pragma: public');

		$image_data = @getimagesize($file_path);
		header('Content-Type: ' . image_type_to_mime_type($image_data[2]));

		if (strpos(strtolower($browser), 'msie') !== false)
		{
			header('Content-Disposition: attachment; ' . header_filename($file));

			if (strpos(strtolower($browser), 'msie 6.0') !== false)
			{
				header('Expires: -1');
			}
			else
			{
				header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
			}
		}
		else
		{
			header('Content-Disposition: inline; ' . header_filename($file));
			header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
		}

		$size = @filesize($file_path);
		if ($size)
		{
			header("Content-Length: $size");
		}

		if (@readfile($file_path) === false)
		{
			$fp = @fopen($file_path, 'rb');

			if ($fp !== false)
			{
				while (!feof($fp))
				{
					echo fread($fp, 8192);
				}
				fclose($fp);
			}
		}

		flush();
	}
	else
	{
		header('HTTP/1.0 404 not found');
	}
}

/**
* Wraps an url into a simple html page. Used to display attachments in IE.
* this is a workaround for now; might be moved to template system later
* direct any complaints to 1 Microsoft Way, Redmond
*/
function wrap_img_in_html($src, $title)
{
	echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd">';
	echo '<html>';
	echo '<head>';
	echo '<meta http-equiv="content-type" content="text/html; charset=UTF-8" />';
	echo '<title>' . $title . '</title>';
	echo '</head>';
	echo '<body>';
	echo '<div>';
	echo '<img src="' . $src . '" alt="' . $title . '" />';
	echo '</div>';
	echo '</body>';
	echo '</html>';
}

/**
* Send file to browser
*/
function send_file_to_browser($attachment, $upload_dir, $category)
{
	global $user, $db, $config, $phpbb_root_path;

	$filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename'];

	if (!@file_exists($filename))
	{
		trigger_error($user->lang['ERROR_NO_ATTACHMENT'] . '<br /><br />' . sprintf($user->lang['FILE_NOT_FOUND_404'], $filename));
	}

	// Correct the mime type - we force application/octetstream for all files, except images
	// Please do not change this, it is a security precaution
	if ($category != ATTACHMENT_CATEGORY_IMAGE || strpos($attachment['mimetype'], 'image') !== 0)
	{
		$attachment['mimetype'] = (strpos(strtolower($user->browser), 'msie') !== false || strpos(strtolower($user->browser), 'opera') !== false) ? 'application/octetstream' : 'application/octet-stream';
	}

	if (@ob_get_length())
	{
		@ob_end_clean();
	}

	// Now send the File Contents to the Browser
	$size = @filesize($filename);

	// To correctly display further errors we need to make sure we are using the correct headers for both (unsetting content-length may not work)

	// Check if headers already sent or not able to get the file contents.
	if (headers_sent() || !@file_exists($filename) || !@is_readable($filename))
	{
		// PHP track_errors setting On?
		if (!empty($php_errormsg))
		{
			trigger_error($user->lang['UNABLE_TO_DELIVER_FILE'] . '<br />' . sprintf($user->lang['TRACKED_PHP_ERROR'], $php_errormsg));
		}

		trigger_error('UNABLE_TO_DELIVER_FILE');
	}

	// Now the tricky part... let's dance
	header('Pragma: public');

	/**
	* Commented out X-Sendfile support. To not expose the physical filename within the header if xsendfile is absent we need to look into methods of checking it's status.
	*
	* Try X-Sendfile since it is much more server friendly - only works if the path is *not* outside of the root path...
	* lighttpd has core support for it. An apache2 module is available at http://celebnamer.celebworld.ws/stuff/mod_xsendfile/
	*
	* Not really ideal, but should work fine...
	* <code>
	*	if (strpos($upload_dir, '/') !== 0 && strpos($upload_dir, '../') === false)
	*	{
	*		header('X-Sendfile: ' . $filename);
	*	}
	* </code>
	*/

	// Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
	header('Content-Type: ' . $attachment['mimetype']);

	if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie') !== false))
	{
		header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
		if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
		{
			header('expires: -1');
		}
	}
	else
	{
		header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
	}

	if ($size)
	{
		header("Content-Length: $size");
	}

	// Try to deliver in chunks
	@set_time_limit(0);

	$fp = @fopen($filename, 'rb');

	if ($fp !== false)
	{
		while (!feof($fp))
		{
			echo fread($fp, 8192);
		}
		fclose($fp);
	}
	else
	{
		@readfile($filename);
	}

	flush();
	exit;
}

/**
* Get a browser friendly UTF-8 encoded filename
*/
function header_filename($file)
{
	$user_agent = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : '';

	// There be dragons here.
	// Not many follows the RFC...
	if (strpos($user_agent, 'MSIE') !== false || strpos($user_agent, 'Safari') !== false || strpos($user_agent, 'Konqueror') !== false)
	{
		return "filename=" . rawurlencode($file);
	}

	// follow the RFC for extended filename for the rest
	return "filename*=UTF-8''" . rawurlencode($file);
}

/**
* Check if downloading item is allowed
*/
function download_allowed()
{
	global $config, $user, $db;

	if (!$config['secure_downloads'])
	{
		return true;
	}

	$url = (!empty($_SERVER['HTTP_REFERER'])) ? trim($_SERVER['HTTP_REFERER']) : trim(getenv('HTTP_REFERER'));

	if (!$url)
	{
		return ($config['secure_allow_empty_referer']) ? true : false;
	}

	// Split URL into domain and script part
	$url = @parse_url($url);

	if ($url === false)
	{
		return ($config['secure_allow_empty_referer']) ? true : false;
	}

	$hostname = $url['host'];
	unset($url);

	$allowed = ($config['secure_allow_deny']) ? false : true;
	$iplist = array();

	if (($ip_ary = @gethostbynamel($hostname)) !== false)
	{
		foreach ($ip_ary as $ip)
		{
			if ($ip)
			{
				$iplist[] = $ip;
			}
		}
	}

	// Check for own server...
	$server_name = $user->host;

	// Forcing server vars is the only way to specify/override the protocol
	if ($config['force_server_vars'] || !$server_name)
	{
		$server_name = $config['server_name'];
	}

	if (preg_match('#^.*?' . preg_quote($server_name, '#') . '.*?$#i', $hostname))
	{
		$allowed = true;
	}

	// Get IP's and Hostnames
	if (!$allowed)
	{
		$sql = 'SELECT site_ip, site_hostname, ip_exclude
			FROM ' . SITELIST_TABLE;
		$result = $db->sql_query($sql);

		while ($row = $db->sql_fetchrow($result))
		{
			$site_ip = trim($row['site_ip']);
			$site_hostname = trim($row['site_hostname']);

			if ($site_ip)
			{
				foreach ($iplist as $ip)
				{
					if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($site_ip, '#')) . '$#i', $ip))
					{
						if ($row['ip_exclude'])
						{
							$allowed = ($config['secure_allow_deny']) ? false : true;
							break 2;
						}
						else
						{
							$allowed = ($config['secure_allow_deny']) ? true : false;
						}
					}
				}
			}

			if ($site_hostname)
			{
				if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($site_hostname, '#')) . '$#i', $hostname))
				{
					if ($row['ip_exclude'])
					{
						$allowed = ($config['secure_allow_deny']) ? false : true;
						break;
					}
					else
					{
						$allowed = ($config['secure_allow_deny']) ? true : false;
					}
				}
			}
		}
		$db->sql_freeresult($result);
	}

	return $allowed;
}

?>
Que extraños problemas estos :S...Ah no te preocupes HuanManwe, no tengo problemas con los permisos, lo entiendo bien, gracias :ok:

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 21:48
por HuanManwe
el file.php de mi directorio download no es así. Creo que no usas la última versión del foro, ¿o es que tú lo que tienes es el phpBBportal?

Por cierto, ¿el del banner es Shaka del signo de Leo? :P

Re: borre los archivos y ahora no se puede instalar mi foro!

Publicado: 20 Jul 2009, 21:56
por ahh72
pues no te hagas tanto rollo y vuelve a subir tu avatar, espero tengas copia de de los avatares de los demas usuarios si no pues tendran que cargarlo nuevamente :roll:
HuanManwe escribió:Por cierto, ¿el del banner es Shaka del signo de Leo? :P
no Huan, el de Virgo es Shaka y el de Leo es Aioria :lol:

Imagen


saludos