|
From: <luc...@us...> - 2013-05-29 21:00:27
|
Revision: 11604
http://sourceforge.net/p/xoops/svn/11604
Author: luciorota
Date: 2013-05-29 21:00:23 +0000 (Wed, 29 May 2013)
Log Message:
-----------
admin side: download manager uses templates
admin side: vote/rating manager uses templates
bug fix: visit.php
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/category.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/download.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/votedata.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_categorylist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_ratefile.html
XoopsModules/wfdownloads/trunk/wfdownloads/visit.php
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Added Paths:
-----------
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_downloadlist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_reviewlist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_votedatalist.html
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php 2013-05-28 19:19:24 UTC (rev 11603)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php 2013-05-29 21:00:23 UTC (rev 11604)
@@ -76,3 +76,10 @@
include_once(XOOPS_ROOT_PATH . "/class/template.php");
$xoopsTpl = new XoopsTpl();
}
+
+$report_handler = xoops_getmodulehandler('report', $GLOBALS['xoopsModule']->getVar('dirname'));
+$review_handler = xoops_getmodulehandler('review', $GLOBALS['xoopsModule']->getVar('dirname'));
+$mirror_handler = xoops_getmodulehandler('mirror', $GLOBALS['xoopsModule']->getVar('dirname'));
+$modification_handler = xoops_getmodulehandler('modification', $GLOBALS['xoopsModule']->getVar('dirname'));
+$download_handler = xoops_getmodulehandler('download', $GLOBALS['xoopsModule']->getVar('dirname'));
+$category_handler = xoops_getmodulehandler('category', $GLOBALS['xoopsModule']->getVar('dirname'));
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/category.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/category.php 2013-05-28 19:19:24 UTC (rev 11603)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/category.php 2013-05-29 21:00:23 UTC (rev 11604)
@@ -250,8 +250,8 @@
$adminMenu->addItemButton(_AM_WFD_CCATEGORY_CREATENEW, 'category.php?op=category.add', 'add');
echo $adminMenu->renderButton();
- $totalcats = wfd_totalcategory();
- if ($totalcats > 0) {
+ $totalCategories = wfd_totalcategory();
+ if ($totalCategories > 0) {
$sorted_categories = wfd_sortCategories();
$GLOBALS['xoopsTpl']->assign('sorted_categories', $sorted_categories);
$GLOBALS['xoopsTpl']->assign('token', $GLOBALS['xoopsSecurity']->getTokenHTML() );
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/download.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/download.php 2013-05-28 19:19:24 UTC (rev 11603)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/download.php 2013-05-29 21:00:23 UTC (rev 11604)
@@ -556,21 +556,19 @@
case "downloads.list" :
case 'main' :
default :
- global $xoopsUser, $xoopsDB, $xoopsConfig;
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+
+ $categories = $category_handler->getObjects();
+
$start = wfdownloads_CleanVars($_GET, 'start', 0, 'int');
$start1 = wfdownloads_CleanVars($_GET, 'start1', 0, 'int');
$start2 = wfdownloads_CleanVars($_GET, 'start2', 0, 'int');
$start3 = wfdownloads_CleanVars($_GET, 'start3', 0, 'int');
$start4 = wfdownloads_CleanVars($_GET, 'start4', 0, 'int');
+
$totalcats = wfd_totalcategory();
+ $categories = $category_handler->getObjects(null, true, false);
- $report_handler = xoops_getmodulehandler('report');
- $review_handler = xoops_getmodulehandler('review');
- $mirror_handler = xoops_getmodulehandler('mirror');
- $modification_handler = xoops_getmodulehandler('modification');
- $download_handler = xoops_getmodulehandler('download');
-
$totalbrokendownloads = $report_handler->getCount();
$totalmodrequests = $modification_handler->getCount();
$newreviews = $review_handler->getCount();
@@ -581,7 +579,7 @@
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation('download.php');
-
+
$adminMenu = new ModuleAdmin();
$adminMenu->addItemButton(_MI_WFD_BINDEX, 'download.php?op=list', 'list');
$adminMenu->addItemButton(_AM_WFD_FFS_DOWNLOADTITLE, 'download.php?op=Download', 'add');
@@ -590,80 +588,98 @@
if ($totaldownloads > 0) {
// Published Downloads
$criteria = new CriteriaCompo();
- $criteria->setLimit($xoopsModuleConfig['admin_perpage']);
- $criteria->setStart($start);
$criteria->setSort("published");
$criteria->setOrder("DESC");
- $published_array = $download_handler->getActiveDownloads($criteria);
- $published_array_count = $download_handler->getActiveCount();
-
- wfd_downlistheader(_AM_WFD_MINDEX_PUBLISHEDDOWN);
- if ($published_array_count > 0) {
- foreach (array_keys($published_array) as $i) {
- wfd_downlistbody($published_array[$i]->toArray());
+ $criteria->setStart($start);
+ $criteria->setLimit($xoopsModuleConfig['admin_perpage']);
+ $published_downloads = $download_handler->getActiveDownloads($criteria);
+ $published_downloads_count = $download_handler->getActiveCount();
+ $GLOBALS['xoopsTpl']->assign('published_downloads_count', $published_downloads_count);
+ if ($published_downloads_count > 0) {
+ foreach ($published_downloads as $published_download) {
+ $published_download_array = $published_download->toArray();
+ $published_download_array['title_html'] = $myts->htmlSpecialChars(trim($published_download_array['title']));
+ $published_download_array['category_title'] = $categories[$published_download_array['cid']]['title'];
+ $published_download_array['submitter_uname'] = XoopsUserUtility::getUnameFromId($published_download_array['submitter']);
+ $published_download_array['published_timestamp'] = formatTimestamp($published_download_array['published'], _DATESTRING);
+ $GLOBALS['xoopsTpl']->append('published_downloads', $published_download_array);
}
- } else {
- wfd_downlistfooter();
}
- wfd_downlistpagenav($published_array_count, $start, 'art');
+ $pagenav = new XoopsPageNav($published_downloads_count, $xoopsModuleConfig['admin_perpage'], $start1, 'start1');
+ $GLOBALS['xoopsTpl']->assign('published_downloads_pagenav', $pagenav->renderNav());
+
// Auto Published Downloads
$criteria = new Criteria("published", time(), ">");
- $auto_publish_count = $download_handler->getCount($criteria);
$criteria->setSort("published");
$criteria->setOrder("ASC");
+ $criteria->setStart($start2);
$criteria->setLimit($xoopsModuleConfig['admin_perpage']);
- $criteria->setStart($start2);
- $auto_published_array = $download_handler->getObjects($criteria);
-
- wfd_downlistheader(_AM_WFD_MINDEX_AUTOPUBLISHEDDOWN);
- if ($auto_publish_count > 0) {
- foreach (array_keys($auto_published_array) as $i) {
- wfd_downlistbody($auto_published_array[$i]->toArray());
+ $auto_published_downloads = $download_handler->getObjects($criteria);
+ $auto_published_downloads_count = $download_handler->getCount($criteria);
+ $GLOBALS['xoopsTpl']->assign('auto_published_downloads_count', $auto_published_downloads_count);
+ if ($auto_published_downloads_count > 0) {
+ foreach ($auto_published_downloads as $auto_published_download) {
+ $auto_published_download_array = $auto_published_download->toArray();
+ $auto_published_download_array['title_html'] = $myts->htmlSpecialChars(trim($auto_published_download_array['title']));
+ $auto_published_download_array['category_title'] = $categories[$auto_published_download_array['cid']]['title'];
+ $auto_published_download_array['submitter_uname'] = XoopsUserUtility::getUnameFromId($auto_published_download_array['submitter']);
+ $auto_published_download_array['published_timestamp'] = formatTimestamp($auto_published_download_array['published'], _DATESTRING);
+ $GLOBALS['xoopsTpl']->append('auto_published_downloads', $auto_published_download_array);
}
- } else {
- wfd_downlistfooter();
}
- wfd_downlistpagenav($auto_publish_count, $start2, 'art2');
+ $pagenav = new XoopsPageNav($auto_published_downloads_count, $xoopsModuleConfig['admin_perpage'], $start2, 'start2');
+ $GLOBALS['xoopsTpl']->assign('auto_published_downloads_pagenav', $pagenav->renderNav());
+
// Expired downloads
$criteria = new CriteriaCompo();
$criteria->add(new Criteria("expired", time(), "<"), 'AND');
$criteria->add(new Criteria("expired", 0, "<>"), 'AND');
- $expired_count = $download_handler->getCount($criteria);
$criteria->setSort("expired");
$criteria->setOrder("ASC");
+ $criteria->setStart($start3);
$criteria->setLimit($xoopsModuleConfig['admin_perpage']);
- $criteria->setStart($start3);
- $expired_array = $download_handler->getObjects($criteria);
-
- wfd_downlistheader(_AM_WFD_MINDEX_EXPIREDDOWN);
- if ($expired_count > 0) {
- foreach (array_keys($expired_array) as $i) {
- wfd_downlistbody($expired_array[$i]->toArray());
+ $expired_downloads = $download_handler->getObjects($criteria);
+ $expired_downloads_count = $download_handler->getCount($criteria);
+ $GLOBALS['xoopsTpl']->assign('expired_downloads_count', $expired_downloads_count);
+ if ($expired_downloads_count > 0) {
+ foreach ($expired_downloads as $expired_download) {
+ $expired_download_array = $expired_download->toArray();
+ $expired_download_array['title_html'] = $myts->htmlSpecialChars(trim($expired_download_array['title']));
+ $expired_download_array['category_title'] = $categories[$expired_download_array['cid']]['title'];
+ $expired_download_array['submitter_uname'] = XoopsUserUtility::getUnameFromId($expired_download_array['submitter']);
+ $expired_download_array['published_timestamp'] = formatTimestamp($expired_download_array['published'], _DATESTRING);
+ $GLOBALS['xoopsTpl']->append('expired_downloads', $expired_download_array);
}
- } else {
- wfd_downlistfooter();
}
- wfd_downlistpagenav($expired_count, $start3, 'art3');
- // Offline download
+ $pagenav = new XoopsPageNav($expired_downloads_count, $xoopsModuleConfig['admin_perpage'], $start3, 'start3');
+ $GLOBALS['xoopsTpl']->assign('expired_downloads_pagenav', $pagenav->renderNav());
+
+ // Offline downloads
$criteria = new Criteria("offline", 1);
- $offline_count = $download_handler->getCount($criteria);
$criteria->setSort("published");
$criteria->setOrder("ASC");
+ $criteria->setStart($start4);
$criteria->setLimit($xoopsModuleConfig['admin_perpage']);
- $criteria->setStart($start4);
- $offline_array = $download_handler->getObjects($criteria);
+ $offline_downloads_count = $download_handler->getCount($criteria);
+ $offline_downloads = $download_handler->getObjects($criteria);
+ $offline_downloads_count = $download_handler->getCount($criteria);
+ $GLOBALS['xoopsTpl']->assign('offline_downloads_count', $offline_downloads_count);
+ if ($offline_downloads_count > 0) {
+ foreach ($offline_downloads as $offline_download) {
+ $offline_download_array = $offline_download->toArray();
+ $offline_download_array['title_html'] = $myts->htmlSpecialChars(trim($offline_download_array['title']));
+ $offline_download_array['category_title'] = $categories[$offline_download_array['cid']]['title'];
+ $offline_download_array['submitter_uname'] = XoopsUserUtility::getUnameFromId($offline_download_array['submitter']);
+ $offline_download_array['published_timestamp'] = formatTimestamp($offline_download_array['published'], _DATESTRING);
- wfd_downlistheader(_AM_WFD_MINDEX_OFFLINEDOWN);
- if ($offline_count > 0) {
- foreach (array_keys($offline_array) as $i) {
- wfd_downlistbody($offline_array[$i]->toArray());
+ $GLOBALS['xoopsTpl']->append('offline_downloads', $offline_download_array);
}
- } else {
- wfd_downlistfooter();
}
- wfd_downlistpagenav($offline_count, $start4, 'art4');
+ $pagenav = new XoopsPageNav($offline_downloads_count, $xoopsModuleConfig['admin_perpage'], $start4, 'start4');
+ $GLOBALS['xoopsTpl']->assign('offline_downloads_pagenav', $pagenav->renderNav());
+
+ $GLOBALS['xoopsTpl']->display("db:wfdownloads_admin_downloadlist.html");
}
- //xoops_cp_footer();
- include_once "admin_footer.php";
+ include 'admin_footer.php';
break;
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/votedata.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/votedata.php 2013-05-28 19:19:24 UTC (rev 11603)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/votedata.php 2013-05-29 21:00:23 UTC (rev 11604)
@@ -19,37 +19,33 @@
* @version svn:$Id$
*/
include 'admin_header.php';
+$rating_handler = xoops_getmodulehandler('rating');
-$op = "";
+$op = wfdownloads_CleanVars($_REQUEST, 'op', 'votes.list', 'string');
-if (isset($_REQUEST['op'])) $op = $_REQUEST['op'];
-$rating_handler = xoops_getmodulehandler('rating');
-switch ($op)
-{
+switch ($op) {
+ case 'vote.delete' :
case "delVote":
- $rid = intval($_GET['rid']);
- $lid = intval($_GET['lid']);
+ $rid = wfdownloads_CleanVars($_GET, 'rid', null, 'int');
+ $lid = wfdownloads_CleanVars($_GET, 'lid', null, 'int');
$rating_handler->deleteAll(new Criteria("ratingid", $rid), true);
wfd_updaterating($lid);
- redirect_header(WFDOWNLOADS_URL.'admin/votedata.php', 1, _AM_WFD_VOTEDELETED);
+ redirect_header(WFDOWNLOADS_URL . 'admin/votedata.php', 1, _AM_WFD_VOTEDELETED);
break;
- case 'main':
+ case 'votes.list' :
default:
-
- global $xoopsDB, $imagearray;
-
- $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
+ $start = wfdownloads_CleanVars($_GET, 'start', 0, 'int');
$useravgrating = '0';
$uservotes = '0';
$criteria = new CriteriaCompo();
$criteria->setSort('ratingtimestamp');
$criteria->setOrder("DESC");
+ $criteria->setStart($start);;
$criteria->setLimit(20);
- $criteria->setStart($start);;
$ratings = $rating_handler->getObjects($criteria);
- $votes = count($ratings);
+ $votes = count($ratings);
$useravgrating = $rating_handler->getUserAverage();
$useravgrating = number_format($useravgrating["avg"], 2);
@@ -57,61 +53,29 @@
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation('votedata.php');
- //wfdownloads_adminMenu(8, _AM_WFD_VOTE_RATINGINFOMATION);
-
- echo "
- <fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFD_VOTE_DISPLAYVOTES . "</legend>\n
- <div style='padding: 8px;'>\n
- <div><b>" . _AM_WFD_VOTE_USERAVG . ": </b>$useravgrating</div>\n
- <div><b>" . _AM_WFD_VOTE_TOTALRATE . ": </b>$votes</div>\n
- <div style='padding: 8px;'>\n
- <li>" . $imagearray['deleteimg'] . " " . _AM_WFD_VOTE_DELETEDSC . "</li>
- <div>\n
- </fieldset>\n
- <br />\n
-
- <table width='100%' cellspacing='1' cellpadding='2' class='outer'>\n
- <tr>\n
- <th align='center'>" . _AM_WFD_VOTE_ID . "</th>\n
- <th align='center'>" . _AM_WFD_VOTE_USER . "</th>\n
- <th align='center'>" . _AM_WFD_VOTE_IP . "</th>\n
- <th align='center'>" . _AM_WFD_VOTE_FILETITLE . "</th>\n
- <th align='center'>" . _AM_WFD_VOTE_RATING . "</th>\n
- <th align='center'>" . _AM_WFD_VOTE_DATE . "</th>\n
- <th align='center'>" . _AM_WFD_MINDEX_ACTION . "</th></tr>\n";
-
- if ($votes == 0)
- {
- echo "<tr><td align='center' colspan='7' class='head'>" . _AM_WFD_VOTE_NOVOTES . "</td></tr>";
- }
- else {
- foreach (array_keys($ratings) as $i) {
- $lids[] = $ratings[$i]->getVar('lid');
+
+ $GLOBALS['xoopsTpl']->assign('votes', $votes);
+ $GLOBALS['xoopsTpl']->assign('useravgrating', $useravgrating);
+ if ($votes > 0) {
+ foreach ($ratings as $rating) {
+ $lids[] = $rating->getVar('lid');
}
$download_handler = xoops_getmodulehandler('download');
- $downloads = $download_handler->getObjects(new Criteria("lid", "(".implode(',', array_unique($lids)).")", "IN"), true);
- foreach (array_keys($ratings) as $i) {
- $formatted_date = formatTimestamp($ratings[$i]->getVar('ratingtimestamp'), $xoopsModuleConfig['dateformat']);
- $ratinguname = XoopsUser::getUnameFromId($ratings[$i]->getVar('ratinguser'));
- echo "
- <tr>\n
- <td class='head' align='center'>".$ratings[$i]->getVar('ratingid')."</td>\n
- <td class='even' align='center'>".$ratings[$i]->getVar('ratinguname')."</td>\n
- <td class='even' align='center'>".$ratings[$i]->getVar('ratinghostname')."</td>\n
- <td class='even' align='center'>".$downloads[$ratings[$i]->getVar('lid')]->getVar('title')."</td>\n
- <td class='even' align='center'>".$ratings[$i]->getVar('rating')."</td>\n
- <td class='even' align='center'>$formatted_date</td>\n
- <td class='even' align='center'><b><a href='".WFDOWNLOADS_URL."admin/votedata.php?op=delVote&lid=".$ratings[$i]->getVar('lid')."&rid=".$ratings[$i]->getVar('ratingid')."'>".$imagearray['deleteimg']."</a></b></td>\n
- </tr>\n";
+ $downloads = $download_handler->getObjects(new Criteria("lid", "(" . implode(',', array_unique($lids)) . ")", "IN"), true);
+ foreach ($ratings as $rating) {
+ $rating_array = $rating->toArray();
+ $rating_array['formatted_date'] = formatTimestamp($rating->getVar('ratingtimestamp'), _DATESTRING);
+ $rating_array['submitter_uname'] = XoopsUser::getUnameFromId($rating->getVar('ratinguser'));
+ $rating_array['download_title'] = $downloads[$rating->getVar('lid')]->getVar('title');
+ $GLOBALS['xoopsTpl']->append('ratings', $rating_array);
}
}
- echo "</table>";
- //Include page navigation
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $page = ($votes > 20) ? _AM_WFD_MINDEX_PAGE : '';
- $pagenav = new XoopsPageNav($page, 20, $start, 'start');
- echo '<div align="right" style="padding: 8px;">' . $page . '' . $pagenav->renderNav() . '</div>';
+ //Include page navigation
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav(_AM_WFD_MINDEX_PAGE, 20, $start, 'start');
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav());
+
+ $GLOBALS['xoopsTpl']->display("db:wfdownloads_admin_votedatalist.html");
+ include 'admin_footer.php';
break;
}
-//xoops_cp_footer();
-include_once "admin_footer.php";
\ No newline at end of file
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-05-28 19:19:24 UTC (rev 11603)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-05-29 21:00:23 UTC (rev 11604)
@@ -411,16 +411,19 @@
$sform -> addElement(new XoopsFormLabel(_AM_WFD_FILE_IP, $this->getVar('ipaddress')));
}
- $titles_tray = new XoopsFormElementTray(_AM_WFD_FILE_TITLE, '<br />');
- $titles = new XoopsFormText('', 'title', 50, 255, $this->getVar('title', 'e'));
- $titles_tray -> addElement($titles);
- $titles_checkbox = new XoopsFormCheckBox('', "title_checkbox", 0);
- $titles_checkbox -> addOption(1, _AM_WFD_FILE_USE_UPLOAD_TITLE);
- $titles_tray -> addElement($titles_checkbox);
+ $titles_tray = new XoopsFormElementTray(_AM_WFD_FILE_TITLE, '<br />');
+ $titles = new XoopsFormText('', 'title', 50, 255, $this->getVar('title', 'e'));
+ $titles_tray -> addElement($titles);
+ $titles_checkbox = new XoopsFormCheckBox('', "title_checkbox", 0);
+ $titles_checkbox -> addOption(1, _AM_WFD_FILE_USE_UPLOAD_TITLE);
+ $titles_tray -> addElement($titles_checkbox);
$sform -> addElement($titles_tray);
if (!$this->isNew()) {
- $sform -> addElement(new XoopsFormText(_AM_WFD_FILE_SUBMITTERID, 'submitter', 10, 10, $this->getVar('submitter', 'e')), true);
+ //$sform -> addElement(new XoopsFormText(_AM_WFD_FILE_SUBMITTERID, 'submitter', 10, 10, $this->getVar('submitter', 'e')), true);
+ $submitter_select = new XoopsFormSelectUser (_AM_WFD_FILE_SUBMITTER, 'submitter', false, $this->getVar('submitter', 'e'), 1, false);
+ $submitter_select->setDescription(_AM_WFD_FILE_SUBMITTER_DESC);
+ $sform -> addElement($submitter_select);
} else {
$sform -> addElement(new XoopsFormHidden('submitter', $xoopsUser->getVar('uid', 'e')));
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-05-28 19:19:24 UTC (rev 11603)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-05-29 21:00:23 UTC (rev 11604)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 (2013-05-25)</u></b>
+<b><u>=> Version 3.23 Beta 1 (2013-05-29)</u></b>
- refactorized admin menu (luciorota)
- added: sort subcategories by cid or title or weight (luciorota)
- fixed: update procedure now updates also permissions (luciorota)
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php 2013-05-28 19:19:24 UTC (rev 11603)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php 2013-05-29 21:00:23 UTC (rev 11604)
@@ -336,50 +336,50 @@
//File management
define("_AM_WFD_FILE_SUBMITTERID","Submitter User Id: <br /><br />Leave this as it is, Unless you want to change who submitted the download");
-define("_AM_WFD_FILE_ID","File ID: ");
-define("_AM_WFD_FILE_IP","Uploader's IP Address: ");
-define("_AM_WFD_FILE_ALLOWEDAMIME","<div style='padding-top: 4px; padding-bottom: 4px;'><b>Allowed Admin File Extensions</b>:</div>");
+define("_AM_WFD_FILE_ID","File ID");
+define("_AM_WFD_FILE_IP","Uploader's IP Address");
+define("_AM_WFD_FILE_ALLOWEDAMIME","<div style='padding-top: 4px; padding-bottom: 4px;'><b>Allowed Admin File Extensions</b></div>");
define("_AM_WFD_FILE_MODIFYFILE","Modify File Information");
define("_AM_WFD_FILE_CREATENEWFILE","Create New File");
-define("_AM_WFD_FILE_TITLE","File Title: ");
-define("_AM_WFD_FILE_DLURL","Remote URL: ");
-define("_AM_WFD_FILE_FILENAME","Local Filename:<br /><br /><span style='font-weight: normal;'>Note: If using local file as download, then you must also enter the correct filetype below!</span>");
-define("_AM_WFD_FILE_FILETYPE","File Type: ");
-define("_AM_WFD_FILE_MIRRORURL","File Mirror: ");
-define("_AM_WFD_FILE_SUMMARY","File Summary: ");
-define("_AM_WFD_FILE_DESCRIPTION","File Description: ");
-define("_AM_WFD_FILE_DUPLOAD"," Upload File:");
-define("_AM_WFD_FILE_CATEGORY","Select Category: ");
-define("_AM_WFD_FILE_HOMEPAGETITLE","Home Page Title: ");
-define("_AM_WFD_FILE_HOMEPAGE","Home Page: ");
-define("_AM_WFD_FILE_SIZE","File Size: ");
-define("_AM_WFD_FILE_VERSION","File Version: ");
-define("_AM_WFD_FILE_VERSIONTYPES","Release Status: ");
-define("_AM_WFD_FILE_PUBLISHER","File Publisher: ");
-define("_AM_WFD_FILE_PLATFORM","Software Platform: ");
-define("_AM_WFD_FILE_LICENCE","Software Licence: ");
-define("_AM_WFD_FILE_LIMITATIONS","Software limitations: ");
+define("_AM_WFD_FILE_TITLE","File Title");
+define("_AM_WFD_FILE_DLURL","Remote URL");
+define("_AM_WFD_FILE_FILENAME","Local Filename<br /><br /><span style='font-weight: normal;'>Note: If using local file as download, then you must also enter the correct filetype below!</span>");
+define("_AM_WFD_FILE_FILETYPE","File Type");
+define("_AM_WFD_FILE_MIRRORURL","File Mirror");
+define("_AM_WFD_FILE_SUMMARY","File Summary");
+define("_AM_WFD_FILE_DESCRIPTION","File Description");
+define("_AM_WFD_FILE_DUPLOAD"," Upload File");
+define("_AM_WFD_FILE_CATEGORY","Select Category");
+define("_AM_WFD_FILE_HOMEPAGETITLE","Home Page Title");
+define("_AM_WFD_FILE_HOMEPAGE","Home Page");
+define("_AM_WFD_FILE_SIZE","File Size");
+define("_AM_WFD_FILE_VERSION","File Version");
+define("_AM_WFD_FILE_VERSIONTYPES","Release Status");
+define("_AM_WFD_FILE_PUBLISHER","File Publisher");
+define("_AM_WFD_FILE_PLATFORM","Software Platform");
+define("_AM_WFD_FILE_LICENCE","Software Licence");
+define("_AM_WFD_FILE_LIMITATIONS","Software limitations");
define("_AM_WFD_FILE_PRICE","Price: ");
-define("_AM_WFD_FILE_KEYFEATURES","Key Features:<br /><br /><span style='font-weight: normal;'>Separate each Key Feature with a |</span>");
-define("_AM_WFD_FILE_REQUIREMENTS","System Requirements:<br /><br /><span style='font-weight: normal;'>Separate each Requirement with |</span>");
-define("_AM_WFD_FILE_HISTORY","Download History Edit:<br /><br /><span style='font-weight: normal;'>Add New Download History and only use this field to if you need to edit the previous history.</span>");
-define("_AM_WFD_FILE_HISTORYD","Add New Download History:<br /><br /><span style='font-weight: normal;'>The version Number and date will be added automatically</span>");
-define("_AM_WFD_FILE_HISTORYVERS","<b>Version: </b>");
-define("_AM_WFD_FILE_HISTORDATE"," <b>Updated:</b> ");
-define("_AM_WFD_FILE_FILESSTATUS"," Set Download offline?<br /><br /><span style='font-weight: normal;'>Download will not be viewable to all users.</span>");
+define("_AM_WFD_FILE_KEYFEATURES","Key Features<br /><br /><span style='font-weight: normal;'>Separate each Key Feature with a |</span>");
+define("_AM_WFD_FILE_REQUIREMENTS","System Requirements<br /><br /><span style='font-weight: normal;'>Separate each Requirement with |</span>");
+define("_AM_WFD_FILE_HISTORY","Download History Edit<br /><br /><span style='font-weight: normal;'>Add New Download History and only use this field to if you need to edit the previous history.</span>");
+define("_AM_WFD_FILE_HISTORYD","Add New Download History<br /><br /><span style='font-weight: normal;'>The version Number and date will be added automatically</span>");
+define("_AM_WFD_FILE_HISTORYVERS","<b>Version</b>");
+define("_AM_WFD_FILE_HISTORDATE"," <b>Updated</b> ");
+define("_AM_WFD_FILE_FILESSTATUS"," Set Download offline<br /><br /><span style='font-weight: normal;'>Download will not be viewable to all users.</span>");
define("_AM_WFD_FILE_SETASUPDATED"," Set Download Status as Updated?<br /><br /><span style='font-weight: normal;'>Download will Display updated icon.</span>");
-define("_AM_WFD_FILE_SHOTIMAGE","Select Screenshot Image: <br /><br /><span style='font-weight: normal;'>Note that screenshots will only be displayed if activated in module preferences.</span>");
+define("_AM_WFD_FILE_SHOTIMAGE","Select Screenshot Image<br /><br /><span style='font-weight: normal;'>Note that screenshots will only be displayed if activated in module preferences.</span>");
define("_AM_WFD_FILE_DISCUSSINFORUM","Add Discuss in this Forum?");
define("_AM_WFD_FILE_PUBLISHDATE","File Publish Date:");
define("_AM_WFD_FILE_EXPIREDATE","File Expire Date:");
-define("_AM_WFD_FILE_CLEARPUBLISHDATE","<br /><br />Remove Publish date:");
-define("_AM_WFD_FILE_CLEAREXPIREDATE","<br /><br />Remove Expire date:");
+define("_AM_WFD_FILE_CLEARPUBLISHDATE","<br /><br />Remove Publish date");
+define("_AM_WFD_FILE_CLEAREXPIREDATE","<br /><br />Remove Expire date");
define("_AM_WFD_FILE_PUBLISHDATESET"," Publish date set: ");
define("_AM_WFD_FILE_SETDATETIMEPUBLISH"," Set the date/time of publish");
define("_AM_WFD_FILE_SETDATETIMEEXPIRE"," Set the date/time of expire");
define("_AM_WFD_FILE_SETPUBLISHDATE","<b>Set Publish Date: </b>");
-define("_AM_WFD_FILE_SETNEWPUBLISHDATE","<b>Set New Publish Date: </b><br />Published:");
-define("_AM_WFD_FILE_SETPUBDATESETS","<b>Publish Date Set: </b><br />Publishes On Date:");
+define("_AM_WFD_FILE_SETNEWPUBLISHDATE","<b>Set New Publish Date: </b><br />Published");
+define("_AM_WFD_FILE_SETPUBDATESETS","<b>Publish Date Set: </b><br />Publishes On Date");
define("_AM_WFD_FILE_EXPIREDATESET"," Expire date set: ");
define("_AM_WFD_FILE_SETEXPIREDATE","<b>Set Expire Date: </b>");
define("_AM_WFD_FILE_MUSTBEVALID","Screenshot image must be a valid image file under %s directory (ex. shot.gif). Leave it blank if there is no image file.");
@@ -518,14 +518,14 @@
define("_AM_WFD_MIRROR_MUSTBEVALID","Home page logo must be a valid image file under %s directory (ex. shot.gif). Leave it blank if there is no image file.");
define("_AM_WFD_MIRROR_POSTER","Submitter");
define("_AM_WFD_MIRROR_SUBMITDATE","Submitted");
-define("_AM_WFD_MIRROR_FHOMEURLTITLE","Home Page Title: ");
+define("_AM_WFD_MIRROR_FHOMEURLTITLE","Home Page Title");
define("_AM_WFD_MIRROR_FHOMEURL","Home Page URL: ");
define("_AM_WFD_MIRROR_UPLOADIMAGE","Upload Site Logo:<br /><br />A small logo representing your website.");
-define("_AM_WFD_MIRROR_MIRRORIMAGE","Site Logo:");
-define("_AM_WFD_MIRROR_CONTINENT","Continent:");
-define("_AM_WFD_MIRROR_LOCATION","Location:<br /><br />Example: London, UK");
-define("_AM_WFD_MIRROR_DOWNURL","Download URL:<br /><br />Enter the url to the file.");
-define("_AM_WFD_MIRROR_FAPPROVE","Mirror Approve: ");
+define("_AM_WFD_MIRROR_MIRRORIMAGE","Site Logo");
+define("_AM_WFD_MIRROR_CONTINENT","Continent");
+define("_AM_WFD_MIRROR_LOCATION","Location<br /><br />Example: London, UK");
+define("_AM_WFD_MIRROR_DOWNURL","Download URL<br /><br />Enter the url to the file.");
+define("_AM_WFD_MIRROR_FAPPROVE","Mirror Approve");
define("_AM_WFD_MIRROR_ACTION","Action");
define("_AM_WFD_MIRROR_NOWAITINGMIRRORS","No Waiting Mirrors Found");
define("_AM_WFD_MIRROR_MIRROR_UPDATED","Selected Mirror Modified and Database Updated Successfully");
@@ -581,4 +581,5 @@
define("_AM_WFD_MINDEX_EXPIREDDOWN","Expired Downloads");
define("_AM_WFD_BUTTON_CATEGORIES_REORDER","Reorder");
define("_AM_WFD_CATEGORIES_REORDERED","Categories reordered");
-
+define("_AM_WFD_FILE_SUBMITTER","Submitter User");
+define("_AM_WFD_FILE_SUBMITTER_DESC","Leave this as it is, Unless you want to change who submitted the download");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php 2013-05-28 19:19:24 UTC (rev 11603)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php 2013-05-29 21:00:23 UTC (rev 11604)
@@ -20,35 +20,35 @@
*/
include 'header.php';
$download_handler = xoops_getmodulehandler('download');
+$rating_handler = xoops_getmodulehandler('rating');
if (!empty($_POST['submit'])) {
$lid = wfdownloads_CleanVars($_POST, 'lid', 0, 'int');
+ $cid = wfdownloads_CleanVars($_POST, 'cid', 0, 'int');
$download = $download_handler->get($lid);
- 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') == false || $download->getVar('published') > time() || $download->getVar('offline') == true || ($download->getVar('expired') !=0 && $download->getVar('expired') < time()) || $download->getVar('status') == 0) {
//Download not published, expired or taken offline - redirect
- redirect_header(WFDOWNLOADS_URL . 'index.php', 3, _MD_WFD_NODOWNLOAD);
+ redirect_header("index.php", 3, _MD_WFD_NODOWNLOAD);
}
-
- $rating_handler = xoops_getmodulehandler('rating');
if (empty($xoopsUser)) {
$ratinguser = 0;
} else {
- $ratinguser = intval($xoopsUser->getVar('uid'));
+ $ratinguser = $xoopsUser->getVar('uid');
}
// Make sure only 1 anonymous from an IP in a single day.
$anonwaitdays = 1;
$ip = getenv("REMOTE_ADDR");
- $cid = intval($_POST['cid']);
- $filerating = intval($_POST['rating']);
+ $filerating = (int)$_POST['rating'];
// Check if Rating is Null
if ($filerating == "--") {
- redirect_header(WFDOWNLOADS_URL."ratefile.php?cid={$cid}&lid={$lid}", 4, _MD_WFD_NORATING);
+ redirect_header("ratefile.php?cid={$cid}&lid={$lid}", 4, _MD_WFD_NORATING);
exit();
}
// Check if Download POSTER is voting (UNLESS Anonymous users allowed to post)
if ($ratinguser != 0) {
if ($download->getVar('submitter') == $ratinguser) {
- redirect_header(WFDOWNLOADS_URL.'index.php', 4, _MD_WFD_CANTVOTEOWN);
+ redirect_header(WFDOWNLOADS_URL . "singlefile.php?cid={$cid}&lid={$lid}", 4, _MD_WFD_CANTVOTEOWN);
exit();
}
// Check if REG user is trying to vote twice.
@@ -56,7 +56,7 @@
$criteria->add(new Criteria("ratinguser", $ratinguser));
$ratingcount = $rating_handler->getCount($criteria);
if ($ratingcount > 0) {
- redirect_header(WFDOWNLOADS_URL.'index.php', 4, _MD_WFD_VOTEONCE);
+ redirect_header("singlefile.php?cid={$cid}&lid={$lid}", 4, _MD_WFD_VOTEONCE);
exit();
}
} else {
@@ -68,7 +68,7 @@
$criteria->add(new Criteria("ratingtimestamp", $yesterday, ">"));
$anonvotecount = $rating_handler->getCount($criteria);
if ($anonvotecount > 0) {
- redirect_header(WFDOWNLOADS_URL . 'index.php', 4, _MD_WFD_VOTEONCE);
+ redirect_header("singlefile.php?cid={$cid}&lid={$lid}", 4, _MD_WFD_VOTEONCE);
exit();
}
}
@@ -83,29 +83,30 @@
// All is well. Calculate Score & Add to Summary (for quick retrieval & sorting) to DB.
wfd_updaterating($lid);
$ratemessage = _MD_WFD_VOTEAPPRE . "<br />" . sprintf(_MD_WFD_THANKYOU, $xoopsConfig['sitename']);
- redirect_header(WFDOWNLOADS_URL . 'index.php', 4, $ratemessage);
+ redirect_header("singlefile.php?cid={$cid}&lid={$lid}", 4, $ratemessage);
} else {
echo $rating->getHtmlErrors();
}
} else {
$lid = wfdownloads_CleanVars($_GET, 'lid', 0, 'int');
+ $cid = wfdownloads_CleanVars($_GET, 'cid', 0, 'int');
$download = $download_handler->get($lid);
- if ($download->getVar('published') == 0 || $download->getVar('published') > time() || $download->getVar('offline') == 1 || ($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())) {
//Download not published, expired or taken offline - redirect
redirect_header("index.php", 3, _MD_WFD_NODOWNLOAD);
}
- $cid = wfdownloads_CleanVars($_GET, 'cid', 0, 'int');
$xoopsOption['template_main'] = 'wfdownloads_ratefile.html';
include XOOPS_ROOT_PATH . '/header.php';
- $xoTheme->addStylesheet(WFDOWNLOADS_URL.'module.css');
- $xoTheme->addStylesheet(WFDOWNLOADS_URL.'thickbox.css');
+ $xoTheme->addStylesheet(WFDOWNLOADS_URL . 'module.css');
+ $xoTheme->addStylesheet(WFDOWNLOADS_URL . 'thickbox.css');
$xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL);
$imageheader = wfd_imageheader();
- $xoopsTpl -> assign('file', array('id' => $lid, 'cid' => $cid, 'title' => $download->getVar('title'), 'imageheader' => $imageheader));
+ $xoopsTpl -> assign('file', array('id' => $lid, 'lid' => $lid, 'cid' => $cid, 'title' => $download->getVar('title'), 'imageheader' => $imageheader));
include XOOPS_ROOT_PATH . '/footer.php';
}
include 'footer.php';
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_categorylist.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_categorylist.html 2013-05-28 19:19:24 UTC (rev 11603)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_categorylist.html 2013-05-29 21:00:23 UTC (rev 11604)
@@ -1,5 +1,5 @@
<form action="category.php" method="post" id="categoriesform">
-<table>
+<table class="outer">
<tr>
<th><{$smarty.const._AM_WFD_FCATEGORY_TITLE}></th>
<th><{$smarty.const._AM_WFD_FCATEGORY_DESCRIPTION}></th>
@@ -16,11 +16,11 @@
<input type="text" name="new_weights[<{$sorted_category.category.cid}>]" size="5" maxlength="5" value="<{$sorted_category.category.weight}>" />
</td>
<td>
- <a href="category.php?op=category.edit&cid=<{$sorted_category.category.cid}>" title="<{$smarty.const._EDIT}>"><{$smarty.const._EDIT}></a>
+ <a href="category.php?op=category.edit&cid=<{$sorted_category.category.cid}>" title="<{$smarty.const._EDIT}>"><img src="<{xoModuleIcons16 edit.png}>" title="<{$smarty.const._EDIT}>" alt="<{$smarty.const._EDIT}>" /></a>
- <a href="category.php?op=category.delete&cid=<{$sorted_category.category.cid}>" title="<{$smarty.const._DELETE}>"><{$smarty.const._DELETE}></a>
+ <a href="category.php?op=category.delete&cid=<{$sorted_category.category.cid}>" title="<{$smarty.const._DELETE}>"><img src="<{xoModuleIcons16 delete.png}>" title="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" /></a>
- <a href="category.php?op=category.move&cid=<{$sorted_category.category.cid}>" title="<{$smarty.const._AM_WFD_BMOVE}>"><{$smarty.const._AM_WFD_BMOVE}></a>
+ <a href="category.php?op=category.move&cid=<{$sorted_category.category.cid}>" title="<{$smarty.const._AM_WFD_BMOVE}>"><img src="<{xoModuleIcons16 forward.png}>" title="<{$smarty.const._AM_WFD_BMOVE}>" alt="<{$smarty.const._AM_WFD_BMOVE}>" /></a>
</td>
</tr>
<{/foreach}>
Added: XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_downloadlist.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_downloadlist.html (rev 0)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_downloadlist.html 2013-05-29 21:00:23 UTC (rev 11604)
@@ -0,0 +1,215 @@
+<form action="download.php" method="post" id="downloadsform">
+<fieldset>
+ <legend style='font-weight: bold; color: #900;'><{$smarty.const._AM_WFD_MINDEX_PUBLISHEDDOWN}></legend>
+ <br />
+<{if ($published_downloads_count == 0)}>
+ <{$smarty.const._AM_WFD_MINDEX_NODOWNLOADSFOUND}>
+<{else}>
+ <table class="outer">
+ <tr>
+ <th><{$smarty.const._AM_WFD_MINDEX_ID}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_TITLE}></th>
+ <th><{$smarty.const._AM_WFD_FCATEGORY_TITLE}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_POSTER}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_SUBMITTED}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_ONLINESTATUS}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_PUBLISHED}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_LOG}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_ACTION}></th>
+ </tr>
+ <{foreach item=download from=$published_downloads}>
+ <tr class="<{cycle values='even, odd'}>">
+ <td><{$download.lid}></td>
+ <td><a href='../singlefile.php?cid=<{$download.cid}>&lid=<{$download.lid}>'><{$download.title}></a></td>
+ <td><{$download.category_title}></td>
+ <td><{$download.submitter_uname}></td>
+ <td><{$download.published_timestamp}></td>
+ <td>
+ <{if $download.offline}>
+ <img src="<{xoModuleIcons16 off.png}>" />
+ <{else}>
+ <img src="<{xoModuleIcons16 on.png}>" />
+ <{/if}>
+ </td>
+ <td>
+ <{if $download.published}>
+ <img src="<{xoModuleIcons16 on.png}>" />
+ <{else}>
+ <img src="<{xoModuleIcons16 off.png}>" />
+ <{/if}>
+ </td>
+ <td><a href='ip_log.php?lid=<{$download.lid}>'><{$smarty.const._AM_WFD_IP_LOGS}></a></td>
+ <td>
+ <a href='download.php?op=download.add&lid=<{$download.lid}>' title="<{$smarty.const._EDIT}>"><img src="<{xoModuleIcons16 edit.png}>" title="<{$smarty.const._EDIT}>" alt="<{$smarty.const._EDIT}>" /></a>
+ <a href='download.php?op=download.delete&lid=<{$download.lid}>' title="<{$smarty.const._DELETE}>"><img src="<{xoModuleIcons16 delete.png}>" title="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" /></a>
+ </td>
+ </tr>
+ <{/foreach}>
+ </table>
+ <{$published_downloads_pagenav}>
+<{/if}>
+</fieldset>
+
+<br />
+
+<fieldset>
+ <legend style='font-weight: bold; color: #900;'><{$smarty.const._AM_WFD_MINDEX_AUTOPUBLISHEDDOWN}></legend>
+ <br />
+<{if ($auto_published_downloads_count == 0)}>
+ <{$smarty.const._AM_WFD_MINDEX_NODOWNLOADSFOUND}>
+<{else}>
+ <table class="outer">
+ <tr>
+ <th><{$smarty.const._AM_WFD_MINDEX_ID}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_TITLE}></th>
+ <th><{$smarty.const._AM_WFD_FCATEGORY_TITLE}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_POSTER}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_SUBMITTED}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_ONLINESTATUS}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_PUBLISHED}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_LOG}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_ACTION}></th>
+ </tr>
+ <{foreach item=download from=$auto_published_downloads}>
+ <tr class="<{cycle values='even, odd'}>">
+ <td><{$download.lid}></td>
+ <td><a href='../singlefile.php?cid=<{$download.cid}>&lid=<{$download.lid}>'><{$download.title}></a></td>
+ <td><{$download.category_title}></td>
+ <td><{$download.submitter_uname}></td>
+ <td><{$download.published_timestamp}></td>
+ <td>
+ <{if $download.offline}>
+ <img src="<{xoModuleIcons16 off.png}>" />
+ <{else}>
+ <img src="<{xoModuleIcons16 on.png}>" />
+ <{/if}>
+ </td>
+ <td>
+ <{if $download.published}>
+ <img src="<{xoModuleIcons16 on.png}>" />
+ <{else}>
+ <img src="<{xoModuleIcons16 off.png}>" />
+ <{/if}>
+ </td>
+ <td><a href='ip_log.php?lid=<{$download.lid}>'><{$smarty.const._AM_WFD_IP_LOGS}></a></td>
+ <td>
+ <a href='download.php?op=download.add&lid=<{$download.lid}>' title="<{$smarty.const._EDIT}>"><img src="<{xoModuleIcons16 edit.png}>" title="<{$smarty.const._EDIT}>" alt="<{$smarty.const._EDIT}>" /></a>
+ <a href='download.php?op=download.delete&lid=<{$download.lid}>' title="<{$smarty.const._DELETE}>"><img src="<{xoModuleIcons16 delete.png}>" title="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" /></a>
+ </td>
+ </tr>
+ <{/foreach}>
+ </table>
+ <{$auto_published_downloads_pagenav}>
+<{/if}>
+</fieldset>
+
+<br />
+
+<fieldset>
+ <legend style='font-weight: bold; color: #900;'><{$smarty.const._AM_WFD_MINDEX_EXPIREDDOWN}></legend>
+ <br />
+<{if ($expired_downloads_count == 0)}>
+ <{$smarty.const._AM_WFD_MINDEX_NODOWNLOADSFOUND}>
+<{else}>
+ <table class="outer">
+ <tr>
+ <th><{$smarty.const._AM_WFD_MINDEX_ID}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_TITLE}></th>
+ <th><{$smarty.const._AM_WFD_FCATEGORY_TITLE}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_POSTER}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_SUBMITTED}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_ONLINESTATUS}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_PUBLISHED}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_LOG}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_ACTION}></th>
+ </tr>
+ <{foreach item=download from=$expired_downloads}>
+ <tr class="<{cycle values='even, odd'}>">
+ <td><{$download.lid}></td>
+ <td><a href='../singlefile.php?cid=<{$download.cid}>&lid=<{$download.lid}>'><{$download.title}></a></td>
+ <td><{$download.category_title}></td>
+ <td><{$download.submitter_uname}></td>
+ <td><{$download.published_timestamp}></td>
+ <td>
+ <{if $download.offline}>
+ <img src="<{xoModuleIcons16 off.png}>" />
+ <{else}>
+ <img src="<{xoModuleIcons16 on.png}>" />
+ <{/if}>
+ </td>
+ <td>
+ <{if $download.published}>
+ <img src="<{xoModuleIcons16 on.png}>" />
+ <{else}>
+ <img src="<{xoModuleIcons16 off.png}>" />
+ <{/if}>
+ </td>
+ <td><a href='ip_log.php?lid=<{$download.lid}>'><{$smarty.const._AM_WFD_IP_LOGS}></a></td>
+ <td>
+ <a href='download.php?op=download.add&lid=<{$download.lid}>' title="<{$smarty.const._EDIT}>"><img src="<{xoModuleIcons16 edit.png}>" title="<{$smarty.const._EDIT}>" alt="<{$smarty.const._EDIT}>" /></a>
+ <a href='download.php?op=download.delete&lid=<{$download.lid}>' title="<{$smarty.const._DELETE}>"><img src="<{xoModuleIcons16 delete.png}>" title="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" /></a>
+ </td>
+ </tr>
+ <{/foreach}>
+ </table>
+ <{$expired_downloads_pagenav}>
+<{/if}>
+</fieldset>
+
+<br />
+
+<fieldset>
+ <legend style='font-weight: bold; color: #900;'><{$smarty.const._AM_WFD_MINDEX_OFFLINEDOWN}></legend>
+ <br />
+<{if ($offline_downloads_count == 0)}>
+ <{$smarty.const._AM_WFD_MINDEX_NODOWNLOADSFOUND}>
+<{else}>
+ <table class="outer">
+ <tr>
+ <th><{$smarty.const._AM_WFD_MINDEX_ID}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_TITLE}></th>
+ <th><{$smarty.const._AM_WFD_FCATEGORY_TITLE}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_POSTER}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_SUBMITTED}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_ONLINESTATUS}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_PUBLISHED}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_LOG}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_ACTION}></th>
+ </tr>
+ <{foreach item=download from=$offline_downloads}>
+ <tr class="<{cycle values='even, odd'}>">
+ <td><{$download.lid}></td>
+ <td><a href='../singlefile.php?cid=<{$download.cid}>&lid=<{$download.lid}>'><{$download.title}></a></td>
+ <td><{$download.category_title}></td>
+ <td><{$download.submitter_uname}></td>
+ <td><{$download.published_timestamp}></td>
+ <td>
+ <{if $download.offline}>
+ <img src="<{xoModuleIcons16 off.png}>" />
+ <{else}>
+ <img src="<{xoModuleIcons16 on.png}>" />
+ <{/if}>
+ </td>
+ <td>
+ <{if $download.published}>
+ <img src="<{xoModuleIcons16 on.png}>" />
+ <{else}>
+ <img src="<{xoModuleIcons16 off.png}>" />
+ <{/if}>
+ </td>
+ <td><a href='ip_log.php?lid=<{$download.lid}>'><{$smarty.const._AM_WFD_IP_LOGS}></a></td>
+ <td>
+ <a href='download.php?op=download.add&lid=<{$download.lid}>' title="<{$smarty.const._EDIT}>"><img src="<{xoModuleIcons16 edit.png}>" title="<{$smarty.const._EDIT}>" alt="<{$smarty.const._EDIT}>" /></a>
+ <a href='download.php?op=download.delete&lid=<{$download.lid}>' title="<{$smarty.const._DELETE}>"><img src="<{xoModuleIcons16 delete.png}>" title="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" /></a>
+ </td>
+ </tr>
+ <{/foreach}>
+ </table>
+ <{$offline_downloads_pagenav}>
+<{/if}>
+</fieldset>
+
+
+
+
+</form>
\ No newline at end of file
Added: XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_reviewlist.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_reviewlist.html (rev 0)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_reviewlist.html 2013-05-29 21:00:23 UTC (rev 11604)
@@ -0,0 +1,39 @@
+<fieldset><legend style='font-weight: bold; color: #900;'><{$smarty.const._AM_WFD_VOTE_DISPLAYVOTES}></legend>
+ <div style='padding: 8px;'>
+ <div><b><{$smarty.const._AM_WFD_VOTE_USERAVG}></b> <{$useravgrating}></div>
+ <div><b><{$smarty.const._AM_WFD_VOTE_TOTALRATE}></b> <{$votes}></div>
+ <div>
+ <img src="<{xoModuleIcons16 delete.png}>" title="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" /> <{$smarty.const._AM_WFD_VOTE_DELETEDSC}>
+ </div>
+</fieldset>
+
+<br />
+
+<{if ($votes == 0)}>
+<{$smarty.const._AM_WFD_VOTE_NOVOTES}>
+<{else}>
+<table class='outer'>
+ <tr>
+ <th><{$smarty.const._AM_WFD_VOTE_ID}></th>
+ <th><{$smarty.const._AM_WFD_VOTE_USER}></th>
+ <th><{$smarty.const._AM_WFD_VOTE_IP}></th>
+ <th><{$smarty.const._AM_WFD_VOTE_FILETITLE}></th>
+ <th><{$smarty.const._AM_WFD_VOTE_RATING}></th>
+ <th><{$smarty.const._AM_WFD_VOTE_DATE}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_ACTION}></th>
+ </tr>
+<{foreach item=rating from=$ratings}>
+ <tr>
+ <td class='head'><{$rating.ratingid}></td>
+ <td class='even'><{$rating.submitter_uname}></td>
+ <td class='even'><{$rating.ratinghostname}></td>
+ <td class='even'><{$rating.download_title}></td>
+ <td class='even'><{$rating.rating}></td>
+ <td class='even'><{$rating.formatted_date}></td>
+ <td class='even'>
+ <a href='votedata.php?op=vote.delete&lid=<{$rating.lid}>&rid=<{$rating.rid}>'><img src="<{xoModuleIcons16 delete.png}>" title="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" /></a>
+ </td>
+ </tr>
+<{/foreach}>
+</table>
+<{/if}>
Added: XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_votedatalist.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_votedatalist.html (rev 0)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_admin_votedatalist.html 2013-05-29 21:00:23 UTC (rev 11604)
@@ -0,0 +1,39 @@
+<fieldset><legend style='font-weight: bold; color: #900;'><{$smarty.const._AM_WFD_VOTE_DISPLAYVOTES}></legend>
+ <div style='padding: 8px;'>
+ <div><b><{$smarty.const._AM_WFD_VOTE_USERAVG}></b> <{$useravgrating}></div>
+ <div><b><{$smarty.const._AM_WFD_VOTE_TOTALRATE}></b> <{$votes}></div>
+ <div>
+ <img src="<{xoModuleIcons16 delete.png}>" title="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" /> <{$smarty.const._AM_WFD_VOTE_DELETEDSC}>
+ </div>
+</fieldset>
+
+<br />
+
+<{if ($votes == 0)}>
+<{$smarty.const._AM_WFD_VOTE_NOVOTES}>
+<{else}>
+<table class='outer'>
+ <tr>
+ <th><{$smarty.const._AM_WFD_VOTE_ID}></th>
+ <th><{$smarty.const._AM_WFD_VOTE_USER}></th>
+ <th><{$smarty.const._AM_WFD_VOTE_IP}></th>
+ <th><{$smarty.const._AM_WFD_VOTE_FILETITLE}></th>
+ <th><{$smarty.const._AM_WFD_VOTE_RATING}></th>
+ <th><{$smarty.const._AM_WFD_VOTE_DATE}></th>
+ <th><{$smarty.const._AM_WFD_MINDEX_ACTION}></th>
+ </tr>
+<{foreach item=rating from=$ratings}>
+ <tr>
+ <td class='head'><{$rating.ratingid}></td>
+ <td class='even'><{$rating.submitter_uname}></td>
+ <td class='even'><{$rating.ratinghostname}></td>
+ <td class='even'><{$rating.download_title}></td>
+ <td class='even'><{$rating.rating}></td>
+ <td class='even'><{$rating.formatted_date}></td>
+ <td class='even'>
+ <a href='votedata.php?op=vote.delete&lid=<{$rating.lid}>&rid=<{$rating.rid}>'><img src="<{xoModuleIcons16 delete.png}>" title="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" /></a>
+ </td>
+ </tr>
+<{/foreach}>
+</table>
+<{/if}>
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_ratefile.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_ratefile.html 2013-05-28 19:19:24 UTC (rev 11603)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_ratefile.html 2013-05-29 21:00:23 UTC (rev 11604)
@@ -18,7 +18,7 @@
<tr>
<td>
<form method="post" action="ratefile.php">
- <input type="hidden" name="lid" value="<{$file.id}>" />
+ <input type="hidden" name="lid" value="<{$file.lid}>" />
<input type="hidden" name="cid" value="<{$file.cid}>" />
<select name="rating">
<option>--</option>
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/visit.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/visit.php 2013-05-28 19:19:24 UTC (rev 11603)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/visit.php 2013-05-29 21:00:23 UTC (rev 11604)
@@ -29,16 +29,15 @@
redirect_header(XOOPS_URL . '/user.php', 1, _MD_WFD_MUSTREGFIRST);
}
-$agreed = (isset($_GET['agree'])) ? intval($_GET['agree']) : 0;
-
+$agreed = wfdownloads_CleanVars($_GET, 'agree', 0, 'int');
$lid = wfdownloads_CleanVars($_GET, 'lid', 0, 'int');
$download = $download_handler->get($lid);
-$cid = intval($download->getVar('cid'));
+$cid = $download->getVar('cid');
if ($download->isNew()) {
redirect_header(WFDOWNLOADS_URL . 'index.php', 1, _MD_WFD_NODOWNLOAD);
}
-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') == false || $download->getVar('published') > time() || $download->getVar('offline') == true || ($download->getVar('expired') != 0 && $download->getVar('expired') < time()) || $download->getVar('status') == 0) {
//Download not published, expired or taken offline - redirect
redirect_header(WFDOWNLOADS_URL . 'index.php', 3, _MD_WFD_NODOWNLOAD);
}
@@ -58,7 +57,7 @@
echo "</div>\n";
}
-if ($agreed == 0) {
+if ($agreed == false) {
if ($xoopsModuleConfig['check_host']) {
$goodhost = 0;
$referer = parse_url(xoops_getenv('HTTP_REFERER'));
@@ -75,7 +74,7 @@
}
}
-if ($xoopsModuleConfig['showDowndisclaimer'] && $agreed == 0) {
+if ($xoopsModuleConfig['showDowndisclaimer'] && $agreed == false) {
$xoopsOption['template_main'] = 'wfdownloads_disclaimer.html';
include XOOPS_ROOT_PATH . '/header.php';
@@ -87,15 +86,13 @@
$xoopsTpl->assign('image_header', wfd_imageheader());
$xoopsTpl->assign('downdisclaimer', $myts->displayTarea($xoopsModuleConfig['downdisclaimer'], 1, 1, 1, 1, 1));
$xoopsTpl->assign('cancel_location', WFDOWNLOADS_URL . 'index.php');
- $xoopsTpl->assign('agree_location', WFDOWNLOADS_URL . "visit.php?agree=1&lid={$lid}&cid={$cid}";
+ $xoopsTpl->assign('agree_location', WFDOWNLOADS_URL . "visit.php?agree=1&lid={$lid}&cid={$cid}");
$xoopsTpl->assign('down_disclaimer', true);
include XOOPS_ROOT_PATH . '/footer.php';
- exit();
} else {
$isadmin = (!empty($xoopsUser) && $xoopsUser -> isAdmin($xoopsModule -> mid())) ? true : false;
- if ($isadmin == false)
- {
+ if ($isadmin == false) {
$download_handler->incrementHits($lid);
}
//--
@@ -113,8 +110,8 @@
if ((!$download->getVar('url') == "" && !$download->getVar('url') == 'http://') || $full_name == '') {
include XOOPS_ROOT_PATH . '/header.php';
- $xoTheme->addStylesheet(WFDOWNLOADS_URL.'module.css');
- $xoTheme->addStylesheet(WFDOWNLOADS_URL.'thickbox.css');
+ $xoTheme->addStylesheet(WFDOWNLOADS_URL . 'module.css');
+ $xoTheme->addStylesheet(WFDOWNLOADS_URL . 'thickbox.css');
$xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL);
echo "<div align='center'>" . wfd_imageheader() . "</div>";
@@ -123,7 +120,7 @@
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";
- echo "<a href='$url' target='_blank'>" . _MD_WFD_CLICKHERE . "</a>.\n";
+ echo "<a href='{$url}' target='_blank'>" . _MD_WFD_CLICKHERE . "</a>.\n";
echo "</div>\n";
header("Cache-Control: no-store, no-cache, must-revalidate");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-05-28 19:19:24 UTC (rev 11603)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-05-29 21:00:23 UTC (rev 11604)
@@ -23,8 +23,8 @@
$modversion['name'] = _MI_WFD_NAME;
$modversion['version'] = 3.23;
-$modversion['releasedate'] = "201...
[truncated message content] |