Template and ereg problems!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mikelou
Forum Newbie
Posts: 4
Joined: Tue Jun 11, 2002 5:20 am

Template and ereg problems!

Post by mikelou »

:cry:
Hello,

I am very new to PHP and have been pulling out my hair over this problem. A friend of mine put together this site for me and up until recently it was working fine. Now all the links are mucked up and the site doesn't work as it should!

I think that the problem lies with this part of the code, can anyone help?

The URL to look at is http://www.andoverpool.co.uk/index.php?ua=division_list , I am completely stuck.


// Prints the warnings for unresolved variable references
// in template files. Used if STRICT is true

function show_unknowns ($Line)
{
$unknown = array();
if (ereg("([A-Z0-9_]+)",$Line,$unknown))
{
$UnkVar = $unknown[1];
if(!(empty($UnkVar)))
{
@error_log("[FastTemplate] Warning: no value found for variable: $UnkVar ",0);
}
}
} // end show_unknowns()

// ************************************************************
// This routine get's called by parse() and does the actual
// {VAR} to VALUE conversion within the template.

function parse_template ($template, $tpl_array)
{
while ( list ($key,$val) = each ($tpl_array) )
{
if (!(empty($key)))
{
if(gettype($val) != "string")
{
settype($val,"string");
}

$template = ereg_replace("{" . $key. "}","$val","$template");
//$template = str_replace("{$key}","$val","$template");
}
}

if(!$this->STRICT)
{
// Silently remove anything not already found

$template = ereg_replace("([A-Z0-9_]+)","",$template);
}
else
{
// Warn about unresolved template variables
if (ereg("([A-Z0-9_]+)",$template))
{
$unknown = split("\n",$template);
while (list ($Element,$Line) = each($unknown) )
{
$UnkVar = $Line;
if(!(empty($UnkVar)))
{
$this->show_unknowns($UnkVar);
}
}
}
}
return $template;

} //end parse_template();
Wandrer
Forum Newbie
Posts: 21
Joined: Thu Jun 06, 2002 8:43 am

Post by Wandrer »

Can you post the html of the template ? What template system are you using (FastTemplate?) ?
mikelou
Forum Newbie
Posts: 4
Joined: Tue Jun 11, 2002 5:20 am

Post by mikelou »

It's a fast template, originally I had a an error message on lines 196 and 210 basically saying there was an error nothing parsed.

Here is the whole code of the fast template. This is where everything happens as far as I can make out. The index page gets all it's info from templates.

Thanks

Mike

Code: Select all

<?php


class FastTemplate &#123;

	var $FILELIST	=	array();	//	Holds the array of filehandles
									//	FILELIST&#1111;HANDLE] == "fileName"

	var $DYNAMIC	=	array();	//	Holds the array of dynamic
									//	blocks, and the fileHandles they
									//	live in.

	var $PARSEVARS	=	array();	//	Holds the array of Variable
									//	handles.
									//	PARSEVARS&#1111;HANDLE] == "value"

	var	$LOADED		=	array();	//	We only want to load a template
									//	once - when it's used.
									//	LOADED&#1111;FILEHANDLE] == 1 if loaded
									//	undefined if not loaded yet.

	var	$HANDLE		=	array();	//	Holds the handle names assigned
									//	by a call to parse()

	var	$ROOT		=	"";			//	Holds path-to-templates

	var $WIN32		=	true;		//	Set to true if this is a WIN32 server

	var $ERROR		=	"";			//	Holds the last error message

	var $LAST		=	"";			//	Holds the HANDLE to the last
									//	template parsed by parse()

	var $STRICT		=	true;		//	Strict template checking.
									//	Unresolved vars in templates will
									//	generate a warning when found.

//	************************************************************

	function FastTemplate ($pathToTemplates = "")
	&#123;
		global $php_errormsg;

		if(!empty($pathToTemplates))
		&#123;
			$this->set_root($pathToTemplates);
		&#125;

	&#125;	// end (new) FastTemplate ()


