After update to 2.0.4 from 2.0.3 -> Admin-Panel problem

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
seanblee
Registered User
Posts: 11
Joined: Sun Jan 26, 2003 3:53 pm
Location: Cornwall, UK
Contact:

Post by seanblee »

No good to me, as my phpBB is on its own domain (http://forums.disco2.com)...
coywolf
Registered User
Posts: 3
Joined: Thu Mar 06, 2003 10:26 pm

Post by coywolf »

In template_file_cache.php

Code: Select all

 
/**
 * Constructor. Simply sets the root dir.
 *
 */
function Template($root = '.')
{
  global $board_config, $db;

  $this->set_rootdir($root);
  $this->db = $db;
}

 /**
  * Sets the template root directory for this Template object.
  */
 function set_rootdir($dir)
 {
  global $phpbb_root_path;

  if (!is_dir($dir))
  {
   return false;
  }
/* Bug: 
   For an common visit 
   phpbb_root_path is ./ 
   $dir ( $root in function Template ) is ./templates/subSilver
   And $this->root is ././templates/subSilver Luckily no harm this time.
   
   For administrator now
   phpbb_root_path is ./../
   $dir is ./../templates/subSilver
   And $this->root is ./.././../templates/subSilver
*/
  $this->root = phpbb_realpath($phpbb_root_path . $dir);
/*
  We got different viewpoints of rootdir at different places! Fix it:
  To improve phpbb_realpath could fix it. The Key point is to remove double roots
  My solution is to NOT TO USE $phpbb_root_path. Replace it with
  $this->root = phpbb_realpath($dir);
*/
  $this->cachedir = phpbb_realpath($phpbb_root_path . $dir . '/cache/');
/*The same reason to fix it to 
  $this->cachedir = phpbb_realpath($dir . '/cache/');
*/
  return true;
 }
coywolf
Registered User
Posts: 3
Joined: Thu Mar 06, 2003 10:26 pm

Simple version

Post by coywolf »

Find

Code: Select all

	/**
	 * Sets the template root directory for this Template object.
	 */
	function set_rootdir($dir)
	{
		global $phpbb_root_path;

		if (!is_dir($dir))
		{
			return false;
		}

      $this->root = phpbb_realpath($phpbb_root_path . $dir);
      $this->cachedir = phpbb_realpath($phpbb_root_path . $dir . '/cache/');
		return true;
	}
Change to

Code: Select all

	/**
	 * Sets the template root directory for this Template object.
	 */
	function set_rootdir($dir)
	{
		global $phpbb_root_path;

		if (!is_dir($dir))
		{
			return false;
		}

// Coywolf's fix
		$this->root = phpbb_realpath($dir);
      $this->cachedir = phpbb_realpath($dir . '/cache/');
		return true;
	}
seanblee
Registered User
Posts: 11
Joined: Sun Jan 26, 2003 3:53 pm
Location: Cornwall, UK
Contact:

Post by seanblee »

That did the trick, thanks very much!
su3su2u1
Registered User
Posts: 5
Joined: Wed Feb 23, 2005 6:33 am

where is the file that you were talking about?

Post by su3su2u1 »

Hello coywolf,

template_file_cache.php

Where is this file? I can't find?! I am using Windows XP and phpbb without phpbb2 plus. I am getting the same problem:

"Template->make_filename(): Error - file admin/index_frameset.tpl does not exist"

after installing the "Andromeda Boards" theme from this site:

http://www.phpbb-design.com/templates/

Thank you.
Locked

Return to “2.0.x Support Forum”