-
Notifications
You must be signed in to change notification settings - Fork 0
/
message_read_left.php
37 lines (34 loc) · 1.49 KB
/
message_read_left.php
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
<?php
/******************************************************************************
Etano
===============================================================================
File: message_read_left.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
$tpl->set_file('left_content','message_read_left.html');
$query="SELECT `fk_folder_id`,count(*) FROM `{$dbtable_prefix}user_inbox` WHERE `fk_user_id`='".$_SESSION[_LICENSE_KEY_]['user']['user_id']."' AND `is_read`=0 AND `del`=0 GROUP BY `fk_folder_id`";
if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);}
$num_messages=array();
while ($rsrow=mysql_fetch_row($res)) {
$num_messages[$rsrow[0]]=$rsrow[1];
}
$loopfolders=array();
$i=0;
foreach ($my_folders as $k=>$v) {
$loopfolders[$i]['fid']=$k;
$loopfolders[$i]['folder']=$v;
if (!empty($num_messages[$k])) {
$loopfolders[$i]['folder'].=' ('.$num_messages[$k].')';
}
++$i;
}
$tpl->set_loop('loopfolders',$loopfolders);
$tpl->set_var('tplvars',$tplvars);
$tpl->process('left_content','left_content',TPL_LOOP | TPL_OPTIONAL);
$tpl->drop_loop('loopfolders');
unset($loopfolders);