Problem with ./templates/...tpl files not being forund

Having problems installing EM? Let's fix that
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
StuartBall
Registered User
Posts: 9
Joined: Tue Feb 22, 2005 8:58 pm

Re: Problem with ./templates/...tpl files not being forund

Post by StuartBall » Mon Feb 28, 2005 9:25 pm

I have sorted it!

I did a Google search on getcwd() and found a posting which gave an alternative function to get the current directory: dirname(__FILE__);

So I inserted the folllowing line in easymod_display_functions.php to fix $template_file so that it has a full path instead of starting with "." for the current directory.

Code: Select all

function display_template( $template_file, $variables)
{
   // fix $template_file (which is in format "./templates/<filename>.php
   // so that it has the full path
   $template_file =  dirname(__FILE__) . substr($template_file, 1, 999);

	if (!file_exists( $template_file))
	// make sure the tpl file exists
   {
	  echo "<h1><span class="ok">A required file [$template_file] is missing.  Aborting install.</span></h1>\n" ;
    }
The whole thing then ran fine and it installed correctly, just as on my development machine. I don't really feel we got to the bottom of the problem here, but at least this provides a workaround the next time a server on which getcwd() does not work comes up.

Stuart

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

Re: Problem with ./templates/...tpl files not being forund

Post by GPHemsley » Mon Feb 28, 2005 9:59 pm

OK, thanks for that. Noted. This bug, along with a handful of others, will be fixed in the next version... whenever that'll be.

StuartBall
Registered User
Posts: 9
Joined: Tue Feb 22, 2005 8:58 pm

Re: Problem with ./templates/...tpl files not being forund

Post by StuartBall » Mon Feb 28, 2005 10:01 pm

Thanks for all your help.

Stuart

Locked