<?php

class UBB_TEMPLATE extends UBB
{
	//the vars allow1 and allow2 contain respectively
	//the types that it is allowed to be.
	//Here for example, allow1 may be nothing (EMPTY), or of the type STRING
	//allow2 can only be of the type STRING
	var $allow1 = array('EMPTY', 'STRING', 'USERDEF');
	var $allow2 = 'STRING';
	
	
	//the $info-var contains some info about the current tag
	var $info = array('Name'=>'UBB Template-tag', 'Version'=>'1.0', 'Info'=>'info about this plugin here');
	
	//if you want to use some non-standard types, you can define
	//it in the var ext_types. Do it as follows: TYPE as the key, and the
	//regex as the value. (try to uppercase the type). You can 
	//extend the types with as many types as you want.
	//Notice, that these types are only used for the *current* tag, and
	//if the type already is defined as a standardtype, it will be 
	//overwritten
	var $ext_types = array('USERDEF'=>'some userdefined regex here');
	
	//this function is called whenever a tag is found that is designed for thiss
	//class. (this class e.g. would accept the [TEMPLATE]-tags).
	//value1 is the first value in the tag, value2 the second. 
	//e.g. [TEMPLATE $value1]$value2[/TEMPLATE]
	//if there are some illegal things you notice, just return false, and the tag is
	//skipped, else return the replacement for the tag.
	function process($value1, $value2)
	{
		if ($value1 == '')
			return "<a href='$value2'>$value2</a>";
		else
			return "<a href='$value2'>$value1</a>";
	}
}

?>