//	************************************************************
//	All templates will be loaded from this "root" directory
//	Can be changed in mid-process by re-calling with a new
//	value.

	function set_root ($root)
	&#123;
		$trailer = substr($root,-1);

		if(!$this->WIN32)
		&#123;
			if( (ord($trailer)) != 47 )
			&#123;
				$root = "$root". chr(47);
			&#125;

			if(is_dir($root))
			&#123;
				$this->ROOT = $root;
			&#125;
			else
			&#123;
				$this->ROOT = "";
				$this->error("Specified ROOT dir &#1111;$root] is not a directory");
			&#125;
		&#125;
		else
		&#123;
			// WIN32 box - no testing
			if( (ord($trailer)) != 92 )
			&#123;
				$root = "$root" . chr(92);
			&#125;
			$this->ROOT = $root;
		&#125;

	&#125;	// End set_root()


//  **************************************************************
//  Calculates current microtime
//	I throw this into all my classes for benchmarking purposes
//	It's not used by anything in this class and can be removed
//	if you don't need it.


	function utime ()
	&#123;
		$time = explode( " ", microtime());
		$usec = (double)$time&#1111;0];
		$sec = (double)$time&#1111;1];
		return $sec + $usec;
    &#125;

//  **************************************************************
//	Strict template checking, if true sends warnings to STDOUT when
//	parsing a template with undefined variable references
//	Used for tracking down bugs-n-such. Use no_strict() to disable.

	function strict ()
	&#123;
		$this->STRICT = true;
	&#125;

//	************************************************************
//	Silently discards (removes) undefined variable references
//	found in templates

	function no_strict ()
	&#123;
		$this->STRICT = false;
	&#125;

//	************************************************************
//	A quick check of the template file before reading it.
//	This is -not- a reliable check, mostly due to inconsistencies
//	in the way PHP determines if a file is readable.

	function is_safe ($filename)
	&#123;
		if(!file_exists($filename))
		&#123;
			$this->error("&#1111;$filename] does not exist",0);
			return false;
		&#125;
		return true;
	&#125;

//	************************************************************
//	Grabs a template from the root dir and 
//	reads it into a (potentially REALLY) big string

	function get_template ($template)
	&#123;
		if(empty($this->ROOT))
		&#123;
			$this->error("Cannot open template. Root not valid.",1);
			return false;
		&#125;

		$filename	=	"$this->ROOT"."$template";

		$contents = implode("",(@file($filename)));
		if( (!$contents) or (empty($contents)) )
		&#123;
			$this->error("get_template() failure: &#1111;$filename] $php_errormsg",1);
		&#125;

		return $contents;

	&#125; // end get_template

//	************************************************************
//	Prints the warnings for unresolved variable references
//	in template files. Used if STRICT is true

	function show_unknowns ($Line)
	&#123;
		$unknown = array();
		if (ereg("(&#123;&#1111;A-Z0-9_]+&#125;)",$Line,$unknown))
		&#123;
			$UnkVar = $unknown&#1111;1];
			if(!(empty($UnkVar)))
			&#123;
				@error_log("&#1111;FastTemplate] Warning: no value found for variable: $UnkVar ",0);
			&#125;
		&#125;
	&#125;	// end show_unknowns()

//	************************************************************
//	This routine get's called by parse() and does the actual
//	&#123;VAR&#125; to VALUE conversion within the template.

	function parse_template ($template, $tpl_array)
	&#123;
		while ( list ($key,$val) = each ($tpl_array) )
		&#123;
			if (!(empty($key)))
			&#123;
				if(gettype($val) != "string")
				&#123;
					settype($val,"string");
				&#125;

				$template = ereg_replace("&#123;" . $key. "&#125;","$val","$template");
				//$template = str_replace("&#123;$key&#125;","$val","$template");
			&#125;
		&#125;

		if(!$this->STRICT)
		&#123;
			// Silently remove anything not already found

			$template = ereg_replace("&#123;(&#1111;A-Z0-9_]+)&#125;","",$template);
		&#125;
		else
		&#123;
			// Warn about unresolved template variables
			if (ereg("(&#123;&#1111;A-Z0-9_]+&#125;)",$template))
			&#123;
				$unknown = split("\n",$template);
				while (list ($Element,$Line) = each($unknown) )
				&#123;
					$UnkVar = $Line;
					if(!(empty($UnkVar)))
					&#123;
						$this->show_unknowns($UnkVar);
					&#125;
				&#125;
			&#125;
		&#125;
		return $template;

	&#125;	// end parse_template();

