|
From: <luc...@us...> - 2013-06-12 21:07:10
|
Revision: 11662
http://sourceforge.net/p/xoops/svn/11662
Author: luciorota
Date: 2013-06-12 21:07:05 +0000 (Wed, 12 Jun 2013)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php
XoopsModules/wfdownloads/trunk/wfdownloads/brokenfile.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/rating.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/header.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/common.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php
XoopsModules/wfdownloads/trunk/wfdownloads/submit.php
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Added Paths:
-----------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_categorieslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_menu.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_mimetypeslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_mirrorslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_permissions.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ratingslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_reportsmodificationslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_reviewslist.html
Removed Paths:
-------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/brokens.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/modifications.php
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_categorylist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadlist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_menu.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_mimetypelist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_mirrorlist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_permissions.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_reviewlist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_votedatalist.html
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php 2013-06-12 20:40:21 UTC (rev 11661)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php 2013-06-12 21:07:05 UTC (rev 11662)
@@ -29,12 +29,12 @@
$myts = &MyTextSanitizer::getInstance();
$module_handler =& xoops_gethandler('module');
-$xoopsModule = & $module_handler->getByDirname(basename(dirname(dirname(__FILE__))));
+$xoopsModule =& $module_handler->getByDirname(basename(dirname(dirname(__FILE__))));
$pathIcon16 = XOOPS_URL . '/' . $xoopsModule->getInfo('icons16');
$pathIcon32 = XOOPS_URL . '/' . $xoopsModule->getInfo('icons32');
-include_once(XOOPS_ROOT_PATH . '/modules/wfdownloads/include/common.php');
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
/*$imagearray = array(
'editimg' => "<img src='" . $pathIcon16 . '/edit.png'."' alt='" . _AM_WFD_ICO_EDIT . "' title='" . _AM_WFD_ICO_EDIT . "' align='middle'>",
@@ -67,7 +67,7 @@
xoops_loadLanguage('modinfo', $xoopsModule->dirname());
xoops_loadLanguage('main', $xoopsModule->dirname());
-// Load handlers
+// Load module handlers
$category_handler = xoops_getmodulehandler('category', $xoopsModule->dirname());
$download_handler = xoops_getmodulehandler('download', $xoopsModule->dirname());
$review_handler = xoops_getmodulehandler('review', $xoopsModule->dirname());
@@ -77,9 +77,10 @@
$modification_handler = xoops_getmodulehandler('modification', $xoopsModule->dirname());
$ip_log_handler = xoops_getmodulehandler('ip_log', $xoopsModule->dirname());
+// Load Xoops handlers
$member_handler = xoops_gethandler("member");
+$notification_handler = &xoops_gethandler('notification');
-
if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
include_once(XOOPS_ROOT_PATH . "/class/template.php");
$xoopsTpl = new XoopsTpl();
Deleted: XoopsModules/wfdownloads/trunk/wfdownloads/admin/brokens.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/brokens.php 2013-06-12 20:40:21 UTC (rev 11661)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/brokens.php 2013-06-12 21:07:05 UTC (rev 11662)
@@ -1,174 +0,0 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * WF-Downloads module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
- * @package wfdownload
- * @since 3.23
- * @author Xoops Development Team
- * @version svn:$id$
- */
-$currentFile = basename(__FILE__);
-include 'admin_header.php';
-
-$op = wfdownloads_CleanVars($_REQUEST, 'op', 'brokendownloads.list', 'string');
-$lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
-
-switch ($op) {
- case "updateNotice":
- $report_handler = xoops_getmodulehandler('report');
- if (isset($_GET['ack'])) {
- $acknowledged = (isset($_GET['ack']) && $_GET['ack'] == 0) ? 1 : 0;
- $report_handler->updateAll("acknowledged", $acknowledged, new Criteria("lid", $lid), true);
- $update_mess = _AM_WFD_BROKEN_NOWACK;
- }
-
- if (isset($_GET['con'])) {
- $confirmed = (isset($_GET['con']) && $_GET['con'] == 0) ? 1 : 0;
- $report_handler->updateAll("confirmed", $confirmed, new Criteria("lid", $lid), true);
- $update_mess = _AM_WFD_BROKEN_NOWCON;
- }
- redirect_header($currentFile, 1, $update_mess);
- break;
-
- case "brokendownload.delete" :
- case "delBrokenDownloads":
- $criteria = new Criteria('lid', intval($lid));
- $report_handler = xoops_getmodulehandler('report');
- $report = $report_handler->getObjects($criteria);
- if (isset($report[0])) {
- $report_handler->delete($report[0], true);
- }
- $download_handler = xoops_getmodulehandler('download');
- $download = $download_handler->get($lid);
- $download_handler->delete($download, true);
- redirect_header($currentFile, 1, _AM_WFD_BROKENFILEDELETED);
- break;
-
- case "brokendownload.ignore" :
- case "ignoreBrokenDownloads":
- $criteria = new Criteria('lid', intval($lid));
- $report_handler = xoops_getmodulehandler('report');
- $report = $report_handler->getObjects($criteria);
- if (isset($report[0])) {
- $report_handler->delete($report[0], true);
- }
- redirect_header($currentFile, 1, _AM_WFD_BROKEN_FILEIGNORED);
- break;
-
- default:
- case "brokendownloads.list" :
- case "listBrokenDownloads":
- case "default":
- $report_handler = xoops_getmodulehandler('report');
- $reports = $report_handler->getObjects();
- $totalbrokendownloads = count($reports);
-
- wfdownloads_xoops_cp_header();
-
- echo "
- <fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFD_BROKEN_REPORTINFO . "</legend>\n
- <div style='padding: 8px;'>" . _AM_WFD_BROKEN_REPORTSNO . " <b>{$totalbrokendownloads}</b><div>\n
- <div style='padding: 8px;'>\n
- <ul><li>" . $imagearray['ignore'] . " " . _AM_WFD_BROKEN_IGNOREDESC . "</li>\n
- <li>" . $imagearray['editimg'] . " " . _AM_WFD_BROKEN_EDITDESC . "</li>
- <li>" . $imagearray['deleteimg'] . " " . _AM_WFD_BROKEN_DELETEDESC . "</li>\n
- <li>" . $imagearray['ack_yes'] . " " . _AM_WFD_BROKEN_ACKDESC . "</li>
- <li>" . $imagearray['con_yes'] . " " . _AM_WFD_BROKEN_CONFIRMDESC . "</li>
- </ul></div>\n
- </fieldset><br />\n
-
- <table width='100%' border='0' cellspacing='1' cellpadding = '2' class='outer'>\n
- <tr align = 'center'>\n
- <th width = '3%' align = 'center'>" . _AM_WFD_BROKEN_ID . "</th>\n
- <th width = '35%' align = 'left'>" . _AM_WFD_BROKEN_TITLE . "</th>\n
- <th>" . _AM_WFD_BROKEN_REPORTER . "</th>\n
- <th>" . _AM_WFD_BROKEN_FILESUBMITTER . "</th>\n
- <th>" . _AM_WFD_BROKEN_DATESUBMITTED . "</th>\n
- <th align='center'>" . _AM_WFD_BROKEN_ACTION . "</th>\n
- </tr>\n
- ";
-
- if ($totalbrokendownloads == 0) {
- echo "<tr align = 'center'><td align = 'center' class='head' colspan = '6'>" . _AM_WFD_BROKEN_NOFILEMATCH . "</td></tr>";
- } else {
- foreach (array_keys($reports) as $i) {
- $lids[] = $reports[$i]->getVar('lid');
- $uids[] = $reports[$i]->getVar('sender');
- }
- $download_handler = xoops_getmodulehandler('download');
- $downloads = $download_handler->getObjects(new Criteria('lid', "(".implode(',', array_unique($lids)).")", "IN"), true);
-
- foreach (array_keys($downloads) as $i) {
- $uids[] = $downloads[$i]->getVar('submitter');
- }
-
- $member_handler = xoops_gethandler('member');
- $users = $member_handler->getUsers(new Criteria("uid", "(" . implode(',', array_unique($uids)) . ")", "IN"), true);
-
- foreach (array_keys($reports) as $i) {
- // Does the download exists ?
- if (isset($downloads[$reports[$i]->getVar('lid')])) {
- $submitter = isset($users[$downloads[$reports[$i]->getVar('lid')]->getVar('submitter')]) ? $users[$downloads[$reports[$i]->getVar('lid')]->getVar('submitter')] : false;
- $download = $downloads[$reports[$i]->getVar('lid')];
- $download_link = "<a href='" . WFDOWNLOADS_URL . "/singlefile.php?cid=" . $download->getVar('cid') . "&lid=" . $download->getVar('lid') . "' target='_blank'>" . $download->getVar('title') . "</a>";
- $submitteremail = is_object($submitter) ? $submitter->getVar('email') : '';
- $submitteruname = is_object($submitter) ? $submitter->getVar('uname') : $xoopsConfig['anonymous'];
- } else {
- $submitter = '';
- $download_link = _AM_WFD_BROKEN_DOWNLOAD_DONT_EXISTS;
- $submitteremail = '';
- $submitteruname = $xoopsConfig['anonymous'];
- }
-
- $sender = isset($users[$reports[$i]->getVar('sender')]) ? $users[$reports[$i]->getVar('sender')] : "";
- $senderemail = isset($users[$reports[$i]->getVar('sender')]) ? $users[$reports[$i]->getVar('sender')]->getVar('email') : "";
- $sendername = isset($users[$reports[$i]->getVar('sender')]) ? $users[$reports[$i]->getVar('sender')]->getVar('uname') : $xoopsConfig['anonymous'];
-
- $lid = intval($download->getVar('lid'));
-
- $ingnore_link = "<a href='{$currentFile}?op=brokendownload.ignore&lid=" . $lid . "' alt='" . _AM_WFD_BROKEN_IGNORE_ALT . "' title='" . _AM_WFD_BROKEN_IGNORE_ALT . "'>" . $imagearray['ignore'] . "</a>";
- $edit_link = "<a href='" . WFDOWNLOADS_URL . "/admin/downloads.php?op=Download&lid=" . $lid . "' alt='" . _AM_WFD_BROKEN_EDIT_ALT . "' title='" . _AM_WFD_BROKEN_EDIT_ALT . "'> " . $imagearray['editimg'] . " </a>";
- $delete_link = "<a href='{$currentFile}?op=brokendownload.delete&lid=" . $lid . "' alt='" . _AM_WFD_BROKEN_DELETE_ALT . "' title='" . _AM_WFD_BROKEN_DELETE_ALT . "'>" . $imagearray['deleteimg'] . "</a>";
- $ack_image = ($reports[$i]->getVar('acknowledged')) ? $imagearray['ack_yes'] : $imagearray['ack_no'];
- $ack_link = "<a href='{$currentFile}?op=updateNotice&lid=" . $lid . "&ack=" . $reports[$i]->getVar('acknowledged') . "' alt='" . _AM_WFD_BROKEN_ACK_ALT . "' title='" . _AM_WFD_BROKEN_ACK_ALT . "'>" . $ack_image . "</a>";
- $con_image = ($reports[$i]->getVar('confirmed')) ? $imagearray['con_yes'] : $imagearray['con_no'];
- $con_link = "<a href='{$currentFile}?op=updateNotice&lid=" . $lid . "&con=" . $reports[$i]->getVar('confirmed') . "' alt='" . _AM_WFD_BROKEN_CONFIRM_ALT . "' title='" . _AM_WFD_BROKEN_CONFIRM_ALT . "'>" . $con_image . " </a>\n";
-
- echo "
- <tr align = 'center'>\n
- <td class = 'head'>" . $reports[$i]->getVar('reportid') . "</td>\n
- <td class = 'even' align = 'left'>$download_link</td>\n
- ";
- if ($senderemail == "") {
- echo "<td class = 'even'>" . $sendername . " (" . $reports[$i]->getVar('ip') . ")";
- } else {
- echo "<td class = 'even'><a href='mailto:" . $senderemail . "'>" . $sendername . "</a> (" . $reports[$i]->getVar('ip') . ")";
- }
- if ($submitteremail == '') {
- echo "<td class = 'even'>" . $submitteruname;
- } else {
- echo "<td class = 'even'><a href='mailto:" . $submitteremail . "'>".$submitteruname."</a>";
- }
- echo "
- </td>\n
- <td class='even' align='center'>" . formatTimestamp($reports[$i]->getVar('date'), $xoopsModuleConfig['dateformat']) . "</td>\n
- <td align='center' class = 'even' nowrap>\n
- $ingnore_link $edit_link $delete_link $ack_link $con_link
- </td></tr>\n
- ";
- }
- }
- echo"</table>";
- include 'admin_footer.php';
-}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-06-12 20:40:21 UTC (rev 11661)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-06-12 21:07:05 UTC (rev 11662)
@@ -193,7 +193,8 @@
$GLOBALS['xoopsTpl']->assign('published_downloads_pagenav', $pagenav->renderNav());
// New Downloads
- $criteria = new Criteria("published", 0);
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria("published", 0));
$criteria->setStart($start_new);
$criteria->setLimit($xoopsModuleConfig['admin_perpage']);
$new_downloads = $download_handler->getObjects($criteria);
@@ -204,6 +205,7 @@
$new_download_array = $new_download->toArray();
$new_download_array['rating'] = number_format($new_download_array['rating'], 2);
$new_download_array['title_html'] = $myts->htmlSpecialChars($new_download_array['title']);
+ $new_download_array['category_title'] = $categories[$published_download_array['cid']]['title'];
$url = urldecode($myts->htmlSpecialChars($new_download_array['url']));
$homepage = $myts->htmlSpecialChars($new_download_array['homepage']);
$version = $myts->htmlSpecialChars($new_download_array['version']);
@@ -219,7 +221,8 @@
$GLOBALS['xoopsTpl']->assign('new_downloads_pagenav', $pagenav->renderNav());
// Auto Published Downloads
- $criteria = new Criteria("published", time(), ">");
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria("published", time(), ">"));
$criteria->setSort("published");
$criteria->setOrder("ASC");
$criteria->setStart($start_auto_published);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php 2013-06-12 20:40:21 UTC (rev 11661)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php 2013-06-12 21:07:05 UTC (rev 11662)
@@ -77,7 +77,7 @@
if ($totalmodrequests > 0) {
$indexAdmin->addInfoBoxLine(
- _AM_WFD_MINDEX_DOWNSUMMARY, "<infolabel>" . '<a href="modifications.php">' . _AM_WFD_SMODREQUEST . '</a><b>'
+ _AM_WFD_MINDEX_DOWNSUMMARY, "<infolabel>" . '<a href="reportsmodifications.php">' . _AM_WFD_SMODREQUEST . '</a><b>'
. "</infolabel>", $totalmodrequests, 'Green'
);
} else {
@@ -88,7 +88,7 @@
if ($totalbrokendownloads > 0) {
$indexAdmin->addInfoBoxLine(
- _AM_WFD_MINDEX_DOWNSUMMARY, "<infolabel>" . '<a href="brokens.php">' . _AM_WFD_SBROKENSUBMIT . '</a><b>'
+ _AM_WFD_MINDEX_DOWNSUMMARY, "<infolabel>" . '<a href="reportsmodifications.php">' . _AM_WFD_SBROKENSUBMIT . '</a><b>'
. "</infolabel>", $totalbrokendownloads, 'Green'
);
} else {
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php 2013-06-12 20:40:21 UTC (rev 11661)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php 2013-06-12 21:07:05 UTC (rev 11662)
@@ -39,22 +39,26 @@
$adminmenu[$i]['link'] = "admin/downloads.php";
$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/download.png';
$i++;
-$adminmenu[$i]['title'] = _MI_WFD_MENU_INDEXPAGE;
-$adminmenu[$i]['link'] = "admin/indexpage.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/index.png';
-$i++;
$adminmenu[$i]['title'] = _MI_WFD_MENU_REVIEWS;
$adminmenu[$i]['link'] = "admin/reviews.php";
$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/translations.png';
$i++;
-$adminmenu[$i]['title'] = _MI_WFD_MENU_BROKENS;
-$adminmenu[$i]['link'] = "admin/brokens.php";
+$adminmenu[$i]['title'] = _MI_WFD_MENU_RATINGS;
+$adminmenu[$i]['link'] = "admin/ratings.php";
+$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/button_ok.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_WFD_MENU_REPORTSMODIFICATIONS;
+$adminmenu[$i]['link'] = "admin/reportsmodifications.php";
$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/alert.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFD_MENU_MIRRORS;
$adminmenu[$i]['link'] = "admin/mirrors.php";
$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/list.png';
$i++;
+$adminmenu[$i]['title'] = _MI_WFD_MENU_INDEXPAGE;
+$adminmenu[$i]['link'] = "admin/indexpage.php";
+$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/index.png';
+$i++;
$adminmenu[$i]['title'] = _MI_WFD_MENU_IMAGES;
$adminmenu[$i]['link'] = "admin/images.php";
$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/photo.png';
@@ -63,10 +67,6 @@
$adminmenu[$i]['link'] = "admin/mimetypes.php";
$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/type.png';
$i++;
-$adminmenu[$i]['title'] = _MI_WFD_MENU_RATINGS;
-$adminmenu[$i]['link'] = "admin/ratings.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/button_ok.png';
-$i++;
$adminmenu[$i]['title'] = _MI_WFD_MENU_PERMISSIONS;
$adminmenu[$i]['link'] = "admin/permissions.php";
$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/permissions.png';
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php 2013-06-12 20:40:21 UTC (rev 11661)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php 2013-06-12 21:07:05 UTC (rev 11662)
@@ -104,7 +104,7 @@
$start_published = wfdownloads_CleanVars($_GET, 'start_published', 0, 'int');
$criteria_waiting = new Criteria("submit", false);
- $num_waiting = $mirror_handler->getCount($criteria_waiting);
+ $waiting_count = $mirror_handler->getCount($criteria_waiting);
$criteria_waiting->setSort("date");
$criteria_waiting->setOrder("DESC");
$criteria_waiting->setLimit($xoopsModuleConfig['admin_perpage']);
@@ -112,17 +112,17 @@
$mirrors_waiting = $mirror_handler->getObjects($criteria_waiting);
$criteria_published = new Criteria("submit", true);
- $num_published = $mirror_handler->getCount($criteria_published);
+ $published_count = $mirror_handler->getCount($criteria_published);
$criteria_published->setSort("date");
$criteria_published->setOrder("DESC");
$criteria_published->setLimit($xoopsModuleConfig['admin_perpage']);
$criteria_published->setStart($start_published);
$mirrors_published = $mirror_handler->getObjects($criteria_published);
- $GLOBALS['xoopsTpl']->assign('mirrors_waiting_count', $num_waiting);
- $GLOBALS['xoopsTpl']->assign('mirrors_published_count', $num_published);
+ $GLOBALS['xoopsTpl']->assign('mirrors_waiting_count', $waiting_count);
+ $GLOBALS['xoopsTpl']->assign('mirrors_published_count', $published_count);
- if ($num_waiting > 0) {
+ if ($waiting_count > 0) {
foreach ($mirrors_waiting as $mirror_waiting) {
$lids_waiting[] = $mirror_waiting->getVar('lid');
$uids_waiting[] = $mirror_waiting->getVar('uid');
@@ -138,11 +138,11 @@
}
//Include page navigation
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav_waiting = new XoopsPageNav($num_waiting, $xoopsModuleConfig['admin_perpage'] , $start_waiting, 'start_waiting');
+ $pagenav_waiting = new XoopsPageNav($waiting_count, $xoopsModuleConfig['admin_perpage'] , $start_waiting, 'start_waiting');
$GLOBALS['xoopsTpl']->assign('mirrors_waiting_pagenav', $pagenav_waiting -> renderNav());
}
- if ($num_published > 0) {
+ if ($published_count > 0) {
foreach ($mirrors_published as $mirror_published) {
$lids_published[] = $mirror_published->getVar('lid');
$uids_published[] = $mirror_published->getVar('uid');
@@ -158,7 +158,7 @@
}
//Include page navigation
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav_published = new XoopsPageNav($num_published, $xoopsModuleConfig['admin_perpage'] , $start_published, 'start_published');
+ $pagenav_published = new XoopsPageNav($published_count, $xoopsModuleConfig['admin_perpage'] , $start_published, 'start_published');
$GLOBALS['xoopsTpl']->assign('mirrors_published_pagenav', $pagenav_published -> renderNav());
}
Deleted: XoopsModules/wfdownloads/trunk/wfdownloads/admin/modifications.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/modifications.php 2013-06-12 20:40:21 UTC (rev 11661)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/modifications.php 2013-06-12 21:07:05 UTC (rev 11662)
@@ -1,309 +0,0 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * WF-Downloads module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
- * @package wfdownload
- * @since 3.23
- * @author Xoops Development Team
- * @version svn:$id$
- */
-$currentFile = basename(__FILE__);
-include 'admin_header.php';
-
-$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : 'modifications.list';
-
-switch ($op) {
- case "listModReqshow":
- wfdownloads_xoops_cp_header();
-
- $requestid = intval($_GET['requestid']);
-
-
- $modification = $modification_handler->get($requestid);
- $download = $download_handler->get($modification->getVar('lid'));
-
- $orig_user = new XoopsUser($download->getVar('submitter'));
- $submittername = XoopsUserUtility::getUnameFromId($download->getVar('submitter')); // $orig_user->getvar("uname");
- $submitteremail = $orig_user->getVar("email");
-
- echo "<div><b>" . _AM_WFD_MOD_MODPOSTER . "</b> $submittername</div>";
- $not_allowed = array("lid", "submitter", "requestid", "modifysubmitter");
-
- $sform = new XoopsThemeForm(_AM_WFD_MOD_ORIGINAL, "storyform", "index.php");
-
- $keys = $download->getVars();
- foreach (array_keys($keys) as $key) {
- if (in_array($key , $not_allowed)) {
- continue;
- }
- $lang_def = constant("_AM_WFD_MOD_" . strtoupper($key));
-
- $content = $download->getVar($key, 'e');
- switch ($key) {
- case "platform":
- case "license":
- case "limitations":
- case "versiontypes":
- $content = $xoopsModuleConfig[$key][$download->getVar($key)];
- break;
-
- case "cid":
- $category_list = $category_handler->getObjects(new Criteria("cid", $download->getVar($key)));
- if (!isset($category_list[0])) {
- continue;
- }
- $content = $category_list[0]->getVar('title', 'e');
- break;
-
- case "screenshot":
- if ($content != "") {
- $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
- }
- break;
-
- case "screenshot2":
- if ($content != "") {
- $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
- }
- break;
-
- case "screenshot3":
- if ($content != "") {
- $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
- }
- break;
-
- case "screenshot4":
- if ($content != "") {
- $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
- }
- break;
-
- case "features":
- case "requirements":
- if ($content != '') {
- $downrequirements = explode('|', trim($content));
- foreach ($downrequirements as $bi) {
- $content = "<li>" . $bi;
- }
- }
- break;
-
- case "dhistory":
- $content = $myts->displayTarea($content, 1, 0, 0, 0, 1);
- break;
- }
- $sform->addElement(new XoopsFormLabel($lang_def, $content));
- }
- $sform->display();
-
- $modify_user = new XoopsUser($modification->getVar('modifysubmitter'));
- $modifyname = XoopsUserUtility::getUnameFromId(intval($modify_user->getVar('uid')));
- $modifyemail = $modify_user->getVar("email");
-
- echo "<div><b>" . _AM_WFD_MOD_MODIFYSUBMITTER . "</b> $modifyname</div>";
- $sform = new XoopsThemeForm(_AM_WFD_MOD_PROPOSED, "storyform", "modifications.php");
- $keys = $modification->getVars();
- foreach (array_keys($keys) as $key) {
- if (in_array($key , $not_allowed)) {
- continue;
- }
- $lang_def = constant("_AM_WFD_MOD_" . strtoupper($key));
-
- $content = $modification->getVar($key, 'e');
- switch ($key) {
- case "platform":
- case "license":
- case "limitations":
- case "versiontypes":
- $content = $xoopsModuleConfig[$key][$modification->getVar($key)];
- break;
-
- case "cid":
- $category_list = $category_handler->getObjects(new Criteria("cid", $modification->getVar($key)));
- if (!isset($category_list[0])) {
- continue;
- }
- $content = $category_list[0]->getVar('title', 'e');
- break;
-
- case "screenshot":
- if ($content != "") {
- $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
- }
- break;
-
- case "screenshot2":
- if ($content != "") {
- $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
- }
- break;
-
- case "screenshot3":
- if ($content != "") {
- $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
- }
- break;
-
- case "screenshot4":
- if ($content != "") {
- $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
- }
- break;
-
- case "features":
- case "requirements":
- if ($content != '') {
- $downrequirements = explode('|', trim($content));
- foreach ($downrequirements as $bi)
- {
- $content = "<li>" . $bi;
- }
- }
- break;
-
- case "dhistory":
- $content = $myts->displayTarea($content, 1, 0, 0, 0, 1);
- break;
- }
- $sform->addElement(new XoopsFormLabel($lang_def, $content));
- }
-
- $button_tray = new XoopsFormElementTray('', '');
- $button_tray->addElement(new XoopsFormHidden('requestid', $requestid));
- $button_tray->addElement(new XoopsFormHidden('lid', intval($modification->getVar('lid'))));
- $hidden = new XoopsFormHidden('op', 'changeModReq');
- $button_tray->addElement($hidden);
- if (!$modification->isNew()) {
- $butt_dup = new XoopsFormButton('', '', _AM_WFD_BAPPROVE, 'submit');
- $butt_dup->setExtra('onclick="this.form.elements.op.value=\'changeModReq\'"');
- $button_tray->addElement($butt_dup);
- }
- $butt_dupct2 = new XoopsFormButton('', '', _AM_WFD_BIGNORE, 'submit');
- $butt_dupct2->setExtra('onclick="this.form.elements.op.value=\'ignoreModReq\'"');
- $button_tray->addElement($butt_dupct2);
- $sform->addElement($button_tray);
- $sform->display();
-
- xoops_cp_footer();
- exit();
- break;
-
- case "changeModReq":
-
- /* 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']);
- $modification_handler = xoops_getmodulehandler('modification');
- $download_handler = xoops_getmodulehandler('download');
-
- $modification = $modification_handler->get($requestid);
- $download = $download_handler->get($modification->getVar('lid'));
-
- if ($modification->getVar('version') == $download->getVar('version')) {
- $raiseModifyEvents = false;
- } else {
- $raiseModifyEvents = true;
- }
- /* end add block */
-
- $modification_handler = xoops_getmodulehandler('modification');
- $modification_handler->approveModification($_POST['requestid']);
-
- $cid = intval($download->getVar('cid'));
- $lid = intval($download->getVar('lid'));
-
- /* 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)
- $notification_handler = &xoops_gethandler('notification');
- $tags = array();
- $tags['FILE_NAME'] = $download->getVar('title');
- $tags['FILE_URL'] = WFDOWNLOADS_URL . '/singlefile.php?cid=' . $cid . '&lid=' . $lid;
- $category_handler = xoops_getmodulehandler('category');
- $category = $category_handler->get($cid);
- $tags['FILE_VERSION'] = $download->getVar('version');
- $tags['CATEGORY_NAME'] = $category->getVar('title');
- $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . '/viewcat.php?cid=' . $cid;
-
- $notification_handler->triggerEvent('global', 0, 'filemodified', $tags);
- $notification_handler->triggerEvent('category', $cid, 'filemodified', $tags);
- $notification_handler->triggerEvent('file', $lid, 'filemodified', $tags);
- }
- /* end add block */
-
- redirect_header(WFDOWNLOADS_URL . '/admin/main.php', 1, _AM_WFD_MOD_REQUPDATED);
- break;
-
- case "ignoreModReq":
- $criteria = new Criteria('requestid', intval($_POST['requestid']));
- $modification_handler = xoops_getmodulehandler('modification');
- $modification_handler->deleteAll($criteria, true);
- redirect_header(WFDOWNLOADS_URL . '/admin/main.php', 1, _AM_WFD_MOD_REQDELETED);
- break;
-
- case "modifications.list" :
- case 'main':
- default:
- $start_modification = wfdownloads_CleanVars($_GET, 'start_modification', 0, 'int');
-
- $criteria = new CriteriaCompo();
- $criteria->setLimit($xoopsModuleConfig['admin_perpage']);
- $criteria->setStart($start_modification);
- $criteria->setSort("requestdate");
- $modifications = $modification_handler->getObjects($criteria);
- $modifications_count = $modification_handler->getCount();
-
- wfdownloads_xoops_cp_header();
- $indexAdmin = new ModuleAdmin();
- echo $indexAdmin->addNavigation('modifications.php');
- echo "
- <fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFD_MOD_MODREQUESTSINFO . "</legend>\n
- <div style='padding: 8px;'>" . _AM_WFD_MOD_TOTMODREQUESTS . " <b>$modifications_count</></div>\n
- </fieldset><br />\n
-
- <table width='100%' cellspacing='1' cellpadding='2' border='0' class='outer'>\n
- <tr>\n
- <th align='center'><b>" . _AM_WFD_MOD_MODID . "</b></th>\n
- <th><b>" . _AM_WFD_MOD_MODTITLE . "</b></th>\n
- <th align='center'><b>" . _AM_WFD_MOD_MODIFYSUBMIT . "</b></th>\n
- <th align='center'><b>" . _AM_WFD_MOD_DATE . "</b></th>\n
- <th align='center'><b>" . _AM_WFD_MINDEX_ACTION . "</b></th>\n
- </tr>\n";
- if ($modifications_count > 0) {
- foreach ($modifications as $modification) {
- $submitter = XoopsUserUtility::getUnameFromId($modification->getVar('modifysubmitter'));
- $requestdate = formatTimestamp($modification->getVar('requestdate'), $xoopsModuleConfig['dateformat']);
- echo "
- <tr>\n
- <td class='head' align='center'>" . intval($modification->getVar('requestid')) . "</td>\n
- <td class='even'>" . $modification->getVar('title') . "</td>\n
- <td class='even' align='center'>" . $submitter . "</td>\n
- <td class='even' align='center'>" . $requestdate . "</td>\n
- <td class='even' align='center'> <a href='" . WFDOWNLOADS_URL . "/admin/modifications.php?op=listModReqshow&requestid=" . intval($modification->getVar('requestid')). "'>"._AM_WFD_MOD_VIEW."</a></td>\n
- </tr>\n";
- }
- } else {
- echo "<tr><td class='head' align='center' colspan='7'>" . _AM_WFD_MOD_NOMODREQUEST . "</td></tr>";
- }
- echo "</table>\n";
-
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $page = ($modifications_count > $xoopsModuleConfig['admin_perpage']) ? _AM_WFD_MINDEX_PAGE : '';
- $pagenav = new XoopsPageNav($modifications_count, $xoopsModuleConfig['admin_perpage'], $start_modification, 'start_modification');
- echo "<div align='right' style='padding: 8px;'>" . $page . '' . $pagenav->renderNav() . '</div>';
- include_once "admin_footer.php";
-}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php 2013-06-12 20:40:21 UTC (rev 11661)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php 2013-06-12 21:07:05 UTC (rev 11662)
@@ -40,12 +40,13 @@
$uservotes = '0';
$criteria = new CriteriaCompo();
+ $votes = $rating_handler->getCount($criteria);
+ $ratings_count = $rating_handler->getCount($criteria);
$criteria->setSort('ratingtimestamp');
$criteria->setOrder("DESC");
$criteria->setStart($start);;
$criteria->setLimit(20);
$ratings = $rating_handler->getObjects($criteria);
- $votes = count($ratings);
$useravgrating = $rating_handler->getUserAverage();
$useravgrating = number_format($useravgrating["avg"], 2);
@@ -55,9 +56,9 @@
echo $indexAdmin->addNavigation($currentFile);
$GLOBALS['xoopsTpl']->assign('votes', $votes);
- $GLOBALS['xoopsTpl']->assign('votes', $votes);
+ $GLOBALS['xoopsTpl']->assign('ratings_count', $ratings_count);
$GLOBALS['xoopsTpl']->assign('useravgrating', $useravgrating);
- if ($votes > 0) {
+ if ($ratings_count > 0) {
foreach ($ratings as $rating) {
$lids[] = $rating->getVar('lid');
}
@@ -73,7 +74,7 @@
}
//Include page navigation
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $ratings_pagenav = new XoopsPageNav($votes, $xoopsModuleConfig['admin_perpage'], $start, 'start');
+ $ratings_pagenav = new XoopsPageNav($ratings_count, $xoopsModuleConfig['admin_perpage'], $start, 'start');
$GLOBALS['xoopsTpl']->assign('ratings_pagenav', $ratings_pagenav->renderNav());
$GLOBALS['xoopsTpl']->display("db:" . $xoopsModule->dirname() . "_admin_ratingslist.html");
Added: XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php (rev 0)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2013-06-12 21:07:05 UTC (rev 11662)
@@ -0,0 +1,372 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * WF-Downloads module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package wfdownload
+ * @since 3.23
+ * @author Xoops Development Team
+ * @version svn:$id$
+ */
+$currentFile = basename(__FILE__);
+include 'admin_header.php';
+
+$op = wfdownloads_CleanVars($_REQUEST, 'op', 'reports.modifications.list', 'string');
+
+switch ($op) {
+ case "reports.update":
+ $lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
+ $criteria = new Criteria('lid', $lid);
+ if (isset($_GET['ack'])) {
+ $acknowledged = (isset($_GET['ack']) && $_GET['ack'] == 0) ? 1 : 0;
+ $report_handler->updateAll("acknowledged", $acknowledged, $criteria, true);
+ $update_mess = _AM_WFD_BROKEN_NOWACK;
+ }
+ if (isset($_GET['con'])) {
+ $confirmed = (isset($_GET['con']) && $_GET['con'] == 0) ? 1 : 0;
+ $report_handler->updateAll("confirmed", $confirmed, $criteria, true);
+ $update_mess = _AM_WFD_BROKEN_NOWCON;
+ }
+ redirect_header($currentFile, 1, $update_mess);
+ break;
+
+ case "report.delete" :
+ $lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
+ $criteria = new Criteria('lid', $lid);
+ $report_handler = xoops_getmodulehandler('report');
+ $report = $report_handler->getObjects($criteria);
+ if (isset($report[0])) {
+ $report_handler->delete($report[0], true);
+ }
+ $download_handler = xoops_getmodulehandler('download');
+ $download = $download_handler->get($lid);
+ $download_handler->delete($download, true);
+ redirect_header($currentFile, 1, _AM_WFD_BROKENFILEDELETED);
+ break;
+
+ case "report.ignore" :
+ $lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
+ $criteria = new Criteria('lid', $lid);
+ $report_handler = xoops_getmodulehandler('report');
+ $report = $report_handler->getObjects($criteria);
+ if (isset($report[0])) {
+ $report_handler->delete($report[0], true);
+ }
+ redirect_header($currentFile, 1, _AM_WFD_BROKEN_FILEIGNORED);
+ break;
+
+ case "modification.show" :
+ wfdownloads_xoops_cp_header();
+
+ $requestid = intval($_GET['requestid']);
+
+ $modification = $modification_handler->get($requestid);
+ $download = $download_handler->get($modification->getVar('lid'));
+
+ $orig_user = new XoopsUser($download->getVar('submitter'));
+ $submittername = XoopsUserUtility::getUnameFromId($download->getVar('submitter')); // $orig_user->getvar("uname");
+ $submitteremail = $orig_user->getVar("email");
+
+ echo "<div><b>" . _AM_WFD_MOD_MODPOSTER . "</b> $submittername</div>";
+ $not_allowed = array("lid", "submitter", "requestid", "modifysubmitter");
+
+ $sform = new XoopsThemeForm(_AM_WFD_MOD_ORIGINAL, "storyform", "index.php");
+
+ $keys = $download->getVars();
+ foreach (array_keys($keys) as $key) {
+ if (in_array($key , $not_allowed)) {
+ continue;
+ }
+ $lang_def = constant("_AM_WFD_MOD_" . strtoupper($key));
+
+ $content = $download->getVar($key, 'e');
+ switch ($key) {
+ case "platform":
+ case "license":
+ case "limitations":
+ case "versiontypes":
+ $content = $xoopsModuleConfig[$key][$download->getVar($key)];
+ break;
+ case "cid":
+ $category_list = $category_handler->getObjects(new Criteria("cid", $download->getVar($key)));
+ if (!isset($category_list[0])) {
+ continue;
+ }
+ $content = $category_list[0]->getVar('title', 'e');
+ break;
+ case "screenshot":
+ if ($content != "") {
+ $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
+ }
+ break;
+ case "screenshot2":
+ if ($content != "") {
+ $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
+ }
+ break;
+ case "screenshot3":
+ if ($content != "") {
+ $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
+ }
+ break;
+ case "screenshot4":
+ if ($content != "") {
+ $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
+ }
+ break;
+ case "features":
+ case "requirements":
+ if ($content != '') {
+ $downrequirements = explode('|', trim($content));
+ foreach ($downrequirements as $bi) {
+ $content = "<li>" . $bi;
+ }
+ }
+ break;
+ case "dhistory":
+ $content = $myts->displayTarea($content, 1, 0, 0, 0, 1);
+ break;
+ }
+ $sform->addElement(new XoopsFormLabel($lang_def, $content));
+ }
+ $sform->display();
+
+ $modify_user = new XoopsUser($modification->getVar('modifysubmitter'));
+ $modifyname = XoopsUserUtility::getUnameFromId(intval($modify_user->getVar('uid')));
+ $modifyemail = $modify_user->getVar("email");
+
+ echo "<div><b>" . _AM_WFD_MOD_MODIFYSUBMITTER . "</b> $modifyname</div>";
+ $sform = new XoopsThemeForm(_AM_WFD_MOD_PROPOSED, "storyform", "reportsmodifications.php");
+ $keys = $modification->getVars();
+ foreach (array_keys($keys) as $key) {
+ if (in_array($key , $not_allowed)) {
+ continue;
+ }
+ $lang_def = constant("_AM_WFD_MOD_" . strtoupper($key));
+
+ $content = $modification->getVar($key, 'e');
+ switch ($key) {
+ case "platform":
+ case "license":
+ case "limitations":
+ case "versiontypes":
+ $content = $xoopsModuleConfig[$key][$modification->getVar($key)];
+ break;
+ case "cid":
+ $category_list = $category_handler->getObjects(new Criteria("cid", $modification->getVar($key)));
+ if (!isset($category_list[0])) {
+ continue;
+ }
+ $content = $category_list[0]->getVar('title', 'e');
+ break;
+ case "screenshot":
+ if ($content != "") {
+ $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
+ }
+ break;
+ case "screenshot2":
+ if ($content != "") {
+ $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
+ }
+ break;
+ case "screenshot3":
+ if ($content != "") {
+ $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
+ }
+ break;
+ case "screenshot4":
+ if ($content != "") {
+ $content = "<img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['screenshots'] . "/" . $content . "' width='" . $xoopsModuleConfig['shotwidth'] . "' alt='' title='' />";
+ }
+ break;
+ case "features":
+ case "requirements":
+ if ($content != '') {
+ $downrequirements = explode('|', trim($content));
+ foreach ($downrequirements as $bi) {
+ $content = "<li>" . $bi;
+ }
+ }
+ break;
+ case "dhistory":
+ $content = $myts->displayTarea($content, 1, 0, 0, 0, 1);
+ break;
+ }
+ $sform->addElement(new XoopsFormLabel($lang_def, $content));
+ }
+
+ $button_tray = new XoopsFormElementTray('', '');
+ $button_tray->addElement(new XoopsFormHidden('requestid', $requestid));
+ $button_tray->addElement(new XoopsFormHidden('lid', intval($modification->getVar('lid'))));
+ $hidden = new XoopsFormHidden('op', 'modification.change');
+ $button_tray->addElement($hidden);
+ if (!$modification->isNew()) {
+ $butt_dup = new XoopsFormButton('', '', _AM_WFD_BAPPROVE, 'submit');
+ $butt_dup->setExtra('onclick="this.form.elements.op.value=\'modification.change\'"');
+ $button_tray->addElement($butt_dup);
+ }
+ $butt_dupct2 = new XoopsFormButton('', '', _AM_WFD_BIGNORE, 'submit');
+ $butt_dupct2->setExtra('onclick="this.form.elements.op.value=\'modification.ignore\'"');
+ $button_tray->addElement($butt_dupct2);
+ $sform->addElement($button_tray);
+ $sform->display();
+
+ xoops_cp_footer();
+ exit();
+ break;
+
+ 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']);
+
+ $modification = $modification_handler->get($requestid);
+ $download = $download_handler->get($modification->getVar('lid'));
+
+ if ($modification->getVar('version') == $download->getVar('version')) {
+ $raiseModifyEvents = false;
+ } else {
+ $raiseModifyEvents = true;
+ }
+ /* end add block */
+
+ $modification_handler->approveModification($_POST['requestid']);
+
+ $cid = intval($download->getVar('cid'));
+ $lid = intval($download->getVar('lid'));
+
+ /* 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;
+ $category = $category_handler->get($cid);
+ $tags['FILE_VERSION'] = $download->getVar('version');
+ $tags['CATEGORY_NAME'] = $category->getVar('title');
+ $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . '/viewcat.php?cid=' . $cid;
+
+ $notification_handler->triggerEvent('global', 0, 'filemodified', $tags);
+ $notification_handler->triggerEvent('category', $cid, 'filemodified', $tags);
+ $notification_handler->triggerEvent('file', $lid, 'filemodified', $tags);
+ }
+ /* end add block */
+
+ redirect_header(WFDOWNLOADS_URL . '/admin/main.php', 1, _AM_WFD_MOD_REQUPDATED);
+ break;
+
+ case "modification.ignore":
+ $criteria = new Criteria('requestid', intval($_POST['requestid']));
+ $modification_handler->deleteAll($criteria, true);
+ redirect_header(WFDOWNLOADS_URL . '/admin/main.php', 1, _AM_WFD_MOD_REQDELETED);
+ break;
+
+ case "reports.modifications.list" :
+ default:
+ $start_report = wfdownloads_CleanVars($_GET, 'start_report', 0, 'int');
+
+ $criteria = new CriteriaCompo();
+ $reports_count = $report_handler->getCount();
+ $criteria->setSort("date");
+ $criteria->setOrder("DESC");
+ $criteria->setLimit($xoopsModuleConfig['admin_perpage']);
+ $criteria->setStart($start_report);
+ $reports = $report_handler->getObjects($criteria);
+
+ wfdownloads_xoops_cp_header();
+ $indexAdmin = new ModuleAdmin();
+ echo $indexAdmin->addNavigation($currentFile);
+
+ $GLOBALS['xoopsTpl']->assign('reports_count', $reports_count);
+
+ if ($reports_count > 0) {
+ foreach (array_keys($reports) as $i) {
+ $lids[] = $reports[$i]->getVar('lid');
+ $uids[] = $reports[$i]->getVar('sender');
+ }
+ $downloads = $download_handler->getObjects(new Criteria('lid', "(".implode(',', array_unique($lids)).")", "IN"), true);
+ foreach (array_keys($downloads) as $i) {
+ $uids[] = $downloads[$i]->getVar('submitter');
+ }
+ $users = $member_handler->getUsers(new Criteria("uid", "(" . implode(',', array_unique($uids)) . ")", "IN"), true);
+
+ foreach ($reports as $report) {
+ $report_array = $report->toArray();
+ // Does the download exists ?
+ if (isset($downloads[$report->getVar('lid')])) {
+ $download = $downloads[$report->getVar('lid')];
+ $report_array['download_lid'] = $download->getVar('title');
+ $report_array['download_cid'] = $download->getVar('cid');
+ $report_array['download_title'] = $download->getVar('lid');
+ $submitter = isset($users[$downloads[$report->getVar('lid')]->getVar('submitter')]) ? $users[$downloads[$report->getVar('lid')]->getVar('submitter')] : false;
+ $report_array['submitter_email'] = is_object($submitter) ? $submitter->getVar('email') : '';
+ $report_array['submitter_uname'] = is_object($submitter) ? $submitter->getVar('uname') : $xoopsConfig['anonymous'];
+ } else {
+ $report_array['download_lid'] = false;
+ $download_link = _AM_WFD_BROKEN_DOWNLOAD_DONT_EXISTS;
+ $report_array['submitter_email'] = '';
+ $report_array['submitter_uname'] = $xoopsConfig['anonymous'];
+ }
+ $sender = isset($users[$report->getVar('sender')]) ? $users[$report->getVar('sender')] : "";
+ $report_array['sender_email'] = isset($users[$report->getVar('sender')]) ? $users[$report->getVar('sender')]->getVar('email') : "";
+ $report_array['sender_uname'] = isset($users[$report->getVar('sender')]) ? $users[$report->getVar('sender')]->getVar('uname') : $xoopsConfig['anonymous'];
+ $report_array['formatted_date'] = formatTimestamp($report->getVar('date'), _DATESTRING);
+ $GLOBALS['xoopsTpl']->append('reports', $report_array);
+ }
+ //Include page navigation
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav_report = new XoopsPageNav($reports_count, $xoopsModuleConfig['admin_perpage'] , $start_report, 'start_report');
+ $GLOBALS['xoopsTpl']->assign('reports_pagenav', $pagenav_report -> renderNav());
+ }
+
+ $start_modification = wfdownloads_CleanVars($_GET, 'start_modification', 0, 'int');
+
+ $modifications_count = $modification_handler->getCount();
+ $criteria = new CriteriaCompo();
+ $criteria->setLimit($xoopsModuleConfig['admin_perpage']);
+ $criteria->setStart($start_modification);
+ $criteria->setSort("requestdate");
+ $modifications = $modification_handler->getObjects($criteria);
+
+ $GLOBALS['xoopsTpl']->assign('modifications_count', $modifications_count);
+
+ if ($modifications_count > 0) {
+ foreach ($modifications as $modification) {
+ $modification_array = $modification->toArray();
+ $modification_array['submitter_uname'] = XoopsUserUtility::getUnameFromId($modification->getVar('modifysubmitter'));
+ $modification_array['formatted_date'] = formatTimestamp($modification->getVar('requestdate'), _DATESTRING);
+ $GLOBALS['xoopsTpl']->append('modifications', $modification_array);
+ }
+ //Include page navigation
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav_modification = new XoopsPageNav($modifications_count, $xoopsModuleConfig['admin_perpage'] , $start_modification, 'start_modification');
+ $GLOBALS['xoopsTpl']->assign('modifications_pagenav', $pagenav_modification -> renderNav());
+ }
+
+
+
+
+
+
+
+
+
+
+ $GLOBALS['xoopsTpl']->display("db:" . $xoopsModule->dirname() . "_admin_reportsmodificationslist.html");
+
+ include_once "admin_footer.php";
+ break;
+}
\ No newline at end of file
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php 2013-06-12 20:40:21 UTC (rev 11661)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php 2013-06-12 21:07:05 UTC (rev 11662)
@@ -100,7 +100,7 @@
$start_published = wfdownloads_CleanVars($_GET, 'start_published', 0, 'int');
$criteria_waiting = new Criteria("submit", false);
- $num_waiting = $review_handler->getCount($criteria_waiting);
+ $waiting_count = $review_handler->getCount();
$criteria_waiting->setSort("date");
$criteria_waiting->setOrder("DESC");
$criteria_waiting->setLimit($xoopsModuleConfig['admin_perpage']);
@@ -108,7 +108,7 @@
$reviews_waiting = $review_handler->getObjects($criteria_waiting);
$criteria_published = new Criteria("submit", true);
- $num_published = $review_handler->getCount($criteria_published);
+ $published_count = $review_handler->getCount();
$criteria_published->s...
[truncated message content] |