+ Deleted a few of classes + Renamed functions + Fixed bug: Changing user nick in ACP git-svn-id: https://svn.pioder.pl/uf-svn/uF@17 72ec579a-5ced-4fa4-82f3-afba5d98df2fmaster
@ -1,80 +0,0 @@ | |||||
<?php | |||||
/** | |||||
* @package uForum | |||||
* @file includes/class_email.php | |||||
* @version $Id$ | |||||
* @copyright 2009(c) PioDer <pioder@wp.pl> | |||||
* @link http://pioder.gim2przemysl.int.pl/ | |||||
* @license GNU GPL v3 | |||||
**/ | |||||
if ( !defined('IN_uF') ) | |||||
{ | |||||
die('Hacking attempt'); | |||||
} | |||||
class Email | |||||
{ | |||||
function SendEmail($email, $title, $content) | |||||
{ | |||||
global $forum_config; | |||||
$email_headers = "MIME-Version: 1.0\r\n"; | |||||
$email_headers .= "Content-type: text/html; charset=iso-8859-2\r\n"; | |||||
$email_headers .= "From: ".$forum_config['forumname']." \n"; | |||||
$email_date = date('d-m-Y, G:i',time()); | |||||
$email_content = ' | |||||
<html> | |||||
<head> | |||||
<title>'.$title.'</title> | |||||
</head> | |||||
<body> | |||||
'.$content.'<br> | |||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br> | |||||
<font face="Verdana" style="font-size:10pt"> | |||||
Message generated automatic by DSF v'.VERSION.'. <b>('.$email_date.')</b></font> | |||||
</body> | |||||
</html>'; | |||||
if ( !mail($email, $title, $email_content, $email_headers )) | |||||
{ | |||||
message_die('GENERAL','Could not send email from: '.$email.'. sorry :(',''); | |||||
} | |||||
} | |||||
function SendRegisterEmail() | |||||
{ | |||||
global $forum_config; | |||||
global $original_pass; | |||||
global $lng; | |||||
$email_content = $lng['email_newpasswd_msg']; | |||||
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content); | |||||
$email_content = str_replace('%url_f%',$forum_config['forumpatch'],$email_content); | |||||
$email_content = str_replace('%ip%',$_SERVER['REMOTE_ADDR'],$email_content); | |||||
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content); | |||||
$email_content = str_replace('%login%',$_POST['nick'],$email_content); | |||||
$email_content = str_replace('%pass%',$original_pass,$email_content); | |||||
Email::SendEmail($_POST['email'],$lng['email_welcome'].$forum_config['forumname'],$email_content); | |||||
} | |||||
function SendForgotPassEmail($newpass) | |||||
{ | |||||
global $forum_config; | |||||
global $original_pass; | |||||
global $lng; | |||||
global $uid; | |||||
$email_content = $lng['email_register_msg']; | |||||
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content); | |||||
$email_content = str_replace('%url_f%',$forum_config['forumpatch'],$email_content); | |||||
$email_content = str_replace('%ip%',$_SERVER['REMOTE_ADDR'],$email_content); | |||||
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content); | |||||
$email_content = str_replace('%login%',$_POST['username'],$email_content); | |||||
$email_content = str_replace('%pass%',$newpass,$email_content); | |||||
Email::SendEmail(User::UserInformation($uid,'email'),$lng['email_sent_forget_pass'].$forum_config['forumname'],$email_content); | |||||
} | |||||
function SendMassEmail($title,$content) | |||||
{ | |||||
$sql = "SELECT `email`,`u_id` FROM ".USERS_TABLE." WHERE `u_id`>0"; | |||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not read users table'); | |||||
while($item = @mysql_fetch_array($query)) | |||||
{ | |||||
Email::SendEmail($item['email'], $title, $content); | |||||
} | |||||
} | |||||
} | |||||
?> |
@ -1,328 +0,0 @@ | |||||
<?php | |||||
/** | |||||
* @package uForum | |||||
* @file includes/class_overall.php | |||||
* @version $Id$ | |||||
* @copyright 2009(c) PioDer <pioder@wp.pl> | |||||
* @link http://pioder.gim2przemysl.int.pl/ | |||||
* @license GNU GPL v3 | |||||
**/ | |||||
if ( !defined('IN_uF') ) | |||||
{ | |||||
die('Hacking attempt'); | |||||
} | |||||
class Over | |||||
{ | |||||
function set_counter() | |||||
{ | |||||
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 generate_header($title, $navigator) | |||||
{ | |||||
global $lng; | |||||
global $forum_config; | |||||
$skin = array( | |||||
'forumname' => $forum_config['forumname'], | |||||
'forumdesc' => $forum_config['forumdesc'], | |||||
'users' => $lng['lusers'], | |||||
'pm' => $lng['lpm'], | |||||
'register' => $lng['lregister'], | |||||
'search' => $lng['lsearch'], | |||||
'eprofile' => $lng['leprofile'], | |||||
'groups' => $lng['lgroups'], | |||||
'keywords' => $forum_config['meta_keywords'], | |||||
'description' => $forum_config['meta_description'], | |||||
'mainpage' => $title, | |||||
'lmainpage' => $navigator, | |||||
'lactual_time'=>$lng['lactualtime'], | |||||
'modelogin' => ($_SESSION['uid']>0) ? 'logout' : 'login', | |||||
'llogin' => ($_SESSION['uid']>0) ? $lng['lunlogin'] : $lng['llogin'] | |||||
); | |||||
return $skin; | |||||
} | |||||
function user_agent($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 AddPages() | |||||
{ | |||||
global $count; | |||||
global $page; | |||||
$content = ''; | |||||
for ($i=1;$i<=$count;$i++) | |||||
{ | |||||
if ($i==$page) | |||||
{ | |||||
$content .= '<option value="'.$i.'" selected="selected">'.$i.'</option>'; | |||||
} | |||||
else | |||||
{ | |||||
$content .= '<option value="'.$i.'">'.$i.'</option>'; | |||||
} | |||||
} | |||||
return $content; | |||||
unset($content); | |||||
} | |||||
function AddPages2($page)//for edit profile, not used in limit! | |||||
{ | |||||
$content = ''; | |||||
for ($i=1;$i<=50;$i++) | |||||
{ | |||||
if ($i==$page) | |||||
{ | |||||
$content .= '<option value="'.$i.'" selected="selected">'.$i.'</option>'; | |||||
} | |||||
else | |||||
{ | |||||
$content .= '<option value="'.$i.'">'.$i.'</option>'; | |||||
} | |||||
} | |||||
return $content; | |||||
unset($content); | |||||
} | |||||
function AddSkins() | |||||
{ | |||||
global $forum_config; | |||||
global $default_skin; | |||||
$all=''; | |||||
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information'); | |||||
while($t = @mysql_fetch_array($query)) | |||||
{ | |||||
if ($t['name']==$default_skin) | |||||
{ | |||||
$all .= '<option value="'.$t['s_id'].'" selected="selected">'.$t['name'].'</option>'; | |||||
} | |||||
else | |||||
{ | |||||
$all .= '<option value="'.$t['s_id'].'">'.$t['name'].'</option>'; | |||||
} | |||||
} | |||||
return $all; | |||||
unset($t, $all); | |||||
} | |||||
function AddLangs() | |||||
{ | |||||
global $forum_config; | |||||
global $default_lang; | |||||
$result=''; | |||||
$rep=opendir('./lngs'); | |||||
$browseruMoinsUnRepertoire = false; | |||||
while ($file = readdir($rep)) | |||||
{ | |||||
if($file != '..' && $file !='.' && $file !='') | |||||
{ | |||||
if (is_dir('./lngs/'.$file)){ | |||||
$browseruMoinsUnRepertoire = true; | |||||
if ($file==$default_lang) | |||||
{ | |||||
$result .='<option value="'.$file.'" selected="selected">'.$file.'</option>'; | |||||
} | |||||
else | |||||
{ | |||||
$result .='<option value="'.$file.'">'.$file.'</option>'; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
return $result; | |||||
unset($rep, $browseruMoinsUnRepertoire, $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' | |||||
<tr> | |||||
<td class="fitem"> | |||||
<span class="fstandard">'.$lng['addusrtogrp'].':</span><input type="text" name="nick" style="widtfh:100px; height:15px" value="'.$_POST['nick'].'"> | |||||
</td> | |||||
<td class="fitem"> | |||||
<span class="fstandard">'.$lng['delusrforgrp'].':</span><input type="text" name="delnick" style="widtfh:100px; height:15px" value="'.$_POST['nick'].'"> | |||||
</td> | |||||
<td class="fitem"> | |||||
<input type="submit" class="fbutton" value="'.$lng['lgo'].'"> | |||||
</tr> | |||||
'; | |||||
} | |||||
} | |||||
function TotalPosts() | |||||
{ | |||||
$sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE.""; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain total posts information'); | |||||
$result = mysql_fetch_array($query); | |||||
$result = $result['p_id']; | |||||
return($result); | |||||
} | |||||
function DefaultLang() | |||||
{ | |||||
global $forum_config; | |||||
global $userdata; | |||||
if ($_SESSION['uid']>0) | |||||
{ | |||||
//$sql = "SELECT `u_id`, `lang` FROM ".USERS_TABLE." WHERE `u_id`='".$_SESSION['uid']."' LIMIT 1"; | |||||
//$result = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain user information')); | |||||
return $userdata['lang']; | |||||
} | |||||
else | |||||
{ | |||||
return $forum_config['defaultlang']; | |||||
} | |||||
} | |||||
function ShowQueries($start, $stop) | |||||
{ | |||||
global $forum_config; | |||||
global $lng; | |||||
if ($forum_config['show_time_generation']) | |||||
{ | |||||
$result = $stop - $start; | |||||
$result = round($result,3); | |||||
if (extension_loaded('xdebug')) | |||||
{ | |||||
return $lng['script_generated'].$result.' '.$lng['seconds'].'. SQL: '.$_COOKIE['queries'].'.<br> | |||||
Wersja Xdebug: '.phpversion('xdebug').', Użycie pamięci: '.round((xdebug_memory_usage()/1024),2).'KB.'; | |||||
} | |||||
else | |||||
{ | |||||
return $lng['script_generated'].$result.' '.$lng['seconds'].'. SQL: '.$_COOKIE['queries'].'.'; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return ''; | |||||
} | |||||
} | |||||
function ViewSkinName() | |||||
{ | |||||
global $forum_config; | |||||
global $userdata; | |||||
if ($_SESSION['uid']>0) | |||||
{ | |||||
$result = $userdata['skin']; | |||||
} | |||||
else | |||||
{ | |||||
$result = $forum_config['defaultskin']; | |||||
} | |||||
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'"; | |||||
$result = mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.')); | |||||
return $result['name']; | |||||
} | |||||
} | |||||
?> |
@ -1,51 +0,0 @@ | |||||
<?php | |||||
/** | |||||
* @package uForum | |||||
* @file includes/class_shoutbox.php | |||||
* @version $Id$ | |||||
* @copyright 2009(c) PioDer <pioder@wp.pl> | |||||
* @link http://pioder.gim2przemysl.int.pl/ | |||||
* @license GNU GPL v3 | |||||
**/ | |||||
if ( !defined('IN_uF') ) | |||||
{ | |||||
die('Hacking attempt'); | |||||
} | |||||
class ShoutBox | |||||
{ | |||||
function new_message($message,$uid) | |||||
{ | |||||
$time = time(); | |||||
$sql = "INSERT INTO ".SHOUTBOX_TABLE." VALUES ('', '$uid', '$message','$time')"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not add shoutbox message.'); | |||||
} | |||||
function read_messages($limit) | |||||
{ | |||||
$sb_content = ''; | |||||
$rank_mod = ($_SESSION['uid']>0) ? User::UserInformation($_SESSION['uid'],'rank') : 0; | |||||
global $user; | |||||
global $default_skin; | |||||
$sql = "SELECT * FROM ".SHOUTBOX_TABLE." ORDER BY `time` LIMIT $limit"; | |||||
$query = DataBase::sql_query($sql,'CRITICAL', 'Could not read shoutbox table'); | |||||
while($sb_msg = @mysql_fetch_array($query)) | |||||
{ | |||||
$del_edit_msg = ($rank_mod>0) ? '<a href="shoutbox.php?mode= | |||||
delete&id='.$sb_msg.'" class="fsmall">x</a> <a href=" | |||||
shoutbox.php?mode=edit&id='.$sb_msg.'" class="fsmall">e</a>' : ' '; | |||||
$sb_content .= '<tr><td>'.$del_edit_msg.'<span class="fsmall"> | |||||
<a href="user.php?id='.$b_msg['u_id'].'" class="fsmall">' | |||||
.Topic::UserName($user[$sb_msg['u_id']]['nick'],$user[$sb_msg['u_id']]['rank']). | |||||
'</a> <span class="fsmall">['.date('d-m, G:i',$sb_msg['time']).']: | |||||
'.$sb_msg['msg_content'].'</span></td></tr>'; | |||||
} | |||||
return $sb_content; | |||||
} | |||||
function del_old_msgs($limiter) | |||||
{ | |||||
$sql = "DELETE FROM ".SHOUTBOX_TABLE." WHERE `time`+$limiter<'".time()."'"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not delete old messages in shoutbox'); | |||||
unset($sql); | |||||
} | |||||
} | |||||
?> |
@ -0,0 +1,140 @@ | |||||
<?php | |||||
/** | |||||
* @package uForum | |||||
* @file includes/classes/class_forum.php | |||||
* @version $Id: classes/class_forum.php 15 2009-05-01 17:06:40Z pioder $ | |||||
* @copyright 2009(c) PioDer <pioder@wp.pl> | |||||
* @link http://pioder.gim2przemysl.int.pl/ | |||||
* @license GNU GPL v3 | |||||
**/ | |||||
if ( !defined('IN_uF') ) | |||||
{ | |||||
die('Hacking attempt'); | |||||
} | |||||
class Forum | |||||
{ | |||||
function AddForums($tid) | |||||
{ | |||||
global $forum_config; | |||||
$forum = Topic::TopicInformation($tid,'f_id'); | |||||
$all=''; | |||||
$query = DataBase::sql_query("SELECT `name`, `f_id` FROM `".FORUMS_TABLE."` ORDER BY `f_id`",'GENERAL','Could not obtain forum information'); | |||||
while($t = @mysql_fetch_array($query)) | |||||
{ | |||||
if ($t['f_id']==$forum) | |||||
{ | |||||
$all .= '<option value="'.$t['f_id'].'" selected="selected">'.$t['name'].'</option>'."\n"; | |||||
} | |||||
else | |||||
{ | |||||
$all .= '<option value="'.$t['f_id'].'">'.$t['name'].'</option>'."\n"; | |||||
} | |||||
} | |||||
return $all; | |||||
unset($t, $all); | |||||
} | |||||
function PostsInForum($forum_name) | |||||
{ | |||||
$sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE." WHERE f_id='$forum_name'"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain posts information.'); | |||||
$result = mysql_fetch_array($query); | |||||
return $result['p_id']; | |||||
} | |||||
function LastPost($posts, $forum) | |||||
{ | |||||
global $lng; | |||||
global $user; | |||||
global $last_post; | |||||
global $userdata; | |||||
global $forum_config; | |||||
if ($posts==0) { return '<p align="center" class="fstandard">'.$lng['nopost'].'</p>';} | |||||
else | |||||
{ | |||||
$id = $last_post[$forum]['tp_id']; | |||||
$topic = $last_post[$forum]['t_id']; | |||||
$userid = $last_post[$forum]['u_id']; | |||||
$un = $last_post[$forum]['user_nick']; | |||||
$rank = $last_post[$forum]['user_rank']; | |||||
switch($rank) | |||||
{ | |||||
case '0': | |||||
{ | |||||
$user_color_name = $un; | |||||
break; | |||||
} | |||||
case '1': | |||||
{ | |||||
$user_color_name = '<font color="'.$forum_config['color_mod'].'"><b>'.$un.'</b></font>'; | |||||
break; | |||||
} | |||||
case '2': | |||||
{ | |||||
$user_color_name = '<font color="'.$forum_config['color_admin'].'"><b>'.$un.'</b></font>'; | |||||
break; | |||||
} | |||||
} | |||||
if ($_SESSION['uid']>0) | |||||
{ | |||||
$limiter = $userdata['limit_tpid']; | |||||
} | |||||
else | |||||
{ | |||||
$limiter = $forum_config['limit_tpid']; | |||||
} | |||||
$count = ceil($id / $limiter); | |||||
if ($count >1) | |||||
{ | |||||
$page= '&page='.$count; | |||||
} | |||||
else | |||||
{ | |||||
$page=''; | |||||
} | |||||
return '<p align="center"><span class="fverysmall"><b>'.GenerateTime($last_post[$forum]['time']).'</b><br></span> <a href="topic.php?t='.$topic.$page.'#p'.$id.'" class="fverysmall"><b>'.$lng['topic'].' #'.$topic.'</b></a><a class="fsmall">: </a><a href="user.php?id='.$userid.'" class="fverysmall">'.$user_color_name.'</a></p>'; | |||||
} | |||||
} | |||||
function LastPostImg($postsinforum) | |||||
{ | |||||
global $last_post; | |||||
global $i; | |||||
global $forum; | |||||
global $default_skin; | |||||
$time = time()-129600; | |||||
if ($_SESSION['uid']>0) | |||||
{ | |||||
if ($postsinforum>0) | |||||
{ | |||||
if ($last_post[$forum[$i]['f_id']]['time']>$time) | |||||
{ | |||||
return 'folder_new_posts'; | |||||
} | |||||
else | |||||
{ | |||||
return 'folder_no_new_posts'; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return 'folder_no_new_posts'; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return 'folder_no_new_posts'; | |||||
} | |||||
} | |||||
function ForumInformation($fid, $inf) | |||||
{ | |||||
$sql = "SELECT `f_id`, `$inf` FROM ".FORUMS_TABLE." WHERE f_id='$fid';"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information.'); | |||||
$result = mysql_fetch_array($query); | |||||
$result = $result[$inf]; | |||||
return $result; | |||||
} | |||||
} | |||||
?> |
@ -0,0 +1,103 @@ | |||||
<?php | |||||
/** | |||||
* @package uForum | |||||
* @file includes/classes/class_mod.php | |||||
* @version $Id: classes/class_mod.php 15 2009-05-01 17:06:40Z pioder $ | |||||
* @copyright 2009(c) PioDer <pioder@wp.pl> | |||||
* @link http://pioder.gim2przemysl.int.pl/ | |||||
* @license GNU GPL v3 | |||||
**/ | |||||
if ( !defined('IN_uF') ) | |||||
{ | |||||
die('Hacking attempt'); | |||||
} | |||||
class Mod | |||||
{ | |||||
function MoveTopic($tid, $fid) | |||||
{ | |||||
$sql = "UPDATE `".TOPICS_TABLE."` SET `f_id`='$fid' WHERE `t_id`='$tid'"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not update topic'); | |||||
$sql = "UPDATE `".POSTS_TABLE."` SET `f_id`='$fid' WHERE `t_id`='$tid'"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not update post'); | |||||
} | |||||
function TopicLocked($tid) | |||||
{ | |||||
global $default_skin; | |||||
global $default_lang; | |||||
$lock = Topic::TopicInformation($tid,'lock'); | |||||
if ($lock=='1') | |||||
{ | |||||
return '<a href="moderate.php?action=unlock&id='.$tid.'"><img border="0" src="skins/'.$default_skin.'/images/unlock.gif" width="20" height="20" alt="unlock">'; | |||||
} | |||||
else | |||||
{ | |||||
return '<a href="moderate.php?action=lock&id='.$tid.'"><img border="0" src="skins/'.$default_skin.'/images/lock.gif" width="20" height="20" alt="lock"></a>'; | |||||
} | |||||
} | |||||
function DeleteTopic($topicid) | |||||
{ | |||||
$sql="SELECT * FROM ".POSTS_TABLE." WHERE `t_id`='$topicid'"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain post information'); | |||||
while($item = @mysql_fetch_array($query)) | |||||
{ | |||||
$uid = Topic::PostInformation($item['p_id'],'u_id'); | |||||
$posts = User::UserInformation($uid,'posts'); | |||||
$posts = $posts -1; | |||||
$sql = "UPDATE `".USERS_TABLE."` SET `posts`='$posts' WHERE `u_id`='$uid'"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not update user amout of posts'); | |||||
} | |||||
$sql = "DELETE FROM ".POSTS_TABLE." WHERE t_id='$topicid';"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not delete topic posts.'); | |||||
$sql = "DELETE FROM ".TOPICS_TABLE." WHERE t_id='$topicid';"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not delete topic posts.'); | |||||
} | |||||
function LockTopic($topicid) | |||||
{ | |||||
$sql = "UPDATE `".TOPICS_TABLE."` SET `lock` = '1' WHERE `t_id` =$topicid;"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not lock topic.'); | |||||
} | |||||
function StickTopic($topicid, $mode) | |||||
{ | |||||
$sql = "UPDATE `".TOPICS_TABLE."` SET `sticky` = '$mode' WHERE `t_id` =$topicid;"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not stick topic.'); | |||||
} | |||||
function UnlockTopic($topicid) | |||||
{ | |||||
$sql = "UPDATE `".TOPICS_TABLE."` SET `lock` = '0' WHERE `t_id` =$topicid;"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not unlock topic.'); | |||||
} | |||||
function DeletePost($postid) | |||||
{ | |||||
$uid = Topic::PostInformation($postid,'u_id'); | |||||
$tid = Topic::PostInformation($postid,'t_id'); | |||||
$posts = User::UserInformation($uid,'posts'); | |||||
$posts = $posts -1; | |||||
$sql = "UPDATE `".USERS_TABLE."` SET `posts`='$posts' WHERE `u_id`='$uid'"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not update user amout of posts'); | |||||
$sql2 = "DELETE FROM ".POSTS_TABLE." WHERE p_id='$postid';"; | |||||
DataBase::sql_query($sql2,'GENERAL','Could not delete post.'); | |||||
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id>'$postid' AND `t_id`='$tid';"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain post information.'); | |||||
while($item=mysql_fetch_array($query)) | |||||
{ | |||||
$number = $item['tp_id']; | |||||
$number = $number-1; | |||||
$number2 = $item['p_id']; | |||||
$sql3 = "UPDATE `".POSTS_TABLE."` SET `tp_id` = '$number' WHERE `p_id` =$number2;"; | |||||
DataBase::sql_query($sql3,'GENERAL','Could not update post.'); | |||||
} | |||||
} | |||||
function AcceptPost($postid) | |||||
{ | |||||
$sql = "UPDATE `".POSTS_TABLE."` SET `moderated`='0' WHERE `p_id`='$postid'"; | |||||
DataBase::sql_query($sql, 'GENERAL', 'Could not accept post'); | |||||
} | |||||
} | |||||
?> |
@ -0,0 +1,119 @@ | |||||
<?php | |||||
/** | |||||
* @package uForum | |||||
* @file includes/classes/class_posting.php | |||||
* @version $Id: classes/class_posting.php 15 2009-05-01 17:06:40Z pioder $ | |||||
* @copyright 2009(c) PioDer <pioder@wp.pl> | |||||
* @link http://pioder.gim2przemysl.int.pl/ | |||||
* @license GNU GPL v3 | |||||
**/ | |||||
if ( !defined('IN_uF') ) | |||||
{ | |||||
die('Hacking attempt'); | |||||
} | |||||
class Post | |||||
{ | |||||
function NewPost($tid, $post, $uid) | |||||
{ | |||||
#read last post | |||||
$last = DataBase::new_id(POSTS_TABLE); | |||||
#read last post in topic | |||||
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE t_id='$tid' ORDER BY tp_id DESC LIMIT 1;"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not last post information.'); | |||||
$result = mysql_fetch_array($query); | |||||
$forum = $result['f_id'];//forum id | |||||
$moderate = Forum::ForumInformation($forum,'moderate'); | |||||
$tpid = $result['tp_id'];//post in topic id | |||||
$tpid = $tpid+1; | |||||
# | |||||
$time = time(); | |||||
#add new post | |||||
$sql = "INSERT INTO `".POSTS_TABLE."` VALUES ('$last','$tid', '$uid', '$post', '".$_SERVER['HTTP_USER_AGENT']."', '$time', '$tpid', '$forum','$moderate','".$_SERVER['REMOTE_ADDR']."')"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not add new post.'); | |||||
$result=User::UserInformation($uid,'posts'); | |||||
$result = $result+1; | |||||
$sql="UPDATE ".TOPICS_TABLE." SET lastpost_time='$time' WHERE t_id='$tid' "; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not update user information.'); | |||||
$sql="UPDATE ".USERS_TABLE." SET posts='$result' WHERE u_id='$uid' "; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not update user information.'); | |||||
return $tpid; | |||||
} | |||||
function EditPost($postid, $text) | |||||
{ | |||||
$sql = "UPDATE `".POSTS_TABLE."` SET text='$text' WHERE `p_id`='$postid';"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not edit post.'); | |||||
} | |||||
function NewTopic($posttext, $ntopic, $forum, $uid, $sticky) | |||||
{ | |||||
//Select last topic | |||||
$moderate = Forum::ForumInformation($forum,'moderate'); | |||||
$time = time(); | |||||
$lastt=DataBase::new_id(TOPICS_TABLE); | |||||
$sql = "INSERT INTO ".TOPICS_TABLE." VALUES ('$lastt', '$forum', '0', '$sticky', '$ntopic', '$uid','$time')"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not add new topic'); | |||||
//add post | |||||
//select last post | |||||
$last = DataBase::new_id(POSTS_TABLE); | |||||
//add post | |||||
$sql = "INSERT INTO ".POSTS_TABLE." VALUES ('$last','$lastt', '$uid', '$posttext','".$_SERVER['HTTP_USER_AGENT']."', '$time', '1', '$forum', '$moderate','".$_SERVER['REMOTE_ADDR']."');"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not add new post.'); | |||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid';"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'); | |||||
$result = mysql_fetch_array($query); | |||||
$result = $result['posts']; | |||||
$result = $result+1; | |||||
$sql = "UPDATE ".USERS_TABLE." SET posts='$result' WHERE u_id='$uid' "; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not update user information.'); | |||||
return $lastt; | |||||
} | |||||
function SmilesShow() | |||||
{ | |||||
$text =''; | |||||
$result=''; | |||||
$sql = "SELECT * FROM ".SMILES_TABLE.""; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Cold not obtain smiles information.'); | |||||
$i = 1; | |||||
while($smile = mysql_fetch_array($query)) | |||||
{ | |||||
$action = "insertSmile('".$smile['url']."','".$smile['smile']."')"; | |||||
$mouse = "this.style.cursor='hand';"; | |||||
$text = "\n".'<img src="'.$smile['url'].'" onmouseover="'.$mouse.'" onclick="'.$action.'" alt="'.$smile['smile'].'"> '."\n"; | |||||
$result = $result.$text; | |||||
if ($i%5==0) | |||||
{ | |||||
$i = 1; | |||||
$result=$result.'<br>'; | |||||
} | |||||
else | |||||
{ | |||||
$i +=1; | |||||
} | |||||
} | |||||
return $result; | |||||
} | |||||
function SmilesReplace($text) | |||||
{ | |||||
$sql = "SELECT * FROM ".SMILES_TABLE.""; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain emoticons information.'); | |||||
$i = 1; | |||||
while($result = mysql_fetch_array($query)) | |||||
{ | |||||
$smile[$i]['smile'] = $result['smile']; | |||||
$smile[$i]['url'] = $result['url']; | |||||
$i +=1; | |||||
} | |||||
$smile = (!isset($smile)) ? array() : $smile; | |||||
$i = 1; | |||||
for($i=1;$i<=count($smile);$i++) | |||||
{ | |||||
$text = str_replace(' '.$smile[$i]['smile'],'<img src="'.$smile[$i]['url'].'" alt="'.$smile[$i]['smile'].'">', $text); | |||||
$text = str_replace(' '.$smile[$i]['smile'],'<img src="'.$smile[$i]['url'].'" alt="'.$smile[$i]['smile'].'">', $text); | |||||
} | |||||
return $text; | |||||
} | |||||
} | |||||
?> |
@ -0,0 +1,204 @@ | |||||
<?php | |||||
/** | |||||
* @package uForum | |||||
* @file includes/classes/class_topic.php | |||||
* @version $Id: classes/class_topic.php 15 2009-05-01 17:06:40Z pioder $ | |||||
* @copyright 2009(c) PioDer <pioder@wp.pl> | |||||
* @link http://pioder.gim2przemysl.int.pl/ | |||||
* @license GNU GPL v3 | |||||
**/ | |||||
if ( !defined('IN_uF') ) | |||||
{ | |||||
die('Hacking attempt'); | |||||
} | |||||
class Topic | |||||
{ | |||||
function LastPostInTopic($topic) | |||||
{ | |||||
global $lng; | |||||
global $lastpost; | |||||
global $forum_config; | |||||
global $userdata; | |||||
$id = $lastpost[$topic]['tp_id']; | |||||
$userid = $lastpost[$topic]['u_id']; | |||||
$un = $lastpost[$topic]['user_nick']; | |||||
$rank = $lastpost[$topic]['user_rank']; | |||||
switch($rank) | |||||
{ | |||||
case '0': | |||||
{ | |||||
$user_color_name = $un; | |||||
break; | |||||
} | |||||
case '1': | |||||
{ | |||||
$user_color_name = '<font color="'.$forum_config['color_mod'].'"><b>'.$un.'</b></font>'; | |||||
break; | |||||
} | |||||
case '2': | |||||
{ | |||||
$user_color_name = '<font color="'.$forum_config['color_admin'].'"><b>'.$un.'</b></font>'; | |||||
break; | |||||
} | |||||
} | |||||
if ($_SESSION['uid']>0) | |||||
{ | |||||
$limiter = $userdata['limit_tpid']; | |||||
} | |||||
else | |||||
{ | |||||
$limiter = $forum_config['limit_tpid']; | |||||
} | |||||
$count = ceil($id / $limiter); | |||||
if ($count >1) | |||||
{ | |||||
$page= '&page='.$count; | |||||
} | |||||
else | |||||
{ | |||||
$page=''; | |||||
} | |||||
return '<p align="center"><span class="fverysmall"><b>'.GenerateTime($lastpost[$topic]['time']).'</b><br></span> <a href="topic.php?t='.$topic.$page.'#p'.$id.'" class="fverysmall"><b>Post #'.$id.'</b></a><a class="fsmall">: </a><a href="user.php?id='.$userid.'" class="fverysmall">'.$user_color_name.'</a></p>'; | |||||
} | |||||
function LastPostImg() | |||||
{ | |||||
global $lastpost; | |||||
global $record; | |||||
global $default_skin; | |||||
$time = time()-129600; | |||||
if ($_SESSION['uid']>0) | |||||
{ | |||||
if ($lastpost[$record['t_id']]['time']>$time) | |||||
{ | |||||
return 'folder_new_posts'; | |||||
} | |||||
else | |||||
{ | |||||
return 'folder_no_new_posts'; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return 'folder_no_new_posts'; | |||||
} | |||||
} | |||||
function TopicAuthor($uid) | |||||
{ | |||||
global $record; | |||||
global $forum_config; | |||||
$rank = $record['rank']; | |||||
$nick = $record['nick']; | |||||
switch($rank) | |||||
{ | |||||
case '0': | |||||
{ | |||||
$user_color_name = $nick; | |||||
break; | |||||
} | |||||
case '1': | |||||
{ | |||||
$user_color_name = '<font color="'.$forum_config['color_mod'].'"><b>'.$nick.'</b></font>'; | |||||
break; | |||||
} | |||||
case '2': | |||||
{ | |||||
$user_color_name = '<font color="'.$forum_config['color_admin'].'"><b>'.$nick.'</b></font>'; | |||||
break; | |||||
} | |||||
} | |||||
return '<a href="user.php?id='.$uid.'" class="fstandard">'.$user_color_name.'</a>'; | |||||
} | |||||
function TopicInformation($tid, $mode) | |||||
{ | |||||
$sql = "SELECT * FROM ".TOPICS_TABLE." WHERE t_id='$tid';"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information'); | |||||
$result = mysql_fetch_array($query); | |||||
$result = $result[$mode]; | |||||
return $result; | |||||
} | |||||
function PostInformation($pid, $mode) | |||||
{ | |||||
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id='$pid';"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information'); | |||||
$result = mysql_fetch_array($query); | |||||
$result = $result[$mode]; | |||||
return $result; | |||||
} | |||||
function PostText($text,$postmoderate, $pid) | |||||
{ | |||||
global $forum; | |||||
global $lng; | |||||
$text = stripslashes($text); | |||||
$text = Topic::TagsReplace($text); | |||||
if($forum['moderate']==1) | |||||
{ | |||||
if ($postmoderate==1) | |||||
{ | |||||
if ($_SESSION['uid']>0) | |||||
{ | |||||
if (RANK>0) | |||||
{ | |||||
return '<span class="fstandard"><b>'.$lng['moderated_post_text'].': </b></span><br>'.Topic::TagsReplace('[quote]'.$text.'[/quote]').'<br><a href="moderate.php?action=accept&id='.$pid.'"><span class="fstandard" style="color: red"><b>'.$lng['visible_of_post'].'</b></span></a>'; | |||||
} | |||||
else | |||||
{ | |||||
return '<span class="fstandard"><b><i>'.$lng['post_moderated'].'</i></b></span>'; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return '<span class="fstandard"><b><i>'.$lng['post_moderated'].'</i></b></span>'; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return $text; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return $text; | |||||
} | |||||
} | |||||
function UserName($nick, $rank) | |||||
{ | |||||
global $forum_config; | |||||
switch($rank) | |||||
{ | |||||
case '0': | |||||
{ | |||||
return $nick; | |||||
break; | |||||
} | |||||
case '1': | |||||
{ | |||||
return '<font color="'.$forum_config['color_mod'].'"><b>'.$nick.'</b></font>'; | |||||
break; | |||||
} | |||||
case '2': | |||||
{ | |||||
return '<font color="'.$forum_config['color_admin'].'"><b>'.$nick.'</b></font>'; | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
function TagsReplace($text) | |||||
{ | |||||
global $lng; | |||||
//quote | |||||
$text = preg_replace("#\[quote\](.*?)\[/quote]#si", "<table class=\"maintable\" width=\"450\"><tr><td bgcolor=\"silver\"><span class=\"fsmall\"><b>".$lng['quote2'].":</b></span></td></tr><tr><td bgcolor=\"lightgrey\"><span class=\"textquote\">\\1</span></td></tr></table>", $text); | |||||
//code | |||||
$text = preg_replace("#\[code\](.*?)\[/code]#si", "<table class=\"maintable\" width=\"450\"><tr><td bgcolor=\"lightgreen\"><font face=\"Verdana\" style=\"font-size: 8pt\" color=\"green\"><b>Code:</b></font></td></tr><tr><td bgcolor=\"#D4FFAA\"><span class=\"textquote\">\\1</span></td></tr></table>", $text); | |||||
return $text; | |||||
} | |||||
} | |||||
?> |
@ -0,0 +1,224 @@ | |||||
<?php | |||||
/** | |||||
* @package uForum | |||||
* @file includes/classes/class_user.php | |||||
* @version $Id: classes/class_user.php 15 2009-05-01 17:06:40Z pioder $ | |||||
* @copyright 2009(c) PioDer <pioder@wp.pl> | |||||
* @link http://pioder.gim2przemysl.int.pl/ | |||||
* @license GNU GPL v3 | |||||
**/ | |||||
if ( !defined('IN_uF') ) | |||||
{ | |||||
die('Hacking attempt'); | |||||
} | |||||
class User | |||||
{ | |||||
function LastUser() | |||||
{ | |||||
global $lastuser; | |||||
$usr = $lastuser['nick']; | |||||
$uid = $lastuser['u_id']; | |||||
return '<a href="user.php?id='.$uid.'" class="fstandard">'.$usr.'</a>'; | |||||
} | |||||
function UserInformation($uid, $inf) | |||||
{ | |||||
$sql = "SELECT `$inf` FROM ".USERS_TABLE." WHERE u_id='$uid';"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'); | |||||
$result = mysql_fetch_array($query); | |||||
$result = $result[$inf]; | |||||
return $result; | |||||
} | |||||
function UserIdByNick($nick) | |||||
{ | |||||
$sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$nick';"; | |||||
$result = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.')); | |||||
$result = $result['u_id']; | |||||
/*if ($result=='') | |||||
{ | |||||
message_forum('nick failed','admin_groups.php'); | |||||
}*/ | |||||
return $result; | |||||
} | |||||
function AddToGroup($uid, $gid) | |||||
{ | |||||
$last= DataBase::new_id(USERS_GROUP_TABLE); | |||||
$sql = "INSERT INTO `".USERS_GROUP_TABLE."` VALUES ('$last','$uid', '$gid')"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not add user to group.'); | |||||
} | |||||
function DeleteFromGroup($uid, $gid) | |||||
{ | |||||
$sql = "DELETE FROM `".USERS_GROUP_TABLE."` WHERE `u_id`='$uid' AND `g_id`='$gid'"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not delete user for group.'); | |||||
} | |||||
function LogedAs($sid, $uid) | |||||
{ | |||||
global $lng; | |||||
global $userdata; | |||||
if ($uid>0) | |||||
{ | |||||
$nick = $userdata['nick']; | |||||
return(''.$lng['youareloggedas'].' <a href="user.php?id='.$uid.'" class="fstandard"><b>'.$nick.'</b></a>'); | |||||
} | |||||
else | |||||
{ | |||||
return($lng['youarenotlogd']); | |||||
} | |||||
} | |||||
function PostWithForum($posts) | |||||
{ | |||||
$result2 = TotalPosts(); | |||||
if($result2>0) | |||||
{ | |||||
$result3 = ($posts/$result2*100); | |||||
$result3 = round($result3,2); | |||||
return($result3); | |||||
} | |||||
else | |||||
{ | |||||
return(0); | |||||
} | |||||
} | |||||
function LastRegVisit($uid, $mode) | |||||
{ | |||||
global $lng; | |||||
$result = User::UserInformation($uid,$mode); | |||||
if ($result=='0') | |||||
{ | |||||
return($lng['never']); | |||||
} | |||||
else | |||||
{ | |||||
$date = date('d-m-Y, G:i',$result); | |||||
return($date); | |||||
} | |||||
} | |||||
function UserRank($rank) | |||||
{ | |||||
global $lng; | |||||
global $forum_config; | |||||
switch($rank) | |||||
{ | |||||
case '0': {$result=$lng['user']; break; } | |||||
case '1': {$result='<font color="'.$forum_config['color_mod'].'"><b>'.$lng['mod'].'</b></font>'; break; } | |||||
case '2': {$result='<font color="'.$forum_config['color_admin'].'"><b>'.$lng['admin'].'</b></font>'; break; } | |||||
} | |||||
return($result); | |||||
} | |||||
function RankAdminMod($uid) | |||||
{ | |||||
if ($uid>0) | |||||
{ | |||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid'"; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user`s rank information.'); | |||||
$result = mysql_fetch_array($query); | |||||
$rank = $result['rank']; | |||||
if (($rank=='1') or ($rank=='2')) | |||||
{ | |||||
return '1'; | |||||
} | |||||
else | |||||
{ | |||||
return '0'; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return '0'; | |||||
} | |||||
} | |||||
function UpdateProfile($uid, $gg, $email, $interests, $sig, $avatar, $allow_qr, $allow_email, $allow_gg, $skin, $lang, $limit_tpid, $limit_ftid, $limit_users, $allow_shoutbox) | |||||
{ | |||||
$sql ="UPDATE `".USERS_TABLE."` SET | |||||
`gg` = '$gg', | |||||
`email` = '$email', | |||||
`allow_gg` = '$allow_gg', | |||||
`allow_email` = '$allow_email', | |||||
`allow_qr` = '$allow_qr', | |||||
`interests` = '$interests', | |||||
`sig` = '$sig', | |||||
`avatar` = '$avatar', | |||||
`skin`='$skin', | |||||
`lang`='$lang', | |||||
`limit_tpid` = '$limit_tpid', | |||||
`limit_ftid` = '$limit_ftid', | |||||
`view_shoutbox` = '$allow_shoutbox', | |||||
`limit_users` = '$limit_users' | |||||
WHERE `u_id` ='$uid' LIMIT 1 ;"; | |||||
DataBase::sql_query($sql,'CRITICAL','Could not update user information'); | |||||
} | |||||
function UpdateAdminPools($uid, $posts, $rank, $active, $nick) | |||||
{ | |||||
$sql ="UPDATE `".USERS_TABLE."` SET | |||||
`posts` = '$posts', | |||||
`rank` = '$rank', | |||||
`active` = '$active', | |||||
`nick` = '$nick' | |||||
WHERE `u_id` ='$uid' LIMIT 1 ;"; | |||||
DataBase::sql_query($sql,'CRITICAL','Could not update user information'); | |||||
} | |||||
function UpdatePassword($uid, $pass) | |||||
{ | |||||
$sql ="UPDATE `".USERS_TABLE."` SET | |||||
`pass` = '$pass' | |||||
WHERE `u_id` ='$uid' LIMIT 1 ;"; | |||||
DataBase::sql_query($sql,'CRITICAL','Could not update user information'); | |||||
} | |||||
function CreateProfile($nick, $pass, $email, $gg, $allow_gg, $allow_email, $allow_qr, $sig, $av, $interests) | |||||
{ | |||||
global $forum_config; | |||||
$last = DataBase::new_id(USERS_TABLE); | |||||
$time = time(); | |||||
$sql = "INSERT INTO ".USERS_TABLE." VALUES | |||||
('$last', '$nick', '$pass', '$email', '0', '$time', '0', '$gg', '$allow_gg', '$allow_email', '$allow_qr', '".$forum_config['view_shoutbox']."', '".$forum_config['defaultskin']."', '".$forum_config['defaultlang']."','".$forum_config['limit_tpid']."', '".$forum_config['limit_ftid']."', '".$forum_config['limit_users']."', '$sig', '$av', '1','0','$interests');"; | |||||
DataBase::sql_query($sql,'CRITICAL','Could not create new user'); | |||||
} | |||||
function UserMsgs() | |||||
{ | |||||
$uid = $_SESSION['uid']; | |||||
if($uid>0) | |||||
{ | |||||
$sql = "SELECT count(*) as `m_id` FROM ".PM_INBOX_TABLE." WHERE `u_id`='$uid' AND `read`='0'"; | |||||
$result = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain amounts PM of User.')); | |||||
$result = $result['m_id']; | |||||
if ($result>0) | |||||
{ | |||||
return '<font color="red">'.$result.'</font>'; | |||||
} | |||||
else | |||||
{ | |||||
return $result; | |||||
} | |||||
} | |||||
} | |||||
function UserAddWarn($uid, $value, $motive) | |||||
{ | |||||
$sql = "INSERT INTO `".WARNINGS_TABLE."` ( `w_id` , `u_id` , `value` , `motive` ) VALUES('','$uid','$value','$motive');"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not add new warn.'); | |||||
if (User::UserLevelWarns($uid)==100) | |||||
{ | |||||
$ban_ip = '0.0.0.0'; | |||||
$ban_uid = $uid; | |||||
$ban_motive = $lng['warns_ban']; | |||||
$sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('', '$ban_uid', '$ban_ip', '$ban_motive')"; | |||||
DataBase::sql_query($sql,'GENERAL','Could not update add ban.'); | |||||
} | |||||
} | |||||
} | |||||
?> |
@ -0,0 +1,87 @@ | |||||
<?php | |||||
/** | |||||
* @package uForum | |||||
* @file includes/class_email.php | |||||
* @version $Id: emailer.php -1 $ | |||||
* @copyright 2009(c) PioDer <pioder@wp.pl> | |||||
* @link http://pioder.gim2przemysl.int.pl/ | |||||
* @license GNU GPL v3 | |||||
**/ | |||||
if ( !defined('IN_uF') ) | |||||
{ | |||||
die('Hacking attempt'); | |||||
} | |||||
function SendEmail($email, $title, $content) | |||||
{ | |||||
global $forum_config; | |||||
#headers | |||||
$email_headers = "MIME-Version: 1.0\r\n"; | |||||
$email_headers .= "Content-type: text/html; charset=iso-8859-2\r\n"; | |||||
$email_headers .= "From: ".$forum_config['forumname']." \n"; | |||||
$email_date = date('d-m-Y, G:i',time()); | |||||
$email_content = ' | |||||
<html> | |||||
<head> | |||||
<title>'.$title.'</title> | |||||
</head> | |||||
<body> | |||||
'.$content.'<br> | |||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br> | |||||
<font face="Verdana" style="font-size:10pt"> | |||||
Message generated automatic by µForum <b>('.$email_date.')</b></font> | |||||
</body> | |||||
</html>'; | |||||
#send email - do it! | |||||
if ( !mail($email, $title, $email_content, $email_headers )) | |||||
{ | |||||
message_die('GENERAL','Could not send email from: '.$email.'. sorry :(',''); | |||||
} | |||||
} | |||||
function SendRegisterEmail() | |||||
{ | |||||
global $forum_config; | |||||
global $original_pass; | |||||
global $lng; | |||||
$email_content = $lng['email_newpasswd_msg']; | |||||
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content); | |||||
$email_content = str_replace('%url_f%',$forum_config['forumpatch'],$email_content); | |||||
$email_content = str_replace('%ip%',$_SERVER['REMOTE_ADDR'],$email_content); | |||||
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content); | |||||
$email_content = str_replace('%login%',$_POST['nick'],$email_content); | |||||
$email_content = str_replace('%pass%',$original_pass,$email_content); | |||||
SendEmail($_POST['email'],$lng['email_welcome'].$forum_config['forumname'],$email_content); | |||||
} | |||||
function SendForgotPassEmail($newpass) | |||||
{ | |||||
global $forum_config; | |||||
global $original_pass; | |||||
global $lng; | |||||
global $uid; | |||||
$email_content = $lng['email_register_msg']; | |||||
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content); | |||||
$email_content = str_replace('%url_f%',$forum_config['forumpatch'],$email_content); | |||||
$email_content = str_replace('%ip%',$_SERVER['REMOTE_ADDR'],$email_content); | |||||
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content); | |||||
$email_content = str_replace('%login%',$_POST['username'],$email_content); | |||||
$email_content = str_replace('%pass%',$newpass,$email_content); | |||||
SendEmail(User::UserInformation($uid,'email'),$lng['email_sent_forget_pass'].$forum_config['forumname'],$email_content); | |||||
} | |||||
function SendMassEmail($title,$content) | |||||
{ | |||||
$sql = "SELECT `email`,`u_id` FROM ".USERS_TABLE." WHERE `u_id`>0"; | |||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not read users table'); | |||||
while($item = @mysql_fetch_array($query)) | |||||
{ | |||||
SendEmail($item['email'], $title, $content); | |||||
} | |||||
} | |||||
?> |
@ -0,0 +1,72 @@ | |||||
<?php | |||||
/** | |||||
* @package uForum | |||||
* @file includes/errors.php | |||||
* @version $Id: errors.php 15 2009-05-01 17:06:40Z pioder $ | |||||
* @copyright 2009(c) PioDer <pioder@wp.pl> | |||||
* @link http://pioder.gim2przemysl.int.pl/ | |||||
* @license GNU GPL v3 | |||||
**/ | |||||
if ( !defined('IN_uF') ) | |||||
{ | |||||
die('Hacking attempt'); | |||||
} | |||||
function message_die($type, $msm, $sql) | |||||
{ | |||||
$msg =''; | |||||
$msg = ' | |||||
<body bgcolor=""> | |||||
<table align="left" border="1" style="border-collapse: collapse; border-color: grey" width="500"> | |||||
<tr> | |||||
<td bgcolor="" align="left"> | |||||
<font face="Verdana" style="font-size: 18pt; font-weight: bold" color="red">DSF v'.VERSION.' - '; | |||||
$msg .= ($type='CRITICAL') ? 'CRITICAL ERROR' : 'GENERAL ERROR' ; | |||||
$msg .= '</font> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td bgcolor="#FEC876" align="center"> | |||||
<font face="Verdana" style="font-size: 13pt; font-weight: bold">'; | |||||
$msg = $msg.$msm.' | |||||
</font> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td align="left" bgcolor="white">'; | |||||
if ($sql !='') | |||||
{ | |||||
$msg = $msg.'<font face="Verdana" style="font-size: 11pt"><i>'.$sql.'</i></font>'; | |||||
} | |||||
$msg = $msg.'</td></tr><tr><td bgcolor="white"><center><font face="Verdana" style="font-size: 10pt">Problems? Questions? Visit: | |||||
<a href="http://pioder.gim2przemysl.int.pl/forum/" target="_blank">http://pioder.gim2przemysl.int.pl/forum</a></font></td></tr></table></center></body>'; | |||||
die($msg); | |||||
} | |||||
function message_forum($text, $url, $interval = 1.8) | |||||
{ | |||||
global $lng; | |||||
global $forum_config; | |||||
$skin = array( | |||||
'url' => $url, | |||||
'msg' => $text, | |||||
'queries' => '', | |||||
'pa_link' => '', | |||||
); | |||||
$skin = array_push_associative($skin,GenerateHeader($lng['message_forum'], '> '.$lng['message_forum'])); | |||||
die( | |||||
include('./skins/'.ViewSkinName().'/message_body.tpl') | |||||
); | |||||
} | |||||
function admin_message_forum($text, $url) | |||||
{ | |||||
$skin = array( | |||||
'url'=>$url, | |||||
'msg'=>$text, | |||||
); | |||||
$skin['queries'] = ''; | |||||
$skin['pa_link'] = ''; | |||||
die( | |||||
include('./template/message_body.tpl') | |||||
); | |||||
} | |||||
?> |
@ -0,0 +1,346 @@ | |||||
<?php | |||||
/** | |||||
* @package uForum | |||||
* @file includes/class_overall.php | |||||
* @version $Id$ | |||||
* @copyright 2009(c) PioDer <pioder@wp.pl> | |||||
* @link http://pioder.gim2przemysl.int.pl/ | |||||
* @license GNU GPL v3 | |||||
**/ | |||||
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( | |||||
'forumname' => $forum_config['forumname'], | |||||
'forumdesc' => $forum_config['forumdesc'], | |||||
'users' => $lng['lusers'], | |||||
'pm' => $lng['lpm'], | |||||
'register' => $lng['lregister'], | |||||
'search' => $lng['lsearch'], | |||||
'eprofile' => $lng['leprofile'], | |||||
'groups' => $lng['lgroups'], | |||||
'keywords' => $forum_config['meta_keywords'], | |||||
'description' => $forum_config['meta_description'], | |||||
'mainpage' => $title, | |||||
'lmainpage' => $navigator, | |||||
'lactual_time'=>$lng['lactualtime'], | |||||
'modelogin' => ($_SESSION['uid']>0) ? 'logout' : 'login', | |||||
'llogin' => ($_SESSION['uid']>0) ? $lng['lunlogin'] : $lng['llogin'] | |||||
); | |||||
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 AddPages() | |||||
{ | |||||
global $count; | |||||
global $page; | |||||
$content = ''; | |||||
for ($i=1;$i<=$count;$i++) | |||||
{ | |||||
if ($i==$page) | |||||
{ | |||||
$content .= '<option value="'.$i.'" selected="selected">'.$i.'</option>'; | |||||
} | |||||
else | |||||
{ | |||||
$content .= '<option value="'.$i.'">'.$i.'</option>'; | |||||
} | |||||
} | |||||
return $content; | |||||
unset($content); | |||||
} | |||||
function AddPages2($page)//for edit profile, not used in limit! | |||||
{ | |||||
$content = ''; | |||||
for ($i=1;$i<=50;$i++) | |||||
{ | |||||
if ($i==$page) | |||||
{ | |||||
$content .= '<option value="'.$i.'" selected="selected">'.$i.'</option>'; | |||||
} | |||||
else | |||||
{ | |||||
$content .= '<option value="'.$i.'">'.$i.'</option>'; | |||||
} | |||||
} | |||||
return $content; | |||||
unset($content); | |||||
} | |||||
function AddSkins() | |||||
{ | |||||
global $forum_config; | |||||
global $default_skin; | |||||
$all=''; | |||||
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information'); | |||||
while($t = @mysql_fetch_array($query)) | |||||
{ | |||||
if ($t['name']==$default_skin) | |||||
{ | |||||
$all .= '<option value="'.$t['s_id'].'" selected="selected">'.$t['name'].'</option>'; | |||||
} | |||||
else | |||||
{ | |||||
$all .= '<option value="'.$t['s_id'].'">'.$t['name'].'</option>'; | |||||
} | |||||
} | |||||
return $all; | |||||
unset($t, $all); | |||||
} | |||||
function AddLangs() | |||||
{ | |||||
global $forum_config; | |||||
global $default_lang; | |||||
$result=''; | |||||
$rep=opendir('./lngs'); | |||||
$browseruMoinsUnRepertoire = false; | |||||
while ($file = readdir($rep)) | |||||
{ | |||||
if($file != '..' && $file !='.' && $file !='') | |||||
{ | |||||
if (is_dir('./lngs/'.$file)){ | |||||
$browseruMoinsUnRepertoire = true; | |||||
if ($file==$default_lang) | |||||
{ | |||||
$result .='<option value="'.$file.'" selected="selected">'.$file.'</option>'; | |||||
} | |||||
else | |||||
{ | |||||
$result .='<option value="'.$file.'">'.$file.'</option>'; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
return $result; | |||||
unset($rep, $browseruMoinsUnRepertoire, $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' | |||||
<tr> | |||||
<td class="fitem"> | |||||
<span class="fstandard">'.$lng['addusrtogrp'].':</span><input type="text" name="nick" style="widtfh:100px; height:15px" value="'.$_POST['nick'].'"> | |||||
</td> | |||||
<td class="fitem"> | |||||
<span class="fstandard">'.$lng['delusrforgrp'].':</span><input type="text" name="delnick" style="widtfh:100px; height:15px" value="'.$_POST['nick'].'"> | |||||
</td> | |||||
<td class="fitem"> | |||||
<input type="submit" class="fbutton" value="'.$lng['lgo'].'"> | |||||
</tr> | |||||
'; | |||||
} | |||||
} | |||||
function TotalPosts() | |||||
{ | |||||
$sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE.""; | |||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain total posts information'); | |||||
$result = mysql_fetch_array($query); | |||||
$result = $result['p_id']; | |||||
return($result); | |||||
} | |||||
function DefaultLang() | |||||
{ | |||||
global $forum_config; | |||||
global $userdata; | |||||
if ($_SESSION['uid']>0) | |||||
{ | |||||
return $userdata['lang']; | |||||
} | |||||
else | |||||
{ | |||||
return $forum_config['defaultlang']; | |||||
} | |||||
} | |||||
function ShowQueries($start, $stop) | |||||
{ | |||||
global $forum_config; | |||||
global $lng; | |||||
if ($forum_config['show_time_generation']) | |||||
{ | |||||
$result = $stop - $start; | |||||
$result = round($result,3); | |||||
if (extension_loaded('xdebug')) | |||||
{ | |||||
return $lng['script_generated'].$result.' '.$lng['seconds'].'. SQL: '.$_COOKIE['queries'].'.<br> | |||||
Wersja Xdebug: '.phpversion('xdebug').', Użycie pamięci: '.round((xdebug_memory_usage()/1024),2).'KB.'; | |||||
} | |||||
else | |||||
{ | |||||
return $lng['script_generated'].$result.' '.$lng['seconds'].'. SQL: '.$_COOKIE['queries'].'.'; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return ''; | |||||
} | |||||
} | |||||
function ViewSkinName() | |||||
{ | |||||
global $forum_config; | |||||
global $userdata; | |||||
if ($_SESSION['uid']>0) | |||||
{ | |||||
$result = $userdata['skin']; | |||||
} | |||||
else | |||||
{ | |||||
$result = $forum_config['defaultskin']; | |||||
} | |||||
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'"; | |||||
$result = mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.')); | |||||
return $result['name']; | |||||
} | |||||
?> |