|
From: <luc...@us...> - 2013-09-18 16:17:33
|
Revision: 12067
http://sourceforge.net/p/xoops/svn/12067
Author: luciorota
Date: 2013-09-18 16:17:30 +0000 (Wed, 18 Sep 2013)
Log Message:
-----------
fixed some errors in ip_logs page
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ip_logslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/visit.php
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-09-18 10:19:12 UTC (rev 12066)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-09-18 16:17:30 UTC (rev 12067)
@@ -764,17 +764,19 @@
$criteria->setSort('date');
$criteria->setOrder('DESC');
$ip_logs = $wfdownloads->getHandler('ip_log')->getObjects($criteria);
- $ip_logs_count = $wfdownloads->getHandler('ip_log')->count($criteria);
+ $ip_logs_count = $wfdownloads->getHandler('ip_log')->getCount($criteria);
$GLOBALS['xoopsTpl']->assign('ip_logs_count', $ip_logs_count);
unset($criteria);
// Get download info
if ($lid != 0) {
$download = $wfdownloads->getHandler('download')->get($lid);
- $downloadArray = $download->toArray();
- $GLOBALS['xoopsTpl']->assign('download', $download->toArray());
+ $download_array = $download->toArray();
+ $download_array['log_title'] = sprintf(_AM_WFD_LOG_FOR_LID, $download_array['title']);
+ $GLOBALS['xoopsTpl']->assign('download', $download_array);
}
+
// Get all logged users
$uidArray = array();
foreach($ip_logs as $ip_log) {
@@ -792,11 +794,8 @@
} else {
foreach($ip_logs as $ip_log){
$ip_log_array = $ip_log->toArray();
- if($ip_log_array['uid'] != 0 ) {
- $ip_log_array['uname'] = $userList[$ip_log_array['uid']];
- } else {
- $ip_log_array['uname'] = _AM_WFD_ANONYMOUS;
- }
+ $ip_log_array['uname'] = XoopsUserUtility::getUnameFromId($ip_log_array['uid']);//($ip_log_array['uid'] != 0) ? $userList[$ip_log_array['uid']] : _AM_WFD_ANONYMOUS;
+ $ip_log_array['date_timestamp'] = formatTimestamp($ip_log_array['date']);
$GLOBALS['xoopsTpl']->append('ip_logs', $ip_log_array);
}
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-18 10:19:12 UTC (rev 12066)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-18 16:17:30 UTC (rev 12067)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 Beta (2013-09-17)</u></b>
+<b><u>=> Version 3.23 Beta (2013-09-18)</u></b>
- module standardization: header.php, admin/admin_header.php, xoops_version.php
- module standardization: standardize directories/files names/structures
- module standardization: standardize code headers
@@ -19,7 +19,7 @@
- added: breadcrumb class (luciorota)
- added: html tags compatible autosummary generator (luciorota)
- added: sort subcategories by cid or title or weight (luciorota)
-- added: improved letters choice bar (luciorota)
+- added: improved by letters choice bar (luciorota)
- added: wfdownloads_submit.html template for submit.php (luciorota)
- added: folder checker (mamba + luciorota)
- added: file checker (luciorota)
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ip_logslist.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ip_logslist.html 2013-09-18 10:19:12 UTC (rev 12066)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ip_logslist.html 2013-09-18 16:17:30 UTC (rev 12067)
@@ -1,29 +1,24 @@
<input type='button' value='<{$smarty.const._AM_WFD_BACK}>' onclick='history.go(-1)'>
-// IN PROGRESS
<fieldset>
<legend style='font-weight: bold; color: #900;'><{$smarty.const._AM_WFD_IP_LOGS}></legend>
<{if ($ip_logs_count == 0)}>
<{$smarty.const._AM_WFD_EMPTY_LOG}>
<{else}>
-
- <h2>sprintf(_AM_WFD_LOG_FOR_LID, $download->getVar('title'))</h2>
-
+ <h2><{$download.log_title}></h2>
<table class="outer">
<tr>
<th><{$smarty.const._AM_WFD_IP_ADDRESS}></th>
<th><{$smarty.const._AM_WFD_DATE}></th>
<th><{$smarty.const._AM_WFD_USER}></th>
</tr>
-
<{foreach item=ip_log from=$ip_logs}>
<tr class="<{cycle values='even, odd'}>">
<td><{$ip_log.ip_address}></td>
- <td align='center'>formatTimestamp($ip_log->getVar('date'))</td>
- <td align='center'><{$ip_logs.uname}></td>
+ <td align='center'><{$ip_log.date_timestamp}></td>
+ <td align='center'><{$ip_log.uname}></td>
</tr>
<{/foreach}>
</table>
<{/if}>
</fieldset>
-</form>
<input type='button' value='<{$smarty.const._AM_WFD_BACK}>' onclick='history.go(-1)'>
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/visit.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/visit.php 2013-09-18 10:19:12 UTC (rev 12066)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/visit.php 2013-09-18 16:17:30 UTC (rev 12067)
@@ -111,7 +111,7 @@
if (!wfdownloads_userIsAdmin()) {
$wfdownloads->getHandler('download')->incrementHits($lid);
}
-
+ // Create ip log
$ip_log = $wfdownloads->getHandler('ip_log')->create();
$ip_log->setVar('lid', $lid);
$ip_log->setVar('date', time());
@@ -119,8 +119,8 @@
$ip_log->setVar('uid', is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0);
$wfdownloads->getHandler('ip_log')->insert($ip_log, true);
- $full_name = trim($download->getVar('filename'));
- if ((!$download->getVar('url') == '' && !$download->getVar('url') == 'http://') || $full_name == '') {
+ $fullFilename = trim($download->getVar('filename'));
+ if ((!$download->getVar('url') == '' && !$download->getVar('url') == 'http://') || $fullFilename == '') {
include XOOPS_ROOT_PATH . '/header.php';
$xoTheme->addStylesheet(WFDOWNLOADS_URL . '/module.css');
@@ -129,7 +129,6 @@
echo "<div align='center'>" . wfdownloads_headerImage() . "</div>";
$url = $myts->htmlSpecialChars(preg_replace('/javascript:/si' , 'javascript:', $download->getVar('url')), ENT_QUOTES);
-
echo "<h4><img src='" . WFDOWNLOADS_URL . "/images/icon/downloads.gif' align='middle' alt='' title='" . _MD_WFD_DOWNINPROGRESS . "' /> " . _MD_WFD_DOWNINPROGRESS . "</h4>\n";
echo "<div>" . _MD_WFD_DOWNSTARTINSEC . "</div><br />\n";
echo "<div>" . _MD_WFD_DOWNNOTSTART . "\n";
@@ -138,44 +137,31 @@
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
- // HTTP/1.0
- header("Pragma: no-cache");
- // Date in the past
- header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
- // always modified
- header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+ header("Pragma: no-cache"); // HTTP/1.0
+ header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
+ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Refresh: 3; url={$url}");
- } elseif (!empty($full_name)) {
+ } elseif (!empty($fullFilename)) {
$mimeType = $download->getVar('filetype');
-
- $file = strrev($full_name);
- $temp_name = strtolower(strrev(substr($file, 0, strpos($file, "--"))) );
- if ($temp_name == '') {
- $file_name = $full_name;
- } else {
- $file_name = $temp_name;
- }
- $filePath = $wfdownloads->getConfig('uploaddir') . '/' . stripslashes(trim($full_name));
-
+ $file = strrev($fullFilename);
+ $tempFilename = strtolower(strrev(substr($file, 0, strpos($file, '--'))) );
+ $filename = ($tempFilename == '') ? $fullFilename : $tempFilename;
+ $filePath = $wfdownloads->getConfig('uploaddir') . '/' . stripslashes(trim($fullFilename));
if(ini_get('zlib.output_compression')) {
ini_set('zlib.output_compression', 'Off');
}
-
// MSIE Bug fix.
- $header_file = (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) ? preg_replace('/\./', '%2e', $file_name, substr_count($file_name, '.') - 1) : $file_name;
-
+ $headerFilename = (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) ? preg_replace('/\./', '%2e', $filename, substr_count($filename, '.') - 1) : $filename;
header("Pragma: public");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Length: " . (string)(filesize($filePath)) );
header("Content-Transfer-Encoding: binary");
if(isset($mimeType)) {
- header("Content-Type: " . $mimeType);
+ header("Content-Type: {$mimeType}");
}
-
- header("Content-Disposition: attachment; filename=" . $header_file);
-
- if(isset($mimeType) && strstr($mimeType, "text/")) {
+ header("Content-Disposition: attachment; filename={$headerFilename}");
+ if(isset($mimeType) && strstr($mimeType, 'text/')) {
wfdownloads_download($filePath, false, true);
} else {
wfdownloads_download($filePath, true, true);
@@ -183,9 +169,9 @@
exit();
} else {
include XOOPS_ROOT_PATH . '/header.php';
- echo "<br /><div align='center'>" . wfdownloads_headerImage() . "</div>";
+ echo "<br />";
+ echo "<div align='center'>" . wfdownloads_headerImage() . "</div>";
reportBroken($lid);
}
-
include 'footer.php';
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-18 10:19:12 UTC (rev 12066)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-18 16:17:30 UTC (rev 12067)
@@ -47,9 +47,9 @@
$modversion['onUpdate'] = 'include/module.php';
$modversion['onUninstall'] = 'include/module.php';
-$modversion['date'] = '2013-09-17';
-$modversion['release_date'] = '2013/09/17';
-$modversion['releasedate'] = '2013-09-17';
+$modversion['date'] = '2013-09-18';
+$modversion['release_date'] = '2013/09/18';
+$modversion['releasedate'] = '2013-09-18';
$modversion['status'] = 'BETA';
$modversion['teammembers'] = "Bender, David, FrankBlack, Xpider, M0nty, Mithrandir, Marcan, felix[fx2024], Sudhaker, Jegelstaff";
|