phpBBHacks.com - Template->make_filename(): Error - file does not exist
Bad Boy Blog, an unofficial Diddy and Bad Boy fan blog
StatsForums Home   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in
FAQFAQ   SearchSearch   MemberlistMemberlist   TutorialsTutorials   ContactContact Us
Username:    Password:
Remember Me?    
   I Lost My Password!
Bookmark and Share
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2: Troubleshooting
 See a User Guidelines violation? Please contact us.
Author Message

Thoul
VIP

Joined: 30 Jul 2002
Posts: 18040
Location: USA

PostPosted: December 7th 2003, 2:22 pm    Post subject: Template->make_filename(): Error - file does not exist Reply with quote

phpBB wrote:
Template->make_filename(): Error - file does not exist


This is a commonly seen phpBB error message. Unfortunately, this one is not very helpful and can be hard to track down. The error means that phpBB can not find a template file it needs to display a page. As you may notice, the name of the missing template file is not displayed. Sometimes the name will be displayed, but this is most often not the case.

To fix this error, you need to determine which template file is missing. There are a few ways to do this.

  1. If you have recently installed a hack that added new template files, be sure you've added these new files in every template. While most hack instructions will only tell you to add or edit files in the subSilver template, you really need to make those changes to every template installed on your forums.
  2. If you have recently installed a new template, and previously installed any hacks that added new template files, then you have a similar situation. Add the hack(s) template files to the new template. Please note that using a prehacked forum package does, in this sense, count as previously installing hacks that add new template files.
  3. The "hard way" to find out which template files are missing is to compare a list of all the files in every template's directory. If some templates are missing files that are present in another template, copy those files to the template that does not have them.


Another method of determining which template file is missing involves fixing an error within the error message itself. I mentioned earlier that this error message often does not include the name of the file that is missing. Originally, it was designed to always include the filename, but changes in phpBB have broken this functionality in phpBB 2.0.4 - 2.0.11. Please note that phpBB 2.0.12 and the eXtreme Styles hack both fix this problem. To repair this error and ensure that the filename is always displayed in the error message, make the following change to includes/template.php. View the page that presented the error again and you'll see which file is missing.

Code:
#
#-----[ FIND ]------------------------------------------
#
   function make_filename($filename)
   {
      // Check if it's an absolute or relative path.
      if (substr($filename, 0, 1) != '/')
      {
             $filename = phpbb_realpath($this->root . '/' . $filename);
      }

      if (!file_exists($filename))
      {
         die("Template->make_filename(): Error - file $filename does not exist");
      }

      return $filename;
   }

#
#-----[ REPLACE WITH ]------------------------------------------
#
   function make_filename($filename)
   {
      $old_filename = $filename;
      // Check if it's an absolute or relative path.
      if (substr($filename, 0, 1) != '/')
      {
             $old_filename = $this->root . '/' . $old_filename;
          $filename = phpbb_realpath($this->root . '/' . $filename);
      }

      if (!file_exists($filename))
      {
         if ( !$filename )
         {
            $filename = $old_filename;
         }
         die("Template->make_filename(): Error - file $filename does not exist");
      }

      return $filename;
   }


This code is also available for download as a hack.
_________________
Fringes of Algo - Phantasy Star Community
TV Blitz Forums - Television Discussion Community
phpBB Smith: Modifications

70+ Listings @ phpBBHacks.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2: Troubleshooting All times are GMT - 6 Hours
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Big Message Boards - Free JavaScript - phpBB2 - phpbb styles - Suporte phpBB - phpBB Česky - phpBB Turkiye - phpBBArabia.com - phpBB-fr.com - Romanian phpBB online community - phpBB-TW.net - phpBBservice.nl - phpBB Brasil - phpBB Portugal - phpBBpersian.com

Network: iFroggy Hosting - PhotoshopForums.com - Managing Online Forums - ManagingCommunities.com - CommunityAdmins.com - KarateForums.com - Bad Boy Blog - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact Us - Disclosure Policy - Staff - User Guidelines >

Copyright © 2001-2012. iFroggy Network, phpBBHacks.com. All Rights Reserved. Privacy Policy. We Support phpBBHacks.com (of course!).
Powered by phpBB © phpBB Group. phpBB SEO. We are in no way affiliated with the phpBB Group. phpBB is copyright to the phpBB Group.