php php /* Author's info template --------------------------------------------------------------------- Copyright (C) 2005 Marek 'juneau' Klusak, Web: http://rs.reality-show.net 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. 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. */ // precteni sablony $finalni_sablona = file_get_contents('./vzhled/'.$set['adresar_sablon'].'/html/web/sablona-index.html'); $webtitle = $txt['TitleAutor']; ereg('(.*)',$finalni_sablona,$p); $sab['text'] = $p[0]; $sab['text-pure'] = $p[1]; ereg('(.*)',$finalni_sablona,$p2); $sab['strankovani'] = $p2[0]; $sab['strankovani-pure'] = $p2[1]; if(empty($finalni_sablona)) // neni sablona struktury { $finalni_sablona = $txt['NeniSablonaAutor']; } else // sablona je ok { // odmazeme strankovani $finalni_sablona = replace($sab['strankovani'],'',$finalni_sablona); $aut_id = intval($_GET['autor-info']); $m = $db->query('SELECT realne_jmeno,popis FROM web_users WHERE id='.$aut_id); if(!mysql_num_rows($m)) exit($txt['AutorNeni']); $aut_jmeno = mysql_result($m,0,'realne_jmeno'); $aut_popis = mysql_result($m,0,'popis'); mysql_free_result($m); $webtitle .= ' '.$aut_jmeno; // obsah stranky $src = '

'.$txt['AutorNadpisStranky'].' '.$aut_jmeno.'

'."\n\n\n"; if(!empty($aut_popis)) $src .= '
'.$aut_popis.'
'."\n\n\n"; $mt = $db->query('SELECT id,sekundy,nadpis FROM web_texty WHERE rozepsano=\'0\' AND sekundy<'.time().' AND autor='.$aut_id.' ORDER BY sekundy DESC'); $mc = $db->query('SELECT id,nadpis FROM web_clanky WHERE videt=\'1\' AND autor='.$aut_id.' ORDER BY nadpis ASC'); $pocet_textu = mysql_num_rows($mt); $pocet_clanku = mysql_num_rows($mc); if($pocet_textu + $pocet_clanku > 0) { // nacist do zasoby hity, autor ocividne neco napsal $m2 = $db->query('SELECT id_textu,typ,pocet FROM web_statistika_textu'); while($p2 = mysql_fetch_assoc($m2)) { $pole_hitu[$p2['typ'].'-'.$p2['id_textu']] = $p2['pocet']; } } if($pocet_textu > 0) { $tab = ''; while($p = mysql_fetch_assoc($mt)) { $pocet = 0; if(isset($pole_hitu['1-'.$p['id']])) $pocet = $pole_hitu['1-'.$p['id']]; $tab .= ' '; } $tab .= '
'.$txt['AutorPrehledTextu'].'
'.datum ($p['sekundy'],$set,$txt).' '.$p['nadpis'].' '.$pocet.'x
'; $src .= $tab; } if($pocet_clanku > 0) { $tab = ''; while($p = mysql_fetch_assoc($mc)) { $pocet = 0; if(isset($pole_hitu['2-'.$p['id']])) $pocet = $pole_hitu['2-'.$p['id']]; $tab .= ''; } $tab .= '
'.$txt['AutorPrehledClanku'].'
'.$p['nadpis'].' '.$pocet.'x
'; $src .= $tab; } /* Pridat k user uctu popisek (texy!) a ten tu vypsat Pak seznam clanku a textu */ $finalni_sablona = replace($sab['text'],$src,$finalni_sablona); } // else if sablona ?>