Critical Error, Can't figure out why

Wondering why that MOD you have won't install correctly? Let's take a look
Forum rules
DO NOT give out any FTP passwords to anyone! There is no reason to do so! If you need help badly enough, create a temporary FTP account that is restricted to only the files that you need help with and give the information for that. Giving out FTP information can be very dangerous!
Locked
BondGamer
Registered User
Posts: 112
Joined: Mon Dec 15, 2003 8:20 pm
Contact:

Critical Error, Can't figure out why

Post by BondGamer »

I get this error:
Critical Error

Function Trace: open_files[5]->modio_open[1]

Could not open [admin\admin_forums.php] for reading.
MOD script line #187 :: FAQ :: Report
]

I double checked and it should be able to open the file. The path is correct and I chmoded it all the way to 777. Here is the Mod Code:

Code: Select all

################################################################################
##
##   Hack Title:		External Forum Redirect
##   Hack Version:		2.0.0
##   Hack Author:		John McKernan 
## 
##   Hack Description:	This hack allows you to specify a forum as an external
##						forum. When the user clicks on the Forum name (on the 
##						index page) they will be taken to an external url you
##						specify in the Admin Control Panel.
##
##						Seperate counters are maintained to track the number
##						of users and guests clicking the links. This is 
##						displayed on the index page.
##
##						The external url may, optionally, be open in a new
##						browser window, and you can specify a custom folder 
##						image for each external forum.
##
##						Useful to direct users to other boards / sites you may
##						have, or to set-up cross-linking arrangements with
##						outside boards / sites.
##
##   phpBB Version:		2.0.4 - 2.0.6
##		
##   Difficulty Level:	Moderate 
##   Installation Time:	25 Minutes 
##
##   Files To Edit:		(7)
##						\index.php
##						\admin\admin_forums.php
##						\language\lang_english\lang_admin.php
##						\language\lang_english\lang_main.php
##						\templates\subSilver\index_body.tpl
##						\templates\subSilver\subSilver.cfg
##						\templates\subSilver\admin\forum_edit_body.tpl
##
##   Files Included:	(3)
##						\install_hack.php
##						\view_external.php
##						\templates\xxx\images\folder_external.gif
##
##   Release History:
##						2.0.0 - added option to open external link in a new
##								window & specify a custom folder image
##								(Nov 24, 2003)
##						1.0.1 - corrected typo in 'Find' instruction for
##								index.php - thanks to Rapid Dr3am (Sep 7, 2003)
##						1.0.0 - Initial release (Sep 1, 2003)
##
################################################################################
##
##  FOR UPDATES/SUPPORT, please visit http://www.phpbbhacks.com/forums" target="_blank
##
##  Stay up-to-date on the latest news involving our hacks, sign-up for
##  our newsletter at http://wwww.presagemedia.com/lists/?p=subscribe" target="_blank
##
##  This author supports phpBBHacks.com. This hack is made available
##  solely through their database at http://www.phpbbhacks.com" target="_blank
##
##  If you are new to installing hacks for phpBB, may I suggest that you take
##  a look at my 'Installing phpBB Hacks' tutorial at phpBBHacks.com. You can
##  find it here: http://www.phpbbhacks.com/forums/viewtopic.php?t=12211." target="_blank You
##  may also find my other tutorials helpful, please visit 
##  http://www.presagemedia.com/hacks/cms_articles.php" target="_blank
##
################################################################################
##
##  This hack is released under the GPL License.
##  All Intellectual Property Rights are retained by the hack author(s) 
##  shown above.
##
##  This hack can be freely used, but not distributed, without permission.
##
################################################################################
## Author Notes: 
## 
##     This hack has been tested on phpBB v 2.0.4 & 2.0.6
## 
################################################################################
##
##  BEFORE ADDING THIS HACK TO YOUR FORUM, please be sure to backup ALL
##  affected files.
##
################################################################################

################################################################################
## IMPORTANT: FULL INSTALLATION.
## 
##     These instructions should only be followed if you have not already
##	   installed the 'External Forum Redirect' hack versions 1.0.0 or 1.0.1.
##
##     If you have installed an earlier version of this hack, please
##     disregard these instructions and follow the instructions in the
##     'Upgrade_from_v1.txt' file instead.
## 
################################################################################

##
##----------[ OPEN ]-------------------------------------
##

index.php