//	************************************************************
//	The meat of the whole class. The magic happens here.

	function parse ( $ReturnVar, $FileTags )
	&#123;
		$append = false;
		$this->LAST = $ReturnVar;
		$this->HANDLE&#1111;$ReturnVar] = 1;

		if (gettype($FileTags) == "array")
		&#123;
			unset($this->$ReturnVar);	// Clear any previous data

			while ( list ( $key , $val ) = each ( $FileTags ) )
			&#123;
				if ( (!isset($this->$val)) || (empty($this->$val)) )
				&#123;
					$this->LOADED&#1111;"$val"] = 1;
					if(isset($this->DYNAMIC&#1111;"$val"]))
					&#123;
						$this->parse_dynamic($val,$ReturnVar);
					&#125;
					else
					&#123;
						$fileName = $this->FILELIST&#1111;"$val"];
						$this->$val = $this->get_template($fileName);
					&#125;
				&#125;

				//	Array context implies overwrite

				$this->$ReturnVar = $this->parse_template($this->$val,$this->PARSEVARS);

				//	For recursive calls.

				$this->assign( array( $ReturnVar => $this->$ReturnVar ) );

			&#125;
		&#125;	// end if FileTags is array()
		else
		&#123;
			// FileTags is not an array

			$val = $FileTags;

			if( (substr($val,0,1)) == '.' )
			&#123;
				// Append this template to a previous ReturnVar

				$append = true;
				$val = substr($val,1);
			&#125;

			if ( (!isset($this->$val)) || (empty($this->$val)) )
			&#123;
					$this->LOADED&#1111;"$val"] = 1;
					if(isset($this->DYNAMIC&#1111;"$val"]))
					&#123;
						$this->parse_dynamic($val,$ReturnVar);
					&#125;
					else
					&#123;
						$fileName = $this->FILELIST&#1111;"$val"];
						$this->$val = $this->get_template($fileName);
					&#125;
			&#125;

			if($append)
			&#123;
				$this->$ReturnVar .= $this->parse_template($this->$val,$this->PARSEVARS);
			&#125;
			else
			&#123;
				$this->$ReturnVar = $this->parse_template($this->$val,$this->PARSEVARS);
			&#125;

			//	For recursive calls.

			$this->assign(array( $ReturnVar => $this->$ReturnVar) );

		&#125;
		return;
	&#125;	//	End parse()


//	************************************************************

	function FastPrint ( $template = "" )
	&#123;
		if(empty($template))
		&#123;
			$template = $this->LAST;
		&#125;

		if( (!(isset($this->$template))) || (empty($this->$template)) )
		&#123;
			$this->error("Nothing parsed, nothing printed",0);
			return;
		&#125;
		else
		&#123;
			print $this->$template;
		&#125;
		return;
	&#125;

//	************************************************************

	function fetch ( $template = "" )
	&#123;
		if(empty($template))
		&#123;
			$template = $this->LAST;
		&#125;
		if( (!(isset($this->$template))) || (empty($this->$template)) )
		&#123;
			$this->error("Nothing parsed, nothing printed",0);
			return "";
		&#125;

		return($this->$template);
	&#125;


//	************************************************************

	function define_dynamic ($Macro, $ParentName)
	&#123;
		//	A dynamic block lives inside another template file.
		//	It will be stripped from the template when parsed
		//	and replaced with the &#123;$Tag&#125;.

		$this->DYNAMIC&#1111;"$Macro"] = $ParentName;
		return true;
	&#125;

//	************************************************************

	function parse_dynamic ($Macro,$MacroName)
	&#123;
		// The file must already be in memory.

		$ParentTag = $this->DYNAMIC&#1111;"$Macro"];
		if( (!$this->$ParentTag) or (empty($this->$ParentTag)) )
		&#123;
			$fileName = $this->FILELIST&#1111;$ParentTag];
			$this->$ParentTag = $this->get_template($fileName);
			$this->LOADED&#1111;$ParentTag] = 1;
		&#125;
		if($this->$ParentTag)
		&#123;
			$template = $this->$ParentTag;
			$DataArray = split("\n",$template);
			$newMacro = "";
			$newParent = "";
			$outside = true;
			$start = false;
			$end = false;
			while ( list ($lineNum,$lineData) = each ($DataArray) )
			&#123;
				$lineTest = trim($lineData);
				if("<!-- BEGIN DYNAMIC BLOCK: $Macro -->" == "$lineTest" )
				&#123;
					$start = true;
					$end = false;
					$outside = false;
				&#125;
				if("<!-- END DYNAMIC BLOCK: $Macro -->" == "$lineTest" )
				&#123;
					$start = false;
					$end = true;
					$outside = true;
				&#125;
				if( (!$outside) and (!$start) and (!$end) )
				&#123;
					$newMacro .= "$lineData\n"; // Restore linebreaks
				&#125;
				if( ($outside) and (!$start) and (!$end) )
				&#123;
					$newParent .= "$lineData\n"; // Restore linebreaks
				&#125;
				if($end)
				&#123;
					$newParent .= "&#123;$MacroName&#125;\n";
				&#125;
				// Next line please
				if($end) &#123; $end = false; &#125;
				if($start) &#123; $start = false; &#125;
			&#125;	// end While

			$this->$Macro = $newMacro;
			$this->$ParentTag = $newParent;
			return true;

		&#125;	// $ParentTag NOT loaded - MAJOR oopsie
		else
		&#123;
			@error_log("ParentTag: &#1111;$ParentTag] not loaded!",0);
			$this->error("ParentTag: &#1111;$ParentTag] not loaded!",0);
		&#125;
		return false;
	&#125;

//	************************************************************
//	Strips a DYNAMIC BLOCK from a template.

	function clear_dynamic ($Macro="")
	&#123;
		if(empty($Macro)) &#123; return false; &#125;

		// The file must already be in memory.

		$ParentTag = $this->DYNAMIC&#1111;"$Macro"];

		if( (!$this->$ParentTag) or (empty($this->$ParentTag)) )
		&#123;
			$fileName = $this->FILELIST&#1111;$ParentTag];
			$this->$ParentTag = $this->get_template($fileName);
			$this->LOADED&#1111;$ParentTag] = 1;
		&#125;

		if($this->$ParentTag)
		&#123;
			$template = $this->$ParentTag;
			$DataArray = split("\n",$template);
			$newParent = "";
			$outside = true;
			$start = false;
			$end = false;
			while ( list ($lineNum,$lineData) = each ($DataArray) )
			&#123;
				$lineTest = trim($lineData);
				if("<!-- BEGIN DYNAMIC BLOCK: $Macro -->" == "$lineTest" )
				&#123;
					$start = true;
					$end = false;
					$outside = false;
				&#125;
				if("<!-- END DYNAMIC BLOCK: $Macro -->" == "$lineTest" )
				&#123;
					$start = false;
					$end = true;
					$outside = true;
				&#125;
				if( ($outside) and (!$start) and (!$end) )
				&#123;
					$newParent .= "$lineData\n"; // Restore linebreaks
				&#125;
				// Next line please
				if($end) &#123; $end = false; &#125;
				if($start) &#123; $start = false; &#125;
			&#125;	// end While

			$this->$ParentTag = $newParent;
			return true;

		&#125;	// $ParentTag NOT loaded - MAJOR oopsie
		else
		&#123;
			@error_log("ParentTag: &#1111;$ParentTag] not loaded!",0);
			$this->error("ParentTag: &#1111;$ParentTag] not loaded!",0);
		&#125;
		return false;
	&#125;


//	************************************************************

	function define ($fileList)
	&#123;
		while ( list ($FileTag,$FileName) = each ($fileList) )
		&#123;
			$this->FILELIST&#1111;"$FileTag"] = $FileName;
		&#125;
		return true;
	&#125;

//	************************************************************

	function clear_parse ( $ReturnVar = "")
	&#123;
		$this->clear($ReturnVar);
	&#125;

//	************************************************************

	function clear ( $ReturnVar = "" )
	&#123;
		// Clears out hash created by call to parse()

		if(!empty($ReturnVar))
		&#123;
			if( (gettype($ReturnVar)) != "array")
			&#123;
				unset($this->$ReturnVar);
				return;
			&#125;
			else
			&#123;
				while ( list ($key,$val) = each ($ReturnVar) )
				&#123;
					unset($this->$val);
				&#125;
				return;
			&#125;
		&#125;

		// Empty - clear all of them

		while ( list ( $key,$val) = each ($this->HANDLE) )
		&#123;
			$KEY = $key;
			unset($this->$KEY);
		&#125;
		return;

	&#125;	//	end clear()

//	************************************************************

	function clear_all ()
	&#123;
		$this->clear();
		$this->clear_assign();
		$this->clear_define();
		$this->clear_tpl();

		return;

	&#125;	//	end clear_all

//	************************************************************

	function clear_tpl ($fileHandle = "")
	&#123;
		if(empty($this->LOADED))
		&#123;
			// Nothing loaded, nothing to clear

			return true;
		&#125;
		if(empty($fileHandle))
		&#123;
			// Clear ALL fileHandles

			while ( list ($key, $val) = each ($this->LOADED) )
			&#123;
				unset($this->$key);
			&#125;
			unset($this->LOADED);

			return true;
		&#125;
		else
		&#123;
			if( (gettype($fileHandle)) != "array")
			&#123;
				if( (isset($this->$fileHandle)) || (!empty($this->$fileHandle)) )
				&#123;
					unset($this->LOADED&#1111;$fileHandle]);
					unset($this->$fileHandle);
					return true;
				&#125;
			&#125;
			else
			&#123;
				while ( list ($Key, $Val) = each ($fileHandle) )
				&#123;
					unset($this->LOADED&#1111;$Key]);
					unset($this->$Key);
				&#125;
				return true;
			&#125;
		&#125;

		return false;

	&#125;	// end clear_tpl

//	************************************************************

	function clear_define ( $FileTag = "" )
	&#123;
		if(empty($FileTag))
		&#123;
			unset($this->FILELIST);
			return;
		&#125;

		if( (gettype($Files)) != "array")
		&#123;
			unset($this->FILELIST&#1111;$FileTag]);
			return;
		&#125;
		else
		&#123;
			while ( list ( $Tag, $Val) = each ($FileTag) )
			&#123;
				unset($this->FILELIST&#1111;$Tag]);
			&#125;
			return;
		&#125;
	&#125;

//	************************************************************
//	Aliased function - used for compatibility with CGI::FastTemplate
	function clear_parse ()
	&#123;
		$this->clear_assign();
	&#125;

//	************************************************************
//	Clears all variables set by assign()

	function clear_assign ()
	&#123;
		if(!(empty($this->PARSEVARS)))
		&#123;
			while(list($Ref,$Val) = each ($this->PARSEVARS) )
			&#123;
				unset($this->PARSEVARS&#1111;"$Ref"]);
			&#125;
		&#125;
	&#125;

//	************************************************************

	function clear_href ($href)
	&#123;
		if(!empty($href))
		&#123;
			if( (gettype($href)) != "array")
			&#123;
				unset($this->PARSEVARS&#1111;$href]);
				return;
			&#125;
			else
			&#123;
				while (list ($Ref,$val) = each ($href) )
				&#123;
					unset($this->PARSEVARS&#1111;$Ref]);
				&#125;
				return;
			&#125;
		&#125;
		else
		&#123;
			// Empty - clear them all

			$this->clear_assign();
		&#125;
		return;
	&#125;

//	************************************************************

	function assign ($tpl_array, $trailer="")
	&#123;
		if(gettype($tpl_array) == "array")
		&#123;
			while ( list ($key,$val) = each ($tpl_array) )
			&#123;
				if (!(empty($key)))
				&#123;
					//	Empty values are allowed
					//	Empty Keys are NOT

					$this->PARSEVARS&#1111;"$key"] = $val;
				&#125;
			&#125;
		&#125;
		else
		&#123;
			// Empty values are allowed in non-array context now.
			if (!empty($tpl_array))
			&#123;
				$this->PARSEVARS&#1111;"$tpl_array"] = $trailer;
			&#125;
		&#125;
	&#125;

//	************************************************************
//	Return the value of an assigned variable.
//	Christian Brandel cbrandel@gmx.de

	function get_assigned($tpl_name = "")
	&#123;
		if(empty($tpl_name)) &#123; return false; &#125;
		if(isset($this->PARSEVARS&#1111;"$tpl_name"]))
		&#123;
			return ($this->PARSEVARS&#1111;"$tpl_name"]);
		&#125;
		else
		&#123;
			return false;
        &#125;
	&#125;

//	************************************************************

	function error ($errorMsg, $die = 0)
	&#123;
		$this->ERROR = $errorMsg;
		echo "ERROR: $this->ERROR <BR> \n";
		if ($die == 1)
		&#123;
			exit;
		&#125;

		return;

	&#125; // end error()


//	************************************************************



//	************************************************************

&#125; // End class.FastTemplate.php3

?>
Wandrer
Forum Newbie
Posts: 21
Joined: Thu Jun 06, 2002 8:43 am

Post by Wandrer »

Could you post the html page you are using as a template ?
Wandrer
Forum Newbie
Posts: 21
Joined: Thu Jun 06, 2002 8:43 am

Post by Wandrer »

Also, it looks like your fasttemplate class may be messed up. Download it again from:

http://www.thewebmasters.net/php/FastTemplate.phtml

and be sure to make the changes from July 20, 1999 to the class you download.
mikelou
Forum Newbie
Posts: 4
Joined: Tue Jun 11, 2002 5:20 am

Post by mikelou »

Thanks for that, I will do so. Here is the template code.

Code: Select all

<?php

//A class (or an 'object') basically describes a real world thing. 
//In this case we are describing all the properties and methods of a group of Divisions
class DivisionGroup&#123;

	var $RTE;				//The runtime environment

	//This function is run when you create an instance of the class
	function DivisionGroup( $RTE )&#123;

		//Sets the internal variable RTE so that we have access to it ( it has stuff like the database in it and all that)
		$this->RTE = $RTE;
	&#125;
	
	//We call this when we want to find out more about a Division - it is better to do this here than anywhere else
	function GetDivision( $divisionID )&#123;
		return new Division( $this->RTE, $divisionID );
	&#125;
	
	function GetDivisionIDS()&#123;
		return $this->RTE->poolDB->GetValues( "division", "ID" );
	&#125;
	
	//This spits out all the HTML (FROM A TEMPLATE!!!) to make the division list
	function OutputDivisionTable( $short="t" )&#123;
		$divisionIDs = $this->GetDivisionIDs();
		
		$tpl = new FastTemplate( $this->RTE->templateDIR );
		
		if ( $short == "t" ) &#123;
			$templatePrefix = "short";
		&#125; else &#123;
			$templatePrefix = "long";
		&#125;
		$tpl->define( array( 
				"division_table_hdr" => "division_table_".$templatePrefix."_hdr.tpl",
				"division_table_dtl" => "division_table_".$templatePrefix."_dtl.tpl"
					) );		
		if ( count( $divisionIDs ) < 1 ) &#123;
				$tpl->assign( ROWS, "" );		
		&#125; else &#123;
			foreach( $divisionIDs as $divisionID )&#123;
				$division = $this->GetDivision( $divisionID );
				$tpl->assign( DIVISION_ID, $divisionID );
				$tpl->assign( DIVISION_NAME, $division->GetName() );
				$tpl->parse( ROWS, ".division_table_dtl" );
			&#125;		
		&#125;
		$tpl->parse( MAIN, "division_table_hdr" );
		return $tpl->fetch( MAIN );
	
	&#125;
	
	function AddDivision( $name )&#123;
		$sql = "INSERT into division VALUES( '','$name')";
		$this->RTE->poolDB->RunSQL( $sql );	
	&#125;
	
	function OutputDivisionSelection( $def_divisionID="0" )&#123;
		$divisionIDs = $this->GetDivisionIDs();
		
		$tpl = new FastTemplate( $this->RTE->templateDIR );
		
		$tpl->define( array( 
				"division_dd_hdr" => "division_dd_hdr.tpl",
				"division_dd_dtl" => "division_dd_dtl.tpl"
					) );		
		//Do the unassigned one first
		$tpl->assign( DIVISION_ID, 0 );
		$tpl->assign( DIVISION_NAME, "Not assigned to a division" );
		if ( $def_divisionID == 0 ) &#123;
			$tpl->assign( SELECTED, "selected" );
		&#125; else &#123;
			$tpl->assign( SELECTED, "" );
		&#125;
		$tpl->parse( ROWS, ".division_dd_dtl" );		
		
		foreach( $divisionIDs as $divisionID )&#123;
			$division = $this->GetDivision( $divisionID );
			$tpl->assign( DIVISION_ID, $divisionID );
			$tpl->assign( DIVISION_NAME, $division->GetName() );
			if ( $def_divisionID == $divisionID ) &#123;
				$tpl->assign( SELECTED, "selected" );
			&#125; else &#123;
				$tpl->assign( SELECTED, "" );
			&#125;
			$tpl->parse( ROWS, ".division_dd_dtl" );
		&#125;
		$tpl->parse( MAIN, "division_dd_hdr" );
		return $tpl->fetch( MAIN );
	&#125;

&#125;//class DivisionGroup


?>
mikelou
Forum Newbie
Posts: 4
Joined: Tue Jun 11, 2002 5:20 am

Post by mikelou »

I think this is working now...

Thanks very much for your help with this.

Mike
Post Reply