|
From: <luc...@us...> - 2013-09-15 21:50:20
|
Revision: 12059
http://sourceforge.net/p/xoops/svn/12059
Author: luciorota
Date: 2013-09-15 21:50:16 +0000 (Sun, 15 Sep 2013)
Log Message:
-----------
added: enable/disable reviews system
added: enable/disable ratings system
removed some query (performances)
Modified Paths:
--------------
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/mirror.php
XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php
XoopsModules/wfdownloads/trunk/wfdownloads/review.php
XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_singlefile.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_viewcat.html
XoopsModules/wfdownloads/trunk/wfdownloads/topten.php
XoopsModules/wfdownloads/trunk/wfdownloads/viewcat.php
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-09-15 21:50:16 UTC (rev 12059)
@@ -135,16 +135,21 @@
$add_mirror = false;
if (!is_object($xoopsUser) && ($this->wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_MIRROR || $this->wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_BOTH) && ($this->wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_MIRROR || $this->wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH) && $use_mirrors == true) {
$add_mirror = true;
- } elseif (is_object($xoopsUser) && ($this->wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_MIRROR || $this->wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH || $xoopsUser->isAdmin()) && $use_mirrors == true) {
+ } elseif (is_object($xoopsUser) && ($this->wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_MIRROR || $this->wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH || wfdownloads_userIsAdmin()) && $use_mirrors == true) {
$add_mirror = true;
}
$download['add_mirror'] = $add_mirror;
$download['use_mirrors'] = $use_mirrors;
+ $use_reviews = $this->wfdownloads->getConfig('enable_reviews');
+ $download['use_reviews'] = $use_reviews;
+
+ $use_ratings = $this->wfdownloads->getConfig('enable_ratings');
$download['rateimg'] = "rate" . round(number_format($this->getVar('rating'), 0) / 2) . ".gif"; // this definition is not removed for compatibility issues
$download['average_rating'] = $this->getVar('rating'); // new
$download['votes'] = ($this->getVar('votes') == 1) ? _MD_WFD_ONEVOTE : sprintf(_MD_WFD_NUMVOTES, $this->getVar('votes'));
$download['hits'] = $this->getVar('hits');
+ $download['use_ratings'] = $use_ratings;
$download['path'] = $this->wfdownloads->getHandler('category')->getNicePath($download['cid']);
@@ -283,7 +288,7 @@
$download['mail_subject'] = rawurlencode(sprintf(_MD_WFD_INTFILEFOUND, $xoopsConfig['sitename']));
$download['mail_body'] = rawurlencode(sprintf(_MD_WFD_INTFILEFOUND, $xoopsConfig['sitename']) . ': ' . WFDOWNLOADS_URL . '/singlefile.php?cid=' . $download['cid'] . '&lid=' . $download['id']);
- $download['isadmin'] = (!empty($xoopsUser) && $xoopsUser->isAdmin($this->wfdownloads->getModule()->mid())) ? true : false;
+ $download['isadmin'] = (wfdownloads_userIsAdmin()) ? true : false;
$download['adminlink'] = '';
if ($download['isadmin'] == true) {
@@ -343,10 +348,10 @@
$sform->addElement(new XoopsFormHidden('filename', $this->getVar('filename', 'e')));
$sform->addElement(new XoopsFormHidden('filetype', $this->getVar('filetype', 'e')));
}
- if (($this->wfdownloads->getConfig('useruploads') && array_intersect($this->wfdownloads->getConfig('useruploadsgroup'), $groups)) || (is_object($xoopsUser) && $xoopsUser->isAdmin()) ) {
+ if (($this->wfdownloads->getConfig('useruploads') && array_intersect($this->wfdownloads->getConfig('useruploadsgroup'), $groups)) || (wfdownloads_userIsAdmin()) ) {
$userfile_file = new XoopsFormFile(_MD_WFD_UPLOAD_FILEC, 'userfile', 0);
$maxFileSize = wfdownloads_bytesToSize1024($this->wfdownloads->getConfig('maxfilesize'));
- if (is_object($xoopsUser) && $xoopsUser->isAdmin()) {
+ if (wfdownloads_userIsAdmin()) {
$criteria = new Criteria('mime_admin', true);
} else {
$criteria = new Criteria('mime_user', true);
@@ -434,7 +439,7 @@
$dhistoryaddedd_textarea->setDescription(_MD_WFD_HISTORYD_DESC);
$sform->addElement($dhistoryaddedd_textarea, false);
}
- if (($this->wfdownloads->getConfig('useruploads') && array_intersect($this->wfdownloads->getConfig('useruploadsgroup'), $groups)) || (is_object($xoopsUser) && $xoopsUser->isAdmin()) ) {
+ if (($this->wfdownloads->getConfig('useruploads') && array_intersect($this->wfdownloads->getConfig('useruploadsgroup'), $groups)) || wfdownloads_userIsAdmin() ) {
$sform->addElement(new XoopsFormFile(_MD_WFD_DUPLOADSCRSHOT, 'screenshot', 0), false);
if ($this->wfdownloads->getConfig('max_screenshot') >= 2) {
$sform->addElement(new XoopsFormFile(_MD_WFD_DUPLOADSCRSHOT, 'screenshot2', 0), false);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-15 21:50:16 UTC (rev 12059)
@@ -11,6 +11,8 @@
- fixed: deprecated "XoopsTree" (luciorota)
- fixed: html errors in templates (luciorota)
- fixed: deprecated XoopsTree (mamba)
+- added: enable/disable reviews system (luciorota)
+- added: enable/disable ratings system (luciorota)
- added: admin side downloads filter (luciorota)
- added: breadcrumb class (luciorota)
- added: html tags compatible autosummary generator (luciorota)
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-09-15 21:50:16 UTC (rev 12059)
@@ -653,7 +653,14 @@
$category_suffix = !empty($_GET['cid']) ? "?cid=" . (int)$_GET['cid']: ""; //Added by Lankford
$toolbar .= "<a href='submit.php$category_suffix'>" . _MD_WFD_SUBMITDOWNLOAD . "</a> | ";
}
- $toolbar .= "<a href='newlist.php'>" . _MD_WFD_LATESTLIST . "</a> | <a href='topten.php?list=hit'>" . _MD_WFD_POPULARITY . "</a> | <a href='topten.php?list=rate'>" . _MD_WFD_TOPRATED . "</a> ]";
+ $toolbar .= "<a href='newlist.php'>" . _MD_WFD_LATESTLIST . "</a>";
+ $toolbar.= " | ";
+ $toolbar.= "<a href='topten.php?list=hit'>" . _MD_WFD_POPULARITY . "</a>";
+ if ($wfdownloads->getConfig('enable_ratings')) {
+ $toolbar.= " | ";
+ $toolbar.= "<a href='topten.php?list=rate'>" . _MD_WFD_TOPRATED . "</a>";
+ }
+ $toolbar.= " ]";
return $toolbar;
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php 2013-09-15 21:50:16 UTC (rev 12059)
@@ -102,9 +102,9 @@
define('_MI_WFD_IMGHEIGHT','[upload files] Max upload image height (pixels)');
define('_MI_WFD_IMGHEIGHTDSC','Maximum image height permitted when uploading image files.');
-define('_MI_WFD_AUTOSUMMARY','[auto summary] Enable download autosummary');
+define('_MI_WFD_AUTOSUMMARY','[autosummary] Enable download autosummary');
define('_MI_WFD_AUTOSUMMARYDESC','Automatically create download summary based on x amount of characters defined.');
-define('_MI_WFD_AUTOSUMMARYLENGTH','[auto summary] Summary length');
+define('_MI_WFD_AUTOSUMMARYLENGTH','[autosummary] Summary length');
define('_MI_WFD_AUTOSUMMARYLENGTHDESC','The maximum amount of characters displayed for the summary.');
define('_MI_WFD_UPLOADDIR','[upload files] Upload directory');
@@ -297,8 +297,8 @@
define('_MI_WFD_MIRROR_MAXIMGHEIGHT','Upload logo height'); // not implemented yet
define('_MI_WFD_MIRROR_MAXIMGHEIGHTDSC','Maximum logo height permitted when uploading logo files.'); // not implemented yet
-define('_MI_WFD_MIRROR_ENABLE','[mirrors] Enable mirror system');
-define('_MI_WFD_MIRROR_ENABLEDSC','');
+define('_MI_WFD_MIRROR_ENABLE','[mirrors] Enable mirrors system');
+define('_MI_WFD_MIRROR_ENABLEDSC','If enabled, morrors system (submit and use mirrors) is enabled in backend.');
define('_MI_WFD_MIRROR_ENABLEONCHK','[mirrors] Enable server online check');
define('_MI_WFD_MIRROR_ENABLEONCHKDSC','Enables the host server check for the mirrors.<br />This can slow your page load down if you have many mirrors.');
define('_MI_WFD_MIRROR_ALLOWSUBMISS','[mirrors] User mirror submissions');
@@ -350,3 +350,9 @@
define("_MI_WFD_LIMITSDSC","// in progress");
define("_MI_WFD_VERSIONTYPESDSC","// in progress");
+
+define("_MI_WFD_REVIEW_ENABLE","[reviews] Enable reviews system");
+define("_MI_WFD_REVIEW_ENABLEDSC","If enabled, reviews system (submit and show reviews) is enabled in backend.");
+
+define("_MI_WFD_RATING_ENABLE","[ratings] Enable ratings system");
+define("_MI_WFD_RATING_ENABLEDSC","If enabled, ratings system (vote and show ratings) is enabled in backend.");
\ No newline at end of file
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php 2013-09-15 21:50:16 UTC (rev 12059)
@@ -32,7 +32,7 @@
}
// Check permissions
-if ($wfdownloads->getConfig('enable_mirrors') == false && ((is_object($xoopsUser) && !$xoopsUser->isAdmin()) || !is_object($xoopsUser))) {
+if ($wfdownloads->getConfig('enable_mirrors') == false && !wfdownloads_userIsAdmin()) {
redirect_header('index.php', 3, _NOPERM);
}
$userGroups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php 2013-09-15 21:50:16 UTC (rev 12059)
@@ -31,6 +31,10 @@
redirect_header("index.php", 3, _MD_WFD_NODOWNLOAD);
}
+// Check permissions
+if ($wfdownloads->getConfig('enable_ratings') == false && !wfdownloads_userIsAdmin()) {
+ redirect_header('index.php', 3, _NOPERM);
+}
// Breadcrumb
include_once XOOPS_ROOT_PATH . "/class/tree.php";
$categoriesTree = new XoopsObjectTree($wfdownloads->getHandler('category')->getObjects(), 'cid', 'pid');
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/review.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/review.php 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/review.php 2013-09-15 21:50:16 UTC (rev 12059)
@@ -32,6 +32,9 @@
}
// Check permissions
+if ($wfdownloads->getConfig('enable_reviews') == false && !wfdownloads_userIsAdmin()) {
+ redirect_header('index.php', 3, _NOPERM);
+}
$userGroups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0=>XOOPS_GROUP_ANONYMOUS);
if (!$gperm_handler->checkRight('WFDownCatPerm', $cid, $userGroups, $wfdownloads->getModule()->mid())) {
redirect_header('index.php',3, _NOPERM);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php 2013-09-15 21:50:16 UTC (rev 12059)
@@ -153,7 +153,7 @@
$add_mirror = false;
if (!is_object($xoopsUser) && $use_mirrors == true && ($wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_MIRROR || $wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_BOTH) && ($wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_MIRROR || $wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH)) {
$add_mirror = true;
-} elseif (is_object($xoopsUser) && $use_mirrors == true && ($wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_MIRROR || $wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH || $xoopsUser->isAdmin())) {
+} elseif (is_object($xoopsUser) && $use_mirrors == true && ($wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_MIRROR || $wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH || wfdownloads_userIsAdmin())) {
$add_mirror = true;
}
@@ -213,27 +213,32 @@
} else {
$user_reviews = "cid={$cid}&lid={$lid}\">" . _MD_WFD_NOUSERREVIEWS;
}
-$xoopsTpl->assign('lang_user_reviews', $xoopsConfig['sitename'] . " " . _MD_WFD_USERREVIEWSTITLE);
+$xoopsTpl->assign('lang_user_reviews', $xoopsConfig['sitename'] . ' ' . _MD_WFD_USERREVIEWSTITLE);
$xoopsTpl->assign('lang_UserReviews', sprintf($user_reviews, $download->getVar('title')));
$xoopsTpl->assign('review_amount', $reviewsCount);
// User mirrors
$downloadInfo['add_mirror'] = $add_mirror;
-$criteria = new CriteriaCompo(new Criteria("lid", $lid));
-$criteria->add(new Criteria("submit", 1));
+$criteria = new CriteriaCompo(new Criteria('lid', $lid));
+$criteria->add(new Criteria('submit', 1));
$mirrorsCount = $wfdownloads->getHandler('mirror')->getCount($criteria);
if ($mirrorsCount > 0) {
$user_mirrors = "op=list&cid={$cid}&lid={$lid}\">" . _MD_WFD_USERMIRRORS;
} else {
$user_mirrors = "cid={$cid}&lid={$lid}\">" . _MD_WFD_NOUSERMIRRORS;
}
-$xoopsTpl->assign('lang_user_mirrors', $xoopsConfig['sitename'] . " " . _MD_WFD_USERMIRRORSTITLE);
+$xoopsTpl->assign('lang_user_mirrors', $xoopsConfig['sitename'] . ' ' . _MD_WFD_USERMIRRORSTITLE);
$xoopsTpl->assign('lang_UserMirrors', sprintf($user_mirrors, $download->getVar('title')));
$xoopsTpl->assign('mirror_amount', $mirrorsCount);
+$xoopsTpl->assign('use_ratings', $wfdownloads->getConfig('enable_mirrors'));
+$xoopsTpl->assign('use_ratings', $wfdownloads->getConfig('enable_ratings'));
+$xoopsTpl->assign('use_reviews', $wfdownloads->getConfig('enable_reviews'));
+$xoopsTpl->assign('use_rss', $wfdownloads->getConfig('enablerss'));
+
// Copyright
if ($wfdownloads->getConfig('copyright') == true) {
- $xoopsTpl->assign('lang_copyright', $download->getVar('title') . " © " . _MD_WFD_COPYRIGHT . " " . date("Y"));
+ $xoopsTpl->assign('lang_copyright', $download->getVar('title') . ' © ' . _MD_WFD_COPYRIGHT . ' ' . date('Y'));
}
$xoopsTpl->assign('down', $downloadInfo); // this definition is not removed for compatibility issues
$xoopsTpl->assign('download', $downloadInfo);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_singlefile.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_singlefile.html 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_singlefile.html 2013-09-15 21:50:16 UTC (rev 12059)
@@ -38,14 +38,18 @@
<br />
+ <{if $download.use_ratings == 1}>
<div style="margin-left: 10px; margin-right: 10px; padding: 4px; background-color:#e6e6e6; border-color:#999999;" class="outer">
<div><b><{$smarty.const._MD_WFD_RATINGC}></b> <img src="images/icon/<{$download.rateimg}>" alt="<{$download.average_rating|string_format:'%.2f'}>" title="<{$download.average_rating|string_format:'%.2f'}>" align="middle" /> (<{$download.votes}>)</div>
</div>
<br />
+ <{/if}>
+ <{if $download.use_reviews == 1}>
<div style="margin-left: 10px; margin-right: 10px; padding: 4px; background-color:#e6e6e6; border-color:#999999;" class="outer">
<div><b><{$smarty.const._MD_WFD_REVIEWS}></b> <img src="images/icon/<{$download.review_rateimg}>" alt="<{$download.review_average_rating|string_format:'%.2f'}>" title="<{$download.review_average_rating|string_format:'%.2f'}>" /> (<{$download.reviews_num}>)</div>
</div>
<br />
+ <{/if}>
<{if $download.use_mirrors == 1}>
<div style="margin-left: 10px; margin-right: 10px; padding: 4px; background-color:#e6e6e6; border-color:#999999;" class="outer">
<div><b><{$smarty.const._MD_WFD_MIRROR_AVAILABLE}></b> <{$download.mirrors_num}></div>
@@ -205,10 +209,14 @@
<a href="mirror.php?cid=<{$download.cid}>&lid=<{$download.id}>"><{$smarty.const._MD_WFD_ADDMIRROR}></a>
|
<{/if}>
+ <{if $download.use_reviews == 1}>
<a href="review.php?cid=<{$download.cid}>&lid=<{$download.id}>"><{$smarty.const._MD_WFD_REVIEWTHISFILE}></a>
|
+ <{/if}>
+ <{if $download.use_ratings == 1}>
<a href="ratefile.php?cid=<{$download.cid}>&lid=<{$download.id}>"><{$smarty.const._MD_WFD_RATETHISFILE}></a>
|
+ <{/if}>
<{if $download.useradminlink == true}>
<a href="submit.php?cid=<{$download.cid}>&lid=<{$download.id}>"><{$smarty.const._MD_WFD_MODIFY}></a>
|
@@ -223,11 +231,11 @@
-
<br />
+<{if $download.use_reviews == 1}>
<div><b><{$smarty.const._MD_WFD_USERREVIEWSTITLE}></b></div>
<div style="padding: 3px; margin:3px;">
<{if ($review_amount > 0)}>
@@ -236,9 +244,11 @@
<a href="review.php?op=review.add&cid=<{$download.cid}>&lid=<{$download.id}>"><{$smarty.const._MD_WFD_NOUSERREVIEWS|replace:'%s':$download.title}></a>
<{/if}>
</div>
-
<br />
+<{/if}>
+
+
<{if $download.use_mirrors == 1 && $download.mirrors_num >= 1}>
<div><b><{$smarty.const._MD_WFD_USERMIRRORSTITLE}></b></div>
<div style="padding: 3px; margin:3px;">
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_viewcat.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_viewcat.html 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_viewcat.html 2013-09-15 21:50:16 UTC (rev 12059)
@@ -71,8 +71,10 @@
|
<a href="viewcat.php?cid=<{$category_cid}>&orderby=dateA"><{$smarty.const._MD_WFD_DATE}> ↑</a> <a href="viewcat.php?cid=<{$category_cid}>&orderby=dateD"><{$smarty.const._MD_WFD_DATE}> ↓</a>
|
+ <{if $use_ratings == true}>
<a href="viewcat.php?cid=<{$category_cid}>&orderby=ratingA"><{$smarty.const._MD_WFD_RATING}> ↑</a> <a href="viewcat.php?cid=<{$category_cid}>&orderby=ratingD"><{$smarty.const._MD_WFD_RATING}> ↓</a>
|
+ <{/if}>
<a href="viewcat.php?cid=<{$category_cid}>&orderby=hitsA"><{$smarty.const._MD_WFD_POPULARITY}> ↑</a> <a href="viewcat.php?cid=<{$category_cid}>&orderby=hitsD"><{$smarty.const._MD_WFD_POPULARITY}> ↓</a>
<br />
<b><{$lang_cursortedby}></b>
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/topten.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/topten.php 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/topten.php 2013-09-15 21:50:16 UTC (rev 12059)
@@ -23,6 +23,10 @@
$xoopsOption['template_main'] = 'wfdownloads_topten.html';
+// Check permissions
+if (($_GET['list'] == 'rate') && $wfdownloads->getConfig('enable_ratings') == false && !wfdownloads_userIsAdmin()) {
+ redirect_header('index.php', 3, _NOPERM);
+}
$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0=>XOOPS_GROUP_ANONYMOUS);
include XOOPS_ROOT_PATH . '/header.php';
@@ -35,14 +39,14 @@
$list_array = array('hits', 'rating');
$lang_array = array(_MD_WFD_HITS, _MD_WFD_RATING);
-$sort = (isset($_GET['list']) && in_array($_GET['list'], $action_array)) ? $_GET['list'] : 'rate';
+$sort = (isset($_GET['list']) && in_array($_GET['list'], $action_array)) ? $_GET['list'] : 'hit';
$thisselected = $action_array[$sort];
$sortDB = $list_array[$thisselected];
$catarray['imageheader'] = wfdownloads_headerImage();
$catarray['letters'] = wfdownloads_lettersChoice();
$catarray['toolbar'] = wfdownloads_toolbar();
-$xoopsTpl -> assign('catarray', $catarray);
+$xoopsTpl->assign('catarray', $catarray);
$arr = array();
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/viewcat.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/viewcat.php 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/viewcat.php 2013-09-15 21:50:16 UTC (rev 12059)
@@ -274,6 +274,11 @@
$xoopsTpl->assign('pagenav', $pagenav->renderNav());
}
+$xoopsTpl->assign('use_ratings', $wfdownloads->getConfig('enable_mirrors'));
+$xoopsTpl->assign('use_ratings', $wfdownloads->getConfig('enable_ratings'));
+$xoopsTpl->assign('use_reviews', $wfdownloads->getConfig('enable_reviews'));
+$xoopsTpl->assign('use_rss', $wfdownloads->getConfig('enablerss'));
+
if($wfdownloads->getConfig('enablerss') == true && $downloads_count > 0) {
$rsslink_URL = WFDOWNLOADS_URL . "/rss.php?cid={$cid}";
$xoopsTpl->assign('category_rssfeed_URL', $rsslink_URL);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-15 17:49:03 UTC (rev 12058)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-15 21:50:16 UTC (rev 12059)
@@ -586,6 +586,14 @@
'default' => 'uploads/' . $modversion['dirname'] . '/images');
$modversion['config'][] = array(
+ 'name' => 'enable_reviews',
+ 'title' => '_MI_WFD_REVIEW_ENABLE',
+ 'description' => '_MI_WFD_REVIEW_ENABLEDSC',
+ 'formtype' => 'yesno',
+ 'valuetype' => 'int',
+ 'default' => true);
+
+$modversion['config'][] = array(
'name' => 'rev_anonpost',
'title' => '_MI_WFD_REVIEWANONPOST',
'description' => '_MI_WFD_REVIEWANONPOSTDSC',
@@ -602,6 +610,14 @@
'default' => false);
$modversion['config'][] = array(
+ 'name' => 'enable_ratings',
+ 'title' => '_MI_WFD_RATING_ENABLE',
+ 'description' => '_MI_WFD_RATING_ENABLEDSC',
+ 'formtype' => 'yesno',
+ 'valuetype' => 'int',
+ 'default' => true);
+
+$modversion['config'][] = array(
'name' => 'enable_mirrors',
'title' => '_MI_WFD_MIRROR_ENABLE',
'description' => '_MI_WFD_MIRROR_ENABLEDSC',
|