[go: up one dir, main page]

Menu

[r19]: / admin / cache.php  Maximize  Restore  History

Download this file

156 lines (136 with data), 6.0 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
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php
/*
$Id: cache.php,v 1.1.1.1 2004/03/04 23:38:12 ccwjr Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
$dir_cache = DIR_FS_CATALOG . DIR_FS_CACHE ;
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
if (tep_not_null($action)) {
if ($action == 'reset') {
tep_reset_cache_block($HTTP_GET_VARS['block']);
}
tep_redirect(tep_href_link(FILENAME_CACHE));
}
// check if the cache directory exists
if (is_dir($dir_cache)) {
if (!is_writeable($dir_cache)) $messageStack->add('search', ERROR_CACHE_DIRECTORY_NOT_WRITEABLE, 'error');
} else {
$messageStack->add('search', ERROR_CACHE_DIRECTORY_DOES_NOT_EXIST, 'error');
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CACHE; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_CREATED; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
</tr>
<?php
if ($messageStack->size < 1) {
$languages = tep_get_languages();
// get default template
if (tep_not_null($cptemplate1['template_selected'])) {
define(TEMPLATE_NAME, $cptemplate['template_selected']);
}else if (tep_not_null(DEFAULT_TEMPLATE)){
define(TEMPLATE_NAME, DEFAULT_TEMPLATE);
} else {
define(TEMPLATE_NAME, 'default');
}
$template_query = tep_db_query("select tp.template_name from " . TABLE_TEMPLATE . " tp order by tp.template_name");
while ($template = tep_db_fetch_array($template_query)) {
$template_array[]=array(template=>$template['template_name']);
}
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
if ($languages[$i]['code'] == DEFAULT_LANGUAGE) {
$language = $languages[$i]['directory'];
}
}
for ($i=0, $n=sizeof($cache_blocks); $i<$n; $i++) {
$cached_file = @ereg_replace('.language', '.' . $language, $cache_blocks[$i]['file']);
for ($j=0, $k=sizeof($template_array); $j<$k; $j++) {
// echo $template_array[$j]['template'] . 'name';
$cached_file_unlink = @ereg_replace('-TEMPLATE_NAME', '-' . $template_array[$j]['template'] , $cached_file);
//echo $cached_file_unlink . '<br />';
if (file_exists($dir_cache . $cached_file_unlink)) {
$cache_mtime = strftime(DATE_TIME_FORMAT, filemtime($dir_cache . $cached_file_unlink));
} else {
$cache_mtime = TEXT_FILE_DOES_NOT_EXIST;
$dir = dir($dir_cache);
//echo $template_array['template_name'] . $cached_file . ' <br />';
while ($cached_file_unlink = $dir->read()) {
// $cached_file = @ereg_replace('.language', '.' . $language, $cache_blocks[$i]['file']);
if (@ereg('^' . $cached_file, $cache_file)) {
$cache_mtime = strftime(DATE_TIME_FORMAT, filemtime($dir_cache . $cached_file_unlink));
break;
}
}
}
// echo $cached_file . '<br />';
$dir->close();
}
?>
<tr class="dataTableRow" >
<td class="dataTableContent"><?php echo $cache_blocks[$i]['title']; ?></td>
<td class="dataTableContent" align="right"><?php echo $cache_mtime; ?></td>
<td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CACHE, 'action=reset&block=' . $cache_blocks[$i]['code'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_reset.gif', 'Reset', 13, 13) . '</a>'; ?>&nbsp;</td>
</tr>
<?php
}
}
?>
<tr>
<td class="smallText" colspan="3"><?php echo TEXT_CACHE_DIRECTORY . ' ' . $dir_cache; ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br />
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>