|
From: <luc...@us...> - 2014-07-25 17:45:52
|
Revision: 12726
http://sourceforge.net/p/xoops/svn/12726
Author: luciorota
Date: 2014-07-25 17:45:37 +0000 (Fri, 25 Jul 2014)
Log Message:
-----------
fix folder error,
it is possible that I am becoming stupid?
Removed Paths:
-------------
XoopsModules/wfdownloads/trunk/admin/
XoopsModules/wfdownloads/trunk/assets/
XoopsModules/wfdownloads/trunk/blocks/
XoopsModules/wfdownloads/trunk/brokenfile.php
XoopsModules/wfdownloads/trunk/class/
XoopsModules/wfdownloads/trunk/comment_delete.php
XoopsModules/wfdownloads/trunk/comment_edit.php
XoopsModules/wfdownloads/trunk/comment_new.php
XoopsModules/wfdownloads/trunk/comment_post.php
XoopsModules/wfdownloads/trunk/comment_reply.php
XoopsModules/wfdownloads/trunk/docs/
XoopsModules/wfdownloads/trunk/footer.php
XoopsModules/wfdownloads/trunk/header.php
XoopsModules/wfdownloads/trunk/include/
XoopsModules/wfdownloads/trunk/index.html
XoopsModules/wfdownloads/trunk/index.php
XoopsModules/wfdownloads/trunk/language/
XoopsModules/wfdownloads/trunk/mirror.php
XoopsModules/wfdownloads/trunk/newlist.php
XoopsModules/wfdownloads/trunk/notification_update.php
XoopsModules/wfdownloads/trunk/ratefile.php
XoopsModules/wfdownloads/trunk/review.php
XoopsModules/wfdownloads/trunk/rss.php
XoopsModules/wfdownloads/trunk/singlefile.php
XoopsModules/wfdownloads/trunk/sql/
XoopsModules/wfdownloads/trunk/submit.php
XoopsModules/wfdownloads/trunk/templates/
XoopsModules/wfdownloads/trunk/topten.php
XoopsModules/wfdownloads/trunk/uploads/
XoopsModules/wfdownloads/trunk/viewcat.php
XoopsModules/wfdownloads/trunk/visit.php
XoopsModules/wfdownloads/trunk/xoops_version.php
Deleted: XoopsModules/wfdownloads/trunk/brokenfile.php
===================================================================
--- XoopsModules/wfdownloads/trunk/brokenfile.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/brokenfile.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,195 +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.
- */
-/**
- * Wfdownloads 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 'header.php';
-
-$lid = WfdownloadsRequest::getInt('lid', 0);
-$downloadObj = $wfdownloads->getHandler('download')->get($lid);
-if (empty($downloadObj)) {
- redirect_header('index.php', 3, _CO_WFDOWNLOADS_ERROR_NODOWNLOAD);
-}
-$cid = WfdownloadsRequest::getInt('cid', $downloadObj->getVar('cid'));
-$categoryObj = $wfdownloads->getHandler('category')->get($cid);
-if (empty($categoryObj)) {
- redirect_header('index.php', 3, _CO_WFDOWNLOADS_ERROR_NOCATEGORY);
-}
-
-// Download not published, expired or taken offline - redirect
-if (
- $downloadObj->getVar('published') == 0 ||
- $downloadObj->getVar('published') > time() ||
- $downloadObj->getVar('offline') == true ||
- ($downloadObj->getVar('expired') == true && $downloadObj->getVar('expired') < time()) ||
- $downloadObj->getVar('status') == _WFDOWNLOADS_STATUS_WAITING) {
- redirect_header('index.php', 3, _MD_WFDOWNLOADS_NODOWNLOAD);
-}
-
-// Check permissions
-if ($wfdownloads->getConfig('enable_brokenreports') == false && !wfdownloads_userIsAdmin()) {
- redirect_header('index.php', 3, _NOPERM);
-}
-
-// Breadcrumb
-include_once XOOPS_ROOT_PATH . "/class/tree.php";
-$categoriesTree = new XoopsObjectTree($wfdownloads->getHandler('category')->getObjects(), 'cid', 'pid');
-$breadcrumb = new WfdownloadsBreadcrumb();
-$breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
-foreach (array_reverse($categoriesTree->getAllParent($cid)) as $parentCategory) {
- $breadcrumb->addLink($parentCategory->getVar('title'), "viewcat.php?cid=" . $parentCategory->getVar('cid'));
-}
-$breadcrumb->addLink($categoryObj->getVar('title'), "viewcat.php?cid={$cid}");
-$breadcrumb->addLink($downloadObj->getVar('title'), "singlefile.php?lid={$lid}");
-
-
-$op = WfdownloadsRequest::getString('op', 'report.add');
-switch ($op) {
- case "report.add" :
- default :
- // Get report sender 'uid'
- $senderUid = is_object($xoopsUser) ? (int) $xoopsUser->getVar('uid') : 0;
- $senderIp = getenv('REMOTE_ADDR');
-
- if (!empty($_POST['submit'])) {
- // Check if REG user is trying to report twice
- $criteria = new Criteria('lid', $lid);
- $reportsCount = $wfdownloads->getHandler('report')->getCount($criteria);
- if ($reportsCount > 0) {
- redirect_header('index.php', 2, _MD_WFDOWNLOADS_ALREADYREPORTED);
- } else {
- $reportObj = $wfdownloads->getHandler('report')->create();
- $reportObj->setVar('lid', $lid);
- $reportObj->setVar('sender', $senderUid);
- $reportObj->setVar('ip', $senderIp);
- $reportObj->setVar('date', time());
- $reportObj->setVar('confirmed', 0);
- $reportObj->setVar('acknowledged', 0);
- if ($wfdownloads->getHandler('report')->insert($reportObj)) {
- // All is well
- // Send notification
- $tags = array();
- $tags['BROKENREPORTS_URL'] = WFDOWNLOADS_URL . '/admin/reportsmodifications.php?op=reports.modifications.list';
- $notification_handler->triggerEvent('global', 0, 'file_broken', $tags);
-
- // Send email to the owner of the download stating that it is broken
- $user = $member_handler->getUser($downloadObj->getVar('submitter'));
- $subdate = formatTimestamp($downloadObj->getVar('published'), $wfdownloads->getConfig('dateformat'));
- $cid = $downloadObj->getVar('cid');
- $title = $downloadObj->getVar('title');
- $subject = _MD_WFDOWNLOADS_BROKENREPORTED;
-
- $xoopsMailer = & getMailer();
- $xoopsMailer->useMail();
- $template_dir = WFDOWNLOADS_ROOT_PATH . "/language/" . $xoopsConfig['language'] . "/mail_template";
-
- $xoopsMailer->setTemplateDir($template_dir);
- $xoopsMailer->setTemplate('filebroken_notify.tpl');
- $xoopsMailer->setToEmails($user->email());
- $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
- $xoopsMailer->setFromName($xoopsConfig['sitename']);
- $xoopsMailer->assign("X_UNAME", $user->uname());
- $xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']);
- $xoopsMailer->assign("X_ADMINMAIL", $xoopsConfig['adminmail']);
- $xoopsMailer->assign('X_SITEURL', XOOPS_URL . '/');
- $xoopsMailer->assign("X_TITLE", $title);
- $xoopsMailer->assign("X_SUB_DATE", $subdate);
- $xoopsMailer->assign('X_DOWNLOAD', WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$lid}");
- $xoopsMailer->setSubject($subject);
- $xoopsMailer->send();
- redirect_header('index.php', 2, _MD_WFDOWNLOADS_BROKENREPORTED);
- exit();
- } else {
- echo $reportObj->getHtmlErrors();
- }
- }
- } else {
- $xoopsOption['template_main'] = "{$wfdownloads->getModule()->dirname()}_brokenfile.tpl";
- include XOOPS_ROOT_PATH . '/header.php';
-
- // Begin Main page Heading etc
- $catarray['imageheader'] = wfdownloads_headerImage();
- $xoopsTpl->assign('catarray', $catarray);
-
- $xoTheme->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js');
- $xoTheme->addScript(WFDOWNLOADS_URL . '/assets/js/magnific/jquery.magnific-popup.min.js');
- $xoTheme->addStylesheet(WFDOWNLOADS_URL . '/assets/js/magnific/magnific-popup.css');
- $xoTheme->addStylesheet(WFDOWNLOADS_URL . '/assets/css/module.css');
-
- $xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL . '/');
-
- // Breadcrumb
- $breadcrumb->addLink(_MD_WFDOWNLOADS_REPORTBROKEN, '');
- $xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
-
- // Generate form
- include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
- $sform = new XoopsThemeForm(_MD_WFDOWNLOADS_RATETHISFILE, 'reportform', xoops_getenv('PHP_SELF'));
- $sform->addElement(new XoopsFormHidden('lid', $lid));
- $sform->addElement(new XoopsFormHidden('cid', $cid));
- $sform->addElement(new XoopsFormHidden('uid', $senderUid));
- $button_tray = new XoopsFormElementTray('', '');
- $submit_button = new XoopsFormButton('', 'submit', _MD_WFDOWNLOADS_SUBMITBROKEN, 'submit');
- $button_tray->addElement($submit_button);
- $cancel_button = new XoopsFormButton('', '', _CANCEL, 'button');
- $cancel_button->setExtra('onclick="history.go(-1)"');
- $button_tray->addElement($cancel_button);
- $sform->addElement($button_tray);
- $xoopsTpl->assign('reportform', $sform->render());
- $xoopsTpl->assign(
- 'download',
- array('lid' => $lid, 'cid' => $cid, 'title' => $downloadObj->getVar('title'), 'description' => $downloadObj->getVar('description'))
- );
-
- $criteria = new Criteria('lid', $lid);
- $reportObjs = $wfdownloads->getHandler('report')->getObjects($criteria);
-
- if (count($reportObjs) > 0) {
- $reportObj = $reportObjs[0];
-
- $broken['title'] = trim($downloadObj->getVar('title'));
- $broken['id'] = $reportObj->getVar('reportid');
- $broken['reporter'] = XoopsUserUtility::getUnameFromId((int) $reportObj->getVar('sender'));
- $broken['date'] = formatTimestamp($reportObj->getVar('published'), $wfdownloads->getConfig('dateformat'));
- $broken['acknowledged'] = ($reportObj->getVar('acknowledged') == 1) ? _YES : _NO;
- $broken['confirmed'] = ($reportObj->getVar('confirmed') == 1) ? _YES : _NO;
-
- $xoopsTpl->assign('brokenreportexists', true);
- $xoopsTpl->assign('broken', $broken);
- $xoopsTpl->assign('brokenreport', true); // this definition is not removed for backward compatibility issues
- } else {
- // file info
- $down['title'] = trim($downloadObj->getVar('title'));
- $down['homepage'] = $myts->makeClickable(formatURL(trim($downloadObj->getVar('homepage'))));
- $time = ($downloadObj->getVar('updated') != false) ? $downloadObj->getVar('updated') : $downloadObj->getVar('published');
- $down['updated'] = formatTimestamp($time, $wfdownloads->getConfig('dateformat'));
- $is_updated = ($downloadObj->getVar('updated') != false) ? _MD_WFDOWNLOADS_UPDATEDON : _MD_WFDOWNLOADS_SUBMITDATE;
- $down['publisher'] = XoopsUserUtility::getUnameFromId((int) $downloadObj->getVar('submitter'));
-
- $xoopsTpl->assign('brokenreportexists', false);
- $xoopsTpl->assign('file_id', $lid);
- $xoopsTpl->assign('lang_subdate', $is_updated);
- $xoopsTpl->assign('is_updated', $downloadObj->getVar('updated'));
- $xoopsTpl->assign('lid', $lid);
- $xoopsTpl->assign('down', $down);
- }
- include 'footer.php';
- }
- break;
-}
Deleted: XoopsModules/wfdownloads/trunk/comment_delete.php
===================================================================
--- XoopsModules/wfdownloads/trunk/comment_delete.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/comment_delete.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,22 +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.
- */
-/**
- * Wfdownloads 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$
- */
-include '../../mainfile.php';
-include XOOPS_ROOT_PATH . '/include/comment_delete.php';
Deleted: XoopsModules/wfdownloads/trunk/comment_edit.php
===================================================================
--- XoopsModules/wfdownloads/trunk/comment_edit.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/comment_edit.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,22 +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.
- */
-/**
- * Wfdownloads 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$
- */
-include '../../mainfile.php';
-include XOOPS_ROOT_PATH . '/include/comment_edit.php';
Deleted: XoopsModules/wfdownloads/trunk/comment_new.php
===================================================================
--- XoopsModules/wfdownloads/trunk/comment_new.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/comment_new.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,30 +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.
- */
-/**
- * Wfdownloads 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 'header.php';
-
-$com_itemid = WfdownloadsRequest::getInt('com_itemid', 0);
-if ($com_itemid > 0) {
- // Get file title
- $download = $wfdownloads->getHandler('download')->get($com_itemid);
- $com_replytitle = $download->getVar('title');
- include XOOPS_ROOT_PATH . '/include/comment_new.php';
-}
Deleted: XoopsModules/wfdownloads/trunk/comment_post.php
===================================================================
--- XoopsModules/wfdownloads/trunk/comment_post.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/comment_post.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,22 +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.
- */
-/**
- * Wfdownloads 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$
- */
-include '../../mainfile.php';
-include XOOPS_ROOT_PATH . '/include/comment_post.php';
Deleted: XoopsModules/wfdownloads/trunk/comment_reply.php
===================================================================
--- XoopsModules/wfdownloads/trunk/comment_reply.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/comment_reply.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,22 +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.
- */
-/**
- * Wfdownloads 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$
- */
-include '../../mainfile.php';
-include XOOPS_ROOT_PATH . '/include/comment_reply.php';
Deleted: XoopsModules/wfdownloads/trunk/footer.php
===================================================================
--- XoopsModules/wfdownloads/trunk/footer.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/footer.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,32 +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.
- */
-/**
- * Wfdownloads 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$
- */
-// Module info/menu
-$moduleInfo = $wfdownloads->getModule()->getInfo();
-//$xoopsTpl->assign('wfdownloadModuleInfo', $moduleInfo); // huge array but useful?
-$xoopsTpl->assign('wfdownloadModuleInfoSub', $moduleInfo['sub']);
-// Module admin
-$xoopsTpl->assign("isAdmin", $wfdownloads_isAdmin);
-$xoopsTpl->assign("wfdownloads_adminpage", "<a href='" . WFDOWNLOADS_URL . "/admin/index.php'>" . _MD_WFDOWNLOADS_ADMIN_PAGE . "</a>");
-// Extra info
-$xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL . '/'); // this definition is not removed for backward compatibility issues
-$xoopsTpl->assign("ref_smartfactory","WFDownloads is developed by The SmartFactory (http://www.smartfactory.ca), a division of InBox Solutions (http://www.inboxsolutions.net)");
-
-include_once XOOPS_ROOT_PATH . '/footer.php';
Deleted: XoopsModules/wfdownloads/trunk/header.php
===================================================================
--- XoopsModules/wfdownloads/trunk/header.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/header.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,26 +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.
- */
-/**
- * Wfdownloads 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$
- */
-include_once dirname(dirname(dirname(__FILE__))) . '/mainfile.php';
-include_once dirname(__FILE__) . '/include/common.php';
-
-// uncomment the below line only if you are using Protector 3.x module
-// and you trust your users when uploading files, it is recommended to not allow anonymous uploads if you do so!!
-//define('PROTECTOR_SKIP_FILESCHECKER', true);
Deleted: XoopsModules/wfdownloads/trunk/index.html
===================================================================
--- XoopsModules/wfdownloads/trunk/index.html 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/index.html 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1 +0,0 @@
-<script>history.go(-1);</script>
\ No newline at end of file
Deleted: XoopsModules/wfdownloads/trunk/index.php
===================================================================
--- XoopsModules/wfdownloads/trunk/index.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/index.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,305 +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.
- */
-/**
- * Wfdownloads 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 = pathinfo(__FILE__, PATHINFO_BASENAME);
-include 'header.php';
-
-// Check directories
-if (!is_dir($wfdownloads->getConfig('uploaddir'))) {
- redirect_header(XOOPS_URL, 4, _MD_WFDOWNLOADS_ERROR_UPLOADDIRNOTEXISTS);
- exit();
-}
-if (!is_dir(XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('mainimagedir'))) {
- redirect_header(XOOPS_URL, 4, _MD_WFDOWNLOADS_ERROR_MAINIMAGEDIRNOTEXISTS);
- exit();
-}
-if (!is_dir(XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('screenshots'))) {
- redirect_header(XOOPS_URL, 4, _MD_WFDOWNLOADS_ERROR_SCREENSHOTSDIRNOTEXISTS);
- exit();
-}
-if (!is_dir(XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('catimage'))) {
- redirect_header(XOOPS_URL, 4, _MD_WFDOWNLOADS_ERROR_CATIMAGEDIRNOTEXISTS);
- exit();
-}
-
-$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
-
-// Check if submission is allowed
-$isSubmissionAllowed = false;
-if (is_object($xoopsUser)
- && ($wfdownloads->getConfig('submissions') == _WFDOWNLOADS_SUBMISSIONS_DOWNLOAD
- || $wfdownloads->getConfig('submissions') == _WFDOWNLOADS_SUBMISSIONS_BOTH)
-) {
- // if user is a registered user
- $groups = $xoopsUser->getGroups();
- if (count(array_intersect($wfdownloads->getConfig('submitarts'), $groups)) > 0) {
- $isSubmissionAllowed = true;
- }
-} else {
- // if user is anonymous
- if ($wfdownloads->getConfig('anonpost') == _WFDOWNLOADS_ANONPOST_DOWNLOAD || $wfdownloads->getConfig('anonpost') == _WFDOWNLOADS_ANONPOST_BOTH) {
- $isSubmissionAllowed = true;
- }
-}
-
-// Get download/upload permissions
-$allowedDownCategoriesIds = $gperm_handler->getItemIds('WFDownCatPerm', $groups, $wfdownloads->getModule()->mid());
-$allowedUpCategoriesIds = $gperm_handler->getItemIds('WFUpCatPerm', $groups, $wfdownloads->getModule()->mid());
-
-$xoopsOption['template_main'] = "{$wfdownloads->getModule()->dirname()}_index.tpl";
-include XOOPS_ROOT_PATH . '/header.php';
-
-$xoTheme->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js');
-$xoTheme->addScript(WFDOWNLOADS_URL . '/assets/js/magnific/jquery.magnific-popup.min.js');
-$xoTheme->addStylesheet(WFDOWNLOADS_URL . '/assets/js/magnific/magnific-popup.css');
-$xoTheme->addStylesheet(WFDOWNLOADS_URL . '/assets/css/module.css');
-
-$xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL . '/');
-
-// Breadcrumb
-$breadcrumb = new WfdownloadsBreadcrumb();
-$breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
-
-$xoopsTpl->assign('module_home', wfdownloads_module_home(false)); // this definition is not removed for backward compatibility issues
-$xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
-
-$cat_criteria = new CriteriaCompo();
-$cat_criteria->setSort('weight ASC, title');
-$categories = $wfdownloads->getHandler('category')->getObjects($cat_criteria);
-unset($cat_criteria);
-
-$categoriesTree = new XoopsObjectTree($categories, "cid", "pid");
-
-// Generate content header
-$sql = "SELECT * FROM " . $xoopsDB->prefix('wfdownloads_indexpage') . " ";
-$head_arr = $xoopsDB->fetchArray($xoopsDB->query($sql));
-$catarray['imageheader'] = wfdownloads_headerImage();
-$catarray['indexheaderalign'] = $head_arr['indexheaderalign'];
-$catarray['indexfooteralign'] = $head_arr['indexfooteralign'];
-$html = ($head_arr['nohtml']) ? 1 : 0;
-$smiley = ($head_arr['nosmiley']) ? 1 : 0;
-$xcodes = ($head_arr['noxcodes']) ? 1 : 0;
-$images = ($head_arr['noimages']) ? 1 : 0;
-$breaks = ($head_arr['nobreak']) ? 1 : 0;
-$catarray['indexheader'] = $myts->displayTarea($head_arr['indexheader'], $html, $smiley, $xcodes, $images, $breaks);
-$catarray['indexfooter'] = $myts->displayTarea($head_arr['indexfooter'], $html, $smiley, $xcodes, $images, $breaks);
-$catarray['letters'] = wfdownloads_lettersChoice();
-$catarray['toolbar'] = wfdownloads_toolbar();
-$xoopsTpl->assign('catarray', $catarray);
-
-// Begin Main page download info
-$chcount = 0;
-$countin = 0;
-
-$listings = wfdownloads_getTotalDownloads($allowedDownCategoriesIds);
-
-// Get total amount of categories
-$total_cat = count($allowedDownCategoriesIds);
-// Get all main categories
-$mainCategories = $categoriesTree->getFirstChild(0);
-$count = 0;
-
-// Comparison functions for uasort()
-/**
- * @param $category_a
- * @param $category_b
- *
- * @return int
- */
-function categoriesCompareCid($category_a, $category_b)
-{
- if ($category_a->getVar('cid') == $category_b->getVar('cid')) {
- return 0;
- }
-
- return ($category_a->getVar('cid') < $category_b->getVar('cid')) ? -1 : 1;
-}
-
-/**
- * @param $category_a
- * @param $category_b
- *
- * @return int
- */
-function categoriesCompareTitle($category_a, $category_b)
-{
- if ($category_a->getVar('title') == $category_b->getVar('title')) {
- return 0;
- }
-
- return ($category_a->getVar('title') < $category_b->getVar('title')) ? -1 : 1;
-}
-
-/**
- * @param $category_a
- * @param $category_b
- *
- * @return int
- */
-function categoriesCompareWeight($category_a, $category_b)
-{
- if ($category_a->getVar('weight') == $category_b->getVar('weight')) {
- return 0;
- }
-
- return ($category_a->getVar('weight') < $category_b->getVar('weight')) ? -1 : 1;
-}
-
-// Foreach main category
-foreach (array_keys($mainCategories) as $i) {
- if (in_array($mainCategories[$i]->getVar('cid'), $allowedDownCategoriesIds)) {
- // Get this category image
- // Get this category subcategories
- $allSubcategories = $categoriesTree->getAllChild($mainCategories[$i]->getVar('cid'));
-
- // Sort subcategories by: cid or title or weight
- switch ($wfdownloads->getConfig('subcatssortby')) {
- case 'cid' :
- uasort($allSubcategories, 'categoriesCompareCid');
- break;
- case 'title' :
- uasort($allSubcategories, 'categoriesCompareTitle');
- break;
- case 'weight' :
- default :
- uasort($allSubcategories, 'categoriesCompareWeight');
- break;
- }
-
- // Get this category indicator image
- $publishdate = isset($listings['published'][$mainCategories[$i]->getVar('cid')]) ? $listings['published'][$mainCategories[$i]->getVar('cid')]
- : 0;
- if (count($allSubcategories) > 0) {
- // Foreach subcategory
- foreach (array_keys($allSubcategories) as $k) {
- if (in_array($allSubcategories[$k]->getVar('cid'), $allowedDownCategoriesIds)) {
- $publishdate = (isset($listings['published'][$allSubcategories[$k]->getVar('cid')]) &&
- $listings['published'][$allSubcategories[$k]->getVar('cid')] > $publishdate)
- ? $listings['published'][$allSubcategories[$k]->getVar('cid')] : $publishdate;
- }
- }
- }
- $isNewImage = wfdownloads_isNewImage($publishdate);
- if (($mainCategories[$i]->getVar('imgurl') != "")
- && is_file(
- XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('catimage') . '/' . $mainCategories[$i]->getVar('imgurl')
- )
- ) {
- if ($wfdownloads->getConfig('usethumbs') && function_exists('gd_info')) {
- $imageURL = wfdownloads_createThumb(
- $mainCategories[$i]->getVar('imgurl'),
- $wfdownloads->getConfig('catimage'),
- "thumbs",
- $wfdownloads->getConfig('cat_imgwidth'),
- $wfdownloads->getConfig('cat_imgheight'),
- $wfdownloads->getConfig('imagequality'),
- $wfdownloads->getConfig('updatethumbs'),
- $wfdownloads->getConfig('keepaspect')
- );
- } else {
- $imageURL = XOOPS_URL . '/' . $wfdownloads->getConfig('catimage') . '/' . $mainCategories[$i]->getVar('imgurl');
- }
- } else {
- $imageURL = $isNewImage['image'];
- }
-
- // Get this category subcategories id and title
- $subcategories = array();
- ++$count;
- $download_count = isset($listings['count'][$mainCategories[$i]->getVar('cid')]) ? $listings['count'][$mainCategories[$i]->getVar('cid')] : 0;
- // modified July 5 2006 by Freeform Solutions (jwe)
- // make download count recursive, to include all sub categories that the user has permission to view
- //$allSubcategories = $categoriesTree->getAllChild($mainCategories[$i]->getVar('cid'));
- if (count($allSubcategories) > 0) {
- foreach (array_keys($allSubcategories) as $k) {
- if (in_array($allSubcategories[$k]->getVar('cid'), $allowedDownCategoriesIds)) {
- $download_count += isset($listings['count'][$allSubcategories[$k]->getVar('cid')])
- ? $listings['count'][$allSubcategories[$k]->getVar('cid')] : 0;
- if ($wfdownloads->getConfig('subcats') == 1 && $allSubcategories[$k]->getVar('pid') == $mainCategories[$i]->getVar('cid')) {
- // if we are collecting subcat info for displaying, and this subcat is a first level child...
- $subcategories[] = array(
- 'id' => $allSubcategories[$k]->getVar('cid'), // this definition is not removed for backward compatibility issues
- 'cid' => $allSubcategories[$k]->getVar('cid'),
- 'allowed_download' => in_array($allSubcategories[$k]->getVar('cid'), $allowedDownCategoriesIds),
- 'allowed_upload' => ($isSubmissionAllowed && in_array($allSubcategories[$k]->getVar('cid'), $allowedUpCategoriesIds)),
- 'title' => $allSubcategories[$k]->getVar('title')
- );
- }
- }
- }
- }
-
- if ($wfdownloads->getConfig('subcats') != true) {
- unset($subcategories);
- $xoopsTpl->append(
- 'categories',
- array(
- 'image' => $imageURL, // this definition is not removed for backward compatibility issues
- 'image_URL' => $imageURL,
- 'days' => $isNewImage['days'],
- 'id' => (int) $mainCategories[$i]->getVar('cid'), // this definition is not removed for backward compatibility issues
- 'cid' => (int) $mainCategories[$i]->getVar('cid'),
- 'allowed_download' => in_array($mainCategories[$i]->getVar('cid'), $allowedDownCategoriesIds),
- 'allowed_upload' => ($isSubmissionAllowed && in_array($mainCategories[$i]->getVar('cid'), $allowedUpCategoriesIds)),
- 'title' => $mainCategories[$i]->getVar('title'),
- 'summary' => $mainCategories[$i]->getVar('summary'),
- 'totaldownloads' => (int) $download_count, // this definition is not removed for backward compatibility issues
- 'downloads_count' => (int) $download_count,
- 'count' => (int) $count,
- 'alttext' => $isNewImage['alttext']
- )
- );
- } else {
- $xoopsTpl->append(
- 'categories',
- array(
- 'image' => $imageURL, // this definition is not removed for backward compatibility issues
- 'image_URL' => $imageURL,
- 'days' => $isNewImage['days'],
- 'id' => (int) $mainCategories[$i]->getVar('cid'), // this definition is not removed for backward compatibility issues
- 'cid' => (int) $mainCategories[$i]->getVar('cid'),
- 'allowed_download' => in_array($mainCategories[$i]->getVar('cid'), $allowedDownCategoriesIds),
- 'allowed_upload' => ($isSubmissionAllowed && in_array($mainCategories[$i]->getVar('cid'), $allowedUpCategoriesIds)),
- 'title' => $mainCategories[$i]->getVar('title'),
- 'summary' => $mainCategories[$i]->getVar('summary'),
- 'subcategories' => $subcategories,
- 'totaldownloads' => (int) $download_count, // this definition is not removed for backward compatibility issues
- 'downloads_count' => (int) $download_count,
- 'count' => (int) $count,
- 'alttext' => $isNewImage['alttext']
- )
- );
- }
- }
-}
-$lang_ThereAre = $count != 1 ? _MD_WFDOWNLOADS_THEREARE : _MD_WFDOWNLOADS_THEREIS;
-
-$xoopsTpl->assign('lang_thereare', sprintf($lang_ThereAre, $count, array_sum($listings['count'])));
-
-if ($wfdownloads->getConfig('enablerss') == true) {
- $rsslink_URL = WFDOWNLOADS_URL . "/rss.php";
- $xoopsTpl->assign('full_rssfeed_URL', $rsslink_URL);
- $rsslink = "<a href='" . $rsslink_URL . "' title='" . _MD_WFDOWNLOADS_LEGENDTEXTRSS . "'>";
- $rsslink.= "<img src='" . WFDOWNLOADS_URL . "/assets/images/icon/rss.gif' border='0' alt='" . _MD_WFDOWNLOADS_LEGENDTEXTRSS . "' title='" . _MD_WFDOWNLOADS_LEGENDTEXTRSS . "'>";
- $rsslink.= "</a>";
- $xoopsTpl->assign('full_rssfeed_link', $rsslink); // this definition is not removed for backward compatibility issues
-}
-
-include 'footer.php';
Deleted: XoopsModules/wfdownloads/trunk/mirror.php
===================================================================
--- XoopsModules/wfdownloads/trunk/mirror.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/mirror.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,258 +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.
- */
-/**
- * Wfdownloads 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 'header.php';
-
-$lid = WfdownloadsRequest::getInt('lid', 0);
-$downloadObj = $wfdownloads->getHandler('download')->get($lid);
-if (empty($downloadObj)) {
- redirect_header('index.php', 3, _CO_WFDOWNLOADS_ERROR_NODOWNLOAD);
-}
-$cid = WfdownloadsRequest::getInt('cid', $downloadObj->getVar('cid'));
-$categoryObj = $wfdownloads->getHandler('category')->get($cid);
-if (empty($categoryObj)) {
- redirect_header('index.php', 3, _CO_WFDOWNLOADS_ERROR_NOCATEGORY);
-}
-
-// Download not published, expired or taken offline - redirect
-if (
- $downloadObj->getVar('published') == 0 ||
- $downloadObj->getVar('published') > time() ||
- $downloadObj->getVar('offline') == true ||
- ($downloadObj->getVar('expired') != 0 && $downloadObj->getVar('expired') < time()) ||
- $downloadObj->getVar('status') == _WFDOWNLOADS_STATUS_WAITING) {
- redirect_header('index.php', 3, _MD_WFDOWNLOADS_NODOWNLOAD);
-}
-
-// Check permissions
-if ($wfdownloads->getConfig('enable_mirrors') == false && !wfdownloads_userIsAdmin()) {
- redirect_header('index.php', 3, _NOPERM);
-}
-$userGroups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
-if (!$gperm_handler->checkRight('WFDownCatPerm', $cid, $userGroups, $wfdownloads->getModule()->mid())) {
- redirect_header('index.php', 3, _NOPERM);
-}
-
-// Breadcrumb
-include_once XOOPS_ROOT_PATH . "/class/tree.php";
-$categoriesTree = new XoopsObjectTree($wfdownloads->getHandler('category')->getObjects(), 'cid', 'pid');
-$breadcrumb = new WfdownloadsBreadcrumb();
-$breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
-foreach (array_reverse($categoriesTree->getAllParent($cid)) as $parentCategory) {
- $breadcrumb->addLink($parentCategory->getVar('title'), "viewcat.php?cid=" . $parentCategory->getVar('cid'));
-}
-$breadcrumb->addLink($categoryObj->getVar('title'), "viewcat.php?cid={$cid}");
-$breadcrumb->addLink($downloadObj->getVar('title'), "singlefile.php?lid={$lid}");
-
-$op = WfdownloadsRequest::getString('op', 'mirror.add');
-switch ($op) {
- case "mirrors.list" :
- case "list" : // this case is not removed for backward compatibility issues
- $start = WfdownloadsRequest::getInt('start', 0);
-
- $xoopsOption['template_main'] = "{$wfdownloads->getModule()->dirname()}_mirrors.tpl";
- include XOOPS_ROOT_PATH . '/header.php';
-
- $xoTheme->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js');
- $xoTheme->addScript(WFDOWNLOADS_URL . '/assets/js/magnific/jquery.magnific-popup.min.js');
- $xoTheme->addStylesheet(WFDOWNLOADS_URL . '/assets/js/magnific/magnific-popup.css');
- $xoTheme->addStylesheet(WFDOWNLOADS_URL . '/assets/css/module.css');
-
- $xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL . '/');
-
- // Generate content header
- $sql = "SELECT * FROM " . $xoopsDB->prefix('wfdownloads_indexpage') . " ";
- $head_arr = $xoopsDB->fetchArray($xoopsDB->query($sql));
- $catarray['imageheader'] = wfdownloads_headerImage();
- $xoopsTpl->assign('catarray', $catarray);
- $xoopsTpl->assign('category_path', $wfdownloads->getHandler('category')->getNicePath($cid));
- $xoopsTpl->assign('category_id', $cid);
-
- // Breadcrumb
- $breadcrumb->addLink(_CO_WFDOWNLOADS_MIRRORS_LIST, '');
- $xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
-
- // Count mirrors
- $criteria = new CriteriaCompo(new Criteria("lid", $lid));
- $criteria->add(new Criteria("submit", 1)); // true
- $mirrorsCount = $wfdownloads->getHandler('mirror')->getCount($criteria);
-
- // Get mirrors
- $criteria->setSort('date');
- $criteria->setLimit(5);
- $criteria->setStart($start);
- $mirrorObjs = $wfdownloads->getHandler('mirror')->getObjects($criteria);
-
- $download_array = $downloadObj->toArray();
- $xoopsTpl->assign('down_arr', $download_array);
-
- $add_mirror = false;
- if (!is_object($xoopsUser)
- && ($wfdownloads->getConfig('anonpost') == _WFDOWNLOADS_ANONPOST_MIRROR
- || $wfdownloads->getConfig('anonpost') == _WFDOWNLOADS_ANONPOST_BOTH)
- && ($wfdownloads->getConfig('submissions') == _WFDOWNLOADS_SUBMISSIONS_MIRROR
- || $wfdownloads->getConfig('submissions') == _WFDOWNLOADS_SUBMISSIONS_BOTH)
- ) {
- $add_mirror = true;
- } elseif (is_object($xoopsUser)
- && ($wfdownloads->getConfig('submissions') == _WFDOWNLOADS_SUBMISSIONS_MIRROR
- || $wfdownloads->getConfig('submissions') == _WFDOWNLOADS_SUBMISSIONS_BOTH
- || $xoopsUser->isAdmin())
- ) {
- $add_mirror = true;
- }
-
- foreach ($mirrorObjs as $mirrorObj) {
- $mirror_array = $mirrorObj->toArray();
- if ($wfdownloads->getConfig('enable_onlinechk') == 1) {
- $serverURL = str_replace('http://', '', trim($mirror_array['homeurl']));
- $mirror_array['isonline'] = wfdownloads_mirrorOnline($serverURL);
- } else {
- $mirror_array['isonline'] = 2;
- }
- $mirror_array['add_mirror'] = $add_mirror;
- $mirror_array['date'] = formatTimestamp($mirror_array['date'], $wfdownloads->getConfig('dateformat'));
- $mirror_array['submitter'] = XoopsUserUtility::getUnameFromId($mirror_array['uid']);
- $xoopsTpl->append('down_mirror', $mirror_array);
- }
- $xoopsTpl->assign('lang_mirror_found', sprintf(_MD_WFDOWNLOADS_MIRROR_TOTAL, $mirrorsCount));
-
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($mirrorsCount, 5, $start, 'start', "op=mirrors.list&cid={$cid}&lid={$lid}", 1);
- $navbar['navbar'] = $pagenav->renderNav();
- $xoopsTpl->assign('navbar', $navbar);
-
- $xoopsTpl->assign('categoryPath', $pathstring . " > " . $download_array['title']);
- $xoopsTpl->assign('module_home', wfdownloads_module_home(true));
-
- include 'footer.php';
- break;
-
- case "mirror.add" :
- default :
- // Check if ANONYMOUS user can post mirrors
- if (!is_object($xoopsUser)
- && ($wfdownloads->getConfig('anonpost') == _WFDOWNLOADS_ANONPOST_NONE
- || $wfdownloads->getConfig('anonpost') == _WFDOWNLOADS_ANONPOST_DOWNLOAD)
- ) {
- redirect_header(XOOPS_URL . '/user.php', 1, _MD_WFDOWNLOADS_MUSTREGFIRST);
- exit();
- }
- // Check if user can submit mirrors
- if (is_object($xoopsUser)
- && ($wfdownloads->getConfig('submissions') == _WFDOWNLOADS_SUBMISSIONS_NONE
- || $wfdownloads->getConfig('submissions') == _WFDOWNLOADS_SUBMISSIONS_DOWNLOAD)
- && !$xoopsUser->isAdmin()
- ) {
- redirect_header('index.php', 1, _MD_WFDOWNLOADS_MIRROR_NOTALLOWESTOSUBMIT);
- exit();
- }
-
- // Get mirror poster 'uid'
- $mirroruserUid = is_object($xoopsUser) ? (int) $xoopsUser->getVar('uid') : 0;
-
- if (!empty($_POST['submit'])) {
- $mirrorObj = $wfdownloads->getHandler('mirror')->create();
- $mirrorObj->setVar('title', trim($_POST['title']));
- $mirrorObj->setVar('homeurl', formatURL(trim($_POST['homeurl'])));
- $mirrorObj->setVar('location', trim($_POST['location']));
- $mirrorObj->setVar('continent', trim($_POST['continent']));
- $mirrorObj->setVar('downurl', trim($_POST['downurl']));
- $mirrorObj->setVar('lid', (int) $_POST['lid']);
- $mirrorObj->setVar('uid', $mirroruserUid);
- $mirrorObj->setVar('date', time());
- if (($wfdownloads->getConfig('autoapprove') == _WFDOWNLOADS_AUTOAPPROVE_NONE
- || $wfdownloads->getConfig('autoapprove') == _WFDOWNLOADS_AUTOAPPROVE_DOWNLOAD)
- && !$wfdownloads_isAdmin
- ) {
- $approve = false;
- } else {
- $approve = true;
- }
- $submit = ($approve) ? true : false;
- $mirrorObj->setVar('submit', $submit);
-
- if (!$wfdownloads->getHandler('mirror')->insert($mirrorObj)) {
- redirect_header('index.php', 3, _MD_WFDOWNLOADS_ERROR_CREATEMIRROR);
- } else {
- $database_mess = ($approve) ? _MD_WFDOWNLOADS_ISAPPROVED : _MD_WFDOWNLOADS_ISNOTAPPROVED;
- redirect_header('index.php', 2, $database_mess);
- }
- } else {
- include XOOPS_ROOT_PATH . '/header.php';
-
- $xoTheme->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js');
- $xoTheme->addScript(WFDOWNLOADS_URL . '/assets/js/magnific/jquery.magnific-popup.min.js');
- $xoTheme->addStylesheet(WFDOWNLOADS_URL . '/assets/js/magnific/magnific-popup.css');
- $xoTheme->addStylesheet(WFDOWNLOADS_URL . '/assets/css/module.css');
-
- $xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL . '/');
-
- // Breadcrumb
- $breadcrumb->addLink(_MD_WFDOWNLOADS_ADDMIRROR, '');
- echo $breadcrumb->render();
-
- echo "<div align='center'>" . wfdownloads_headerImage() . "</div><br />\n";
- echo "<div>" . _MD_WFDOWNLOADS_MIRROR_SNEWMNAMEDESC . "</div>\n";
-
- // Generate form
- include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
- $sform = new XoopsThemeForm(_MD_WFDOWNLOADS_MIRROR_SUBMITMIRROR, 'mirrorform', xoops_getenv('PHP_SELF'));
- $title_text = new XoopsFormText(_MD_WFDOWNLOADS_MIRROR_HOMEURLTITLE, 'title', 50, 255);
- $title_text->setDescription(_MD_WFDOWNLOADS_MIRROR_HOMEURLTITLE_DESC);
- $sform->addElement($title_text, true);
- $homeurl_text = new XoopsFormText(_MD_WFDOWNLOADS_MIRROR_HOMEURL, 'homeurl', 50, 255);
- $homeurl_text->setDescription(_MD_WFDOWNLOADS_MIRROR_HOMEURL_DESC);
- $sform->addElement($homeurl_text, true);
- $location_text = new XoopsFormText(_MD_WFDOWNLOADS_MIRROR_LOCATION, 'location', 50, 255);
- $location_text->setDescription(_MD_WFDOWNLOADS_MIRROR_LOCATION_DESC);
- $sform->addElement($location_text, true);
- $continent_select = new XoopsFormSelect(_MD_WFDOWNLOADS_MIRROR_CONTINENT, 'continent');
- $continent_select->addOptionArray(
- array(
- _MD_WFDOWNLOADS_CONT1 => _MD_WFDOWNLOADS_CONT1,
- _MD_WFDOWNLOADS_CONT2 => _MD_WFDOWNLOADS_CONT2,
- _MD_WFDOWNLOADS_CONT3 => _MD_WFDOWNLOADS_CONT3,
- _MD_WFDOWNLOADS_CONT4 => _MD_WFDOWNLOADS_CONT4,
- _MD_WFDOWNLOADS_CONT5 => _MD_WFDOWNLOADS_CONT5,
- _MD_WFDOWNLOADS_CONT6 => _MD_WFDOWNLOADS_CONT6,
- _MD_WFDOWNLOADS_CONT7 => _MD_WFDOWNLOADS_CONT7
- )
- );
- $sform->addElement($continent_select);
- $downurl_text = new XoopsFormText(_MD_WFDOWNLOADS_MIRROR_DOWNURL, 'downurl', 50, 255);
- $downurl_text->setDescription(_MD_WFDOWNLOADS_MIRROR_DOWNURL_DESC);
- $sform->addElement($downurl_text, true);
- $sform->addElement(new XoopsFormHidden('lid', $lid));
- $sform->addElement(new XoopsFormHidden('cid', $cid));
- $sform->addElement(new XoopsFormHidden('uid', $mirroruserUid));
- $button_tray = new XoopsFormElementTray('', '');
- $submit_button = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
- $button_tray->addElement($submit_button);
- $cancel_button = new XoopsFormButton('', '', _CANCEL, 'button');
- $cancel_button->setExtra('onclick="history.go(-1)"');
- $button_tray->addElement($cancel_button);
- $sform->addElement($button_tray);
- $sform->display();
- include 'footer.php';
- }
- break;
-}
Deleted: XoopsModules/wfdownloads/trunk/newlist.php
===================================================================
--- XoopsModules/wfdownloads/trunk/newlist.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/newlist.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,108 +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.
- */
-/**
- * Wfdownloads 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 'header.php';
-
-$xoopsOption['template_main'] = "{$wfdownloads->getModule()->dirname()}_newlistindex.tpl";
-include XOOPS_ROOT_PATH . '/header.php';
-
-$xoTheme->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js');
-$xoTheme->addScript(WFDOWNLOADS_URL . '/assets/js/magnific/jquery.magnific-popup.min.js');
-$xoTheme->addStylesheet(WFDOWNLOADS_URL . '/assets/js/magnific/magnific-popup.css');
-$xoTheme->addStylesheet(WFDOWNLOADS_URL . '/assets/css/module.css');
-
-$xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL . '/');
-
-$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
-
-$catArray['imageheader'] = wfdownloads_headerImage();
-$catArray['letters'] = wfdownloads_lettersChoice();
-$catArray['toolbar'] = wfdownloads_toolbar();
-$xoopsTpl->assign('catarray', $catArray);
-
-// Breadcrumb
-$breadcrumb = new WfdownloadsBreadcrumb();
-$breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
-
-// Get number of downloads...
-$allowedCategories = $gperm_handler->getItemIds('WFDownCatPerm', $groups, $wfdownloads->getModule()->mid());
-// ... in the last week
-$oneWeekAgo = strtotime("-1 week"); //$oneWeekAgo = time() - 3600*24*7; //@TODO: Change to strtotime (TODAY-1week);
-$criteria = new Criteria('published', $oneWeekAgo, ">=");
-$allWeekDownloads = $wfdownloads->getHandler('download')->getActiveCount($criteria);
-// ... in the last month
-$oneMonthAgo = strtotime("-1 month"); //$one_month_ago = time() - 3600*24*7; //@TODO: Change to strtotime (TODAY-1month);
-$criteria = new Criteria('published', $oneMonthAgo, ">=");
-$allMonthDownloads = $wfdownloads->getHandler('download')->getActiveCount($criteria);
-$xoopsTpl->assign('allweekdownloads', $allWeekDownloads);
-$xoopsTpl->assign('allmonthdownloads', $allMonthDownloads);
-
-// Get latest downloads
-$criteria = new CriteriaCompo(new Criteria("offline", 0));
-if (isset($_GET['newdownloadshowdays'])) {
- $days = (int) $_GET['newdownloadshowdays'];
- $days_limit = array(7, 14, 30);
- if (in_array($days, $days_limit)) {
- $xoopsTpl->assign('newdownloadshowdays', $days);
- $downloadshowdays = time() - (3600 * 24 * $days);
- $criteria->add(new Criteria('published', $downloadshowdays, '>='), 'AND');
- }
-}
-$criteria->setSort('published');
-$criteria->setOrder('DESC');
-$criteria->setLimit($wfdownloads->getConfig('perpage'));
-$criteria->setStart(0);
-$downloadObjs = $wfdownloads->getHandler('download')->getActiveDownloads($criteria);
-foreach ($downloadObjs as $downloadObj) {
- $downloadInfo = $downloadObj->getDownloadInfo();
- $xoopsTpl->assign('lang_dltimes', sprintf(_MD_WFDOWNLOADS_DLTIMES, $downloadInfo['hits']));
- $xoopsTpl->assign('lang_subdate', $downloadInfo['is_updated']);
- $xoopsTpl->append('file', $downloadInfo);
- $xoopsTpl->append('downloads', $downloadInfo); // this definition is not removed for backward compatibility issues
-}
-
-// Screenshots display
-$xoopsTpl->assign('show_screenshot', false);
-if ($wfdownloads->getConfig('screenshot') == 1) {
- $xoopsTpl->assign('shots_dir', $wfdownloads->getConfig('screenshots'));
- $xoopsTpl->assign('shotwidth', $wfdownloads->getConfig('shotwidth'));
- $xoopsTpl->assign('shotheight', $wfdownloads->getConfig('shotheight'));
- $xoopsTpl->assign('show_screenshot', true);
- $xoopsTpl->assign('viewcat', true);
-}
-if (isset($days)) {
- $which_new_downloads = " > " . sprintf(_MD_WFDOWNLOADS_NEWDOWNLOADS_INTHELAST, (int) $days);
- $xoopsTpl->assign(
- 'categoryPath',
- '<a href="' . WFDOWNLOADS_URL . '/newlist.php">' . _MD_WFDOWNLOADS_NEWDOWNLOADS . '</a>' . $which_new_downloads
- );
- $breadcrumb->addLink(_MD_WFDOWNLOADS_LATESTLIST, $currentFile);
- $breadcrumb->addLink(sprintf(_MD_WFDOWNLOADS_NEWDOWNLOADS_INTHELAST, (int) $days), '');
-} else {
- $xoopsTpl->assign('categoryPath', _MD_WFDOWNLOADS_NEWDOWNLOADS);
- $breadcrumb->addLink(_MD_WFDOWNLOADS_LATESTLIST, '');
-}
-
-// Breadcrumb
-$xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
-
-$xoopsTpl->assign('module_home', wfdownloads_module_home(true));
-include 'footer.php';
Deleted: XoopsModules/wfdownloads/trunk/notification_update.php
===================================================================
--- XoopsModules/wfdownloads/trunk/notification_update.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/notification_update.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,22 +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.
- */
-/**
- * Wfdownloads 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$
- */
-include '../../mainfile.php';
-include XOOPS_ROOT_PATH . '/include/notification_update.php';
Deleted: XoopsModules/wfdownloads/trunk/ratefile.php
===================================================================
--- XoopsModules/wfdownloads/trunk/ratefile.php 2014-07-25 17:27:29 UTC (rev 12725)
+++ XoopsModules/wfdownloads/trunk/ratefile.php 2014-07-25 17:45:37 UTC (rev 12726)
@@ -1,176 +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.
- */
-/**
- * Wfdownloads 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 'header.php';
-
-$lid = WfdownloadsRequest::getInt('lid', 0);
-$downloadObj = $wfdownloads->getHandler('download')->get($lid);
-if (empty($downloadObj)) {
- redirect_header('index.php', 3, _CO_WFDOWNLOADS_ERROR_NODOWNLOAD);
-}
-$cid = WfdownloadsRequest::getInt('cid', $downloadObj->getVar('cid'));
-$categoryObj = $wfdownloads->getHandler('category')->get($cid);
-if (empty($categoryObj)) {
- redirect_header('index.php', 3, _CO_WFDOWNLOADS_ERROR_NOCATEGORY);
-}
-
-// Download not published, expired or taken offline - redirect
-if (
- $downloadObj->getVar('published') == false ||
- $downloadObj->getVar('published') > time() ||
- $downloadObj->getVar('offline') == true ||
- ($downloadObj->getVar('expired') != 0 && $downloadObj->getVar('expired') < time())) {
- redirect_header("index.php", 3, _MD_WFDOWNLOADS_NODOWNLOAD);
-}
-
-// Check permissions
-if ($wfdownloads->getConfig('enable_ratings') == false && !wfdownloads_userIsAdmin()) {
- redirect_header('index.php', 3, _NOPERM);
-}
-// Breadcrumb
-include_once XOOPS_ROOT_PATH . "/class/tree.php";
-$categoriesTree = new XoopsObjectTree($wfdownloads->getHandler('category')->getObjects(), 'cid', 'pid');
-$breadcrumb = new WfdownloadsBreadcrumb();
-$breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
-foreach (array_reverse($categoriesTree->getAllParent($cid)) as $parentCategory) {
- $breadcrumb->addLink($parentCategory->getVar('title'), "viewcat.php?cid=" . $parentCategory->getVar('cid'));
-}
-$breadcrumb->addLink($categoryObj->getVar('title'), "viewcat.php?cid={$cid}");
-$breadcrumb->addLink($downloadObj->getVar('title'), "singlefile.php?lid={$lid}");
-
-$op = WfdownloadsRequest::getString('op', 'vote.add');
-switch ($op) {
- case "vote.add" :
- default :
- // Get vote poster 'uid'
- $ratinguserUid = is_object($xoopsUser) ? (int) $xoopsUser->getVar('uid') : 0;
- $ratinguserIp = getenv("REMOTE_ADDR");
-
- if (!empty($_POST['submit'])) {
- $rating = WfdownloadsRequest::getString('rating', '--', 'POST');
-
- // Check if Rating is Null
- if ($rating == '--') {
- redirect_header("?cid={$cid}&lid={$lid}", 4, _MD_WFDOWNLOADS_NORAT...
[truncated message content] |