* @link http://www.pioder.pl/ * @license see LICENSE.txt **/ if ( !defined('IN_uF') ) { die('Hacking attempt'); } function SetCounter() { global $forum_config; if (!isset($_COOKIE['forum_visited'])) { setcookie('forum_visited','1'); $visit_count = $forum_config['forum_counter'] +1; DataBase::sql_query("UPDATE `".CONFIG_TABLE."` SET `value`='$visit_count' WHERE `name`='forum_counter'",GENERAL,'Could not update forum counter'); } else { $visit_count = $forum_config['forum_counter']; } return $visit_count; } function GenerateHeader($title, $navigator) { global $lng; global $forum_config; $skin = array( 'L.forumname' => $forum_config['forumname'], 'L.forumdesc' => $forum_config['forumdesc'], 'L.users' => $lng['lusers'], 'L.pm' => $lng['lpm'], 'L.register' => $lng['lregister'], 'L.search' => $lng['lsearch'], 'L.eprofile' => $lng['leprofile'], 'L.groups' => $lng['lgroups'], 'keywords' => $forum_config['meta_keywords'], 'description' => $forum_config['meta_description'], 'mainpage' => $title, 'L.mainpage' => $navigator, 'L.actual_time'=>$lng['lactualtime'], 'modelogin' => ($_SESSION['uid']>0) ? 'logout' : 'login', 'L.login' => ($_SESSION['uid']>0) ? $lng['lunlogin'] : $lng['llogin'], 'L.pa_link' => $lng['pa_link'] ); return $skin; } function UserAgent($agent) { global $lng; /*This original function is in phpBB 1.12.5 modified by Przemo*/ /*Modified by PioDer: added new browsers and systems and other replaces*/ $agent_tst = ' ' . strtolower($agent); $system = $browser = ''; if ( strpos($agent_tst, 'windows') || strpos($agent_tst, 'win9') || strpos($agent_tst, 'win32') || strpos($agent_tst, 'nt 5.') || strpos($agent_tst, 'nt 4') ) { $system = ( strpos($agent_tst, 'windows 9') || strpos($agent_tst, 'nt 4') || strpos($agent_tst, 'windows') || strpos($agent_tst, 'win32') ) ? 'windows_98_nt_2000' : $system; $system = ( strpos($agent_tst, 'nt 5.') || strpos($agent_tst, 'nt 6.') || strpos($agent_tst, 'nt 7.') || strpos($agent_tst, 'nt 8.') ) ? 'windows_xp_2003' : $system; $system = (strpos($agent_tst, 'nt 5.0')) ? 'windows_98_nt_2000' : $system; $system = (strpos($agent_tst, 'nt 6.0')) ? 'windows_vista' : $system; } else { $system = (strpos($agent_tst, 'linux')) ? 'linux' : $system; $system = (strpos($agent_tst, 'suse')) ? 'linux_suse' : $system; $system = (strpos($agent_tst, 'knoppix')) ? 'linux_knoppix' : $system; $system = (strpos($agent_tst, 'turbolinux')) ? 'linux_turbolinux' : $system; $system = (strpos($agent_tst, 'slackware')) ? 'linux_slackware' : $system; $system = (strpos($agent_tst, 'gentoo')) ? 'linux_gentoo' : $system; $system = (strpos($agent_tst, 'lycoris')) ? 'linux_lycoris' : $system; $system = (strpos($agent_tst, 'debian')) ? 'linux_debian' : $system; $system = (strpos($agent_tst, 'redhat')) ? 'linux_redhat' : $system; $system = (strpos($agent_tst, 'archlinux')) ? 'linux_arch' : $system; $system = (strpos($agent_tst, 'ubuntu')) ? 'linux_ubuntu' : $system; $system = (strpos($agent_tst, 'cdlinux')) ? 'linux_cdlinux' : $system; $system = (strpos($agent_tst, 'mandriva')) ? 'linux_mandriva' : $system; $system = (strpos($agent_tst, 'kateos')) ? 'linux_kateos' : $system; $system = (strpos($agent_tst, 'bsd')) ? 'linux_freebsd' : $system; } if ( $system == '') { $system = (strpos($agent_tst, 'mac')) ? 'macos' : $system; $system = (strpos($agent_tst, 'aix')) ? 'aix' : $system; $system = (strpos($agent_tst, 'lindows')) ? 'lindows' : $system; $system = (strpos($agent_tst, 'amiga')) ? 'amiga' : $system; $system = (strpos($agent_tst, 'athe')) ? 'athe' : $system; $system = (strpos($agent_tst, 'beos')) ? 'beos' : $system; $system = (strpos($agent_tst, 'zeta')) ? 'beos' : $system; $system = (strpos($agent_tst, 'BlueEyed')) ? 'beos' : $system; $system = (strpos($agent_tst, 'nextstep')) ? 'nextstep' : $system; $system = (strpos($agent_tst, 'warp')) ? 'warp' : $system; $system = (strpos($agent_tst, 'qnx')) ? 'qnx' : $system; $system = (strpos($agent_tst, 'risc')) ? 'risc' : $system; $system = (strpos($agent_tst, 'solaris')) ? 'solaris' : $system; $system = (strpos($agent_tst, 'unix')) ? 'unix' : $system; $system = (strpos($agent_tst, 'macos')) ? 'macos' : $system; $system = (strpos($agent_tst, 'mac os')) ? 'macos' : $system; $system = (strpos($agent_tst, 'symbian')) ? 'symbian' : $system; $system = ($system == '' && strpos($agent_tst, 'win9') || strpos($agent_tst, 'win3') || strpos($agent_tst, 'windows') ) ? 'windows_98_nt_2000' : $system; } $browser = (strpos($agent_tst, 'mozilla')) ? 'mozilla' : $browser; $browser = (strpos($agent_tst, 'msie')) ? 'ie' : $browser; $browser = (strpos($agent_tst, 'msie 7')) ? 'ie7' : $browser; $browser = (strpos($agent_tst, 'netscape')) ? 'netscape' : $browser; $browser = (strpos($agent_tst, 'opera')) ? 'opera' : $browser; $browser = (strpos($agent_tst, 'konqueror')) ? 'konqueror' : $browser; $browser = (strpos($agent_tst, 'galeon')) ? 'galeon' : $browser; $browser = (strpos($agent_tst, 'firefox')) ? 'firefox' : $browser; $browser = (strpos($agent_tst, 'netsprint')) ? 'netsprint' : $browser; $browser = (strpos($agent_tst, 'firebird')) ? 'firebird' : $browser; $browser = (strpos($agent_tst, 'links')) ? 'links' : $browser; $browser = (strpos($agent_tst, 'dillo')) ? 'dillo' : $browser; $browser = (strpos($agent_tst, 'omniweb')) ? 'omniweb' : $browser; $browser = (strpos($agent_tst, 'avant')) ? 'avant' : $browser; $browser = (strpos($agent_tst, 'myie2')) ? 'myie2' : $browser; $browser = (strpos($agent_tst, 'seamonkey')) ? 'seamonkey' : $browser; $browser = (strpos($agent_tst, 'maxthon')) ? 'maxthon' : $browser; $browser = ($browser == '') ? 'unknown' : $browser; $system = ($system == '') ? 'unknown' : $system; return array('icon_' . $system . '.gif', 'icon_' . $browser . '.gif', ($system=='unknown') ? $lng['unknown'] : $system, ($browser=='unknown') ? $lng['unknown'] : $browser); } function GenerateTime($request_time) { global $lng; if (date('d M Y',$request_time)== date('d M Y',time())) { $date = $lng['today'].', '.date('G:i', $request_time); } else { if ((date('d',$request_time))== (date('d',time())-1) && (date('m-Y',$request_time)== date('m-Y',time()))) { $date = $lng['yesterday'].', '.date('G:i', $request_time); } else { $date = date('d M Y, G:i',$request_time); } } return $date; } function ListPages($page, $count = 50)//for edit profile, not used in limit! { $content = ''; for ($i=1;$i<=$count;$i++) { if ($i==$page) { $content .= ''; } else { $content .= ''; } } return $content; unset($content); } function ListDir($dir, $selection) { $result=''; $rep=opendir('./'.$dir); while ($file = readdir($rep)) { if($file != '..' && $file !='.' && $file !='' && $file[0] != '.') { if (is_dir('./'.$dir.'/'.$file)){ if ($file==$selection) { $result .=''; } else { $result .=''; } } } } return $result; unset($rep, $file, $result); } function TimeGeneration() { list($usec, $sec ) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } function IfModGroup($guid) { global $lng; $uid = $_SESSION['uid']; if ($guid==$uid) { return'