FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » 2.6.8: Wrong template name in Template Editor
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
icon6.gif  2.6.8: Wrong template name in Template Editor [message #21353] Fri, 26 November 2004 10:55 Go to next message
KeksKlip is currently offline  KeksKlip   Russian Federation
Messages: 1
Registered: November 2004
Karma: 0
Junior Member
I've got wrong name in Template Editor for curtime.tmpl.
It looked like this
"C:\Inetpub\wwwroot\frm\thm\default\tmpl\curtime.tmpl"
FUDforum Version 2.6.8 update from cvs

I've found misstake in adm\tmpllist.php
* $Id: tmpllist.php,v 1.38 2004/11/24 19:53:43 hackie Exp $

What it was
foreach ($files as $f) {
		$data = file_get_contents($f);
		$n = basename($f);

		if ($n == 'footer.tmpl' || $n == 'header.tmpl') {
			$file = $n;
		} else {
			/* fetch file name */
			if (($p = strpos($data, '{PHP_FILE: input: ')) === false) {
				$file = $f; // it's full file name (KeksKlip)
			} else {
				$p = strpos($data, '; output: ', $p) + 10;
				if ($data[$p] == '@' || $data[$p] == '!') {
					++$p;
				}
				$file = substr($data, $p, (strpos($data, ';', $p) - $p));
				if ($file != 'forum.css') {
					$file = substr($file, 0, strrpos($file, '.'));
				}
				$file .= '.tmpl';
			}
		}


What I think it should be
foreach ($files as $f) {
		$data = file_get_contents($f);
		$n = basename($f);

		if ($n == 'footer.tmpl' || $n == 'header.tmpl') {
			$file = $n;
		} else {
			/* fetch file name */
			if (($p = strpos($data, '{PHP_FILE: input: ')) === false) {
				$file = $n; // only file name (KeksKlip)
			} else {
				$p = strpos($data, '; output: ', $p) + 10;
				if ($data[$p] == '@' || $data[$p] == '!') {
					++$p;
				}
				$file = substr($data, $p, (strpos($data, ';', $p) - $p));
				if ($file != 'forum.css') {
					$file = substr($file, 0, strrpos($file, '.'));
				}
				$file .= '.tmpl';
			}
		}

[Updated on: Fri, 26 November 2004 11:15]

Report message to a moderator

Re: 2.6.8: Wrong template name in Template Editor [message #21357 is a reply to message #21353] Fri, 26 November 2004 14:23 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Fixed in CVS.

Thanks.


FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Email setting sender?
Next Topic: Bulbs doesn't snuff out
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 05:49:37 GMT 2024

Total time taken to generate the page: 0.01905 seconds