forked from SnowHall/Silurus-Classifieds-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathajax_getPreview.php
More file actions
executable file
·69 lines (55 loc) · 1.91 KB
/
ajax_getPreview.php
File metadata and controls
executable file
·69 lines (55 loc) · 1.91 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
<?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");
include("./include_php/TemplVotingView.php");
$type = intval($_GET['type']);
$id = intval($_GET['id']);
$book = mysql_fetch_assoc(mysql_query("select * from Store where type=".($type-1)." and ID=".$id));
$categ = mysql_fetch_assoc(mysql_query("select * from StoreCategories where ID=".$book['categoryID']));
$user = mysql_fetch_assoc(mysql_query("select * from Profiles where ID=".intval($book['userID'])));
$oVotingView = new TemplVotingView ('gvoting', 0);
$oVotingView->_fRate = $book['rating'];
$vote1 = $oVotingView->getSmallVoting (0,'');
$book['title_short'] = strlen($book['Title'])>30?substr(htmlspecialchars($book['Title']),0,30).'...':htmlspecialchars($book['Title']);
$book['price'] = number_format($book['price'],2,".","");
if($type==1)
{
$book['url'] = '/product';
$book['prefix'] = '';
}
else
{
$book['url'] = '/wproduct';
$book['prefix'] = '_b';
}
$img = '';
$photos = array();
$q = mysql_query("select v.* from StorePropValues v inner join StoreProp p on p.ID=v.PropID where v.itemID=".$id." and p.Type=3 limit 1");
while($arr = mysql_fetch_assoc($q))
{
if(is_file("./media/store/small_".$arr['Value']))
$book['Photo1'] = $arr['Value'];
}
$smarty->assign("vote1", $vote1);
$smarty->assign("book", $book);
$smarty->assign("categ", $categ);
$smarty->assign("user", $user);
show_smarty_template('ap_preview');
?>