Location: PHPKode > projects > Write2Left > Plugins/tag_timenow.php
<?php
/*
+------------------------------------------------------
| Write2Left
| (c) timdorr
| http://www.write2left.com
| hide@address.com
| See License.txt for license info
|------------------------------------------------------
| Script: tag_timenow.php
| Description:
|   A plugin to add the <W2TimeNow> tag
| Created Aug-6-2003
+------------------------------------------------------
*/

/* Class: TagTimeNow
 * Description:
 *   Parses <W2TimeNow> tags
 */
class TagTimeNow
{
	function register_callbacks( &$callbacks )
	{
		$callbacks['TimeNow']   = array( 'TagTimeNow', 'do_tags' );
	}

	function do_tags( $tag_name, $context, $attributes, $content, $filename, $settings )
	{
		global $W2L;

		switch( $tag_name )
	    {
			case 'TimeNow':
				return "<?=date('$settings[date_format]')?>";
			default:
				return $content;
		}
	}
}

$tag_parser[] = new TagTimeNow();
?>
Return current item: Write2Left