Page 1 of 1

Help please, errors

Posted: Sun May 24, 2009 6:52 pm
by kirsty100000
Hi, I just installed a pre modded version of phpbb2. I uploaded all of the files fine and then the forum seemed to install fine, however once I try to access the forum, I keep getting error messages which I think is something to do with this mod which is already installed on the forum so I have not modified any of the files yet lol :) The error messages I get are:


Warning: include_once(./mods/attachments/attachment_mod.php) [function.include-once]: failed to open stream: No such file or directory in /home/a5011867/public_html/common.php on line 487

Free Web Hosting

PHP Error Message

Warning: include_once() [function.include]: Failed opening './mods/attachments/attachment_mod.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a5011867/public_html/common.php on line 487

Free Web Hosting

PHP Error Message

Fatal error: Call to undefined function include_attach_lang() in /home/a5011867/public_html/includes/functions.php on line 812

There is no support for this, and after reading the faqs this is what it says about the error:
My screen is filled with errors when I try to view the forum!
Are they errors? Are you sure they are not warnings? They probably are ... What you're seeing is PHP warn you about unset variables. Great care has been taken with phpBB 2.0 to ensure it is secure. Unset variables while being a potential security risk really shouldn't be in 2.0. Unfortunately some hosting providers have decided that any unset variables equal security problems and force PHP to output these warnings even though phpBB 2.0 is set to ignore them.

We have worked some way toward checking and/or setting all variables before use but this will take time to complete (if it can be). Therefore I am afraid for the time being you will have to manually modify the code or ask your hosting provider to be more realistic with their setup.
so being kinda new to this I have no idea how to do this, does anyone here know what I need to edit to get it to work lol cause at the moment I can't even access the forum :( btw incase you need it this is the coding thing from the file I think needs editing (attatchment_mod):

Code: Select all

<?php
/***************************************************************************
 *							   attachment_mod.php
 *                            -------------------
 *   begin                : Monday, Jan 07, 2002
 *   copyright            : (C) 2002 Meik Sievertsen
 *   email                : acyd.burn@gmx.de
 *
 *   $Id: attachment_mod.php,v 1.6 2005/11/06 18:35:43 acydburn Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

if ( !defined('IN_PHPBB') )
{
	die('Hacking attempt');
	exit;
}

include($phpbb_root_path . 'mods/attachments/includes/constants.'.$phpEx);
include($phpbb_root_path . 'mods/attachments/includes/functions_includes.'.$phpEx);
include($phpbb_root_path . 'mods/attachments/includes/functions_attach.'.$phpEx);
include($phpbb_root_path . 'mods/attachments/includes/functions_delete.'.$phpEx);
include($phpbb_root_path . 'mods/attachments/includes/functions_thumbs.'.$phpEx);
include($phpbb_root_path . 'mods/attachments/includes/functions_filetypes.'.$phpEx);

if ( defined('ATTACH_INSTALL') )
{
	return;
}

/**
* wrapper function for determining the correct language directory
*/
function attach_mod_get_lang($language_file)
{
	global $phpbb_root_path, $phpEx, $attach_config, $board_config;
	
	$language = $board_config['default_lang'];

	if (!file_exists($phpbb_root_path . 'language/lang_' . $language . '/' . $language_file . '.' . $phpEx))
	{
		$language = $attach_config['board_lang'];
		
		if (!file_exists($phpbb_root_path . 'language/lang_' . $language . '/' . $language_file . '.' . $phpEx))
		{
			message_die(GENERAL_MESSAGE, 'Attachment Mod language file does not exist: language/lang_' . $language . '/' . $language_file . '.' . $phpEx);
		}
		else
		{
			return $language;
		}
	}
	else
	{
		return $language;
	}
	}

/**
* Include attachment mod language entries
*/
function include_attach_lang()
{
	global $phpbb_root_path, $phpEx, $lang, $board_config, $attach_config;
	
	// Include Language
	$language = attach_mod_get_lang('lang_main_attach');
	include_once($phpbb_root_path . 'language/lang_' . $language . '/lang_main_attach.' . $phpEx);

	if ( defined('IN_ADMIN') )
	{
		$language = attach_mod_get_lang('lang_admin_attach');
		include_once($phpbb_root_path . 'language/lang_' . $language . '/lang_admin_attach.' . $phpEx);
		}
}