##
##----------[ FIND ]-------------------------------------
##

							$template->assign_block_vars('catrow.forumrow',	array(

##
##----------[ BEFORE, ADD ]------------------------------
##

							$forum_target = '';

							if ($forum_data[$j]['forum_external'])
							{
								$forum_url = append_sid("view_external.$phpEx?" . 

POST_FORUM_URL . "=$forum_id");

								$member_hits = $forum_data[$j]['forum_redirects_user'];
								$guest_hits = $forum_data[$j]['forum_redirects_guest'];
								$all_hits = ($member_hits + $guest_hits);

								$forum_details = $lang['External_text'] . '<b>' . $all_hits . 

'</b>';

								$forum_details .= ( $all_hits == 1 ) ? $lang['External_hit'] 

: $lang['External_hits'];
								
								$forum_details .= '<br />(' . $lang['External_members'] . ': 

<b>' . $member_hits . '</b>&nbsp;&middot;&nbsp;' . $lang['External_guests'] . ': <b>' . $guest_hits . '</b>)';

								$folder_image = ($forum_data[$j]['forum_ext_image']) ?  

$forum_data[$j]['forum_ext_image'] : $images['forum_external'];

								$forum_posts = '--';
								$forum_topics = '--';

								$forum_target = ($forum_data[$j]['forum_ext_newwin']) ? 

'target="_external"' : '';
							}
							else 
							{	
								$forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL 

. "=$forum_id");

								$forum_posts = $forum_data[$j]['forum_posts'];
								$forum_topics = $forum_data[$j]['forum_topics'];
								$forum_details = $last_post;
							}

##
##----------[ FIND ]-------------------------------------
##

								'POSTS' => $forum_data[$j]['forum_posts'],
								'TOPICS' => $forum_data[$j]['forum_topics'],

##
##----------[ REPLACE WITH ]-----------------------------
##

								'POSTS' => $forum_posts,
								'TOPICS' => $forum_topics,

##
##----------[ FIND ]-------------------------------------
##

								'LAST_POST' => $last_post,

##
##----------[ REPLACE WITH ]-----------------------------
##

								'LAST_POST' => $forum_details,
								'TARGET' => $forum_target,

##
##----------[ FIND ]-------------------------------------
##

								'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . 

POST_FORUM_URL . "=$forum_id"))

##
##----------[ REPLACE WITH ]-----------------------------
##

								'U_VIEWFORUM' => $forum_url)

##
##----------[ OPEN ]-------------------------------------
##

admin\admin_forums.php

##
##----------[ FIND ]-------------------------------------
##

				$forumstatus = $row['forum_status'];

##
##----------[ AFTER, ADD ]-------------------------------
##

				$forum_external = $row['forum_external'];
				$forum_redirect_url = $row['forum_redirect_url'];
				$forum_ext_newwin = $row['forum_ext_newwin'];
				$forum_ext_image = $row['forum_ext_image'];

##
##----------[ FIND ]-------------------------------------
##

				$forumstatus = FORUM_UNLOCKED;
				$forum_id = ''; 
				$prune_enabled = '';

##
##----------[ AFTER, ADD ]-------------------------------
##

				$forum_external = '0';
				$forum_redirect_url = '';
				$forum_ext_newwin = '0';
				$forum_ext_image = '';

##
##----------[ FIND ]-------------------------------------
##

				'L_DAYS' => $lang['Days'],

##
##----------[ AFTER, ADD ]-------------------------------
##

				'FORUM_EXTERNAL_YES' => ($forum_external) ? 'checked="checked"' : '',
				'FORUM_EXTERNAL_NO' => (!$forum_external) ? 'checked="checked"' : '',
				'FORUM_REDIRECT_URL' => $forum_redirect_url,
				'FORUM_EXT_NEWWIN_YES' => ($forum_ext_newwin) ? 'checked="checked"' : '',
				'FORUM_EXT_NEWWIN_NO' => (!$forum_ext_newwin) ? 'checked="checked"' : '',
				'FORUM_EXT_IMAGE' => $forum_ext_image,
				'L_FORUM_EXT_NEWWIN' => $lang['Forum_ext_newwin'],
				'L_FORUM_EXT_IMAGE' => $lang['Forum_ext_image'],
				'L_FORUM_EXTERNAL' => $lang['Forum_external'],
				'L_FORUM_REDIRECT_URL' => $lang['Forum_redirect_url'],
				'L_NO' => $lang['No'],
				'L_YES' => $lang['Yes'],

##
##----------[ FIND ]-------------------------------------
##
##  There is more to this piece of code than what is
##  shown here. This excerpt is shown since many hacks
##  alter this code, and so yours may be different than
##  the default code. This portion should remain constant.
##

			// There is no problem having duplicate forum names so we won't check for it.
			$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id,

##
##----------[ INLINE FIND ]------------------------------
##

forum_status

##
##----------[ AFTER, ADD ]-------------------------------
##

, forum_external, forum_redirect_url, forum_ext_newwin, forum_ext_image

##
##----------[ INLINE FIND ]------------------------------
##

" . intval($HTTP_POST_VARS['forumstatus']) . "

##
##----------[ AFTER, ADD ]-------------------------------
##

, " . intval($HTTP_POST_VARS['forum_external']) . ", '" . $HTTP_POST_VARS['forum_redirect_url'] . "', " . 

intval($HTTP_POST_VARS['forum_ext_newwin']) . ", '" . $HTTP_POST_VARS['forum_ext_image'] . "'

##
##----------[ FIND ]-------------------------------------
##
##  There is more to this piece of code than what is
##  shown here. This excerpt is shown since many hacks
##  alter this code, and so yours may be different than
##  the default code. This portion should remain constant.
##

			$sql = "UPDATE " . FORUMS_TABLE . "

##
##----------[ INLINE FIND ]------------------------------
##

forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . "

##
##----------[ AFTER, ADD ]-------------------------------
##

