forked from SnowHall/Silurus-Classifieds-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·91 lines (80 loc) · 3.11 KB
/
index.php
File metadata and controls
executable file
·91 lines (80 loc) · 3.11 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/**
* Silurus Classifieds Builder
*
*
* @author SnowHall - http://snowhall.com
* @website http://snowhall.com/silurus
* @email support@snowhall.com
*
* @version 1.0
* @date May 7, 2009
*
* Silurus is a professionally developed PHP Classifieds script that was built for you.
* Whether you are running classifieds for autos, motorcycles, bicycles, rv's, guns,
* horses, or general merchandise, our product is the right package for you.
* It has template system and no limit to usage with free for any changes.
*
* Copyright (c) 2009
*/
include("./include_php/init.php");
$text = array();
$q = mysql_query("select * from SimpleMain order by ID");
while($arr = mysql_fetch_assoc($q))
{
$text[$arr['ID']] = $arr;
}
$sQuery = ("select s.*,c.Title as ctitle,c.ID as cid,p.ID as uid,CONCAT(p.fname,' ',lname) as user from Store s inner join StoreCategories c on c.ID=s.categoryID inner join Profiles p on p.ID=s.userID where ".($_SESSION['location']['condition']!=''?'s.userID in '.$_SESSION['location']['condition'].' and ':'')." s.type=0 and s.status=0 order by s.ID desc limit 2 ");
$rElems = mysql_query( $sQuery );
while($book = mysql_fetch_assoc($rElems))
{
$temp = array();
$temp['ID'] = $book['ID'];
$temp['Title'] = htmlspecialchars($book['Title']);
$temp['Date'] = date("F jS, Y",$book['date']);
$temp['Price'] = number_format($book['price'],2,".","");
$temp['ctitle'] = $book['ctitle'];
$temp['cid'] = $book['cid'];
$temp['uid'] = $book['uid'];
$temp['user'] = $book['user'];
$img = '';
$photos = array();
$q = mysql_query("select v.* from StorePropValues v inner join StoreProp p on p.ID=v.PropID where v.itemID=".$book['ID']." and p.Type=3 limit 1");
while($arr = mysql_fetch_assoc($q))
{
if(is_file("./media/store/small_".$arr['Value']))
$img = $arr['Value'];
}
$temp['img'] = $img;
$books[] = $temp;
}
$smarty->assign("recent", $books);
$books = array();
$sQuery = ("select s.*,c.Title as ctitle,c.ID as cid,p.ID as uid,CONCAT(p.fname,' ',lname) as user from Store s inner join StoreCategories c on c.ID=s.categoryID inner join Profiles p on p.ID=s.userID where ".($_SESSION['location']['condition']!=''?'s.userID in '.$_SESSION['location']['condition'].' and ':'')." s.type=1 and s.status=0 order by s.ID desc limit 2 ");
$rElems = mysql_query( $sQuery );
while($book = mysql_fetch_assoc($rElems))
{
$temp = array();
$temp['ID'] = $book['ID'];
$temp['Title'] = htmlspecialchars($book['Title']);
$temp['Date'] = date("F jS, Y",$book['date']);
$temp['Price'] = number_format($book['price'],2,".","");
$temp['ctitle'] = $book['ctitle'];
$temp['cid'] = $book['cid'];
$temp['uid'] = $book['uid'];
$temp['user'] = $book['user'];
$img = '';
$photos = array();
$q = mysql_query("select v.* from StorePropValues v inner join StoreProp p on p.ID=v.PropID where v.itemID=".$book['ID']." and p.Type=3 limit 1");
while($arr = mysql_fetch_assoc($q))
{
if(is_file("./media/store/small_".$arr['Value']))
$img = $arr['Value'];
}
$temp['img'] = $img;
$books[] = $temp;
}
$smarty->assign("wrecent", $books);
$smarty->assign("text_blocks", $text);
show_smarty_template("index");
?>