|
From: <luc...@us...> - 2014-01-09 21:20:34
|
Revision: 12254
http://sourceforge.net/p/xoops/svn/12254
Author: luciorota
Date: 2014-01-09 21:20:30 +0000 (Thu, 09 Jan 2014)
Log Message:
-----------
code makeup
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/trunk/wfdownloads/blocks/top.php
XoopsModules/wfdownloads/trunk/wfdownloads/blocks/top_by_cat.php
XoopsModules/wfdownloads/trunk/wfdownloads/brokenfile.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/formelementchoose.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/modification.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/include/constants.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php
XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php
XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php
XoopsModules/wfdownloads/trunk/wfdownloads/review.php
XoopsModules/wfdownloads/trunk/wfdownloads/rss.php
XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php
XoopsModules/wfdownloads/trunk/wfdownloads/submit.php
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.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 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -239,7 +239,7 @@
case "addDownload" :
$lid = WfdownloadsRequest::getInt('lid', 0, 'POST');
$cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
- $status = WfdownloadsRequest::getInt('status', 2, 'POST');
+ $status = WfdownloadsRequest::getInt('status', _WFDOWNLOADS_STATUS_UPDATED, 'POST');
if ($lid > 0) {
$thisIsANewRecord = false; /* Added by Lankford on 2007/3/21 */
@@ -361,7 +361,7 @@
}
$download->setVar('updated', $updated);
- $offline = ($_POST['offline'] == 1) ? 1 : 0;
+ $offline = ($_POST['offline'] == true) ? true : false;
$download->setVar('offline', $offline);
$approved = (isset($_POST['approved']) && $_POST['approved'] == true) ? true : false;
$notifypub = (isset($_POST['notifypub']) && $_POST['notifypub'] == true);
@@ -548,7 +548,7 @@
}
// Update the database
$download->setVar('published', time());
- $download->setVar('status', 1);
+ $download->setVar('status', _WFDOWNLOADS_STATUS_APPROVED);
if (!$wfdownloads->getHandler('download')->insert($download, true)) {
echo $download->getHtmlErrors();
exit();
@@ -750,7 +750,7 @@
$GLOBALS['xoopsTpl']->assign('expired_downloads_pagenav', $pagenav->renderNav());
// Offline downloads
- $criteria = new Criteria("offline", 1);
+ $criteria = new Criteria('offline', true);
$criteria->setSort('published');
$criteria->setOrder('ASC');
$criteria->setStart($start_offline);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -23,7 +23,7 @@
$op = WfdownloadsRequest::getString('op', 'reports.modifications.list');
switch ($op) {
- case "reports.update":
+ case "reports.update" :
$lid = WfdownloadsRequest::getInt('lid', 0);
$criteria = new Criteria('lid', $lid);
if (isset($_GET['ack'])) {
@@ -39,7 +39,7 @@
redirect_header($currentFile, 1, $update_mess);
break;
- case "report.delete":
+ case "report.delete" :
$lid = WfdownloadsRequest::getInt('lid', 0);
$criteria = new Criteria('lid', $lid);
$report = $wfdownloads->getHandler('report')->getObjects($criteria);
@@ -51,7 +51,7 @@
redirect_header($currentFile, 1, _AM_WFDOWNLOADS_BROKENFILEDELETED);
break;
- case "report.ignore":
+ case "report.ignore" :
$lid = WfdownloadsRequest::getInt('lid', 0);
$criteria = new Criteria('lid', $lid);
$report = $wfdownloads->getHandler('report')->getObjects($criteria);
@@ -61,7 +61,7 @@
redirect_header($currentFile, 1, _AM_WFDOWNLOADS_BROKEN_FILEIGNORED);
break;
- case "modification.show":
+ case "modification.show" :
$requestid = WfdownloadsRequest::getInt('requestid', 0);
$modification = $wfdownloads->getHandler('modification')->get($requestid);
@@ -300,8 +300,8 @@
$hidden = new XoopsFormHidden('op', 'modification.change');
$button_tray->addElement($hidden);
if (!$modification->isNew()) {
- $button_approve = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BAPPROVE, 'submit');
- $button_approve->setExtra('onclick="this.form.elements.op.value=\'modification.change\'"');
+ $button_approve = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BAPPROVE, 'submit');
+ $button_approve->setExtra('onclick="this.form.elements.op.value=\'modification.change\'"');
$button_tray->addElement($button_approve);
}
$button_ignore = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BIGNORE, 'submit');
@@ -319,7 +319,7 @@
exit();
break;
- case "modification.change":
+ case "modification.change" :
/* Added by Lankford on 2007/3/21 */
// Get a pointer to the download record and the modification record, then compare their 'versions' to see if they are different. If they are, then raise filemodify events.
$requestid = WfdownloadsRequest::getInt('requestid', 0, 'POST');
@@ -333,7 +333,6 @@
$raiseModifyEvents = true;
}
/* end add block */
-
$wfdownloads->getHandler('modification')->approveModification($_POST['requestid']);
$cid = $download->getVar('cid');
@@ -342,7 +341,6 @@
/* Added by lankford on 2007/3/21 */
if ($raiseModifyEvents) {
// Trigger the three events related to modified files (one for the file, category, and global event categories respectively)
-
$tags = array();
$tags['FILE_NAME'] = $download->getVar('title');
$tags['FILE_URL'] = WFDOWNLOADS_URL . '/singlefile.php?cid=' . $cid . '&lid=' . $lid;
@@ -360,7 +358,7 @@
redirect_header(WFDOWNLOADS_URL . '/admin/index.php', 1, _AM_WFDOWNLOADS_MOD_REQUPDATED);
break;
/*
- case "modification.ignore":
+ case "modification.ignore" :
$requestid = WfdownloadsRequest::getInt('requestid', 0, 'POST');
$criteria = new Criteria('requestid', $requestid);
@@ -368,7 +366,7 @@
redirect_header(WFDOWNLOADS_URL . '/admin/index.php', 1, _AM_WFDOWNLOADS_MOD_REQDELETED);
break;
*/
- case "modification.ignore":
+ case "modification.ignore" :
case "modification.delete" :
$requestid = WfdownloadsRequest::getInt('requestid', 0);
$ok = WfdownloadsRequest::getBool('ok', false, 'POST');
@@ -403,8 +401,8 @@
}
break;
- case "reports.modifications.list":
- default:
+ case "reports.modifications.list" :
+ default :
$start_report = WfdownloadsRequest::getInt('start_report', 0);
$criteria = new CriteriaCompo();
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/blocks/top.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/blocks/top.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/blocks/top.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -43,7 +43,7 @@
// get downloads
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('cid', '(' . implode(',', $allowedDownCategoriesIds) . ')', 'IN'));
- $criteria->add(new Criteria('offline', 0)); // false
+ $criteria->add(new Criteria('offline', false));
$criteria->setSort($options[0]);
$criteria->setOrder('DESC');
$criteria->setLimit($options[1]);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/blocks/top_by_cat.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/blocks/top_by_cat.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/blocks/top_by_cat.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -43,7 +43,7 @@
// get downloads
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('cid', '(' . implode(',', $allowedDownCategoriesIds) . ')', 'IN'));
- $criteria->add(new Criteria('offline', 0)); // false
+ $criteria->add(new Criteria('offline', false));
$criteria->setSort('date');
$criteria->setOrder('DESC');
$criteria->setLimit($options[1]);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/brokenfile.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/brokenfile.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/brokenfile.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -33,13 +33,12 @@
}
// Download not published, expired or taken offline - redirect
-if ($download->getVar('published') == 0 || $download->getVar('published') > time() || $download->getVar('offline') == true
- || ($download->getVar(
- 'expired'
- ) == true
- && $download->getVar('expired') < time())
- || $download->getVar('status') == 0
-) {
+if (
+ $download->getVar('published') == 0 ||
+ $download->getVar('published') > time() ||
+ $download->getVar('offline') == true ||
+ ($download->getVar('expired') == true && $download->getVar('expired') < time()) ||
+ $download->getVar('status') == _WFDOWNLOADS_STATUS_WAITING) {
redirect_header('index.php', 3, _MD_WFDOWNLOADS_NODOWNLOAD);
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -57,7 +57,7 @@
$this->initVar('screenshot4', XOBJ_DTYPE_TXTBOX, '');
$this->initVar('submitter', XOBJ_DTYPE_INT);
$this->initVar('publisher', XOBJ_DTYPE_TXTBOX, '');
- $this->initVar('status', XOBJ_DTYPE_INT, 0);
+ $this->initVar('status', XOBJ_DTYPE_INT, _WFDOWNLOADS_STATUS_WAITING);
$this->initVar('date', XOBJ_DTYPE_INT);
$this->initVar('hits', XOBJ_DTYPE_INT, 0);
$this->initVar('rating', XOBJ_DTYPE_OTHER, 0.0);
@@ -77,7 +77,7 @@
$this->initVar('published', XOBJ_DTYPE_INT, 0); // published time or 0
$this->initVar('expired', XOBJ_DTYPE_INT, 0);
$this->initVar('updated', XOBJ_DTYPE_INT, 0); // uploaded time or 0
- $this->initVar('offline', XOBJ_DTYPE_INT, 0);
+ $this->initVar('offline', XOBJ_DTYPE_INT, false); // boolean
$this->initVar('summary', XOBJ_DTYPE_TXTAREA, '');
$this->initVar('description', XOBJ_DTYPE_TXTAREA, '');
$this->initVar('ipaddress', XOBJ_DTYPE_TXTBOX, '');
@@ -1020,12 +1020,12 @@
$button_tray = new XoopsFormElementTray('', '');
$button_tray->addElement(new XoopsFormHidden('op', 'download.save'));
if ($this->isNew()) {
- $button_tray->addElement(new XoopsFormHidden('status', 1));
+ $button_tray->addElement(new XoopsFormHidden('status', _WFDOWNLOADS_STATUS_APPROVED));
$button_tray->addElement(new XoopsFormHidden('notifypub', $this->getVar('notifypub', 'e')));
$button_tray->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit'));
} else {
- $button_tray->addElement(new XoopsFormHidden('status', 2));
+ $button_tray->addElement(new XoopsFormHidden('status', _WFDOWNLOADS_STATUS_UPDATED));
$button_tray->addElement(new XoopsFormHidden('lid', (int)$this->getVar('lid')));
$button_submit = new XoopsFormButton('', '', _SUBMIT, 'submit');
$button_submit->setExtra('onclick="this.form.elements.op.value=\'download.save\'"');
@@ -1153,7 +1153,7 @@
global $xoopsUser;
$gperm_handler = xoops_gethandler('groupperm');
- $criteria = new CriteriaCompo(new Criteria('offline', 0));
+ $criteria = new CriteriaCompo(new Criteria('offline', false));
$criteria->add(new Criteria('published', 0, '>'));
$criteria->add(new Criteria('published', time(), '<='));
$expiredCriteria = new CriteriaCompo(new Criteria('expired', 0));
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/formelementchoose.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/formelementchoose.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/formelementchoose.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -58,19 +58,21 @@
$value = $arg;
$name = $arg;
}
- unset($arg);
+ unset($arg);
+
+ $tray = new XoopsFormElementTray ('', ' ', '');
+ //$tray = new XoopsFormElementTray ('', '</td><td>', '');
switch (get_class($formElement)) {
case 'XoopsFormSelect' :
- if ($formElement->isMultiple()) {
+ if ($formElement->isMultiple()) {
// IN PROGRESS XoopsFormSelect with $multiple argument true
- } else {
- $tray = new XoopsFormElementTray ('', ' ', '');
- $button = new XoopsFormButton('', "{$formElementName}_button_{$i}", constant("_BUTTON_{$i}"), 'button');
- $onclick = "onclick='javascript:document.getElementById(\"{$formElementName}\").value = \"{$value}\";'";
- $button->setExtra($onclick);
- $tray->addElement($button);
- $tray->addElement(new XoopsFormLabel ('', $name, "{$formElementName}_name_{$i}"));
- }
+ } else {
+ $button = new XoopsFormButton('', "{$formElementName}_button_{$i}", constant("_BUTTON_{$i}"), 'button');
+ $onclick = "onclick='javascript:document.getElementById(\"{$formElementName}\").value = \"{$value}\";'";
+ $button->setExtra($onclick);
+ $tray->addElement($button);
+ $tray->addElement(new XoopsFormLabel ('', $name, "{$formElementName}_name_{$i}"));
+ }
$this->addElement($tray);
unset($tray);
unset($button);
@@ -78,7 +80,6 @@
break;
case 'XoopsFormSelectUser' :
// IN PROGRESS XoopsFormSelectUser with $multiple argument true
- $tray = new XoopsFormElementTray ('', ' ', '');
$button = new XoopsFormButton('', "{$formElementName}_button_{$i}", constant("_BUTTON_{$i}"), 'button');
$onclick = "onclick='javascript:document.getElementById(\"{$formElementName}\").value = \"{$value}\";'";
$button->setExtra($onclick);
@@ -90,25 +91,24 @@
unset($onclick);
break;
case 'XoopsFormDateTime' :
- $value = intval($value);
- $value = ($value > 0) ? $value : time();
- $datetime = getDate($value);
- if (is_string($value)) {
- $date = $value;
- $value = time();
- } else {
- $date = date(_SHORTDATESTRING, $value);
- }
- $time = $datetime['hours'] * 3600 + 600 * ceil($datetime['minutes'] / 10);
- $tray = new XoopsFormElementTray ('', ' ', '');
- $button = new XoopsFormButton('', "{$formElementName}_button_{$i}", constant("_BUTTON_{$i}"), 'button');
- $onclick = "onclick='javascript:";
- $onclick.= "document.getElementById(\"{$formElementName}[date]\").value = \"{$date}\";";
- $onclick.= "document.getElementById(\"{$formElementName}[time]\").value = \"{$time}\";";
- $onclick.= "'";
- $button->setExtra($onclick);
- $tray->addElement($button);
- $tray->addElement(new XoopsFormLabel ('', $name, "{$formElementName}_name_{$i}"));
+ $value = intval($value);
+ $value = ($value > 0) ? $value : time();
+ $datetime = getDate($value);
+ if (is_string($value)) {
+ $date = $value;
+ $value = time();
+ } else {
+ $date = date(_SHORTDATESTRING, $value);
+ }
+ $time = $datetime['hours'] * 3600 + 600 * ceil($datetime['minutes'] / 10);
+ $button = new XoopsFormButton('', "{$formElementName}_button_{$i}", constant("_BUTTON_{$i}"), 'button');
+ $onclick = "onclick='javascript:";
+ $onclick.= "document.getElementById(\"{$formElementName}[date]\").value = \"{$date}\";";
+ $onclick.= "document.getElementById(\"{$formElementName}[time]\").value = \"{$time}\";";
+ $onclick.= "'";
+ $button->setExtra($onclick);
+ $tray->addElement($button);
+ $tray->addElement(new XoopsFormLabel ('', $name, "{$formElementName}_name_{$i}"));
$this->addElement($tray);
unset($tray);
unset($button);
@@ -118,12 +118,11 @@
case 'XoopsFormTextArea' :
case 'XoopsFormDhtmlTextArea' :
default :
- $tray = new XoopsFormElementTray ('', ' ', '');
- $button = new XoopsFormButton('', "{$formElementName}_button_{$i}", constant("_BUTTON_{$i}"), 'button');
- $onclick = "onclick='javascript:document.getElementById(\"{$formElementName}\").value = \"{$value}\";'";
- $button->setExtra($onclick);
- $tray->addElement($button);
- $tray->addElement(new XoopsFormLabel ('', $name, "{$formElementName}_name_{$i}"));
+ $button = new XoopsFormButton('', "{$formElementName}_button_{$i}", constant("_BUTTON_{$i}"), 'button');
+ $onclick = "onclick='javascript:document.getElementById(\"{$formElementName}\").value = \"{$value}\";'";
+ $button->setExtra($onclick);
+ $tray->addElement($button);
+ $tray->addElement(new XoopsFormLabel ('', $name, "{$formElementName}_name_{$i}"));
$this->addElement($tray);
unset($tray);
unset($button);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/modification.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/modification.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/modification.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -55,7 +55,7 @@
$this->initVar('screenshot4', XOBJ_DTYPE_TXTBOX, '');
$this->initVar('submitter', XOBJ_DTYPE_INT);
$this->initVar('publisher', XOBJ_DTYPE_TXTBOX, '');
- $this->initVar('status', XOBJ_DTYPE_INT, 0);
+ $this->initVar('status', XOBJ_DTYPE_INT, _WFDOWNLOADS_STATUS_WAITING);
$this->initVar('date', XOBJ_DTYPE_INT);
$this->initVar('hits', XOBJ_DTYPE_INT, 0);
$this->initVar('rating', XOBJ_DTYPE_OTHER, 0.0);
@@ -75,7 +75,7 @@
$this->initVar('published', XOBJ_DTYPE_INT, 0); // published time or 0
$this->initVar('expired', XOBJ_DTYPE_INT, 0);
$this->initVar('updated', XOBJ_DTYPE_INT, 0); // uploaded time or 0
- $this->initVar('offline', XOBJ_DTYPE_INT, 0);
+ $this->initVar('offline', XOBJ_DTYPE_INT, false); // boolean
$this->initVar('summary', XOBJ_DTYPE_TXTAREA, '');
$this->initVar('description', XOBJ_DTYPE_TXTAREA, '');
// $this->initVar('ipaddress', XOBJ_DTYPE_TXTBOX, '');
@@ -114,36 +114,39 @@
function approveModification($requestid)
{
- $sql = "UPDATE " . $this->table . " m, " . $this->wfdownloads->getHandler('download')->table . " d";
+ $sql = "UPDATE {$this->table} m, {$this->wfdownloads->getHandler('download')->table} d";
$sql.= " SET
- d.cid = 'm.cid',
- d.title = 'm.title',
- d.url = 'm.url',
- d.filename = 'm.filename',
- d.filetype = 'm.filetype',
- d.mirror = 'm.mirror',
- d.license = 'm.license',
- d.features = 'm.features',
- d.homepage = 'm.homepage',
- d.version = 'm.version',
- d.size = 'm.size',
- d.platform = 'm.platform',
- d.screenshot = 'm.screenshot', d.screenshot2 = 'm.screenshot2', d.screenshot3 = 'm.screenshot3', d.screenshot4 = 'm.screenshot4',
- d.publisher = 'm.publisher',
- d.status = '2',
- d.price = 'm.price',
- d.requirements = 'm.requirements',
- d.homepagetitle = 'm.homepagetitle',
- d.limitations = 'm.limitations',
- d.versiontypes = 'm.versiontypes',
- d.dhistory = 'm.dhistory', d.updated = 'm.updated',
- d.summary = 'm.summary',
- d.description = 'm.description'";
- $sql .= " WHERE d.lid = 'm.lid' AND m.requestid='" . (int)$requestid . "'";
+ d.cid = m.cid,
+ d.title = m.title,
+ d.url = m.url,
+ d.filename = m.filename,
+ d.filetype = m.filetype,
+ d.mirror = m.mirror,
+ d.license = m.license,
+ d.features = m.features,
+ d.homepage = m.homepage,
+ d.version = m.version,
+ d.size = m.size,
+ d.platform = m.platform,
+ d.screenshot = m.screenshot,
+ d.screenshot2 = m.screenshot2,
+ d.screenshot3 = m.screenshot3,
+ d.screenshot4 = m.screenshot4,
+ d.publisher = m.publisher,
+ d.status = '" . _WFDOWNLOADS_STATUS_UPDATED . "',
+ d.price = m.price,
+ d.requirements = m.requirements,
+ d.homepagetitle = m.homepagetitle,
+ d.limitations = m.limitations,
+ d.versiontypes = m.versiontypes,
+ d.dhistory = m.dhistory,
+ d.updated = m.updated,
+ d.summary = m.summary,
+ d.description = m.description";
+ $sql .= " WHERE d.lid = m.lid AND m.requestid='{$requestid}'";
if ($this->db->query($sql)) {
return $this->deleteAll(new Criteria('requestid', (int)$requestid));
}
-
return false;
}
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2014-01-09 21:20:30 UTC (rev 12254)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 Beta (2014-01-03)</u></b>
+<b><u>=> Version 3.23 Beta (2014-01-07)</u></b>
- update jQuery Thickbox plugin to 3.1 (luciorota)
- fixed: jQuery bug in templates (luciorota)
- standardization of English language files (cesag)
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/constants.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/constants.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/constants.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -45,3 +45,8 @@
define("_WFDOWNLOADS_AUTOSUMMARY_NO", 1);
define("_WFDOWNLOADS_AUTOSUMMARY_IFBLANK", 2);
define("_WFDOWNLOADS_AUTOSUMMARY_YES", 3);
+
+// DOWNLOADS status
+define("_WFDOWNLOADS_STATUS_WAITING", 0);
+define("_WFDOWNLOADS_STATUS_APPROVED", 1);
+define("_WFDOWNLOADS_STATUS_UPDATED", 2);
\ No newline at end of file
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -721,7 +721,7 @@
*
* @return
*/
-function wfdownloads_displayIcons($time, $status = 0, $counter = 0)
+function wfdownloads_displayIcons($time, $status = _WFDOWNLOADS_STATUS_WAITING, $counter = 0)
{
$wfdownloads = WfdownloadsWfdownloads::getInstance();
@@ -733,7 +733,7 @@
if ($wfdownloads->getConfig('displayicons') != _WFDOWNLOADS_DISPLAYICONS_NO) {
if ($newdate < $time) {
- if (intval($status) > 1) {
+ if ((int)$status > _WFDOWNLOADS_STATUS_APPROVED) {
if ($wfdownloads->getConfig('displayicons') == _WFDOWNLOADS_DISPLAYICONS_ICON) {
$new = " <img src=" . XOOPS_URL . "/modules/wfdownloads/images/icon/update.gif alt='' align ='absmiddle'/>";
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -95,7 +95,7 @@
"screenshot4" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
"submitter" => array("Type" => "int(11) NOT NULL default '0'", "Default" => true),
"publisher" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
- "status" => array("Type" => "tinyint(2) NOT NULL default '0'", "Default" => true),
+ "status" => array("Type" => "tinyint(2) NOT NULL default '" . _WFDOWNLOADS_STATUS_WAITING . "'", "Default" => true),
"date" => array("Type" => "int(10) NOT NULL default '0'", "Default" => true),
"hits" => array("Type" => "int(11) unsigned NOT NULL default '0'", "Default" => true),
"rating" => array("Type" => "double(6,4) NOT NULL default '0.0000'", "Default" => true),
@@ -247,7 +247,7 @@
"screenshot4" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
"submitter" => array("Type" => "int(11) NOT NULL default '0'", "Default" => true),
"publisher" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
- "status" => array("Type" => "tinyint(2) NOT NULL default '0'", "Default" => true),
+ "status" => array("Type" => "tinyint(2) NOT NULL default '" . _WFDOWNLOADS_STATUS_WAITING . "'", "Default" => true),
"date" => array("Type" => "int(10) NOT NULL default '0'", "Default" => true),
"hits" => array("Type" => "int(11) unsigned NOT NULL default '0'", "Default" => true),
"rating" => array("Type" => "double(6,4) NOT NULL default '0.0000'", "Default" => true),
@@ -307,7 +307,7 @@
"screenshot4" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
"submitter" => array("Type" => "int(11) NOT NULL default '0'", "Default" => true),
"publisher" => array("Type" => "text NOT NULL", "Default" => false),
- "status" => array("Type" => "tinyint(2) NOT NULL default '0'", "Default" => true),
+ "status" => array("Type" => "tinyint(2) NOT NULL default '" . _WFDOWNLOADS_STATUS_WAITING . "'", "Default" => true),
"date" => array("Type" => "int(10) NOT NULL default '0'", "Default" => true),
"hits" => array("Type" => "int(11) unsigned NOT NULL default '0'", "Default" => true),
"rating" => array("Type" => "double(6,4) NOT NULL default '0.0000'", "Default" => true),
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -33,13 +33,12 @@
}
// Download not published, expired or taken offline - redirect
-if ($download->getVar('published') == 0 || $download->getVar('published') > time() || $download->getVar('offline') == 1
- || ($download->getVar(
- 'expired'
- ) != 0
- && $download->getVar('expired') < time())
- || $download->getVar('status') == 0
-) {
+if (
+ $download->getVar('published') == 0 ||
+ $download->getVar('published') > time() ||
+ $download->getVar('offline') == true ||
+ ($download->getVar('expired') != 0 && $download->getVar('expired') < time()) ||
+ $download->getVar('status') == _WFDOWNLOADS_STATUS_WAITING) {
redirect_header('index.php', 3, _MD_WFDOWNLOADS_NODOWNLOAD);
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -33,12 +33,11 @@
}
// Download not published, expired or taken offline - redirect
-if ($download->getVar('published') == false || $download->getVar('published') > time() || $download->getVar('offline') == true
- || ($download->getVar(
- 'expired'
- ) != 0
- && $download->getVar('expired') < time())
-) {
+if (
+ $download->getVar('published') == false ||
+ $download->getVar('published') > time() ||
+ $download->getVar('offline') == true ||
+ ($download->getVar('expired') != 0 && $download->getVar('expired') < time())) {
redirect_header("index.php", 3, _MD_WFDOWNLOADS_NODOWNLOAD);
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/review.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/review.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/review.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -33,13 +33,12 @@
}
// Download not published, expired or taken offline - redirect
-if ($download->getVar('published') == 0 || $download->getVar('published') > time() || $download->getVar('offline') == true
- || ($download->getVar(
- 'expired'
- ) != 0
- && $download->getVar('expired') < time())
- || $download->getVar('status') == 0
-) {
+if (
+ $download->getVar('published') == 0 ||
+ $download->getVar('published') > time() ||
+ $download->getVar('offline') == true ||
+ ($download->getVar('expired') != 0 && $download->getVar('expired') < time()) ||
+ $download->getVar('status') == _WFDOWNLOADS_STATUS_WAITING) {
redirect_header('index.php', 3, _MD_WFDOWNLOADS_NODOWNLOAD);
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/rss.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/rss.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/rss.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -68,7 +68,7 @@
// Get content
$limit = 30;
- $criteria = new CriteriaCompo(new Criteria('offline', 0));
+ $criteria = new CriteriaCompo(new Criteria('offline', false));
$criteria->setSort('published');
$criteria->setOrder('DESC');
$criteria->setLimit($limit);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -48,13 +48,12 @@
}
// If Download not published, expired or taken offline - redirect
-if ($download->getVar('published') == 0 || $download->getVar('published') > time() || $download->getVar('offline') == true
- || ($download->getVar(
- 'expired'
- ) != 0
- && $download->getVar('expired') < time())
- || $download->getVar('status') == 0
-) {
+if (
+ $download->getVar('published') == 0 ||
+ $download->getVar('published') > time() ||
+ $download->getVar('offline') == true ||
+ ($download->getVar('expired') != 0 && $download->getVar('expired') < time()) ||
+ $download->getVar('status') == _WFDOWNLOADS_STATUS_WAITING) {
redirect_header('index.php', 3, _MD_WFDOWNLOADS_NODOWNLOAD);
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/submit.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/submit.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/submit.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -299,10 +299,10 @@
|| $wfdownloads->getConfig('autoapprove') == _WFDOWNLOADS_AUTOAPPROVE_BOTH
) {
$download->setVar('published', time());
- $download->setVar('status', 1);
+ $download->setVar('status', _WFDOWNLOADS_STATUS_APPROVED);
} else {
$download->setVar('published', false);
- $download->setVar('status', 0);
+ $download->setVar('status', _WFDOWNLOADS_STATUS_WAITING);
}
}
@@ -423,7 +423,7 @@
$dhistory .= $dhistoryhistory;
}
$download->setVar('dhistory', $dhistory);
- $offline = (isset($_POST['offline']) && $_POST['offline'] == 1) ? 1 : 0;
+ $offline = (isset($_POST['offline']) && $_POST['offline'] == 1) ? true : false;
$download->setVar('offline', $offline);
$download->setVar('date', time());
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html 2014-01-09 21:20:30 UTC (rev 12254)
@@ -79,18 +79,19 @@
<td><{$download.submitter_uname}></td>
<td><{$download.published_timestamp}></td>
<td align='center'>
- <{if $download.offline}>
+ <{if $download.offline}>
<img src="<{xoModuleIcons16 0.png}>"/>
- <{else}>
+ <{else}>
<img src="<{xoModuleIcons16 1.png}>"/>
- <{/if}>
+ <{/if}>
</td>
<td align='center'>
- <{if $download.published}>
+ <{if $download.published}>
<img src="<{xoModuleIcons16 1.png}>"/>
- <{else}>
+ <!--<{$download.published_timestamp}>-->
+ <{else}>
<img src="<{xoModuleIcons16 0.png}>"/>
- <{/if}>
+ <{/if}>
</td>
<td>
<a href='?op=ip_logs.list&lid=<{$download.lid}>' title="<{$smarty.const._AM_WFDOWNLOADS_IP_LOGS}>"><{$smarty.const._AM_WFDOWNLOADS_IP_LOGS}></a>
@@ -110,7 +111,7 @@
<{/if}>
</fieldset>
-<br/>
+<br />
<fieldset>
<legend style='font-weight: bold; color: #900;'><{$smarty.const._AM_WFDOWNLOADS_MINDEX_NEWDOWN}></legend>
@@ -150,11 +151,11 @@
<{/if}>
</fieldset>
-<br/>
+<br />
<fieldset>
<legend style='font-weight: bold; color: #900;'><{$smarty.const._AM_WFDOWNLOADS_MINDEX_AUTOPUBLISHEDDOWN}></legend>
- <br/>
+ <br />
<{if ($autopublished_downloads_count == 0)}>
<{$smarty.const._AM_WFDOWNLOADS_MINDEX_NODOWNLOADSFOUND}>
<{else}>
@@ -178,18 +179,19 @@
<td><{$download.submitter_uname}></td>
<td><{$download.published_timestamp}></td>
<td align='center'>
- <{if $download.offline}>
+ <{if $download.offline}>
<img src="<{xoModuleIcons16 0.png}>"/>
- <{else}>
+ <{else}>
<img src="<{xoModuleIcons16 1.png}>"/>
- <{/if}>
+ <{/if}>
</td>
<td align='center'>
- <{if $download.published}>
+ <{if $download.published}>
<img src="<{xoModuleIcons16 1.png}>"/>
- <{else}>
+ <!--<{$download.published_timestamp}>-->
+ <{else}>
<img src="<{xoModuleIcons16 0.png}>"/>
- <{/if}>
+ <{/if}>
</td>
<td><a href='ip_logs.php?lid=<{$download.lid}>'><{$smarty.const._AM_WFDOWNLOADS_IP_LOGS}></a></td>
<td align='center'>
@@ -207,11 +209,11 @@
<{/if}>
</fieldset>
-<br/>
+<br />
<fieldset>
<legend style='font-weight: bold; color: #900;'><{$smarty.const._AM_WFDOWNLOADS_MINDEX_EXPIREDDOWN}></legend>
- <br/>
+ <br />
<{if ($expired_downloads_count == 0)}>
<{$smarty.const._AM_WFDOWNLOADS_MINDEX_NODOWNLOADSFOUND}>
<{else}>
@@ -235,18 +237,19 @@
<td><{$download.submitter_uname}></td>
<td><{$download.published_timestamp}></td>
<td align='center'>
- <{if $download.offline}>
+ <{if $download.offline}>
<img src="<{xoModuleIcons16 0.png}>"/>
- <{else}>
+ <{else}>
<img src="<{xoModuleIcons16 1.png}>"/>
- <{/if}>
+ <{/if}>
</td>
<td align='center'>
- <{if $download.published}>
+ <{if $download.published}>
<img src="<{xoModuleIcons16 1.png}>"/>
- <{else}>
+ <!--<{$download.published_timestamp}>-->
+ <{else}>
<img src="<{xoModuleIcons16 0.png}>"/>
- <{/if}>
+ <{/if}>
</td>
<td><a href='ip_logs.php?lid=<{$download.lid}>'><{$smarty.const._AM_WFDOWNLOADS_IP_LOGS}></a></td>
<td align='center'>
@@ -264,7 +267,7 @@
<{/if}>
</fieldset>
-<br/>
+<br />
<fieldset>
<legend style='font-weight: bold; color: #900;'><{$smarty.const._AM_WFDOWNLOADS_MINDEX_OFFLINEDOWN}></legend>
@@ -292,18 +295,19 @@
<td><{$download.submitter_uname}></td>
<td><{$download.published_timestamp}></td>
<td align='center'>
- <{if $download.offline}>
+ <{if $download.offline}>
<img src="<{xoModuleIcons16 0.png}>"/>
- <{else}>
+ <{else}>
<img src="<{xoModuleIcons16 1.png}>"/>
- <{/if}>
+ <{/if}>
</td>
<td align='center'>
- <{if $download.published}>
+ <{if $download.published}>
<img src="<{xoModuleIcons16 1.png}>"/>
- <{else}>
+ <!--<{$download.published_timestamp}>-->
+ <{else}>
<img src="<{xoModuleIcons16 0.png}>"/>
- <{/if}>
+ <{/if}>
</td>
<td><a href='ip_logs.php?lid=<{$download.lid}>'><{$smarty.const._AM_WFDOWNLOADS_IP_LOGS}></a></td>
<td align='center'>
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/visit.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/visit.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/visit.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -40,13 +40,12 @@
$agreed = WfdownloadsRequest::getBool('agreed', false, 'POST');
//Download not published, expired or taken offline - redirect
-if ($download->getVar('published') == 0 || $download->getVar('published') > time() || $download->getVar('offline') == true
- || ($download->getVar(
- 'expired'
- ) != 0
- && $download->getVar('expired') < time())
- || $download->getVar('status') == 0
-) {
+if (
+ $download->getVar('published') == 0 ||
+ $download->getVar('published') > time() ||
+ $download->getVar('offline') == true ||
+ ($download->getVar('expired') != 0 && $download->getVar('expired') < time()) ||
+ $download->getVar('status') == _WFDOWNLOADS_STATUS_WAITING) {
redirect_header('index.php', 3, _MD_WFDOWNLOADS_NODOWNLOAD);
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2014-01-03 22:42:52 UTC (rev 12253)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2014-01-09 21:20:30 UTC (rev 12254)
@@ -42,9 +42,9 @@
$modversion['onUpdate'] = 'include/module.php';
$modversion['onUninstall'] = 'include/module.php';
-$modversion['date'] = '2014-01-03';
-$modversion['release_date'] = '2014/01/03';
-$modversion['releasedate'] = '2014-01-03';
+$modversion['date'] = '2014-01-07';
+$modversion['release_date'] = '2014/01/07';
+$modversion['releasedate'] = '2014-01-07';
$modversion['status'] = 'BETA 2';
$modversion['teammembers'] = "Bender, David, FrankBlack, Xpider, M0nty, Mithrandir, Marcan, felix[fx2024], Sudhaker, Jegelstaff";
|