function smiles text aa mysql_query SELECT name adres FROM smiles orde

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function smiles($text){
$aa = mysql_query("SELECT name,adres FROM `smiles` order by `id` desc");
while($ba = mysql_fetch_array($aa)){
$text=str_replace($ba['name'],'<img src="'.$ba['adres'].'" alt="'.$ba['name'].'" />', $text);}
$text = preg_replace('/\[img\]{1}(.+?)\[\/img\]{1}/', '<img src="$1"/>', $text);
return nl2br($text);
}
////////////////////////////////////
$reqvb = mysql_query("SELECT kol,usr,param FROM `bonus` WHERE `time`<'".$time."' and `typ`='4'");
while($pramb = mysql_fetch_array($reqvb)){
mysql_query("DELETE FROM `bonus` WHERE `time`<'".$time."' and `typ`='4'");
mysql_query("UPDATE `umen` set `time` = `time`+'".$pramb['kol']."' WHERE `usr` = '".$pramb['usr']."' and `img` = '".$pramb['param']."'");
}
////////////////////////////////////////
$remq = mysql_query("SELECT kol,param FROM `bonus` WHERE `time`<'".$time."' and `typ`='0' and `image`!='2' and `image`!='14' and `usr`='".$user['id']."'");
$vtij = mysql_num_rows($remq);
if($vtij > 0){
While($pram = mysql_fetch_array($remq)){
mysql_query("DELETE FROM `bonus` WHERE `time`<'".$time."' and `typ`='0' and `image`!='2' and `image`!='14' and `usr`='".$user['id']."'");
if($pram['param']!='max_health'){
mysql_query("UPDATE `user` set `".$pram['param']."` = `".$pram['param']."` - '".$pram['kol']."', `param`=`param`-'".$pram['kol']."' where `id` = '".$user['id']."'");
} else {
mysql_query("UPDATE `user` set `".$pram['param']."` = `".$pram['param']."` - '".$pram['kol']."', `param`=`param`-('".$pram['kol']."'/'10') where `id` = '".$user['id']."'");
}
}
}