-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy_searches_left.php
30 lines (27 loc) · 1.41 KB
/
my_searches_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
<?php
/******************************************************************************
Etano
===============================================================================
File: my_searches_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. *
******************************************************************************/
$my_searches=array();
if (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id'])) {
$query="SELECT `search_qs`,`title` FROM `{$dbtable_prefix}user_searches` WHERE `fk_user_id`='".$_SESSION[_LICENSE_KEY_]['user']['user_id']."' ORDER BY `search_id` DESC LIMIT 5";
if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);}
while ($rsrow=mysql_fetch_assoc($res)) {
$rsrow['title']=sanitize_and_format($rsrow['title'],TYPE_STRING,$__field2format[TEXT_DB2DISPLAY]);
$my_searches[]=$rsrow;
}
}
$tpl->set_file('left_content','my_searches_left.html');
$tpl->set_loop('my_searches',$my_searches);
$tpl->set_var('tplvars',$tplvars);
$tpl->process('left_content','left_content',TPL_LOOP | TPL_NOLOOP | TPL_OPTIONAL);
$tpl->drop_loop('my_searches');
unset($my_searches);