|
From: <luc...@us...> - 2013-10-08 18:25:03
|
Revision: 12166
http://sourceforge.net/p/xoops/svn/12166
Author: luciorota
Date: 2013-10-08 18:24:57 +0000 (Tue, 08 Oct 2013)
Log Message:
-----------
added: html or plain text auto summary
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2013-10-08 12:12:22 UTC (rev 12165)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2013-10-08 18:24:57 UTC (rev 12166)
@@ -62,10 +62,8 @@
break;
case "modification.show":
- wfdownloads_xoops_cp_header();
+ $requestid = WfdownloadsRequest::getInt('requestid', 0);
- $requestid = intval($_GET['requestid']);
-
$modification = $wfdownloads->getHandler('modification')->get($requestid);
$download = $wfdownloads->getHandler('download')->get($modification->getVar('lid'));
@@ -73,6 +71,7 @@
$submittername = XoopsUserUtility::getUnameFromId($download->getVar('submitter')); // $orig_user->getvar("uname");
$submitteremail = $orig_user->getVar('email');
+ wfdownloads_xoops_cp_header();
echo "<div><b>" . _AM_WFDOWNLOADS_MOD_MODPOSTER . "</b> $submittername</div>";
$not_allowed = array('lid', 'submitter', 'requestid', 'modifysubmitter');
@@ -233,10 +232,8 @@
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 = intval($_POST['requestid']);
+ // 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');
$modification = $wfdownloads->getHandler('modification')->get($requestid);
$download = $wfdownloads->getHandler('download')->get($modification->getVar('lid'));
@@ -275,7 +272,9 @@
break;
case "modification.ignore":
- $criteria = new Criteria('requestid', intval($_POST['requestid']));
+ $requestid = WfdownloadsRequest::getInt('requestid', 0, 'POST');
+
+ $criteria = new Criteria('requestid', $requestid);
$wfdownloads->getHandler('modification')->deleteAll($criteria, true);
redirect_header(WFDOWNLOADS_URL . '/admin/index.php', 1, _AM_WFDOWNLOADS_MOD_REQDELETED);
break;
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-10-08 12:12:22 UTC (rev 12165)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-10-08 18:24:57 UTC (rev 12166)
@@ -319,22 +319,24 @@
if (($this->wfdownloads->getConfig('autosummary') == _WFDOWNLOADS_AUTOSUMMARY_YES)
|| ($this->wfdownloads->getConfig('autosummary') == _WFDOWNLOADS_AUTOSUMMARY_IFBLANK && empty($summary))
) {
- // generate autosummary
- $maxSummaryLength = (int)$this->wfdownloads->getConfig('autosumlength');
-
+ // generate auto summary from description field
+ $download['summary'] = $this->getVar('description');
+ // patch for multilanguage summary if xlanguage module is installed
if (wfdownloads_checkModule('xlanguage')) {
global $xlanguage;
include_once(XOOPS_ROOT_PATH . '/modules/xlanguage/include/vars.php');
include_once(XOOPS_ROOT_PATH . '/modules/xlanguage/include/functions.php');
- $download['summary'] = xlanguage_ml($this->getVar('description'));
- } else {
- $download['summary'] = $this->getVar('description');
+ $download['summary'] = xlanguage_ml($download['summary']);
}
- if (strlen($download['summary']) > $maxSummaryLength) {
- $download['summary'] = wfdownloads_truncateHtml($download['summary'], $maxSummaryLength, '...', false, true);
- } else {
- // NOP
+ // html or plain text auto summary
+ if ($this->wfdownloads->getConfig('autosumplaintext')) {
+ $download['summary'] = strip_tags($download['summary'], "<br><br />");
}
+ // truncate auto summary
+ $autosumLength = (int) $this->wfdownloads->getConfig('autosumlength');
+ if (strlen($download['summary']) > $autosumLength) {
+ $download['summary'] = wfdownloads_truncateHtml($download['summary'], $autosumLength, '...', false, true);
+ }
} else {
$download['summary'] = $summary;
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-10-08 12:12:22 UTC (rev 12165)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-10-08 18:24:57 UTC (rev 12166)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 Beta (2013-10-05)</u></b>
+<b><u>=> Version 3.23 Beta (2013-10-08)</u></b>
- standardization of English language files (cesag)
- fixed: typos in english folder (cesag)
- module standardization: header.php, admin/admin_header.php, xoops_version.php
@@ -20,8 +20,10 @@
- added: enable/disable brokens reports system (luciorota)
- added: admin side downloads filter (luciorota)
- added: breadcrumb class (luciorota)
-- added: new autosummary option: autosummary if summary field is empty (luciorota)
-- added: xoops/xlanguage/html tags compatible autosummary generator (luciorota)
+- added: new auto summary option: auto summary if summary field is empty (luciorota)
+- added: new auto summary option: plain text or html auto summary (luciorota)
+- added: xoops/xlanguage/html tags compatible auto summary generator (luciorota)
+
- added: sort subcategories by cid or title or weight (luciorota)
- added: improved by letters choice bar (luciorota)
- added: wfdownloads_submit.html template for submit.php (luciorota)
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-10-08 12:12:22 UTC (rev 12165)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-10-08 18:24:57 UTC (rev 12166)
@@ -50,7 +50,7 @@
function wfdownloads_bytesToSize1024($bytes, $precision = 2)
{
// human readable format -- powers of 1024
- $unit = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB');
+ $unit = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB');
return @round(
$bytes / pow(1024, ($i = floor(log($bytes, 1024)))),
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php 2013-10-08 12:12:22 UTC (rev 12165)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php 2013-10-08 18:24:57 UTC (rev 12166)
@@ -99,7 +99,7 @@
define('_MI_WFDOWNLOADS_IMGHEIGHTDSC', "Maximum image height permitted when uploading image files.");
define('_MI_WFDOWNLOADS_AUTOSUMMARY', "[auto summary] Enable download auto summary");
define('_MI_WFDOWNLOADS_AUTOSUMMARYDESC', "Automatically create download summary based on x amount of characters defined.");
-define('_MI_WFDOWNLOADS_AUTOSUMMARYLENGTH', "[auto summary] Summary length");
+define('_MI_WFDOWNLOADS_AUTOSUMMARYLENGTH', "[auto summary] Auto summary length");
define('_MI_WFDOWNLOADS_AUTOSUMMARYLENGTHDESC', "The maximum amount of characters displayed for the summary.");
define('_MI_WFDOWNLOADS_UPLOADDIR', "[upload files] Upload directory");
define('_MI_WFDOWNLOADS_UPLOADDIRDSC', "Upload directory *MUST* be an absolute path! <br />No trailing slash.");
@@ -334,5 +334,8 @@
define('_MI_WFDOWNLOADS_AUTOSUMMARY2', "If blank");
define('_MI_WFDOWNLOADS_AUTOSUMMARY3', _YES);
+define('_MI_WFDOWNLOADS_AUTOSUMMARYPLAINTEXT', "[auto summary] Auto summary plain text");
+define('_MI_WFDOWNLOADS_AUTOSUMMARYPLAINTEXTDESC', "If '" . _YES . "' all html tags, except <br>, will be removed.");
+
define('_MI_WFDOWNLOADS_DISCLAIMER_DEFAULT', 'We have the right, but not the obligation to monitor and review submissions submitted by users, in the forums. We shall not be responsible for any of the content of these messages. We further reserve the right, to delete, move or edit submissions that the we, in its exclusive discretion, deems abusive, defamatory, obscene or in violation of any Copyright or Trademark laws or otherwise objectionable.');
define('_MI_WFDOWNLOADS_DOWNDISCLAIMER_DEFAULT', 'The file downloads on this site are provided as is without warranty either expressed or implied. Downloaded files should be checked for possible virus infection using the most up-to-date detection and security packages. If you have a question concerning a particular piece of software, feel free to contact the developer. We refuse liability for any damage or loss resulting from the use or misuse of any software offered from this site for downloading. If you have any doubt at all about the safety and operation of software made available to you on this site, do not download it.<br /><br />Contact us if you have questions concerning this disclaimer.');
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-10-08 12:12:22 UTC (rev 12165)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-10-08 18:24:57 UTC (rev 12166)
@@ -42,9 +42,9 @@
$modversion['onUpdate'] = 'include/module.php';
$modversion['onUninstall'] = 'include/module.php';
-$modversion['date'] = '2013-10-05';
-$modversion['release_date'] = '2013/10/05';
-$modversion['releasedate'] = '2013-10-05';
+$modversion['date'] = '2013-10-08';
+$modversion['release_date'] = '2013/10/08';
+$modversion['releasedate'] = '2013-10-08';
$modversion['status'] = 'BETA 1';
$modversion['teammembers'] = "Bender, David, FrankBlack, Xpider, M0nty, Mithrandir, Marcan, felix[fx2024], Sudhaker, Jegelstaff";
@@ -887,16 +887,7 @@
'default' => 'title ASC'
);
-/*
$modversion['config'][] = array(
- 'name' => 'autosummary',
- 'title' => '_MI_WFDOWNLOADS_AUTOSUMMARY',
- 'description' => '_MI_WFDOWNLOADS_AUTOSUMMARYDESC',
- 'formtype' => 'yesno',
- 'valuetype' => 'int',
- 'default' => true);
-*/
-$modversion['config'][] = array(
'name' => 'autosummary',
'title' => '_MI_WFDOWNLOADS_AUTOSUMMARY',
'description' => '_MI_WFDOWNLOADS_AUTOSUMMARYDESC',
@@ -920,6 +911,16 @@
);
$modversion['config'][] = array(
+ 'name' => 'autosumplaintext',
+ 'title' => '_MI_WFDOWNLOADS_AUTOSUMMARYPLAINTEXT',
+ 'description' => '_MI_WFDOWNLOADS_AUTOSUMMARYPLAINTEXTDESC',
+ 'formtype' => 'yesno',
+ 'valuetype' => 'int',
+ 'default' => true
+);
+
+
+$modversion['config'][] = array(
'name' => 'platform',
'title' => '_MI_WFDOWNLOADS_PLATFORM',
'description' => '_MI_WFDOWNLOADS_PLATFORMDSC',
|