/**
* Get attachment mod configuration
*/
function get_config()
{
	global $db, $board_config;

	$attach_config = array();

	$sql = 'SELECT *
		FROM ' . ATTACH_CONFIG_TABLE;
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not query attachment information', '', __LINE__, __FILE__, $sql);
	}

	while ($row = $db->sql_fetchrow($result))
	{
		$attach_config[$row['config_name']] = trim($row['config_value']);
	}
	$db->sql_freeresult($result);

	// We assign the original default board language here, because it gets overwritten later with the users default language
	$attach_config['board_lang'] = trim($board_config['default_lang']);

	return $attach_config;
}

// Get Attachment Config
$cache_dir = $phpbb_root_path . '/cache';
$cache_file = $cache_dir . '/config_attach.php';
$attach_config = array();

if (file_exists($cache_dir) && is_dir($cache_dir) && is_writable($cache_dir))
{
	if (file_exists($cache_file))
	{
		include($cache_file);
	}
	else
	{
		$attach_config = get_config();
		$fp = @fopen($cache_file, 'wt+');
		if ($fp)
		{
			$lines = array();
			foreach ($attach_config as $k => $v)
			{
				if (is_int($v))
				{
					$lines[] = "'$k'=>$v";
				}
				else if (is_bool($v))
				{
					$lines[] = "'$k'=>" . (($v) ? 'TRUE' : 'FALSE');
				}
				else
			{
					$lines[] = "'$k'=>'" . str_replace("'", "\\'", str_replace('\\', '\\\\', $v)) . "'";
				}
			}
			fwrite($fp, '<?php if (!defined(\'IN_PHPBB\')) { die(\'Hacking attempt\'); } $attach_config = array(' . implode(',', $lines) . '); ?>');
			fclose($fp);

			@chmod($cache_file, 0777);
		}
	}
}
else
{
	$attach_config = get_config();
}

// Please do not change the include-order, it is valuable for proper execution.
// Functions for displaying Attachment Things
include($phpbb_root_path . 'mods/attachments/displaying.'.$phpEx);

// Posting Attachments Class (HAVE TO BE BEFORE PM)
include($phpbb_root_path . 'mods/attachments/posting_attachments.'.$phpEx);

// PM Attachments Class
include($phpbb_root_path . 'mods/attachments/pm_attachments.'.$phpEx);

if (!intval($attach_config['allow_ftp_upload']))
{
	$upload_dir = $attach_config['upload_dir'];
}
else
{
	$upload_dir = $attach_config['download_path'];
}

if (!function_exists('attach_mod_sql_escape'))
{
	message_die(GENERAL_MESSAGE, 'You haven\'t correctly updated/installed the Attachment Mod.<br />You seem to forgot uploading a new file. Please refer to the update instructions for help and make sure you have uploaded every file correctly.');
}


?>
Thanks in advance for any help :)

Re: Help please, errors

Posted: Sun May 24, 2009 6:56 pm
by DavidIQ
You'll need to re-upload the premodified files again and do a replace of files when your FTP program promts you. Seems like some files are missing and only some of the files are modified.

Re: Help please, errors

Posted: Sun May 24, 2009 7:02 pm
by kirsty100000
thanks for your really fast reply :) I've just done what you've suggested and unfortunately I'm still getting the same error messages :(

Re: Help please, errors

Posted: Mon May 25, 2009 8:37 am
by DavidIQ
Post a link to your site so I can take a closer look.

Re: Help please, errors

Posted: Mon May 25, 2009 9:33 am
by kirsty100000
thanks :) here's the link :)

http://koolkats.netii.net/

Re: Help please, errors

Posted: Mon May 25, 2009 7:21 pm
by DavidIQ
Because it's a premodded version, you will need to get help from the place you downloaded the premodded phpBB2 from. This is the edit that's supposed to be done to common.php:

Code: Select all

include($phpbb_root_path . 'attach_mod/attachment_mod.'.$phpEx);
The error you're getting is that (./mods/attachments/attachment_mod.php) can't be found which, as you can see, is vastly different from the original.

Where did you download it from anyways?

Re: Help please, errors

Posted: Tue May 26, 2009 9:39 am
by kirsty100000
ok thanks :) unfortunately if I want support I have to pay $10 a month lol :( I got it from their website (fully modded phpbb2) :) Thanks for your help anyways :)