if defined DATALIFEENGINE die Hacking attempt lim if is_logged return

 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
35
36
37
38
39
40
41
42
43
44
45
if(!defined('DATALIFEENGINE'))die("Hacking attempt!");
$lim = 4;
if(!$is_logged) return false;
#if(!$member_id['pm_unread']) return false;
function pm_words($n,$word){
$word = explode("|",$word);
$n = intval($n);
return $n%10==1&&$n%100!=11?$word[0].$word[1]:($n%10>=2&&$n%10<=4&&($n%100<10||$n%100>=20)?$word[0].$word[2]:$word[0].$word[3]);
}
if($member_id['pm_unread']){
$rows = $db->super_query("SELECT SQL_CALC_FOUND_ROWS p.id, p.subj, p.user_from, p.date, u.foto FROM " . USERPREFIX . "_pm p LEFT JOIN ".USERPREFIX."_users u ON p.user_from=u.name WHERE p.user = '{$member_id['user_id']}' AND p.pm_read=0 AND p.folder = 'inbox' ORDER BY p.date DESC LIMIT 0,$lim",true);
$list = "";
foreach($rows as $row){
$date = langdate("j F Y в H:i",$row['date']);
$time = langdate("H:i",$row['date']);
$subj = stripslashes($row['subj']);
if( count(explode("@", $row['foto'])) == 2 ) $foto = 'http://www.gravatar.com/avatar/' . md5(trim($row['foto'])) . '?s=40';
else{
if($row['foto']) $foto = $config['http_home_url'] . "uploads/fotos/" . $row['foto'];
else $foto = "{THEME}/dleimages/noavatar.png";
}
$list .= <<<HTML
<li>
<a href="{$config['http_home_url']}index.php?do=pm&amp;doaction=readpm&amp;pmid={$row['id']}" class="pm-inform-item">
<span class="pm-inform-ava"><img src="$foto" alt="" /></span>
<span class="pm-inform-date" title="$date">$time</span>
<span class="pm-inform-author">{$row['user_from']}</span>
<span class="pm-inform-subj" title="$subj">$subj</span>
</a>
</li>
HTML;
}
}else $list = "<li class=\"pm-inform-empty\">нет новых сообщений</li>";
$num_txt = intval($member_id['pm_unread']).pm_words($member_id['pm_unread']," нов|ое|ых|ых");
$num_txt2 = pm_words($member_id['pm_unread']," сообщени|е|я|й");