-
Notifications
You must be signed in to change notification settings - Fork 0
/
flirt_send_left.php
44 lines (40 loc) · 2.01 KB
/
flirt_send_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
38
39
40
41
42
43
44
<?php
/******************************************************************************
Etano
===============================================================================
File: flirt_send_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','flirt_send_left.html');
$my_folders=array(FOLDER_INBOX=>$GLOBALS['_lang'][110],FOLDER_OUTBOX=>$GLOBALS['_lang'][111],FOLDER_TRASH=>$GLOBALS['_lang'][112],FOLDER_SPAMBOX=>$GLOBALS['_lang'][113]);
$query="SELECT `folder_id`,`folder` FROM `{$dbtable_prefix}user_folders` WHERE `fk_user_id`='".$_SESSION[_LICENSE_KEY_]['user']['user_id']."'";
if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);}
while ($rsrow=mysql_fetch_row($res)) {
$my_folders[$rsrow[0]]=sanitize_and_format($rsrow[1],TYPE_STRING,$__field2format[TEXT_DB2DISPLAY]);
}
$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);