<?php

/********************************************************************************
	- MemHT Portal -
	
	Copyright (C) 2007-2008 by Miltenovik Manojlo
	http://www.memht.com
	
	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your opinion) any later version.
	
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	GNU General Public License for more details.
	
	You should have received a copy of the GNU General Public License along
	with this program; if not, see <http://www.gnu.org/licenses/> (GPLv2)
	or write to the Free Software Foundation, Inc., 51 Franklin Street,
	Fifth Floor, Boston, MA02110-1301, USA.
		
********************************************************************************/

class tags {
	//==============================
	//DEFAULT CONFIGURATION
	//==============================
	var $whr = 0; //Where
	var $wid = 0; //Item id
	var $box_attribute = " style='margin-top:4px;' class='box std_tagbox'";
	
	function show() {
		global $dblink;
		
		if ($result = $dblink->get_list("SELECT tag FROM memht_tags WHERE whr=".$this->whr." AND cid=".$this->wid." ORDER BY tag")) {
			echo "<div".$this->box_attribute.">\n";
				echo "<img src='images/tag.gif' border='0' alt='"._TAGS_."' title='"._TAGS_."' align='left'>&nbsp;";
				foreach ($result as $row) {
					$mtag = outCode($row['tag']);
					echo "<a href=\"index.php?page=tags&op=list&tag=".mem_urlencode($mtag)."\" title=\"$mtag\">$mtag</a> ";
				}
			echo "</div>\n";
		}	
	}
}

?>