+ Censorlist was extended - added replacement parametr
+ Fixed bug with DB Size in check_script.php + Deleted a lot of indexes in check_script_data.php + Deleted cache index and forum lastpost section in cache_index.php and cache_forum.php + Fixed other bugs in warnings + Fixed pagination in search.php + Replaced DSF logo to uForum logo + Moved differend elements in skin + Added "WHOIS" option in "Admin/Mod Pool" in view topic + Fixed bug in add warnings: couldn't add warn for admin/mod git-svn-id: https://svn.pioder.pl/uf-svn/uF@29 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
@@ -209,6 +209,7 @@ class User
|
||||
|
||||
function UserAddWarn($uid, $value, $motive)
|
||||
{
|
||||
global $lng;
|
||||
$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)
|
||||
@@ -220,5 +221,31 @@ class User
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update add ban.');
|
||||
}
|
||||
}
|
||||
|
||||
function UserLevelWarns($uid)
|
||||
{
|
||||
$level =0;
|
||||
$sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."` WHERE `u_id`='$uid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user warns information');
|
||||
$result = DataBase::num_rows($query);
|
||||
while ($result = @DataBase::fetch($query))
|
||||
{
|
||||
if ($result['value']=='-')
|
||||
{
|
||||
$level = $level -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$level = $level +1;
|
||||
}
|
||||
}
|
||||
//version 1.0 Alpha 2
|
||||
//delete second query
|
||||
if ($level>0)
|
||||
{
|
||||
$level = $level*10;
|
||||
}
|
||||
return $level;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -33,8 +33,8 @@ class Secure
|
||||
$sql = "SELECT * FROM ".CENSORLIST_TABLE.";";
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain censorlist information.');
|
||||
while($word = DataBase::fetch($query))
|
||||
{
|
||||
$text = str_replace($word['word'],'[censored]', $text);
|
||||
{
|
||||
$text = str_replace($word['word'],$word['replace'], $text);
|
||||
}
|
||||
}
|
||||
return $text;
|
||||
|
||||
Reference in New Issue
Block a user