, forum_external = " . intval($HTTP_POST_VARS['forum_external']) . ", forum_redirect_url = '" . str_replace("\'", "''", 

$HTTP_POST_VARS['forum_redirect_url']) . "', forum_ext_newwin = " . intval($HTTP_POST_VARS['forum_ext_newwin']) . ", 

forum_ext_image = '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_ext_image']) . "'

##
##----------[ OPEN ]-------------------------------------
##

\language\lang_english\lang_admin.php

##
##----------[ FIND ]-------------------------------------
##

//
// That's all Folks!
// -------------------------------------------------

?>

##
##----------[ BEFORE, ADD ]------------------------------
##

// external forum redirect
$lang['Forum_external'] = 'External Site';
$lang['Forum_redirect_url'] = 'External URL';
$lang['Forum_ext_newwin'] = 'Launch external site in new window';
$lang['Forum_ext_image'] = 'Custom folder image for external site';

##
##----------[ OPEN ]-------------------------------------
##

\language\lang_english\lang_main.php

##
##----------[ FIND ]-------------------------------------
##

//
// That's all, Folks!
// -------------------------------------------------

?>

##
##----------[ BEFORE, ADD ]------------------------------
##

// External forum redirection
$lang['External_text'] = 'This link has been visited ';
$lang['External_hit'] = ' time.';
$lang['External_hits'] = ' times.';
$lang['External_members'] = 'Users';
$lang['External_guests'] = 'Guests';

##
##----------[ OPEN ]-------------------------------------
##

\templates\subSilver\subSilver.cfg

##
##----------[ FIND ]-------------------------------------
##

$images['forum_locked'] = "$current_template_images/folder_locked_big.gif";

##
##----------[ AFTER, ADD ]-------------------------------
##

$images['forum_external'] = "$current_template_images/folder_external.gif";

##
##----------[ OPEN ]-------------------------------------
##

\templates\subSilver\admin\forum_edit_body.tpl

##
##----------[ FIND ]-------------------------------------
##

	<tr> 
	  <td class="row1">{L_FORUM_STATUS}</td>
	  <td class="row2"><select name="forumstatus">{S_STATUS_LIST}</select></td>
	</tr>

##
##----------[ AFTER, ADD ]-------------------------------
##

	<tr> 
	  <td class="row1">{L_FORUM_EXTERNAL}</td>
	  <td class="row2"> 
		<input type="radio" name="forum_external" value="1" {FORUM_EXTERNAL_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="forum_external" value="0" {FORUM_EXTERNAL_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>
	<tr> 
	  <td class="row1">{L_FORUM_REDIRECT_URL}</td>
	  <td class="row2"><input class="post" type="text" name="forum_redirect_url" value="{FORUM_REDIRECT_URL}" size="60" 

class="post" /></td>
	</tr>
	<tr> 
	  <td class="row1">{L_FORUM_EXT_NEWWIN}</td>
	  <td class="row2"> 
		<input type="radio" name="forum_ext_newwin" value="1" {FORUM_EXT_NEWWIN_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="forum_ext_newwin" value="0" {FORUM_EXT_NEWWIN_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>
	<tr> 
	  <td class="row1">{L_FORUM_EXT_IMAGE}</td>
	  <td class="row2"><input class="post" type="text" name="forum_ext_image" value="{FORUM_EXT_IMAGE}" size="60" 

class="post" /></td>
	</tr>

##
##----------[ OPEN ]-------------------------------------
##

\templates\subSilver\index_body.tpl

##
##----------[ FIND ]-------------------------------------
##

<a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">

##
##----------[ REPLACE WITH ]-----------------------------
##

<a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink" {catrow.forumrow.TARGET}>

##
##----------[ SAVE AND CLOSE ALL FILES ]-----------------
##

##
##----------[ COPY FILES ]-------------------------------
##
##  Copy / upload the following files 
##
##		SEE README.txt FILE
##

From:	folder_external.php	
To:		\templates\subSilver\images\folder_external.php

From:	phpbb_root\view_external.php 
To:		\view_external.php

From:	phpbb_root\install_hack.php 
To:		\install_hack.php

##
##----------[ RUN ONCE AND DELETE IMMEDIATELY ]----------
##
##  Using your browser, navigate to the following file. Once the file has been
##  successfully run, please be sure to immediately delete this file from your
##  server.
##

install_hack.php

##
##----------[ POST-INSTALLATION ]------------------------
##

	You've completed all steps necessary to install this hack. Now go to your
	Admin Control Panel and create a new forum or edit an existing forum, and set
	the 'External Site', 'External URL', 'Launch in new window' and 'Custom image' settings appropriately to specify the 

forum as an external link.

	To specify a custom image for any external forum, enter the complete url
	to the desired image. If you leave this blank, the default external forum
	image will be used.

##

User avatar
GPHemsley
Registered User
Posts: 1617
Joined: Fri Apr 18, 2003 4:01 am
Location: Long Beach, NY
Contact:

Re: Critical Error, Can't figure out why

Post by GPHemsley »

Try switching all of the \ in the OPEN actions to / and it should work. ;)

Locked