Location: PHPKode > projects > PSlash > pslash-0.70/html/topic-icon.php
<?

###############################################################################
# Copyright (C) 2000  Derek Leung
#
# 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 option) any later version.
#
# You may modify your copy or copies of this Program or any portion of it,
# but you must cause the modified files to carry prominent notices stating 
# that you changed the files and the date of any change.  And you are required 
# to keep a copy of this License along with this Program.
#
# You are not required to accept this License, since you have not signed it. 
# However, nothing else grants you permission to modify or distribute this 
# Program or its derivative works. These actions are prohibited by law if 
# you do not accept this License. Therefore, by modifying or distributing 
# this Program (or any work based on this Program), you indicate your 
# acceptance of this License to do so, and all its terms and conditions 
# for copying, distributing or modifying this Program or works based on it.
#
# 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.  
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# See the GNU General Public License for more details.
# http://www.opensource.org/licenses/gpl-license.html
###############################################################################

# Select either by topic or by tid and show the image
require("mainfile.php");
	
 	
	unset($config);
	
	if ('' != $tid) {  # Select by primary key ?
		$result=mysql_query("SELECT icon_url FROM ps_topics WHERE tid='$tid'") or die("Can't perform Query (IMG)");
	} else {
		$result=mysql_query("SELECT icon_url FROM ps_topics WHERE topic='$topic'") 
		or die("Can't perform Query (IMG)");
	}
	if ($result) {
		$my_topic	= mysql_fetch_row($result);
		$img	= $my_topic[0];
		mysql_free_result($result);
		
		Header( "Pragma: no-cache");
		Header( "Location: $img" );
	}
	
?>
Return current item: PSlash