-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmedia_content.php
More file actions
76 lines (62 loc) · 2.56 KB
/
media_content.php
File metadata and controls
76 lines (62 loc) · 2.56 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
<?php
/* -----------------------------------------------------------------------------------------
$Id: media_content.php 17 2012-06-04 20:33:29Z deisold $
XT-Commerce - community made shopping
http://www.xt-commerce.com
Copyright (c) 2003 XT-Commerce
-----------------------------------------------------------------------------------------
based on:
(c) 2003 nextcommerce (media_content.php,v 1.2 2003/08/25); www.nextcommerce.org
Released under the GNU General Public License
---------------------------------------------------------------------------------------*/
require ('includes/application_top.php');
$content_query = xtc_db_query("SELECT
content_name,
content_read,
content_file
FROM ".TABLE_PRODUCTS_CONTENT.
WHERE content_id='".(int) $_GET['coID']."'");
$content_data = xtc_db_fetch_array($content_query);
// update file counter
xtc_db_query("UPDATE
".TABLE_PRODUCTS_CONTENT."
SET content_read='". ($content_data['content_read'] + 1)."'
WHERE content_id='".(int) $_GET['coID']."'");
?>
<html <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo $content_data['content_name']; ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo 'templates/'.CURRENT_TEMPLATE.'/stylesheet.css'; ?>">
<script type="text/javascript"><!--
var i=0;
function resize() {
if (navigator.appName == 'Netscape') i=40;
if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);
self.focus();
}
//--></script>
</head>
<body onload="resize();">
<?php
if ($content_data['content_file'] != '') {
if (strpos($content_data['content_file'], '.txt'))
echo '<pre>';
if (eregi('.gif', $content_data['content_file']) or eregi('.jpg', $content_data['content_file']) or eregi('.png', $content_data['content_file']) or eregi('.tif', $content_data['content_file']) or eregi('.bmp', $content_data['content_file'])) {
echo '<table align="center" valign="middle" width="100%" height="100%" border=0><tr><td class="main" align="middle" valign="middle">';
echo xtc_image(DIR_WS_CATALOG.'media/products/'.$content_data['content_file']);
echo '</td></tr></table>';
} else {
echo '<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main">';
include (DIR_FS_CATALOG.'media/products/'.$content_data['content_file']);
echo '</td>
</tr>
</table>';
}
if (strpos($content_data['content_file'], '.txt'))
echo '</pre>';
}
?>
</body>
</html>