Location: PHPKode > projects > Simple Way to Usenet > libs/swun/themes/tfeat_nfo.class.php
<?php
/**
 *  
 * @author  Benjamin Gillissen <hide@address.com>
 * 
 *	**************************************************************

	Copyright (C) 2009  Benjamin Gillissen
	
	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.
	
	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 at:
	http://www.gnu.org/copyleft/gpl.html

 *	**************************************************************
 */
/* used to catch a nfo request on any page.
 * 
 */ 
class tfeat_nfo {
	
	const PROFILE = FALSE;
	
	public function __construct(){ }
	
	public static function implent(){
		if ( ! isset($_GET['nfo']) ){
			ajax::RegisterFunction('tt_nfo');
			thm_mediaq::append_js_file('tooltip_nfo');
			thm_mediaq::append_js_file('tooltip_update'); 
			return TRUE; 
		}
		list($engine, $id) = split(':', $_GET['nfo']);
		if ( empty($id) ){
			$id = $engine;
			$engine = 'nbrid';
		}
		$arg['engine'] = $engine;
		$s = new search($arg);
		$o = $s->get_nfo($id);
		if ( FALSE === $o ){ exit; }
		echo langs::recode_for_client('<!DOCTYPE html 
					PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
					"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
					<html>
					<head>
					<title>NFO For Newzbin Report '.$id.'</title>
					<meta http-equiv="Content-Type" content="text/html; charset='.langs::charset().'" />
					</head>
					<body>
					<pre style="font-size:8pt">'.utf8_encode($o).'</pre>
					</body>
					</html>');		
		exit;
	}
	
	public static function genpart($did, $of=FALSE){
		list($type, $id) = split(':', $did);
		$o='<a href="?nfo='.$did.'" target="_blank">
				<img 	src="'.themes::get_active_conf('img').'/metas/meta_nfo.png"
						alt="[nfo]" 
						onmouseover="tooltip_nfo(\''.$id.'\', dw_Tooltip);" 
						class="showTip nfo_'.$id.'" />
			</a>
			<input type="hidden" id="ttlock_nfo_'.$id.'" value="0" />
			<div style="position:absolute;visibility:hidden" id="tooltip_nfo_'.$id.'">'.langs::translate('tt_loading', NULL, 'search').'</div>';
		if ( !$of ){ return $o; } 
		call_user_func($of, $o);
		return TRUE;
	}
}
return TRUE;
Return current item: Simple Way to Usenet