|
From: <luc...@us...> - 2013-05-20 19:58:18
|
Revision: 11566
http://sourceforge.net/p/xoops/svn/11566
Author: luciorota
Date: 2013-05-20 19:58:14 +0000 (Mon, 20 May 2013)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/main.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/menu.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/index.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/wfdownloads_top.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/wfdownloads_top_by_cat.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/dbupdater.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/img_uploader.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/index.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/ip_log.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mimetype.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mirror.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/modification.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/object.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/rating.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/report.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/review.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/wfd_lists.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_delete.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_edit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_new.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_post.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_reply.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/footer.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/header.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/comment_functions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/common.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/functions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/index.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/notification.inc.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/search.inc.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/update.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/index.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/mirror.php
Added Paths:
-----------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/download.php
Added: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/download.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/download.php (rev 0)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/download.php 2013-05-20 19:58:14 UTC (rev 11566)
@@ -0,0 +1,702 @@
+<?php
+/**
+ * $Id: main.php,v 1.23 2007/09/30 12:39:13 m0nty_ Exp $
+ * Module: WF-Downloads
+ * Version: v2.0.5a
+ * Release Date: 26 july 2004
+ * Author: WF-Sections
+ * Licence: GNU
+ */
+
+include 'admin_header.php';
+include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
+include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
+include_once WFDOWNLOADS_ROOT_PATH . 'class/wfd_lists.php';
+include_once XOOPS_ROOT_PATH . '/class/tree.php';
+include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
+
+//$mytree = new XoopsTree($xoopsDB -> prefix('wfdownloads_cat'), "cid", "pid");
+
+function Download()
+{
+ $lid = isset($_REQUEST['lid']) ? intval($_REQUEST['lid']) : 0;
+
+ $category_handler = xoops_getmodulehandler('category');
+ $numrows = $category_handler->getCount();
+ if ($numrows) {
+ wfdownloads_xoops_cp_header();
+ $indexAdmin = new ModuleAdmin();
+ echo $indexAdmin->addNavigation('main.php');
+
+ //wfdownloads_adminMenu(3, _AM_WFD_MDOWNLOADS);
+
+ echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFD_FILE_ALLOWEDAMIME . "</legend>\n
+ <div style='padding: 8px;'>\n";
+
+ $mime_handler = xoops_getmodulehandler('mimetype');
+ $criteria = new Criteria("mime_admin", 1);
+ $mimetypes = $mime_handler->getList($criteria);
+ $allowmimetypes = implode(' | ', $mimetypes);
+ echo $allowmimetypes;
+ echo "</div>\n
+ </fieldset><br />\n
+ ";
+
+ $download_handler = xoops_getmodulehandler('download');
+ if ($lid) {
+ $download = $download_handler->get($lid);
+ $title = _AM_WFD_FILE_MODIFYFILE;
+ // added - start - March 4 2006 - jpc
+ $cid = intval($download->getVar('cid'));
+ $category = $category_handler->get($cid);
+ // added - end - March 4 2006 - jpc
+ // changed - start - April 22 2006 - jwe
+ //$title = _AM_WFD_FILE_MODIFYFILE;
+ $title = preg_replace("/{category}/", $category->getVar('title'), _AM_WFD_FFS_EDITDOWNLOADTITLE);
+ // changed - end - April 22 2006 - jwe
+ } else {
+ $download = $download_handler->create();
+ $title = _AM_WFD_FILE_CREATENEWFILE;
+ // added - start - March 4 2006 - jpc
+ $cid = (!empty($_POST['cid'])) ? intval($_POST['cid']) : 0 ;
+ $download->setVar('cid', $cid);
+ $category = $category_handler->get($cid);
+ // added - end - March 4 2006 - jpc
+ // changed - start - April 22 2006 - jwe
+ //$title = _AM_WFD_FILE_CREATENEWFILE;
+ $title = preg_replace("/{category}/", $category->getVar('title'), _AM_WFD_FFS_DOWNLOADTITLE);
+ // changed - end - April 22 2006 - jwe
+ }
+
+ // changed - start - March 4 2006 - jpc
+ if ((isset($_POST['submit_category']) && !empty($_POST['submit_category'])) || $lid) {
+
+ $fid = $category->getVar('formulize_fid');
+ $customArray = array();
+ if($fid) {
+ global $xoopsUser;
+ include_once XOOPS_ROOT_PATH . "/modules/formulize/include/formdisplay.php";
+ include_once XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php";
+
+ $customArray['fid'] = $fid;
+ $customArray['formulize_mgr'] =& xoops_getmodulehandler('elements', 'formulize');
+ $customArray['groups'] = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
+ $customArray['prevEntry'] = getEntryValues($download->getVar('formulize_idreq'), $customArray['formulize_mgr'], $customArray['groups'], $fid);
+ $customArray['entry'] = $download->getVar('formulize_idreq');
+ $customArray['go_back'] = "";
+ $customArray['parentLinks'] = "";
+
+ $owner = getEntryOwner($entry);
+ $member_handler =& xoops_gethandler('member');
+ $owner_groups =& $member_handler->getGroupsByUser($owner, FALSE);
+
+ $customArray['owner_groups'] = $owner_groups;
+ }
+ $sform = $download->getAdminForm($title, $customArray);
+ } elseif(file_exists(XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php")) {
+ $sform = $download->getCategoryForm();
+ } else {
+ $sform = $download->getAdminForm($title);
+ }
+ $sform->display();
+ // changed - end - March 4 2006 - jpc
+ } else {
+ redirect_header(WFDOWNLOADS_URL . 'admin/category.php?', 1, _AM_WFD_CCATEGORY_NOEXISTS);
+ exit();
+ }
+
+ if ($lid) {
+ global $imagearray;
+ // Vote data
+ $rating_handler = xoops_getmodulehandler('rating');
+ $totalvotes = $rating_handler->getCount();
+
+ $reg_criteria = new CriteriaCompo(new Criteria('lid', $lid));
+ $reg_criteria->add(new Criteria("ratinguser", 0, ">"));
+ $votesreg = $rating_handler->getCount($reg_criteria);
+ $reg_criteria->setSort("ratingtimestamp");
+ $reg_criteria->setOrder("DESC");
+ $regvotes = $rating_handler->getObjects($reg_criteria);
+
+ $anon_criteria = new CriteriaCompo(new Criteria('lid', $lid));
+ $anon_criteria->add(new Criteria("ratinguser", 0, "="));
+ $votesanon = $rating_handler->getCount($anon_criteria);
+ $anon_criteria->setSort("ratingtimestamp");
+ $anon_criteria->setOrder("DESC");
+
+ echo "
+ <fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFD_VOTE_RATINGINFOMATION . "</legend>\n
+ <div style='padding: 8px;'><b>" . _AM_WFD_VOTE_TOTALVOTES . "</b>" . $totalvotes . "<br /><br />\n
+ ";
+
+ printf(_AM_WFD_VOTE_REGUSERVOTES, $votesreg);
+
+ echo "<br />";
+
+ printf(_AM_WFD_VOTE_ANONUSERVOTES, $votesanon);
+
+ echo "
+ </div>\n
+ <table width='100%' cellspacing='1' cellpadding='2' class='outer'>\n
+ <tr>\n
+ <th align='center'>" . _AM_WFD_VOTE_USER . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_IP . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_RATING . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_USERAVG . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_TOTALRATE . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_DATE . "</td>\n
+ <th align='center'>" . _AM_WFD_MINDEX_ACTION . "</td>\n
+ </tr>\n
+ ";
+
+ if ($votesreg == 0) {
+ echo "<tr><td align='center' colspan='7' class='even'><b>" . _AM_WFD_VOTE_NOREGVOTES . "</b></td></tr>";
+ } else {
+ foreach (array_keys($regvotes) as $i) {
+ $uids[] = $regvotes[$i]->getVar('ratinguser');
+ }
+
+ $criteria = new Criteria("ratinguser", "(" . implode(',', $uids) . ")", "IN");
+ $criteria->setGroupby("ratinguser");
+ $userratings = $rating_handler->getUserAverage($criteria);
+
+
+ foreach (array_keys($regvotes) as $i) {
+ $formatted_date = formatTimestamp($regvotes[$i]->getVar('ratingtimestamp'), $xoopsModuleConfig['dateformat']);
+ $useravgrating = isset($userratings[$regvotes[$i]->getVar('ratinguser')]) ? $userratings[$regvotes[$i]->getVar('ratinguser')]["avg"] : 0;
+ $uservotes = isset($userratings[$regvotes[$i]->getVar('ratinguser')]) ? $userratings[$regvotes[$i]->getVar('ratinguser')]["count"] : 0;
+ $ratinguname = XoopsUser :: getUnameFromId($regvotes[$i]->getVar('ratinguser'));
+
+ echo "
+ <tr><td align='center' class='head'>$ratinguname</td>\n
+ <td align='center' class='even'>" . $regvotes[$i]->getVar('ratinghostname') . "</th>\n
+ <td align='center' class='even'>" . $regvotes[$i]->getVar('rating') . "</th>\n
+ <td align='center' class='even'>$useravgrating</th>\n
+ <td align='center' class='even'>$uservotes</th>\n
+ <td align='center' class='even'>$formatted_date</th>\n
+ <td align='center' class='even'>\n
+ <a href='" . WFDOWNLOADS_URL . "admin/main.php?op=delVote&lid=" . $lid . "&rid=" . $regvotes[$i]->getVar('ratingid') . "'>" . $imagearray['deleteimg'] . "</a>\n
+ </th></tr>\n
+ ";
+ }
+ }
+ echo "
+ </table>\n
+ <br />\n
+ <table width='100%' cellspacing='1' cellpadding='2' class='outer'>\n
+ <tr>\n
+ <th align='center'>" . _AM_WFD_VOTE_USER . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_IP . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_RATING . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_USERAVG . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_TOTALRATE . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_DATE . "</td>\n
+ <th align='center'>" . _AM_WFD_MINDEX_ACTION . "</td>\n
+ </tr>\n
+ ";
+ if ($votesanon == 0) {
+ echo "<tr><td colspan='7' align='center' class='even'><b>" . _AM_WFD_VOTE_NOUNREGVOTES . "</b></td></tr>";
+ } else {
+ $criteria = new Criteria("ratinguser", 0);
+ $userratings = $rating_handler->getUserAverage($criteria);
+ $anonvotes = $rating_handler->getObjects($anon_criteria);
+
+ foreach (array_keys($anonvotes) as $i) {
+ $formatted_date = formatTimestamp($anonvotes[$i]->getVar('ratingtimestamp'), $xoopsModuleConfig['dateformat']);
+ $useravgrating = isset($userratings['avg']) ? $userratings["avg"] : 0;
+ $uservotes = isset($userratings['count']) ? $userratings["count"] : 0;
+
+ $ratinguname = $GLOBALS['xoopsConfig']['anonymous'];
+
+ echo "
+ <tr><td align='center' class='head'>$ratinguname</td>\n
+ <td align='center' class='even'>" . $anonvotes[$i]->getVar('ratinghostname') . "</th>\n
+ <td align='center' class='even'>" . $anonvotes[$i]->getVar('rating') . "</th>\n
+ <td align='center' class='even'>$useravgrating</th>\n
+ <td align='center' class='even'>$uservotes</th>\n
+ <td align='center' class='even'>$formatted_date</th>\n
+ <td align='center' class='even'>\n
+ <a href='" . WFDOWNLOADS_URL . "admin/main.php?op=delVote&lid=" . $lid . "&rid=" . $anonvotes[$i]->getVar('ratingid') . "'>" . $imagearray['deleteimg'] . "</a>\n
+ </th></tr>\n
+ ";
+ }
+ }
+ echo "
+ </table>\n
+ </fieldset>\n
+ ";
+ }
+ xoops_cp_footer();
+}
+
+function delVote()
+{
+ global $_GET;
+ $rating_handler = xoops_getmodulehandler('rating');
+ $rating = $rating_handler->get($_GET['rid']);
+ if ($rating_handler->delete($rating, true)) {
+ wfd_updaterating(intval($rating->getVar('lid')));
+ }
+ redirect_header(WFDOWNLOADS_URL . 'admin/main.php', 1, _AM_WFD_VOTE_VOTEDELETED);
+}
+
+function addDownload()
+{
+ global $xoopsUser, $xoopsModuleConfig;
+
+ $lid = (!empty($_POST['lid'])) ? intval($_POST['lid']) : 0;
+ $cid = (!empty($_POST['cid'])) ? intval($_POST['cid']) : 0;
+ $status = (!empty($_POST['status'])) ? intval($_POST['status']) : 2;
+
+ $download_handler = xoops_getmodulehandler('download');
+ if ($lid > 0) {
+ $thisIsANewRecord = false; /* Added by Lankford on 2007/3/21 */
+ $download = $download_handler->get($lid);
+ } else {
+ $thisIsANewRecord = true; /* Added by Lankford on 2007/3/21 */
+ $download = $download_handler->create();
+ }
+
+ /**
+ * Define URL
+ */
+ if (empty($_FILES['userfile']['name'])) {
+ if ($_POST["url"] && $_POST["url"] != "" && $_POST["url"] != "http://") {
+ $url = ($_POST["url"] != "http://") ? $_POST["url"] : '';
+ $filename = '';
+ $filetype = '';
+ } else {
+ $url = ($_POST["url"] != "http://") ? $_POST["url"] : '';
+ $filename = $_POST['filename'];
+ $filetype = $_POST['filetype'];
+ }
+ $size = ((empty($_POST["size"]) || !is_numeric($_POST["size"]))) ? 0 : intval($_POST["size"]);
+ $title = trim($_POST["title"]);
+ $download->setVar('filename', $filename);
+ $download->setVar('filetype', $filetype);
+ } else {
+ global $_FILES;
+ $down = wfd_uploading($_FILES, $xoopsModuleConfig['uploaddir'], "", "download.php?op=download", 0, 0);
+ $url = ($_POST["url"] != "http://") ? $_POST["url"] : '';
+ $size = $down['size'];
+ $title = $_FILES['userfile']['name'];
+ $ext = rtrim(strrchr($title, '.'), '.');
+ $title = str_replace($ext, '', $title);
+ $title = (isset($_POST["title_checkbox"]) && $_POST["title_checkbox"] == 1) ? $title : trim($_POST["title"]);
+
+ $filename = $down['filename'];
+ $filetype = $_FILES['userfile']['type'];
+ $download->setVar('filename', $filename);
+ $download->setVar('filetype', $filetype);
+ }
+
+ /**
+ * Get data from form
+ */
+ $screenshot = ($_POST["screenshot"] != "blank.png") ? $_POST["screenshot"] : '';
+ $screenshot2 = ($_POST["screenshot2"] != "blank.png") ? $_POST["screenshot2"] : '';
+ $screenshot3 = ($_POST["screenshot3"] != "blank.png") ? $_POST["screenshot3"] : '';
+ $screenshot4 = ($_POST["screenshot4"] != "blank.png") ? $_POST["screenshot4"] : '';
+
+ if (!empty($_POST["homepage"]) || $_POST["homepage"] != "http://") {
+ $download->setVar('homepage', trim($_POST["homepage"]));
+ $download->setVar('homepagetitle', trim($_POST["homepagetitle"]));
+ }
+
+ $version = (!empty($_POST["version"])) ? trim($_POST["version"]) : 0;
+
+ /* Added by Lankford on 2007/3/21 */
+ // Here, I want to know if:
+ // a) Are they actually changing the value of version, or is it the same?
+ // b) Are they actually modifying the record, or is this a new one?
+ // If both conditions are true, then trigger all three notifications related to modified records.
+ if (!$thisIsANewRecord and ($download->getVar('version') != $version)) {
+ // 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'] = $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'] = $version;
+ $tags['CATEGORY_NAME'] = $category->getVar('title');
+ $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . 'viewcat.php?cid=' . $cid;
+
+ if ($xoopsModuleConfig['autoapprove'] == 2 || $xoopsModuleConfig['autoapprove'] == 4) {
+ // Then this change will be automatically approved, so the notification needs to go out.
+ $notification_handler->triggerEvent('global', 0, 'filemodified', $tags);
+ $notification_handler->triggerEvent('category', $cid, 'filemodified', $tags);
+ $notification_handler->triggerEvent('file', $lid, 'filemodified', $tags);
+ }
+ }
+ /* End add block */
+
+ $download->setVar('version', $version);
+ $download->setVar('url', $url);
+ $download->setVar('cid', $cid);
+ $download->setVar('title', $title);
+ $download->setVar('status', $status);
+ $download->setVar('size', $size);
+ $download->setVar('screenshot', $screenshot);
+ $download->setVar('screenshot2', $screenshot2);
+ $download->setVar('screenshot3', $screenshot3);
+ $download->setVar('screenshot4', $screenshot4);
+ $download->setVar('platform', trim($_POST["platform"]));
+ $download->setVar('summary', trim($_POST["summary"]));
+ $download->setVar('description', trim($_POST["description"]));
+ $download->setVar('submitter', trim($_POST["submitter"]));
+ $download->setVar('publisher', trim($_POST["publisher"]));
+ $download->setVar('price', trim($_POST["price"]));
+ if (!$xoopsModuleConfig['enable_mirrors']) {
+ $download->setVar('mirror', formatURL(trim($_POST["mirror"])));
+ }
+ $download->setVar('license', trim($_POST["license"]));
+ $download->setVar('features', trim($_POST["features"]));
+ $download->setVar('requirements', trim($_POST["requirements"]));
+ $limitations = (isset($_POST["limitations"])) ? $_POST["limitations"] : '';
+ $download->setVar('limitations', $limitations);
+ $versiontypes = (isset($_POST["versiontypes"])) ? $_POST["versiontypes"] : '';
+ $download->setVar('versiontypes', $versiontypes);
+
+ $dhistory = (isset($_POST["dhistory"])) ? $_POST["dhistory"] : '';
+ $dhistoryhistory = (isset($_POST["dhistoryaddedd"])) ? $_POST["dhistoryaddedd"] : '';
+
+ if ($lid > 0 && !empty($dhistoryhistory)) {
+ $dhistory = $dhistory . "\n\n";
+ $time = time();
+ $dhistory .= _AM_WFD_FILE_HISTORYVERS . $version . _AM_WFD_FILE_HISTORDATE . formatTimestamp($time, $xoopsModuleConfig['dateformat']) . "\n\n";
+ $dhistory .= $dhistoryhistory;
+ }
+ $download->setVar('dhistory', $dhistory);
+ $download->setVar('dhistoryhistory', $dhistoryhistory);
+
+ $updated = (isset($_POST['was_published']) && $_POST['was_published'] == 0) ? 0 : time();
+
+ if ($_POST['up_dated'] == 0) {
+ $updated = 0;
+ }
+ $download->setVar('updated', $updated);
+
+ $offline = ($_POST['offline'] == 1) ? 1 : 0;
+ $download->setVar('offline', $offline);
+ $approved = (isset($_POST['approved']) && $_POST['approved'] == 1) ? 1 : 0;
+ $notifypub = (isset($_POST['notifypub']) && $_POST['notifypub'] == 1);
+
+ $expiredate = 0;
+ if (!$lid) {
+ $publishdate = time();
+ } else {
+ $publishdate = $_POST['was_published'];
+ $expiredate = $_POST['was_expired'];
+ }
+
+ if ($approved == 1 && empty($publishdate))
+ {
+ $publishdate = time();
+ }
+
+ if (isset($_POST['publishdateactivate'])) {
+ $publishdate = strtotime($_POST['published']['date']) + $_POST['published']['time'];
+ }
+ if ($_POST['clearpublish']) {
+ $publishdate = $download->getVar('published');
+ }
+
+ if (isset($_POST['expiredateactivate'])) {
+ $expiredate = strtotime($_POST['expired']['date']) + $_POST['expired']['time'];
+ }
+ if ($_POST['clearexpire']) {
+ $expiredate = '0';
+ }
+
+ $download->setVar('expired', $expiredate);
+ $download->setVar('published', $publishdate);
+ $download->setVar('date', time());
+ /**
+ * Update or insert download data into database
+ */
+ if (!$lid) {
+ $download->setVar('ipaddress', $_SERVER['REMOTE_ADDR']);
+ }
+
+ // added - start - March 4 2006 - jpc
+ $category_handler = xoops_getmodulehandler('category');
+ $category = $category_handler->get($cid);
+ $fid = $category->getVar('formulize_fid');
+ if($fid) {
+ global $xoopsUser;
+ include_once XOOPS_ROOT_PATH . "/modules/formulize/include/formread.php";
+ include_once XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php";
+
+ $formulize_mgr =& xoops_getmodulehandler('elements', 'formulize');
+
+ if ($lid) {
+ $entries[$fid][0] = $download->getVar('formulize_idreq');
+ if($entries[$fid][0]) {
+ $owner = getEntryOwner($entries[$fid][0]);
+ } else {
+ print "no idreq";
+ $entries[$fid][0] = "";
+ $owner = "";
+ }
+ $cid = $download->getVar('cid');
+ } else {
+ $entries[$fid][0] = "";
+ $owner = "";
+ }
+ $member_handler =& xoops_gethandler('member');
+ $owner_groups =& $member_handler->getGroupsByUser($owner, FALSE);
+ $uid = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
+ $groups = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
+ $entries = handleSubmission($formulize_mgr, $entries, $uid, $owner, $fid, $owner_groups, $groups, "new"); // "new" causes xoops token check to be skipped, since WF-downloads should be doing that
+
+ //if (!$lid)
+ if(!$owner) {
+ $id_req = $entries[$fid][0];
+ $download->setVar('formulize_idreq', $id_req);
+ }
+ }
+ // added - end - March 4 2006 - jpc
+
+
+ $download_handler->insert($download);
+ $newid = intval($download->getVar('lid'));
+ /**
+ * Send notifications
+ */
+ if (!$lid) {
+ $tags = array();
+ $tags['FILE_NAME'] = $title;
+ $tags['FILE_URL'] = WFDOWNLOADS_URL . 'singlefile.php?cid=' . $cid . '&lid=' . $newid;
+
+ // changed - start - March 4 2006 - jpc
+ //$category_handler = xoops_getmodulehandler('category');
+ //$category = $category_handler->get($cid);
+ // changed - end - March 4 2006 - jpc
+ $tags['CATEGORY_NAME'] = $category->getVar('title');
+ $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . 'viewcat.php?cid=' . $cid;
+ $notification_handler = & xoops_gethandler('notification');
+ $notification_handler -> triggerEvent('global', 0, 'new_file', $tags);
+ $notification_handler -> triggerEvent('category', $cid, 'new_file', $tags);
+ }
+ if ($lid && $approved && $notifypub) {
+ $tags = array();
+ $tags['FILE_NAME'] = $title;
+ $tags['FILE_URL'] = WFDOWNLOADS_URL . 'singlefile.php?cid=' . $cid . '&lid=' . $lid;
+ $category_handler = xoops_getmodulehandler('category');
+ $category = $category_handler->get($cid);
+ $tags['CATEGORY_NAME'] = $category->getVar('title');
+ $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . 'viewcat.php?cid=' . $cid;
+ $notification_handler = & xoops_gethandler('notification');
+ $notification_handler -> triggerEvent('global', 0, 'new_file', $tags);
+ $notification_handler -> triggerEvent('category', $cid, 'new_file', $tags);
+ $notification_handler -> triggerEvent('file', $lid, 'approve', $tags);
+ }
+ $message = (!$lid) ? _AM_WFD_FILE_NEWFILEUPLOAD : _AM_WFD_FILE_FILEMODIFIEDUPDATE ;
+ $message = ($lid && !$_POST['was_published'] && $approved) ? _AM_WFD_FILE_FILEAPPROVED : $message;
+
+ redirect_header(WFDOWNLOADS_URL . 'admin/download.php', 1, $message);
+}
+
+
+
+// Page start here
+$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : 'main';
+switch ($op)
+{
+ case "addDownload":
+ addDownload();
+ break;
+
+ case "download":
+ case "Download":
+ Download();
+ break;
+
+ case "delDownload":
+ global $xoopsModule, $xoopsModuleConfig;
+ $confirm = (isset($_REQUEST['confirm'])) ? true : false;
+ $lid = (isset($_GET['lid'])) ? intval($_GET['lid']) : 0;
+ $lid = (isset($_POST['lid'])) ? intval($_POST['lid']) : $lid;
+ $download_handler = xoops_getmodulehandler('download');
+ $download = $download_handler->get($lid);
+ $title = $download->getVar('title');
+ if ($confirm) {
+ $file = $xoopsModuleConfig['uploaddir'] . "/" . $download->getVar('filename');
+ if (is_file($file)) {
+ @chmod($file, 0777);
+ @unlink($file);
+ }
+ $download_handler->delete($download);
+ redirect_header(WFDOWNLOADS_URL . 'admin/download.php', 1, sprintf(_AM_WFD_FILE_FILEWASDELETED, $title));
+ exit();
+ } else {
+ wfdownloads_xoops_cp_header();
+ xoops_confirm(array('op' => 'delDownload', 'lid' => $lid, 'confirm' => true, 'title' => $title), 'download.php', _AM_WFD_FILE_REALLYDELETEDTHIS . "<br /><br>" . $title, _DELETE);
+ xoops_cp_footer();
+ }
+ break;
+
+ case "delVote":
+ delVote();
+ break;
+
+ // added - start - March 4 2006 - jpc
+ case "patch_formulize":
+ patch_formulize();
+ break;
+ // added - end - March 4 2006 - jpc
+
+ case 'main':
+ default:
+ global $xoopsUser, $xoopsDB, $xoopsConfig;
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
+ $start1 = isset($_GET['start1']) ? intval($_GET['start1']) : 0;
+ $start2 = isset($_GET['start2']) ? intval($_GET['start2']) : 0;
+ $start3 = isset($_GET['start3']) ? intval($_GET['start3']) : 0;
+ $start4 = isset($_GET['start4']) ? intval($_GET['start4']) : 0;
+ $totalcats = wfd_totalcategory();
+
+ $report_handler = xoops_getmodulehandler('report');
+ $review_handler = xoops_getmodulehandler('review');
+ $mirror_handler = xoops_getmodulehandler('mirror');
+ $modification_handler = xoops_getmodulehandler('modification');
+ $download_handler = xoops_getmodulehandler('download');
+
+ $totalbrokendownloads = $report_handler->getCount();
+ $totalmodrequests = $modification_handler->getCount();
+ $newreviews = $review_handler->getCount();
+ $newmirrors = $mirror_handler->getCount();
+ $totalnewdownloads = $download_handler->getCount(new Criteria("published", 0));
+ $totaldownloads = $download_handler->getCount(new Criteria("published", 0, ">"));
+
+ wfdownloads_xoops_cp_header();
+ $indexAdmin = new ModuleAdmin();
+ echo $indexAdmin->addNavigation('main.php');
+ //wfdownloads_adminMenu(0, _AM_WFD_BINDEX);
+
+ // echo "
+ // <fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFD_MINDEX_DOWNSUMMARY . "</legend>\n
+ // <div style='padding: 8px;'><small>\n
+ // <a href='category.php'>" . _AM_WFD_SCATEGORY . "</a><b>" . $totalcats . "</b> | \n
+ // <a href='main.php'>" . _AM_WFD_SFILES . "</a><b>" . $totaldownloads . "</b> | \n
+ // <a href='newdownloads.php'>" . _AM_WFD_SNEWFILESVAL . "</a><b>" . $totalnewdownloads . "</b> | \n
+ // <a href='modifications.php'>" . _AM_WFD_SMODREQUEST . "</a><b>" . $totalmodrequests . "</b> | \n
+ // <a href='broken...
[truncated message content] |
|
From: <luc...@us...> - 2013-05-21 21:00:23
|
Revision: 11570
http://sourceforge.net/p/xoops/svn/11570
Author: luciorota
Date: 2013-05-21 21:00:18 +0000 (Tue, 21 May 2013)
Log Message:
-----------
- added: sort subcategories by cid or title or weight
- fixed: update procedure now updates also permissions
- fixed: language definition in modinfo.php
- fixed: deprecated "XoopsTree"
Modified Paths:
--------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_footer.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header2.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/brokendown.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/category.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/cookies.js
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/download.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/funcs.js
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/index.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/indexpage.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/ip_log.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/menu.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mimetypes.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mirror.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/modifications.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/newdownloads.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/newstory.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/permissions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/review.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/update.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/votedata.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/wfdownloads_top.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/wfdownloads_top_by_cat.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/dbupdater.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/img_uploader.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/ip_log.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mimetype.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mirror.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/modification.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/object.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/rating.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/report.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/review.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/uploader.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/wfd_lists.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_delete.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_edit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_new.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_post.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_reply.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/english/__about.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/footer.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/header.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/comment_functions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/common.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/functions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/notification.inc.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/search.inc.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/update.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/index.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/admin.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/help/help.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/modinfo.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/mirror.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/module.css
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/newlist.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/notification_update.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/ratefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/review.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/rss.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/singlefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/sql/wfdownloads.sql
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_admin_menu.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_brokenfile.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_disclaimer.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_download.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_footer.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_header.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_index.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_mirrors.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_newlistindex.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_ratefile.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_reviews.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_singlefile.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_topten.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_viewcat.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/thickbox.css
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/topten.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/viewcat.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/visit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php
Added Paths:
-----------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/imageupload.php
Removed Paths:
-------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/main.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/upload.php
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php 2013-05-21 20:49:57 UTC (rev 11569)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php 2013-05-21 21:00:18 UTC (rev 11570)
@@ -1,23 +1,23 @@
<?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.
+ 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.
*/
-
/**
- * @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
- * @since
- * @author XOOPS Development Team
- * @version $Id $
+ * WF-Downloads module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package wfdownload
+ * @since 3.23
+ * @author WF-Sections, Xoops Development Team, luciorota
+ * @version svn:$Id$
*/
-
include_once dirname(__FILE__) . '/admin_header.php';
xoops_cp_header();
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_footer.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_footer.php 2013-05-21 20:49:57 UTC (rev 11569)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_footer.php 2013-05-21 21:00:18 UTC (rev 11570)
@@ -1,23 +1,23 @@
<?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.
+ 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.
*/
-
/**
- * @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
- * @since
- * @author XOOPS Development Team
- * @version $Id $
+ * WF-Downloads module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package wfdownload
+ * @since 3.23
+ * @author WF-Sections, Xoops Development Team, luciorota
+ * @version svn:$Id$
*/
-
echo "<div class='adminfooter'>\n"
." <div style='text-align: center;'>\n"
." <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php 2013-05-21 20:49:57 UTC (rev 11569)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php 2013-05-21 21:00:18 UTC (rev 11570)
@@ -1,23 +1,23 @@
<?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.
+ 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.
*/
-
/**
- * @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
- * @since
- * @author XOOPS Development Team
- * @version $Id $
+ * WF-Downloads module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package wfdownload
+ * @since 3.23
+ * @author WF-Sections, Xoops Development Team, luciorota
+ * @version svn:$Id$
*/
-
$path = dirname(dirname(dirname(dirname(__FILE__))));
include_once $path . '/mainfile.php';
include_once $path . '/include/cp_functions.php';
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header2.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header2.php 2013-05-21 20:49:57 UTC (rev 11569)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header2.php 2013-05-21 21:00:18 UTC (rev 11570)
@@ -1,13 +1,23 @@
<?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.
+ */
/**
- * $Id: admin_header.php,v 1.5 2007/08/10 20:59:33 m0nty_ Exp $
- * Module: WF-Downloads
- * Version: v2.0.5a
- * Release Date: 26 july 2004
- * Author: WF-Sections
- * Licence: GNU
+ * WF-Downloads module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package wfdownload
+ * @since 3.23
+ * @author WF-Sections, Xoops Development Team, luciorota
+ * @version svn:$Id$
*/
-
include '../../../include/cp_header.php';
include_once(XOOPS_ROOT_PATH . '/modules/wfdownloads/include/functions.php');
include_once(XOOPS_ROOT_PATH . '/modules/wfdownloads/include/common.php');
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/brokendown.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/brokendown.php 2013-05-21 20:49:57 UTC (rev 11569)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/brokendown.php 2013-05-21 21:00:18 UTC (rev 11570)
@@ -1,13 +1,23 @@
<?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.
+ */
/**
- * $Id: brokendown.php,v 1.7 2007/09/30 12:39:13 m0nty_ Exp $
- * Module: WF-Downloads
- * Version: v2.0.5a
- * Release Date: 26 july 2004
- * Author: WF-Sections
- * Licence: GNU
+ * WF-Downloads module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package wfdownload
+ * @since 3.23
+ * @author WF-Sections, Xoops Development Team, luciorota
+ * @version svn:$Id$
*/
-
include 'admin_header.php';
$op = '';
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/category.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/category.php 2013-05-21 20:49:57 UTC (rev 11569)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/category.php 2013-05-21 21:00:18 UTC (rev 11570)
@@ -1,11 +1,22 @@
<?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.
+ */
/**
- * $Id: category.php,v 1.11 2007/09/30 12:39:13 m0nty_ Exp $
- * Module: WF-Downloads
- * Version: v2.0.5a
- * Release Date: 26 july 2004
- * Author: WF-Sections
- * Licence: GNU
+ * WF-Downloads module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package wfdownload
+ * @since 3.23
+ * @author WF-Sections, Xoops Development Team, luciorota
+ * @version svn:$Id$
*/
include 'admin_header.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/cookies.js
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/cookies.js 2013-05-21 20:49:57 UTC (rev 11569)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/cookies.js 2013-05-21 21:00:18 UTC (rev 11570)
@@ -1,4 +1,24 @@
+/*
+ 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 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package wfdownload
+ * @since 3.23
+ * @author WF-Sections, Xoops Development Team, luciorota
+ * @version svn:$Id$
+ */
+
+/**
* Read the JavaScript cookies tutorial at:
* http://www.netspade.com/articles/javascript/cookies.xml
*/
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/download.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/download.php 2013-05-21 20:49:57 UTC (rev 11569)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/download.php 2013-05-21 21:00:18 UTC (rev 11570)
@@ -1,48 +1,59 @@
<?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.
+ */
/**
- * $Id: main.php,v 1.23 2007/09/30 12:39:13 m0nty_ Exp $
- * Module: WF-Downloads
- * Version: v2.0.5a
- * Release Date: 26 july 2004
- * Author: WF-Sections
- * Licence: GNU
+ * WF-Downloads module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package wfdownload
+ * @since 3.23
+ * @author WF-Sections, Xoops Development Team, luciorota
+ * @version svn:$Id$
*/
-
include 'admin_header.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
-include_once WFDOWNLOADS_ROOT_PATH . 'class/wfd_lists.php';
+include_once WFDOWNLOADS_ROOT_PATH.'class/wfd_lists.php';
include_once XOOPS_ROOT_PATH . '/class/tree.php';
include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
-//$mytree = new XoopsTree($xoopsDB -> prefix('wfdownloads_cat'), "cid", "pid");
-
function Download()
{
- $lid = isset($_REQUEST['lid']) ? intval($_REQUEST['lid']) : 0;
+ $download_handler = xoops_getmodulehandler('download');
+ $category_handler = xoops_getmodulehandler('category');
- $category_handler = xoops_getmodulehandler('category');
+ $lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
+
$numrows = $category_handler->getCount();
if ($numrows) {
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
- echo $indexAdmin->addNavigation('main.php');
+ echo $indexAdmin->addNavigation('download.php');
- //wfdownloads_adminMenu(3, _AM_WFD_MDOWNLOADS);
+ $adminMenu = new ModuleAdmin();
+ $adminMenu->addItemButton(_MI_WFD_BINDEX, 'download.php?op=list', 'list');
+ $adminMenu->addItemButton(_AM_WFD_FFS_DOWNLOADTITLE, 'download.php?op=Download', 'add');
+ echo $adminMenu->renderButton();
- echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFD_FILE_ALLOWEDAMIME . "</legend>\n
- <div style='padding: 8px;'>\n";
-
+ // allowed mimetypes list
+ echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFD_FILE_ALLOWEDAMIME . "</legend>\n";
+ echo "<div style='padding: 8px;'>\n";
$mime_handler = xoops_getmodulehandler('mimetype');
$criteria = new Criteria("mime_admin", 1);
$mimetypes = $mime_handler->getList($criteria);
$allowmimetypes = implode(' | ', $mimetypes);
echo $allowmimetypes;
- echo "</div>\n
- </fieldset><br />\n
- ";
+ echo "</div>\n";
+ echo "</fieldset><br />\n";
- $download_handler = xoops_getmodulehandler('download');
if ($lid) {
$download = $download_handler->get($lid);
$title = _AM_WFD_FILE_MODIFYFILE;
@@ -80,7 +91,7 @@
$customArray['fid'] = $fid;
$customArray['formulize_mgr'] =& xoops_getmodulehandler('elements', 'formulize');
- $customArray['groups'] = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
+ $customArray['groups'] = $xoopsUser ? $xoopsUser->getGroups() : array(0=>XOOPS_GROUP_ANONYMOUS);
$customArray['prevEntry'] = getEntryValues($download->getVar('formulize_idreq'), $customArray['formulize_mgr'], $customArray['groups'], $fid);
$customArray['entry'] = $download->getVar('formulize_idreq');
$customArray['go_back'] = "";
@@ -92,7 +103,7 @@
$customArray['owner_groups'] = $owner_groups;
}
- $sform = $download->getAdminForm($title, $customArray);
+ $sform = $download->getAdminForm($title, $customArray);
} elseif(file_exists(XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php")) {
$sform = $download->getCategoryForm();
} else {
@@ -101,7 +112,7 @@
$sform->display();
// changed - end - March 4 2006 - jpc
} else {
- redirect_header(WFDOWNLOADS_URL . 'admin/category.php?', 1, _AM_WFD_CCATEGORY_NOEXISTS);
+ redirect_header(WFDOWNLOADS_URL.'admin/category.php?', 1, _AM_WFD_CCATEGORY_NOEXISTS);
exit();
}
@@ -124,10 +135,8 @@
$anon_criteria->setSort("ratingtimestamp");
$anon_criteria->setOrder("DESC");
- echo "
- <fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFD_VOTE_RATINGINFOMATION . "</legend>\n
- <div style='padding: 8px;'><b>" . _AM_WFD_VOTE_TOTALVOTES . "</b>" . $totalvotes . "<br /><br />\n
- ";
+ echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFD_VOTE_RATINGINFOMATION . "</legend>\n";
+ echo "<div style='padding: 8px;'><b>" . _AM_WFD_VOTE_TOTALVOTES . "</b>" . $totalvotes . "<br /><br />\n";
printf(_AM_WFD_VOTE_REGUSERVOTES, $votesreg);
@@ -136,18 +145,18 @@
printf(_AM_WFD_VOTE_ANONUSERVOTES, $votesanon);
echo "
- </div>\n
- <table width='100%' cellspacing='1' cellpadding='2' class='outer'>\n
- <tr>\n
- <th align='center'>" . _AM_WFD_VOTE_USER . "</td>\n
- <th align='center'>" . _AM_WFD_VOTE_IP . "</td>\n
- <th align='center'>" . _AM_WFD_VOTE_RATING . "</td>\n
- <th align='center'>" . _AM_WFD_VOTE_USERAVG . "</td>\n
- <th align='center'>" . _AM_WFD_VOTE_TOTALRATE . "</td>\n
- <th align='center'>" . _AM_WFD_VOTE_DATE . "</td>\n
- <th align='center'>" . _AM_WFD_MINDEX_ACTION . "</td>\n
- </tr>\n
- ";
+ </div>\n
+ <table width='100%' cellspacing='1' cellpadding='2' class='outer'>\n
+ <tr>\n
+ <th align='center'>" . _AM_WFD_VOTE_USER . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_IP . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_RATING . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_USERAVG . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_TOTALRATE . "</td>\n
+ <th align='center'>" . _AM_WFD_VOTE_DATE . "</td>\n
+ <th align='center'>" . _AM_WFD_MINDEX_ACTION . "</td>\n
+ </tr>\n
+ ";
if ($votesreg == 0) {
echo "<tr><td align='center' colspan='7' class='even'><b>" . _AM_WFD_VOTE_NOREGVOTES . "</b></td></tr>";
@@ -156,7 +165,7 @@
$uids[] = $regvotes[$i]->getVar('ratinguser');
}
- $criteria = new Criteria("ratinguser", "(" . implode(',', $uids) . ")", "IN");
+ $criteria = new Criteria("ratinguser", "(".implode(',', $uids).")", "IN");
$criteria->setGroupby("ratinguser");
$userratings = $rating_handler->getUserAverage($criteria);
@@ -175,7 +184,7 @@
<td align='center' class='even'>$uservotes</th>\n
<td align='center' class='even'>$formatted_date</th>\n
<td align='center' class='even'>\n
- <a href='" . WFDOWNLOADS_URL . "admin/main.php?op=delVote&lid=" . $lid . "&rid=" . $regvotes[$i]->getVar('ratingid') . "'>" . $imagearray['deleteimg'] . "</a>\n
+ <a href='" . WFDOWNLOADS_URL . "admin/download.php?op=delVote&lid=" . $lid . "&rid=" . $regvotes[$i]->getVar('ratingid') . "'>" . $imagearray['deleteimg'] . "</a>\n
</th></tr>\n
";
}
@@ -216,7 +225,7 @@
<td align='center' class='even'>$uservotes</th>\n
<td align='center' class='even'>$formatted_date</th>\n
<td align='center' class='even'>\n
- <a href='" . WFDOWNLOADS_URL . "admin/main.php?op=delVote&lid=" . $lid . "&rid=" . $anonvotes[$i]->getVar('ratingid') . "'>" . $imagearray['deleteimg'] . "</a>\n
+ <a href='" . WFDOWNLOADS_URL . "admin/download.php?op=delVote&lid=" . $lid . "&rid=" . $anonvotes[$i]->getVar('ratingid') . "'>" . $imagearray['deleteimg'] . "</a>\n
</th></tr>\n
";
}
@@ -237,7 +246,7 @@
if ($rating_handler->delete($rating, true)) {
wfd_updaterating(intval($rating->getVar('lid')));
}
- redirect_header(WFDOWNLOADS_URL . 'admin/main.php', 1, _AM_WFD_VOTE_VOTEDELETED);
+ redirect_header(WFDOWNLOADS_URL . 'admin/download.php', 1, _AM_WFD_VOTE_VOTEDELETED);
}
function addDownload()
@@ -251,9 +260,11 @@
$download_handler = xoops_getmodulehandler('download');
if ($lid > 0) {
$thisIsANewRecord = false; /* Added by Lankford on 2007/3/21 */
+
$download = $download_handler->get($lid);
} else {
$thisIsANewRecord = true; /* Added by Lankford on 2007/3/21 */
+
$download = $download_handler->create();
}
@@ -276,7 +287,8 @@
$download->setVar('filetype', $filetype);
} else {
global $_FILES;
- $down = wfd_uploading($_FILES, $xoopsModuleConfig['uploaddir'], "", "download.php?op=download", 0, 0);
+
+ $down = wfd_uploading($_FILES, $xoopsModuleConfig['uploaddir'], "", "download.php", 0, 0);
$url = ($_POST["url"] != "http://") ? $_POST["url"] : '';
$size = $down['size'];
$title = $_FILES['userfile']['name'];
@@ -419,6 +431,7 @@
$download->setVar('ipaddress', $_SERVER['REMOTE_ADDR']);
}
+
// added - start - March 4 2006 - jpc
$category_handler = xoops_getmodulehandler('category');
$category = $category_handler->get($cid);
@@ -446,9 +459,9 @@
}
$member_handler =& xoops_gethandler('member...
[truncated message content] |
|
From: <luc...@us...> - 2014-09-16 20:31:57
|
Revision: 12782
http://sourceforge.net/p/xoops/svn/12782
Author: luciorota
Date: 2014-09-16 20:31:50 +0000 (Tue, 16 Sep 2014)
Log Message:
-----------
standardize code
use absolute path/url where possible
Modified Paths:
--------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/images.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/index.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/indexpage.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mimetypes.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mirrors.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/permissions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/ratings.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reviews.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/swishe.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/top.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/top_by_cat.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/breadcrumb.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mimetype.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mirror.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/rating.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/review.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/wfdownloads_lists.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/xoopstree.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_delete.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_edit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_new.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_post.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_reply.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/comment_functions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/common.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/constants.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/directorychecker.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/filechecker.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/functions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/notification.inc.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/oninstall.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onuninstall.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/search.inc.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/index.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/mirror.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/newlist.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/notification_update.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/ratefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/review.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/rss.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/singlefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_newlistindex.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/topten.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/viewcat.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/visit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php 2014-09-15 03:39:05 UTC (rev 12781)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php 2014-09-16 20:31:50 UTC (rev 12782)
@@ -27,4 +27,4 @@
echo $aboutAdmin->addNavigation('about.php');
echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
-include 'admin_footer.php';
+include_once dirname(__FILE__) . '/admin_footer.php';
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php 2014-09-15 03:39:05 UTC (rev 12781)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php 2014-09-16 20:31:50 UTC (rev 12782)
@@ -35,6 +35,6 @@
xoops_loadLanguage('main', $wfdownloads->getModule()->dirname());
if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
- include_once(XOOPS_ROOT_PATH . '/class/template.php');
+ include_once XOOPS_ROOT_PATH . '/class/template.php';
$xoopsTpl = new XoopsTpl();
}
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php 2014-09-15 03:39:05 UTC (rev 12781)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php 2014-09-16 20:31:50 UTC (rev 12782)
@@ -91,13 +91,13 @@
case "addCat" :
$cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
$pid = WfdownloadsRequest::getInt('pid', 0, 'POST');
- $weight = (isset($_POST["weight"]) && $_POST["weight"] > 0) ? (int) $_POST["weight"] : 0;
+ $weight = (isset($_POST['weight']) && $_POST['weight'] > 0) ? (int) $_POST["weight"] : 0;
$down_groups = isset($_POST['groups']) ? $_POST['groups'] : array();
$up_groups = isset($_POST['up_groups']) ? $_POST['up_groups'] : array();
- $spotlighthis = (isset($_POST["lid"])) ? (int) $_POST["lid"] : 0;
- $spotlighttop = (isset($_POST["spotlighttop"]) && ($_POST["spotlighttop"] == 1)) ? 1 : 0;
+ $spotlighthis = (isset($_POST['lid'])) ? (int) $_POST['lid'] : 0;
+ $spotlighttop = (isset($_POST['spotlighttop']) && ($_POST['spotlighttop'] == 1)) ? 1 : 0;
- include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+ include_once XOOPS_ROOT_PATH . '/class/uploader.php';
$allowedMimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');
$maxFileSize = $wfdownloads->getConfig('maxfilesize');
$maxImgWidth = $wfdownloads->getConfig('maximgwidth');
@@ -109,12 +109,12 @@
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
$errors = $uploader->getErrors();
- redirect_header("javascript:history.go(-1)",3, $errors);
+ redirect_header('javascript:history.go(-1)',3, $errors);
} else {
$imgurl = $uploader->getSavedFileName();
}
} else {
- $imgurl = (isset($_POST["imgurl"]) && $_POST["imgurl"] != "blank.png") ? $myts -> addslashes($_POST["imgurl"]) : "";
+ $imgurl = (isset($_POST['imgurl']) && $_POST['imgurl'] != 'blank.png') ? $myts -> addslashes($_POST['imgurl']) : '';
}
if (!$cid) {
@@ -127,12 +127,12 @@
}
}
- $categoryObj->setVar('title', $_POST["title"]);
+ $categoryObj->setVar('title', $_POST['title']);
$categoryObj->setVar('pid', $pid);
$categoryObj->setVar('weight', $weight);
$categoryObj->setVar('imgurl', $imgurl);
- $categoryObj->setVar('description', $_POST["description"]);
- $categoryObj->setVar('summary', $_POST["summary"]);
+ $categoryObj->setVar('description', $_POST['description']);
+ $categoryObj->setVar('summary', $_POST['summary']);
$categoryObj->setVar('dohtml', isset($_POST['dohtml']));
$categoryObj->setVar('dosmiley', isset($_POST['dosmiley']));
$categoryObj->setVar('doxcode', isset($_POST['doxcode']));
@@ -140,7 +140,7 @@
$categoryObj->setVar('dobr', isset($_POST['dobr']));
// Formulize module support (2006/05/04) jpc - start
if (wfdownloads_checkModule('formulize')) {
- $formulize_fid = (isset($_POST["formulize_fid"])) ? (int) $_POST["formulize_fid"] : 0;
+ $formulize_fid = (isset($_POST['formulize_fid'])) ? (int) $_POST['formulize_fid'] : 0;
$categoryObj->setVar('formulize_fid', $formulize_fid);
}
// Formulize module support (2006/05/04) jpc - end
@@ -238,7 +238,7 @@
$form = $categoryObj->getForm();
$form -> display();
- include 'admin_footer.php';
+ include_once dirname(__FILE__) . '/admin_footer.php';
break;
case 'categories.list' :
@@ -261,7 +261,7 @@
} else {
redirect_header("{$currentFile}?op=category.add", 1, _AM_WFDOWNLOADS_CCATEGORY_NOEXISTS);
}
- include 'admin_footer.php';
+ include_once dirname(__FILE__) . '/admin_footer.php';
break;
case 'categories.reorder' :
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php 2014-09-15 03:39:05 UTC (rev 12781)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php 2014-09-16 20:31:50 UTC (rev 12782)
@@ -44,8 +44,8 @@
}
$patterns = array(
- strtolower(WFDOWNLOADS_DIRNAME) => strtolower($cloneDirname),
- strtoupper(WFDOWNLOADS_DIRNAME) => strtoupper($cloneDirname),
+ strtolower(WFDOWNLOADS_DIRNAME) => strtolower($cloneDirname),
+ strtoupper(WFDOWNLOADS_DIRNAME) => strtoupper($cloneDirname),
ucfirst(strtolower(WFDOWNLOADS_DIRNAME)) => ucfirst(strtolower($cloneDirname))
);
@@ -54,7 +54,7 @@
wfdownloads_cloneFileDir(WFDOWNLOADS_ROOT_PATH);
$logocreated = wfdownloads_createLogo(strtolower($cloneDirname));
- $message = "";
+ $message = '';
if (is_dir(XOOPS_ROOT_PATH . '/modules/' . strtolower($cloneDirname))) {
$message .= sprintf(
_AM_WFDOWNLOADS_CLONE_CONGRAT,
@@ -71,7 +71,7 @@
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
echo $message;
- include 'admin_footer.php';
+ include_once dirname(__FILE__) . '/admin_footer.php';
exit();
} else {
@@ -79,17 +79,14 @@
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
- $form = new XoopsThemeForm(sprintf(
- _AM_WFDOWNLOADS_CLONE_TITLE,
- $wfdownloads->getModule()->getVar('name', 'E')
- ), 'clone', $currentFile, 'post', true);
+ $form = new XoopsThemeForm(sprintf(_AM_WFDOWNLOADS_CLONE_TITLE, $wfdownloads->getModule()->getVar('name', 'E')), 'clone', $currentFile, 'post', true);
$cloneDirname_text = new XoopsFormText(_AM_WFDOWNLOADS_CLONE_NAME, 'clonedirname', 18, 18, '');
$cloneDirname_text->setDescription(_AM_WFDOWNLOADS_CLONE_NAME_DSC);
$form->addElement($cloneDirname_text, true);
$form->addElement(new XoopsFormHidden('op', 'submit'));
$form->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit'));
$form->display();
- include 'admin_footer.php';
+ include_once dirname(__FILE__) . '/admin_footer.php';
exit();
}
@@ -138,16 +135,16 @@
{
$wfdownloads = WfdownloadsWfdownloads::getInstance();
// Check extension/functions
- if (!extension_loaded("gd")) {
+ if (!extension_loaded('gd')) {
return false;
} else {
$required_functions = array(
- "imagecreatetruecolor",
- "imagecolorallocate",
- "imagefilledrectangle",
- "imagejpeg",
- "imagedestroy",
- "imageftbbox"
+ 'imagecreatetruecolor',
+ 'imagecolorallocate',
+ 'imagefilledrectangle',
+ 'imagejpeg',
+ 'imagedestroy',
+ 'imageftbbox'
);
foreach ($required_functions as $func) {
if (!function_exists($func)) {
@@ -156,10 +153,10 @@
}
}
// Check original image/font
- if (!file_exists($imageBase = XOOPS_ROOT_PATH . "/modules/" . $dirname . "/assets/images/module_logo_blank.png")) {
+ if (!file_exists($imageBase = XOOPS_ROOT_PATH . "/modules/{$dirname}/assets/images/module_logo_blank.png")) {
return false;
}
- if (!file_exists($font = XOOPS_ROOT_PATH . "/modules/" . $wfdownloads->getModule()->dirname() . "/assets/images/VeraBd.ttf")) {
+ if (!file_exists($font = XOOPS_ROOT_PATH . "/modules/{$wfdownloads->getModule()->dirname()}/assets/images/VeraBd.ttf")) {
return false;
}
// Create image
@@ -168,7 +165,7 @@
$greyColor = imagecolorallocate($imageModule, 237, 237, 237);
imagefilledrectangle($imageModule, 5, 35, 85, 46, $greyColor);
// Write text
- $textColor = imagecolorallocate($imageModule, 0, 0, 0);
+ $textColor = imagecolorallocate($imageModule, 0, 0, 0);
$space_to_border = (80 - strlen($dirname) * 6.5) / 2;
imagefttext($imageModule, 8.5, 0, $space_to_border, 45, $textColor, $font, ucfirst($dirname), array());
// Set transparency color
@@ -176,7 +173,7 @@
imagefill($imageModule, 0, 0, $whiteColor);
imagecolortransparent($imageModule, $whiteColor);
// Save new image
- imagepng($imageModule, XOOPS_ROOT_PATH . "/modules/" . $dirname . "/assets/images/module_logo.png");
+ imagepng($imageModule, XOOPS_ROOT_PATH . "/modules/{$dirname}/assets/images/module_logo.png");
imagedestroy($imageModule);
return true;
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-09-15 03:39:05 UTC (rev 12781)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-09-16 20:31:50 UTC (rev 12782)
@@ -41,9 +41,9 @@
$op = WfdownloadsRequest::getString('op', 'downloads.list');
switch ($op) {
- case "download.edit" :
- case "download.add" :
- case "Download" :
+ case 'download.edit':
+ case 'download.add':
+ case 'Download':
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
@@ -59,8 +59,8 @@
// Allowed mimetypes list
echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFDOWNLOADS_FILE_ALLOWEDAMIME . "</legend>\n";
echo "<div style='padding: 8px;'>\n";
- $criteria = new Criteria("mime_admin", true);
- $mimetypes = $wfdownloads->getHandler('mimetype')->getList($criteria);
+ $criteria = new Criteria("mime_admin", true);
+ $mimetypes = $wfdownloads->getHandler('mimetype')->getList($criteria);
$allowMimetypes = implode(' | ', $mimetypes);
echo $allowMimetypes;
echo "</div>\n";
@@ -83,7 +83,7 @@
} else {
// create download
$downloadObj = $wfdownloads->getHandler('download')->create();
- $cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
+ $cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
$categoryObj = $wfdownloads->getHandler('category')->get($cid);
$downloadObj->setVar('cid', $cid);
$title = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FILE_CREATE);
@@ -97,15 +97,15 @@
$sform = $downloadObj->getAdminForm($title);
} elseif ((isset($_POST['submit_category']) && !empty($_POST['submit_category']))) {
// two steps form: 2nd step
- $fid = $categoryObj->getVar('formulize_fid');
+ $fid = $categoryObj->getVar('formulize_fid');
$customArray = array();
if ($fid) {
- include_once XOOPS_ROOT_PATH . "/modules/formulize/include/formdisplay.php";
- include_once XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php";
- $customArray['fid'] = $fid;
+ include_once XOOPS_ROOT_PATH . '/modules/formulize/include/formdisplay.php';
+ include_once XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php';
+ $customArray['fid'] = $fid;
$customArray['formulize_mgr'] = xoops_getmodulehandler('elements', 'formulize');
- $customArray['groups'] = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
- $customArray['prevEntry'] = getEntryValues( // is a Formulize function
+ $customArray['groups'] = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
+ $customArray['prevEntry'] = getEntryValues( // is a Formulize function
$downloadObj->getVar('formulize_idreq'),
$customArray['formulize_mgr'],
$customArray['groups'],
@@ -117,14 +117,14 @@
null
);
$customArray['entry'] = $downloadObj->getVar('formulize_idreq');
- $customArray['go_back'] = "";
- $customArray['parentLinks'] = "";
+ $customArray['go_back'] = '';
+ $customArray['parentLinks'] = '';
if (wfdownloads_checkModule('formulize') < 300) {
$owner = getEntryOwner($customArray['entry']); // is a Formulize function
} else {
$owner = getEntryOwner($customArray['entry'], $fid); // is a Formulize function
}
- $ownerGroups = $member_handler->getGroupsByUser($owner, false);
+ $ownerGroups = $member_handler->getGroupsByUser($owner, false);
$customArray['owner_groups'] = $ownerGroups;
}
$sform = $downloadObj->getAdminForm($title22, $customArray);
@@ -141,29 +141,29 @@
// Vote data list/manager
if ($lid) {
- $votes_count = $wfdownloads->getHandler('rating')->getCount();
+ $ratingCount = $wfdownloads->getHandler('rating')->getCount();
- $registeredCriteria = new CriteriaCompo(new Criteria('lid', $lid));
- $registeredCriteria->add(new Criteria('ratinguser', 0, '>'));
- $votesreg = $wfdownloads->getHandler('rating')->getCount($registeredCriteria);
- $registeredCriteria->setSort('ratingtimestamp');
- $registeredCriteria->setOrder('DESC');
- $regvotes = $wfdownloads->getHandler('rating')->getObjects($registeredCriteria);
+ $regUserCriteria = new CriteriaCompo(new Criteria('lid', $lid));
+ $regUserCriteria->add(new Criteria('ratinguser', 0, '>'));
+ $regUserRatingCount = $wfdownloads->getHandler('rating')->getCount($regUserCriteria);
+ $regUserCriteria->setSort('ratingtimestamp');
+ $regUserCriteria->setOrder('DESC');
+ $regUserRatingObjs = $wfdownloads->getHandler('rating')->getObjects($regUserCriteria);
- $anonymousCriteria = new CriteriaCompo(new Criteria('lid', $lid));
- $anonymousCriteria->add(new Criteria('ratinguser', 0, '='));
- $votesanon = $wfdownloads->getHandler('rating')->getCount($anonymousCriteria);
- $anonymousCriteria->setSort('ratingtimestamp');
- $anonymousCriteria->setOrder('DESC');
+ $anonUserCriteria = new CriteriaCompo(new Criteria('lid', $lid));
+ $anonUserCriteria->add(new Criteria('ratinguser', 0, '='));
+ $anonUserRatingCount = $wfdownloads->getHandler('rating')->getCount($anonUserCriteria);
+ $anonUserCriteria->setSort('ratingtimestamp');
+ $anonUserCriteria->setOrder('DESC');
echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFDOWNLOADS_VOTE_RATINGINFOMATION . "</legend>\n";
- echo "<div style='padding: 8px;'><b>" . _AM_WFDOWNLOADS_VOTE_TOTALVOTES . "</b>{$votes_count}<br /><br />\n";
+ echo "<div style='padding: 8px;'><b>" . _AM_WFDOWNLOADS_VOTE_TOTALVOTES . "</b>{$ratingCount}<br /><br />\n";
- printf(_AM_WFDOWNLOADS_VOTE_REGUSERVOTES, $votesreg);
+ printf(_AM_WFDOWNLOADS_VOTE_REGUSERVOTES, $regUserRatingCount);
echo "<br />";
- printf(_AM_WFDOWNLOADS_VOTE_ANONUSERVOTES, $votesanon);
+ printf(_AM_WFDOWNLOADS_VOTE_ANONUSERVOTES, $anonUserRatingCount);
echo "
</div>\n
@@ -179,36 +179,32 @@
</tr>\n
";
- if ($votesreg == 0) {
+ if ($regUserRatingCount == 0) {
echo "<tr><td colspan='7' class='even'><b>" . _AM_WFDOWNLOADS_VOTE_NOREGVOTES . "</b></td></tr>";
} else {
- foreach (array_keys($regvotes) as $i) {
- $uids[] = $regvotes[$i]->getVar('ratinguser');
+ foreach ($regUserRatingObjs as $regUserRatingObj) {
+ $uids[] = $regUserRatingObj->getVar('ratinguser');
}
- $criteria = new Criteria("ratinguser", "(" . implode(',', $uids) . ")", "IN");
- $criteria->setGroupby("ratinguser");
+ $criteria = new Criteria('ratinguser', '(' . implode(',', $uids) . ')', 'IN');
+ $criteria->setGroupby('ratinguser');
$userRatings = $wfdownloads->getHandler('rating')->getUserAverage($criteria);
- foreach (array_keys($regvotes) as $i) {
- $formatted_date = XoopsLocal::formatTimestamp($regvotes[$i]->getVar('ratingtimestamp'), 'l');
- $userAvgRating = isset($userRatings[$regvotes[$i]->getVar('ratinguser')]) ? $userRatings[$regvotes[$i]->getVar(
- 'ratinguser'
- )]["avg"] : 0;
- $userVotes = isset($userRatings[$regvotes[$i]->getVar('ratinguser')]) ? $userRatings[$regvotes[$i]->getVar(
- 'ratinguser'
- )]["count"] : 0;
- $ratingUserName = XoopsUser :: getUnameFromId($regvotes[$i]->getVar('ratinguser'));
+ foreach ($regUserRatingObjs as $regUserRatingObj) {
+ $formatted_date = XoopsLocal::formatTimestamp($regUserRatingObj->getVar('ratingtimestamp'), 'l');
+ $userAvgRating = isset($userRatings[$regUserRatingObj->getVar('ratinguser')]) ? $userRatings[$regUserRatingObj->getVar('ratinguser')]['avg'] : 0;
+ $userVotes = isset($userRatings[$regUserRatingObj->getVar('ratinguser')]) ? $userRatings[$regUserRatingObj->getVar('ratinguser')]['count'] : 0;
+ $ratingUserName = XoopsUser :: getUnameFromId($regUserRatingObj->getVar('ratinguser'));
echo "
<tr><td class='head'>$ratingUserName</td>\n
- <td class='even'>" . $regvotes[$i]->getVar('ratinghostname') . "</th>\n
- <td class='even'>" . $regvotes[$i]->getVar('rating') . "</th>\n
+ <td class='even'>" . $regUserRatingObj->getVar('ratinghostname') . "</th>\n
+ <td class='even'>" . $regUserRatingObj->getVar('rating') . "</th>\n
<td class='even'>$userAvgRating</th>\n
<td class='even'>$userVotes</th>\n
<td class='even'>$formatted_date</th>\n
<td class='even'>\n
- <a href='{$currentFile}?op=vote.delete&lid={$lid}&rid=" . $regvotes[$i]->getVar('ratingid') . "'>"
+ <a href='{$currentFile}?op=vote.delete&lid={$lid}&rid=" . $regUserRatingObj->getVar('ratingid') . "'>"
. $imagearray['deleteimg'] . "</a>\n
</th></tr>\n
";
@@ -228,29 +224,29 @@
<th>" . _AM_WFDOWNLOADS_MINDEX_ACTION . "</td>\n
</tr>\n
";
- if ($votesanon == 0) {
+ if ($anonUserRatingCount == 0) {
echo "<tr><td colspan='7' class='even'><b>" . _AM_WFDOWNLOADS_VOTE_NOUNREGVOTES . "</b></td></tr>";
} else {
- $criteria = new Criteria('ratinguser', 0);
- $userRatings = $wfdownloads->getHandler('rating')->getUserAverage($criteria);
- $anonymousVotes = $wfdownloads->getHandler('rating')->getObjects($anonymousCriteria);
+ $criteria = new Criteria('ratinguser', 0);
+ $userRatings = $wfdownloads->getHandler('rating')->getUserAverage($criteria);
+ $anonUserRatingObjs = $wfdownloads->getHandler('rating')->getObjects($anonUserCriteria);
- foreach (array_keys($anonymousVotes) as $i) {
- $formatted_date = XoopsLocal::formatTimestamp($anonymousVotes[$i]->getVar('ratingtimestamp'), 'l');
- $userAvgRating = isset($userRatings['avg']) ? $userRatings["avg"] : 0;
- $userVotes = isset($userRatings['count']) ? $userRatings["count"] : 0;
+ foreach (array_keys($anonUserRatingObjs) as $anonUserRatingObj) {
+ $formatted_date = XoopsLocal::formatTimestamp($anonUserRatingObj->getVar('ratingtimestamp'), 'l');
+ $userAvgRating = isset($userRatings['avg']) ? $userRatings['avg'] : 0;
+ $userVotes = isset($userRatings['count']) ? $userRatings['count'] : 0;
$ratingUserName = $GLOBALS['xoopsConfig']['anonymous'];
echo "
<tr><td class='head'>$ratingUserName</td>\n
- <td class='even'>" . $anonymousVotes[$i]->getVar('ratinghostname') . "</th>\n
- <td class='even'>" . $anonymousVotes[$i]->getVar('rating') . "</th>\n
+ <td class='even'>" . $anonUserRatingObj->getVar('ratinghostname') . "</th>\n
+ <td class='even'>" . $anonUserRatingObj->getVar('rating') . "</th>\n
<td class='even'>$userAvgRating</th>\n
<td class='even'>$userVotes</th>\n
<td class='even'>$formatted_date</th>\n
<td class='even'>\n
- <a href='{$currentFile}?op=vote.delete&lid={$lid}&rid=" . $anonymousVotes[$i]->getVar('ratingid') . "'>"
+ <a href='{$currentFile}?op=vote.delete&lid={$lid}&rid=" . $anonUserRatingObj->getVar('ratingid') . "'>"
. $imagearray['deleteimg'] . "</a>\n
</th></tr>\n
";
@@ -259,32 +255,32 @@
echo "</table>\n";
echo "</fieldset>\n";
}
- include 'admin_footer.php';
+ include_once dirname(__FILE__) . '/admin_footer.php';
break;
- case "download.save" :
- case "addDownload" :
- $lid = WfdownloadsRequest::getInt('lid', 0, 'POST');
- $cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
+ case 'download.save':
+ case 'addDownload':
+ $lid = WfdownloadsRequest::getInt('lid', 0, 'POST');
+ $cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
$status = WfdownloadsRequest::getInt('status', _WFDOWNLOADS_STATUS_UPDATED, 'POST');
if ($lid > 0) {
$thisIsANewRecord = false; /* Added by Lankford on 2007/3/21 */
- $downloadObj = $wfdownloads->getHandler('download')->get($lid);
+ $downloadObj = $wfdownloads->getHandler('download')->get($lid);
} else {
$thisIsANewRecord = true; /* Added by Lankford on 2007/3/21 */
- $downloadObj = $wfdownloads->getHandler('download')->create();
+ $downloadObj = $wfdownloads->getHandler('download')->create();
}
// Define URL
if (empty($_FILES['userfile']['name'])) {
- if ($_POST['url'] && $_POST['url'] != "" && $_POST['url'] != "http://") {
- $url = ($_POST['url'] != "http://") ? $_POST['url'] : '';
+ if ($_POST['url'] && $_POST['url'] != '' && $_POST['url'] != "http://") {
+ $url = ($_POST['url'] != "http://") ? $_POST['url'] : '';
$filename = '';
...
[truncated message content] |
|
From: <luc...@us...> - 2014-09-17 20:13:31
|
Revision: 12789
http://sourceforge.net/p/xoops/svn/12789
Author: luciorota
Date: 2014-09-17 20:13:28 +0000 (Wed, 17 Sep 2014)
Log Message:
-----------
this is my latest version, start from here
Modified Paths:
--------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/search.inc.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/sql/mysql.sql
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php 2014-09-17 13:55:08 UTC (rev 12788)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php 2014-09-17 20:13:28 UTC (rev 12789)
@@ -56,17 +56,17 @@
$categoryObjsTree = new XoopsObjectTree($categoryObjs, 'cid', 'pid');
$sform->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_BMODIFY, $categoryObjsTree->makeSelBox('target', 'title')));
$create_tray = new XoopsFormElementTray('', '');
- $create_tray -> addElement(new XoopsFormHidden('source', $cid));
- $create_tray -> addElement(new XoopsFormHidden('ok', true));
- $create_tray -> addElement(new XoopsFormHidden('op', 'category.move'));
+ $create_tray->addElement(new XoopsFormHidden('source', $cid));
+ $create_tray->addElement(new XoopsFormHidden('ok', true));
+ $create_tray->addElement(new XoopsFormHidden('op', 'category.move'));
$butt_save = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BMOVE, 'submit');
- $butt_save -> setExtra('onclick="this.form.elements.op.value=\'category.move\'"');
- $create_tray -> addElement($butt_save);
+ $butt_save->setExtra('onclick="this.form.elements.op.value=\'category.move\'"');
+ $create_tray->addElement($butt_save);
$butt_cancel = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BCANCEL, 'submit');
- $butt_cancel -> setExtra('onclick="this.form.elements.op.value=\'cancel\'"');
+ $butt_cancel->setExtra('onclick="this.form.elements.op.value=\'cancel\'"');
$create_tray -> addElement($butt_cancel);
- $sform -> addElement($create_tray);
- $sform -> display();
+ $sform->addElement($create_tray);
+ $sform->display();
xoops_cp_footer();
} else {
$source = WfdownloadsRequest::getInt('source', 0, 'POST');
@@ -77,7 +77,7 @@
if (!$target) {
redirect_header($currentFile . "?op=category.move&ok=0&cid={$source}", 5, _AM_WFDOWNLOADS_CCATEGORY_MODIFY_FAILEDT);
}
- $result = $wfdownloads->getHandler('download')->updateAll("cid", $target, new Criteria("cid", $source), true);
+ $result = $wfdownloads->getHandler('download')->updateAll('cid', $target, new Criteria('cid', $source), true);
if (!$result) {
$error = _AM_WFDOWNLOADS_DBERROR;
trigger_error($error, E_USER_ERROR);
@@ -91,26 +91,26 @@
case 'addCat':
$cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
$pid = WfdownloadsRequest::getInt('pid', 0, 'POST');
- $weight = (isset($_POST['weight']) && $_POST['weight'] > 0) ? (int) $_POST['weight'] : 0;
+ $weight = (isset($_POST['weight']) && $_POST['weight'] > 0) ? (int) $_POST["weight"] : 0;
$down_groups = isset($_POST['groups']) ? $_POST['groups'] : array();
$up_groups = isset($_POST['up_groups']) ? $_POST['up_groups'] : array();
$spotlighthis = (isset($_POST['lid'])) ? (int) $_POST['lid'] : 0;
$spotlighttop = (isset($_POST['spotlighttop']) && ($_POST['spotlighttop'] == 1)) ? 1 : 0;
- $imgurl = 'blank.png';
- include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+ include_once XOOPS_ROOT_PATH . '/class/uploader.php';
$allowedMimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');
+ $imgurl = 'blank.png';
$maxFileSize = $wfdownloads->getConfig('maxfilesize');
$maxImgWidth = $wfdownloads->getConfig('maximgwidth');
$maxImgHeight = $wfdownloads->getConfig('maximgheight');
- $uploadDirectory = XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('catimage');
+ $uploadDirectory = XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('catimage');
$uploader = new XoopsMediaUploader($uploadDirectory, $allowedMimetypes, $maxFileSize, $maxImgWidth, $maxImgHeight);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
$uploader->setTargetFileName('wfdownloads_' . uniqid(time()) . '--' . strtolower($_FILES['uploadfile']['name']));
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
$errors = $uploader->getErrors();
- redirect_header('javascript:history.go(-1)', 3, $errors);
+ redirect_header('javascript:history.go(-1)',3, $errors);
} else {
$imgurl = $uploader->getSavedFileName();
}
@@ -152,15 +152,17 @@
echo $categoryObj->getHtmlErrors();
}
if (!$cid) {
- $newid = (int) $categoryObj->getVar('cid');
+ if ($cid == 0) {
+ $newid = (int) $categoryObj->getVar('cid');
+ }
wfdownloads_savePermissions($down_groups, $newid, 'WFDownCatPerm');
wfdownloads_savePermissions($up_groups, $newid, 'WFUpCatPerm');
// Notify of new category
$tags = array();
$tags['CATEGORY_NAME'] = $_POST['title'];
$tags['CATEGORY_URL'] = WFDOWNLOADS_URL . '/viewcat.php?cid=' . $newid;
- $notification_handler = & xoops_gethandler('notification');
- $notification_handler -> triggerEvent('global', 0, 'new_category', $tags);
+ $notification_handler = xoops_gethandler('notification');
+ $notification_handler->triggerEvent('global', 0, 'new_category', $tags);
$database_mess = _AM_WFDOWNLOADS_CCATEGORY_CREATED;
} else {
$database_mess = _AM_WFDOWNLOADS_CCATEGORY_MODIFIED;
@@ -179,7 +181,6 @@
if ($ok == true) {
// get all subcategories under the specified category
$childCategoryObjs = $categoryObjsTree->getAllChild($cid);
- $cids = array();
foreach ($childCategoryObjs as $childCategoryObj) {
// get all category ids
$cids[] = $childCategoryObj->getVar('cid');
@@ -238,7 +239,7 @@
$form = $categoryObj->getForm();
$form -> display();
- include 'admin_footer.php';
+ include_once dirname(__FILE__) . '/admin_footer.php';
break;
case 'categories.list':
@@ -261,7 +262,7 @@
} else {
redirect_header("{$currentFile}?op=category.add", 1, _AM_WFDOWNLOADS_CCATEGORY_NOEXISTS);
}
- include 'admin_footer.php';
+ include_once dirname(__FILE__) . '/admin_footer.php';
break;
case 'categories.reorder':
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-09-17 13:55:08 UTC (rev 12788)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-09-17 20:13:28 UTC (rev 12789)
@@ -41,9 +41,9 @@
$op = WfdownloadsRequest::getString('op', 'downloads.list');
switch ($op) {
- case "download.edit" :
- case "download.add" :
- case "Download" :
+ case 'download.edit':
+ case 'download.add':
+ case 'Download':
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
@@ -59,8 +59,8 @@
// Allowed mimetypes list
echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFDOWNLOADS_FILE_ALLOWEDAMIME . "</legend>\n";
echo "<div style='padding: 8px;'>\n";
- $criteria = new Criteria("mime_admin", true);
- $mimetypes = $wfdownloads->getHandler('mimetype')->getList($criteria);
+ $criteria = new Criteria("mime_admin", true);
+ $mimetypes = $wfdownloads->getHandler('mimetype')->getList($criteria);
$allowMimetypes = implode(' | ', $mimetypes);
echo $allowMimetypes;
echo "</div>\n";
@@ -83,7 +83,7 @@
} else {
// create download
$downloadObj = $wfdownloads->getHandler('download')->create();
- $cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
+ $cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
$categoryObj = $wfdownloads->getHandler('category')->get($cid);
$downloadObj->setVar('cid', $cid);
$title = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FILE_CREATE);
@@ -97,15 +97,15 @@
$sform = $downloadObj->getAdminForm($title);
} elseif ((isset($_POST['submit_category']) && !empty($_POST['submit_category']))) {
// two steps form: 2nd step
- $fid = $categoryObj->getVar('formulize_fid');
+ $fid = $categoryObj->getVar('formulize_fid');
$customArray = array();
if ($fid) {
- include_once XOOPS_ROOT_PATH . "/modules/formulize/include/formdisplay.php";
- include_once XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php";
- $customArray['fid'] = $fid;
+ include_once XOOPS_ROOT_PATH . '/modules/formulize/include/formdisplay.php';
+ include_once XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php';
+ $customArray['fid'] = $fid;
$customArray['formulize_mgr'] = xoops_getmodulehandler('elements', 'formulize');
- $customArray['groups'] = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
- $customArray['prevEntry'] = getEntryValues( // is a Formulize function
+ $customArray['groups'] = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
+ $customArray['prevEntry'] = getEntryValues( // is a Formulize function
$downloadObj->getVar('formulize_idreq'),
$customArray['formulize_mgr'],
$customArray['groups'],
@@ -117,14 +117,14 @@
null
);
$customArray['entry'] = $downloadObj->getVar('formulize_idreq');
- $customArray['go_back'] = "";
- $customArray['parentLinks'] = "";
+ $customArray['go_back'] = '';
+ $customArray['parentLinks'] = '';
if (wfdownloads_checkModule('formulize') < 300) {
$owner = getEntryOwner($customArray['entry']); // is a Formulize function
} else {
$owner = getEntryOwner($customArray['entry'], $fid); // is a Formulize function
}
- $ownerGroups = $member_handler->getGroupsByUser($owner, false);
+ $ownerGroups = $member_handler->getGroupsByUser($owner, false);
$customArray['owner_groups'] = $ownerGroups;
}
$sform = $downloadObj->getAdminForm($title22, $customArray);
@@ -141,29 +141,29 @@
// Vote data list/manager
if ($lid) {
- $votes_count = $wfdownloads->getHandler('rating')->getCount();
+ $ratingCount = $wfdownloads->getHandler('rating')->getCount();
- $registeredCriteria = new CriteriaCompo(new Criteria('lid', $lid));
- $registeredCriteria->add(new Criteria('ratinguser', 0, '>'));
- $votesreg = $wfdownloads->getHandler('rating')->getCount($registeredCriteria);
- $registeredCriteria->setSort('ratingtimestamp');
- $registeredCriteria->setOrder('DESC');
- $regvotes = $wfdownloads->getHandler('rating')->getObjects($registeredCriteria);
+ $regUserCriteria = new CriteriaCompo(new Criteria('lid', $lid));
+ $regUserCriteria->add(new Criteria('ratinguser', 0, '>'));
+ $regUserRatingCount = $wfdownloads->getHandler('rating')->getCount($regUserCriteria);
+ $regUserCriteria->setSort('ratingtimestamp');
+ $regUserCriteria->setOrder('DESC');
+ $regUserRatingObjs = $wfdownloads->getHandler('rating')->getObjects($regUserCriteria);
- $anonymousCriteria = new CriteriaCompo(new Criteria('lid', $lid));
- $anonymousCriteria->add(new Criteria('ratinguser', 0, '='));
- $votesanon = $wfdownloads->getHandler('rating')->getCount($anonymousCriteria);
- $anonymousCriteria->setSort('ratingtimestamp');
- $anonymousCriteria->setOrder('DESC');
+ $anonUserCriteria = new CriteriaCompo(new Criteria('lid', $lid));
+ $anonUserCriteria->add(new Criteria('ratinguser', 0, '='));
+ $anonUserRatingCount = $wfdownloads->getHandler('rating')->getCount($anonUserCriteria);
+ $anonUserCriteria->setSort('ratingtimestamp');
+ $anonUserCriteria->setOrder('DESC');
echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFDOWNLOADS_VOTE_RATINGINFOMATION . "</legend>\n";
- echo "<div style='padding: 8px;'><b>" . _AM_WFDOWNLOADS_VOTE_TOTALVOTES . "</b>{$votes_count}<br /><br />\n";
+ echo "<div style='padding: 8px;'><b>" . _AM_WFDOWNLOADS_VOTE_TOTALVOTES . "</b>{$ratingCount}<br /><br />\n";
- printf(_AM_WFDOWNLOADS_VOTE_REGUSERVOTES, $votesreg);
+ printf(_AM_WFDOWNLOADS_VOTE_REGUSERVOTES, $regUserRatingCount);
echo "<br />";
- printf(_AM_WFDOWNLOADS_VOTE_ANONUSERVOTES, $votesanon);
+ printf(_AM_WFDOWNLOADS_VOTE_ANONUSERVOTES, $anonUserRatingCount);
echo "
</div>\n
@@ -179,37 +179,32 @@
</tr>\n
";
- if ($votesreg == 0) {
+ if ($regUserRatingCount == 0) {
echo "<tr><td colspan='7' class='even'><b>" . _AM_WFDOWNLOADS_VOTE_NOREGVOTES . "</b></td></tr>";
} else {
- $uids = array();
- foreach (array_keys($regvotes) as $i) {
- $uids[] = $regvotes[$i]->getVar('ratinguser');
+ foreach ($regUserRatingObjs as $regUserRatingObj) {
+ $uids[] = $regUserRatingObj->getVar('ratinguser');
}
- $criteria = new Criteria("ratinguser", "(" . implode(',', $uids) . ")", "IN");
- $criteria->setGroupby("ratinguser");
+ $criteria = new Criteria('ratinguser', '(' . implode(',', $uids) . ')', 'IN');
+ $criteria->setGroupby('ratinguser');
$userRatings = $wfdownloads->getHandler('rating')->getUserAverage($criteria);
- foreach (array_keys($regvotes) as $i) {
- $formatted_date = XoopsLocal::formatTimestamp($regvotes[$i]->getVar('ratingtimestamp'), 'l');
- $userAvgRating = isset($userRatings[$regvotes[$i]->getVar('ratinguser')]) ? $userRatings[$regvotes[$i]->getVar(
- 'ratinguser'
- )]["avg"] : 0;
- $userVotes = isset($userRatings[$regvotes[$i]->getVar('ratinguser')]) ? $userRatings[$regvotes[$i]->getVar(
- 'ratinguser'
- )]["count"] : 0;
- $ratingUserName = XoopsUser :: getUnameFromId($regvotes[$i]->getVar('ratinguser'));
+ foreach ($regUserRatingObjs as $regUserRatingObj) {
+ $formatted_date = XoopsLocal::formatTimestamp($regUserRatingObj->getVar('ratingtimestamp'), 'l');
+ $userAvgRating = isset($userRatings[$regUserRatingObj->getVar('ratinguser')]) ? $userRatings[$regUserRatingObj->getVar('ratinguser')]['avg'] : 0;
+ $userVotes = isset($userRatings[$regUserRatingObj->getVar('ratinguser')]) ? $userRatings[$regUserRatingObj->getVar('ratinguser')]['count'] : 0;
+ $ratingUserName = XoopsUser :: getUnameFromId($regUserRatingObj->getVar('ratinguser'));
echo "
<tr><td class='head'>$ratingUserName</td>\n
- <td class='even'>" . $regvotes[$i]->getVar('ratinghostname') . "</th>\n
- <td class='even'>" . $regvotes[$i]->getVar('rating') . "</th>\n
+ <td class='even'>" . $regUserRatingObj->getVar('ratinghostname') . "</th>\n
+ <td class='even'>" . $regUserRatingObj->getVar('rating') . "</th>\n
<td class='even'>$userAvgRating</th>\n
<td class='even'>$userVotes</th>\n
<td class='even'>$formatted_date</th>\n
<td class='even'>\n
- <a href='{$currentFile}?op=vote.delete&lid={$lid}&rid=" . $regvotes[$i]->getVar('ratingid') . "'>"
+ <a href='{$currentFile}?op=vote.delete&lid={$lid}&rid=" . $regUserRatingObj->getVar('ratingid') . "'>"
. $imagearray['deleteimg'] . "</a>\n
</th></tr>\n
";
@@ -229,29 +224,29 @@
<th>" . _AM_WFDOWNLOADS_MINDEX_ACTION . "</td>\n
</tr>\n
";
- if ($votesanon == 0) {
+ if ($anonUserRatingCount == 0) {
echo "<tr><td colspan='7' class='even'><b>" . _AM_WFDOWNLOADS_VOTE_NOUNREGVOTES . "</b></td></tr>";
} else {
- $criteria = new Criteria('ratinguser', 0);
- $userRatings = $wfdownloads->getHandler('rating')->getUserAverage($criteria);
- $anonymousVotes = $wfdownloads->getHandler('rating')->getObjects($anonymousCriteria);
+ $criteria = new Criteria('ratinguser', 0);
+ $userRatings = $wfdownloads->getHandler('rating')->getUserAverage($criteria);
+ $anonUserRatingObjs = $wfdownloads->getHandler('rating')->getObjects($anonUserCriteria);
- foreach (array_keys($anonymousVotes) as $i) {
- $formatted_date = XoopsLocal::formatTimestamp($anonymousVotes[$i]->getVar('ratingtimestamp'), 'l');
- $userAvgRating = isset($userRatings['avg']) ? $userRatings["avg"] : 0;
- $userVotes = isset($userRatings['count']) ? $userRatings["count"] : 0;
+ foreach (array_keys($anonUserRatingObjs) as $anonUserRatingObj) {
+ $formatted_date = XoopsLocal::formatTimestamp($anonUserRatingObj->getVar('ratingtimestamp'), 'l');
+ $userAvgRating = isset($userRatings['avg']) ? $userRatings['avg'] : 0;
+ $userVotes = isset($userRatings['count']) ? $userRatings['count'] : 0;
$ratingUserName = $GLOBALS['xoopsConfig']['anonymous'];
echo "
<tr><td class='head'>$ratingUserName</td>\n
- <td class='even'>" . $anonymousVotes[$i]->getVar('ratinghostname') . "</th>\n
- <td class='even'>" . $anonymousVotes[$i]->getVar('rating') . "</th>\n
+ <td class='even'>" . $anonUserRatingObj->getVar('ratinghostname') . "</th>\n
+ <td class='even'>" . $anonUserRatingObj->getVar('rating') . "</th>\n
<td class='even'>$userAvgRating</th>\n
<td class='even'>$userVotes</th>\n
<td class='even'>$formatted_date</th>\n
<td class='even'>\n
- <a href='{$currentFile}?op=vote.delete&lid={$lid}&rid=" . $anonymousVotes[$i]->getVar('ratingid') . "'>"
+ <a href='{$currentFile}?op=vote.delete&lid={$lid}&rid=" . $anonUserRatingObj->getVar('ratingid') . "'>"
. $imagearray['deleteimg'] . "</a>\n
</th></tr>\n
";
@@ -260,32 +255,32 @@
echo "</table>\n";
echo "</fieldset>\n";
}
- include 'admin_footer.php';
+ include_once dirname(__FILE__) . '/admin_footer.php';
break;
- case "download.save" :
- case "addDownload" :
- $lid = WfdownloadsRequest::getInt('lid', 0, 'POST');
- $cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
+ case 'download.save':
+ case 'addDownload':
+ $lid = WfdownloadsRequest::getInt('lid', 0, 'POST');
+ $cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
$status = WfdownloadsRequest::getInt('status', _WFDOWNLOADS_STATUS_UPDATED, 'POST');
if ($lid > 0) {
$thisIsANewRecord = false; /* Added by Lankford on 2007/3/21 */
- $downloadObj = $wfdownloads->getHandler('download')->get($lid);
+ $downloadObj = $wfdownloads->getHandler('download')->get($lid);
} else {
$thisIsANewRecord = true; /* Added by Lankford on 2007/3/21 */
- $downloadObj = $wfdownloads->getHandler('download')->create();
+ $downloadObj = $wfdownloads->getHandler('download')->create();
}
// Define URL
if (empty($_FILES['userfile']['name'])) {
- if ($_POST['url'] && $_POST['url'] != "" && $_POST['url'] != "http://") {
- $url = ($_POST['url'] != "http://") ? $_POST['url'] : '';
+ if ($_POST['url'] && $_POST['url'] != '' && $_POST['url'] != "http://") {
+ $url = ($_POST['url'] != "http://") ? $_POST['url'] : '';
$filename = '';
$filetype = '';
// Get size from form
$size = (empty($_POST['size']) || !is_numeric($_POST['size'])) ? 0 : (int) $_POST["size"];
} else {
- $url = ($_POST["url"] != "http://") ? $_POST['url'] : '';
+ $url = ($_POST["url"] != "http://") ? $_POST['url'] : '';
$filename = $_POST['filename'];
$filetype = $_POST['filetype'];
$filePath = $wfdownloads->getConfig('uploaddir') . '/' . $filename;
@@ -296,12 +291,12 @@
$downloadObj->setVar('filename', $filename);
$downloadObj->setVar('filetype', $filetype);
} else {
- $down = wfdownloads_uploading($_FILES, $wfdownloads->getConfig('uploaddir'), '', $currentFile, 0, false, true);
- $url = ($_POST['url'] != "http://") ? $_POST["url"] : '';
- $size = $down['size'];
+ $down = wfdownloads_uploading($_FILES, $wfdownloads->getConfig('uploaddir'), '', $currentFile, 0, false, true);
+ $url = ($_POST['url'] != "http://") ? $_POST["url"] : '';
+ $size = $down['size'];
$title = $_FILES['userfile']['name'];
- $ext = rtrim(strrchr($title, '.'), '.');
+ $ext = rtrim(strrchr($title, '.'), '.');
$title = str_replace($ext, '', $title);
$title = (isset($_POST['title_checkbox']) && $_POST['title_checkbox'] == 1) ? $title : trim($_POST['title']);
@@ -330,11 +325,11 @@
// If both conditions are true, then trigger all three notifications related to modified records.
if (!$thisIsANewRecord && ($downloadObj->getVar('version') != $version)) {
// Trigger the three events related to modified files (one for the file, category, and global event categories respectively)
- $tags = array();
- $tags['FILE_NAME'] = $title;
- $tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$lid}";
- $categoryObj = $wfdownloads->getHandler('category')->get($cid);
- $tags['FILE_VERSION'] = $version;
+ $tags = array();
+ $tags['FILE_NAME'] = $title;
+ $tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$lid}";
+ $categoryObj = $wfdownloads->getHandler('category')->get($cid);
+ $tags['FILE_VERSION'] = $version;
$tags['CATEGORY_NAME'] = $categoryObj->getVar('title');
$tags['CATEGORY_URL'] = WFDOWNLOADS_URL . "/viewcat.php?cid='{$cid}";
@@ -380,12 +375,12 @@
$versiontypes = (isset($_POST['versiontypes'])) ? $_POST['versiontypes'] : '';
$downloadObj->setVar('versiontypes', $versiontypes);
- $dhistory = (isset($_POST['dhistory'])) ? $_POST['dhistory'] : '';
+ $dhistory = (isset($_POST['dhistory'])) ? $_POST['dhistory'] : '';
$dhistoryhistory = (isset($_POST['dhistoryaddedd'])) ? $_POST['dhistoryaddedd'] : '';
if ($lid > 0 && !empty($dhistoryhistory)) {
$dhistory = $dhistory . "\n\n";
- $time = time();
+ $time = time();
$dhistory .= _AM_WFDOWNLOADS_FILE_HISTORYVERS . $version . _AM_WFDOWNLOADS_FILE_HISTORDATE . XoopsLocal::formatTimestamp($time, 'l') . "\n\n";
$dhistory .= $dhistoryhistory;
}
@@ -401,7 +396,7 @@
$offline = ($_POST['offline'] == true) ? true : false;
$downloadObj->setVar('offline', $offline);
- $approved = (isset($_POST['approved']) && $_POST['approved'] == true) ? true : false;
+ $approved = (isset($_POST['approved']) && $_POST['approved'] == true) ? true : false;
$notifypub = (isset($_POST['notifypub']) && $_POST['notifypub'] == true);
$expiredate = 0;
@@ -409,7 +404,7 @@
$publishdate = time();
} else {
$publishdate = $_POST['was_published'];
- $expiredate = $_POST['was_expired'];
+ $expiredate = $_POST['was_expired'];
}
if ($approved == 1 && empty($publishdate)) {
$publishdate = time();
@@ -441,8 +436,8 @@
if (wfdownloads_checkModule('formulize')) {
$fid = $categoryObj->getVar('formulize_fid');
if ($fid) {
- include_once XOOPS_ROOT_PATH . "/modules/formulize/include/formread.php";
- include_once XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php";
+ include_once XOOPS_ROOT_PATH . '/modules/formulize/include/formread.php';
+ include_once XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php';
$formulize_mgr =& xoops_getmodulehandler('elements', 'formulize');
if ($lid) {
$entries[$fid][0] = $downloadObj->getVar('formulize_idreq');
@@ -453,19 +448,19 @@
$owner = getEntryOwner($entries[$fid][0], $fid); // is a Formulize function
}
} else {
- print "no idreq";
- $entries[$fid][0] = "";
- $owner = "";
+ print 'no idreq';
+ $entries[$fid][0] = '';
+ $owner = '';
}
$cid = $downloadObj->getVar('cid');
} else {
- $entries[$fid][0] = "";
- $owner = "";
+ $entries[$fid][0] = '';
+ $owner = '';
}
- $ownerGroups =& $member_handler->getGroupsByUser($owner, false);
- $uid = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
- $groups = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
- $entries = handleSubmission(
+ $ownerGroups = $member_handler->getGroupsByUser($owner, false);
+ $uid = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
+ $groups = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
+ $entries = handleSubmission(
$formulize_mgr,
$entries,
$uid,
@@ -473,7 +468,7 @@
$fid,
$ownerGroups,
$groups,
- "new"
+ 'new'
); // "new" causes xoops token check to be skipped, since Wfdownloads should be doing that
if (!$owner) {
$id_req = $entries[$fid][0];
@@ -486,21 +481,21 @@
$newid = (int) $downloadObj->getVar('lid');
// Send notifications
if (!$lid) {
- $tags = array();
- $tags['FILE_NAME'] = $title;
- $tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$newid}";
+ $tags = array();
+ $tags['FILE_NAME'] = $title;
+ $tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$newid}";
$tags['CATEGORY_NAME'] = $categoryObj->getVar('title');
- $tags['CATEGORY_URL'] = WFDOWNLO...
[truncated message content] |
|
From: <luc...@us...> - 2014-09-18 21:56:31
|
Revision: 12794
http://sourceforge.net/p/xoops/svn/12794
Author: luciorota
Date: 2014-09-18 21:56:17 +0000 (Thu, 18 Sep 2014)
Log Message:
-----------
$GLOBALS['...] instead of global $... IN PROGRESS
Modified Paths:
--------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/indexpage.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/top.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/top_by_cat.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/dbupdater.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mirror.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/review.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/functions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/notification.inc.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/search.inc.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/index.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/mirror.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/newlist.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/ratefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/review.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/rss.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/singlefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/topten.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/viewcat.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/visit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-09-18 21:15:31 UTC (rev 12793)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-09-18 21:56:17 UTC (rev 12794)
@@ -104,7 +104,7 @@
include_once XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php';
$customArray['fid'] = $fid;
$customArray['formulize_mgr'] = xoops_getmodulehandler('elements', 'formulize');
- $customArray['groups'] = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
+ $customArray['groups'] = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
$customArray['prevEntry'] = getEntryValues( // is a Formulize function
$downloadObj->getVar('formulize_idreq'),
$customArray['formulize_mgr'],
@@ -458,8 +458,8 @@
$owner = '';
}
$ownerGroups = $member_handler->getGroupsByUser($owner, false);
- $uid = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
- $groups = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
+ $uid = !empty($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
+ $groups = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
$entries = handleSubmission(
$formulize_mgr,
$entries,
@@ -557,11 +557,10 @@
print "<input type = submit name=patch_formulize value=\"Apply Patch for Formulize\">";
print "</form>";
} else {
- global $xoopsDB;
- $sqls[] = "ALTER TABLE " . $xoopsDB->prefix("wfdownloads_cat") . " ADD formulize_fid int(5) NOT NULL default '0';";
- $sqls[] = "ALTER TABLE " . $xoopsDB->prefix("wfdownloads_downloads") . " ADD formulize_idreq int(5) NOT NULL default '0';";
+ $sqls[] = "ALTER TABLE " . $GLOBALS['xoopsDB']->prefix('wfdownloads_cat') . " ADD formulize_fid int(5) NOT NULL default '0';";
+ $sqls[] = "ALTER TABLE " . $GLOBALS['xoopsDB']->prefix('wfdownloads_downloads') . " ADD formulize_idreq int(5) NOT NULL default '0';";
foreach ($sqls as $sql) {
- if (!$result = $xoopsDB->queryF($sql)) {
+ if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
exit("Error patching for Formulize.<br>SQL dump:<br>" . $sql
. "<br>Please contact <a hre...@fr...>Freeform Solutions</a> for assistance.");
}
@@ -874,8 +873,8 @@
$downloadObj->setVar('published', time());
$downloadObj->setVar('date', time());
$downloadObj->setVar('ipaddress', $_SERVER['REMOTE_ADDR']);
- $downloadObj->setVar('submitter', $xoopsUser->getVar('uid', 'e'));
- $downloadObj->setVar('publisher', $xoopsUser->getVar('uid', 'e'));
+ $downloadObj->setVar('submitter', $GLOBALS['xoopsUser']->getVar('uid', 'e'));
+ $downloadObj->setVar('publisher', $GLOBALS['xoopsUser']->getVar('uid', 'e'));
if (!$wfdownloads->getHandler('download')->insert($downloadObj)) {
wfdownloads_delFile($wfdownloads->getConfig('uploaddir') . '/' . $savedFileName);
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php 2014-09-18 21:15:31 UTC (rev 12793)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php 2014-09-18 21:56:17 UTC (rev 12794)
@@ -248,13 +248,12 @@
*/
function import_wfd_to_wfdownloads()
{
- global $xoopsDB;
- $module_handler =& xoops_gethandler('module');
+ $module_handler = xoops_gethandler('module');
// Get source module/config
$wfdDirname = 'wf' . 'downloads'; // don't modify, is for cloning
$wfdModule = $module_handler->getByDirname($wfdDirname);
if (empty($wfdModuleConfig)) {
- $config_handler = xoops_gethandler("config");
+ $config_handler = xoops_gethandler('config');
$wfdModuleConfig = $config_handler->getConfigsByCat(0, $wfdModule->mid());
}
$wfdCategoriesHandler = xoops_getModuleHandler('category', $wfdDirname);
@@ -301,47 +300,47 @@
echo "<br />";
$destination = array(
- "cat" => $xoopsDB->prefix("wfdownloads_cat"),
- "downloads" => $xoopsDB->prefix("wfdownloads_downloads"),
- "mirrors" => $xoopsDB->prefix("wfdownloads_mirrors"),
- "reviews" => $xoopsDB->prefix("wfdownloads_reviews"),
- "broken" => $xoopsDB->prefix("wfdownloads_broken"),
- "mod" => $xoopsDB->prefix("wfdownloads_mod"),
- "votes" => $xoopsDB->prefix("wfdownloads_votedata")
+ "cat" => $GLOBALS['xoopsDB']->prefix("wfdownloads_cat"),
+ "downloads" => $GLOBALS['xoopsDB']->prefix("wfdownloads_downloads"),
+ "mirrors" => $GLOBALS['xoopsDB']->prefix("wfdownloads_mirrors"),
+ "reviews" => $GLOBALS['xoopsDB']->prefix("wfdownloads_reviews"),
+ "broken" => $GLOBALS['xoopsDB']->prefix("wfdownloads_broken"),
+ "mod" => $GLOBALS['xoopsDB']->prefix("wfdownloads_mod"),
+ "votes" => $GLOBALS['xoopsDB']->prefix("wfdownloads_votedata")
);
$source = array(
- "cat" => $xoopsDB->prefix("wf" . "downloads_cat"), // don't modify, is for cloning
- "downloads" => $xoopsDB->prefix("wf" . "downloads_downloads"), // don't modify, is for cloning
- "mirrors" => $xoopsDB->prefix("wf" . "downloads_mirrors"), // don't modify, is for cloning
- "reviews" => $xoopsDB->prefix("wf" . "downloads_reviews"), // don't modify, is for cloning
- "broken" => $xoopsDB->prefix("wf" . "downloads_broken"), // don't modify, is for cloning
- "mod" => $xoopsDB->prefix("wf" . "downloads_mod"), // don't modify, is for cloning
- "votes" => $xoopsDB->prefix("wf" . "downloads_votedata")
+ "cat" => $GLOBALS['xoopsDB']->prefix("wf" . "downloads_cat"), // don't modify, is for cloning
+ "downloads" => $GLOBALS['xoopsDB']->prefix("wf" . "downloads_downloads"), // don't modify, is for cloning
+ "mirrors" => $GLOBALS['xoopsDB']->prefix("wf" . "downloads_mirrors"), // don't modify, is for cloning
+ "reviews" => $GLOBALS['xoopsDB']->prefix("wf" . "downloads_reviews"), // don't modify, is for cloning
+ "broken" => $GLOBALS['xoopsDB']->prefix("wf" . "downloads_broken"), // don't modify, is for cloning
+ "mod" => $GLOBALS['xoopsDB']->prefix("wf" . "downloads_mod"), // don't modify, is for cloning
+ "votes" => $GLOBALS['xoopsDB']->prefix("wf" . "downloads_votedata")
); // don't modify, is for cloning
//Add temporary field to category table
- $xoopsDB->query("ALTER TABLE {$destination['cat']} ADD `old_cid` int NOT NULL default 0");
- $xoopsDB->query("ALTER TABLE {$destination['cat']} ADD `old_pid` int NOT NULL default 0");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE {$destination['cat']} ADD `old_cid` int NOT NULL default 0");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE {$destination['cat']} ADD `old_pid` int NOT NULL default 0");
//Add temporary fields to downloads table
- $xoopsDB->query("ALTER TABLE {$destination['downloads']} ADD `old_lid` int NOT NULL default 0");
- $xoopsDB->query("ALTER TABLE {$destination['downloads']} ADD `old_cid` int NOT NULL default 0");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE {$destination['downloads']} ADD `old_lid` int NOT NULL default 0");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE {$destination['downloads']} ADD `old_cid` int NOT NULL default 0");
//Get latest mirror ID to determine which records will need an updated lid value afterwards
- $result = $xoopsDB->query("SELECT MAX(mirror_id) FROM {$destination['mirrors']}");
- list($max_mirrorid) = $xoopsDB->fetchRow($result);
+ $result = $GLOBALS['xoopsDB']->query("SELECT MAX(mirror_id) FROM {$destination['mirrors']}");
+ list($max_mirrorid) = $GLOBALS['xoopsDB']->fetchRow($result);
//Get latest review ID to determine which records will need an updated lid value afterwards
- $result = $xoopsDB->query("SELECT MAX(review_id) FROM {$destination['reviews']}");
- list($max_reviewid) = $xoopsDB->fetchRow($result);
+ $result = $GLOBALS['xoopsDB']->query("SELECT MAX(review_id) FROM {$destination['reviews']}");
+ list($max_reviewid) = $GLOBALS['xoopsDB']->fetchRow($result);
//Get latest mod request ID to determine which records will need an updated lid value afterwards
- $result = $xoopsDB->query("SELECT MAX(requestid) FROM {$destination['mod']}");
- list($max_requestid) = $xoopsDB->fetchRow($result);
+ $result = $GLOBALS['xoopsDB']->query("SELECT MAX(requestid) FROM {$destination['mod']}");
+ list($max_requestid) = $GLOBALS['xoopsDB']->fetchRow($result);
//Get latest report ID to determine, which records will need an updated lid value afterwards
- $result = $xoopsDB->query("SELECT MAX(reportid) FROM {$destination['broken']}");
- list($max_reportid) = $xoopsDB->fetchRow($result);
+ $result = $GLOBALS['xoopsDB']->query("SELECT MAX(reportid) FROM {$destination['broken']}");
+ list($max_reportid) = $GLOBALS['xoopsDB']->fetchRow($result);
//Get latest vote ID to determine which records will need an updated lid value afterwards
- $result = $xoopsDB->query("SELECT MAX(ratingid) FROM {$destination['votes']}");
- list($max_ratingid) = $xoopsDB->fetchRow($result);
+ $result = $GLOBALS['xoopsDB']->query("SELECT MAX(ratingid) FROM {$destination['votes']}");
+ list($max_ratingid) = $GLOBALS['xoopsDB']->fetchRow($result);
//Import data into category table
if (wfdownloads_checkModule('wf' . 'downloads') >= 320) {
@@ -357,8 +356,8 @@
$sql .= " `cid`, `pid`, `title`, `imgurl`, `description`, `total`, `summary`, `spotlighttop`, `spotlighthis`, `dohtml`, `dosmiley`, `doxcode`, `doimage`, `dobr`, `weight`";
$sql .= " FROM {$source['cat']}";
}
- $xoopsDB->query($sql);
- echo "Imported {$xoopsDB->getAffectedRows()} categories into {$destination['cat']}<br />";
+ $GLOBALS['xoopsDB']->query($sql);
+ echo "Imported {$GLOBALS['xoopsDB']->getAffectedRows()} categories into {$destination['cat']}<br />";
//Import data into downloads table
if (wfdownloads_checkModule('wf' . 'downloads') >= 320) {
@@ -374,8 +373,8 @@
$sql .= " 0, `lid`, `cid`, `title`, `url`, `filename`, `filetype`, `homepage`, `version`, `size`, `platform`, `screenshot`, `submitter`, `publisher`, `status`, `date`, `hits`, `rating`, `votes`, `comments`, `license`, `mirror`, `price`, `paypalemail`, `features`, `requirements`, `homepagetitle`, `forumid`, `limitations`, `dhistory`, `published`, `expired`, `updated`, `offline`, `summary`, `description`, `ipaddress`, `notifypub`";
$sql .= " FROM {$source['downloads']}";
}
- $xoopsDB->query($sql);
- echo "Imported {$xoopsDB->getAffectedRows()} downloads into {$destination['downloads']}<br />";
+ $GLOBALS['xoopsDB']->query($sql);
+ echo "Imported {$GLOBALS['xoopsDB']->getAffectedRows()} downloads into {$destination['downloads']}<br />";
//Import data into mirrors table
$sql = "INSERT INTO {$destination['mirrors']} (";
@@ -383,8 +382,8 @@
$sql .= " ) SELECT";
$sql .= " `lid`, `title`, `homeurl`, `location`, `continent`, `downurl`, `submit`, `date`, `uid`";
$sql .= " FROM {$source['mirrors']}";
- $xoopsDB->query($sql);
- echo "Imported {$xoopsDB->getAffectedRows()} mirrors into {$destination['mirrors']}<br />";
+ $GLOBALS['xoopsDB']->query($sql);
+ echo "Imported {$GLOBALS['xoopsDB']->getAffectedRows()} mirrors into {$destination['mirrors']}<br />";
//Import data into reviews table
if (wfdownloads_checkModule('wf' . 'downloads') >= 320) {
@@ -400,8 +399,8 @@
$sql .= " `lid`, `title`, `review`, `submit`, `date`, `uid`";
$sql .= " FROM {$source['reviews']}";
}
- $xoopsDB->query($sql);
- echo "Imported {$xoopsDB->getAffectedRows()} reviews into {$destination['reviews']}<br />";
+ $GLOBALS['xoopsDB']->query($sql);
+ echo "Imported {$GLOBALS['xoopsDB']->getAffectedRows()} reviews into {$destination['reviews']}<br />";
//Import data into brokens table
$sql = "INSERT INTO {$destination['broken']} (";
@@ -409,8 +408,8 @@
$sql .= " ) SELECT";
$sql .= " `lid`, `sender`, `date`, `ip`";
$sql .= " FROM {$source['broken']}";
- $xoopsDB->query($sql);
- echo "Imported {$xoopsDB->getAffectedRows()} broken reports into {$destination['broken']}<br />";
+ $GLOBALS['xoopsDB']->query($sql);
+ echo "Imported {$GLOBALS['xoopsDB']->getAffectedRows()} broken reports into {$destination['broken']}<br />";
//Import data into votedata table
$sql = "INSERT INTO {$destination['votes']} (";
@@ -418,8 +417,8 @@
$sql .= " ) SELECT";
$sql .= " `lid`, `ratinguser`, `rating`, `ratinghostname`, `ratingtimestamp`";
$sql .= " FROM {$source['votes']}";
- $xoopsDB->query($sql);
- echo "Imported {$xoopsDB->getAffectedRows()} votes into {$destination['votes']}<br />";
+ $GLOBALS['xoopsDB']->query($sql);
+ echo "Imported {$GLOBALS['xoopsDB']->getAffectedRows()} votes into {$destination['votes']}<br />";
//Import data into mod request table
$sql = "INSERT INTO {$destination['mod']} (";
@@ -427,51 +426,51 @@
$sql .= " SELECT";
$sql .= " `lid`, `cid`, `title`, `url`, `homepage`, `version`, `size`, `platform`, `screenshot`, `description`, `modifysubmitter`, `features`, `requirements`, `publisher`, `dhistory`, `summary`";
$sql .= " FROM {$source['mod']}";
- $xoopsDB->query($sql);
- echo "Imported {$xoopsDB->getAffectedRows()} modification requests into {$destination['mod']}<br />";
+ $GLOBALS['xoopsDB']->query($sql);
+ echo "Imported {$GLOBALS['xoopsDB']->getAffectedRows()} modification requests into {$destination['mod']}<br />";
// Update category ID to new value
- $xoopsDB->query("UPDATE {$destination['downloads']} d, {$destination['cat']} c SET d.cid=c.cid WHERE d.old_cid=c.old_cid AND d.old_cid != 0");
- $xoopsDB->query("UPDATE {$destination['cat']} c1, {$destination['cat']} c2 SET c1.pid=c2.cid WHERE c1.old_pid=c2.old_cid AND c1.old_pid != 0");
+ $GLOBALS['xoopsDB']->query("UPDATE {$destination['downloads']} d, {$destination['cat']} c SET d.cid=c.cid WHERE d.old_cid=c.old_cid AND d.old_cid != 0");
+ $GLOBALS['xoopsDB']->query("UPDATE {$destination['cat']} c1, {$destination['cat']} c2 SET c1.pid=c2.cid WHERE c1.old_pid=c2.old_cid AND c1.old_pid != 0");
// Update lid values in mod table
if ($max_requestid) {
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"UPDATE {$destination['mod']} m, {$destination['cat']} c SET m.cid=c.cid WHERE m.requestid > {$max_requestid} AND c.old_cid=m.cid"
);
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"UPDATE {$destination['mod']} m, {$destination['downloads']} d SET m.lid=d.lid WHERE m.requestid > {$max_requestid} AND m.lid=d.old_lid"
);
}
// Update lid values in mirrors table
if ($max_mirrorid) {
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"UPDATE {$destination['mirrors']} v, {$destination['downloads']} d SET v.lid=d.lid WHERE v.mirror_id > {$max_mirrorid} AND v.lid=d.old_lid"
);
}
// Update lid values in reviews table
if ($max_reviewid) {
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"UPDATE {$destination['reviews']} v, {$destination['downloads']} d SET v.lid=d.lid WHERE v.review_id > {$max_reviewid} AND v.lid=d.old_lid"
);
}
// Update lid values in votedata table
if ($max_ratingid) {
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"UPDATE {$destination['votes']} v, {$destination['downloads']} d SET v.lid=d.lid WHERE v.ratingid > {$max_ratingid} AND v.lid=d.old_lid"
);
}
// Update lid values in broken table
if ($max_reportid) {
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"UPDATE {$destination['broken']} b, {$destination['downloads']} d SET b.lid=d.lid WHERE b.reportid > {$max_reportid} AND b.lid=d.old_lid"
);
}
//Remove temporary fields
- $xoopsDB->query("ALTER TABLE " . $destination['cat'] . " DROP `old_cid`");
- $xoopsDB->query("ALTER TABLE " . $destination['cat'] . " DROP `old_pid`");
- $xoopsDB->query("ALTER TABLE " . $destination['downloads'] . " DROP `old_cid`");
- $xoopsDB->query("ALTER TABLE " . $destination['downloads'] . " DROP `old_lid`");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE " . $destination['cat'] . " DROP `old_cid`");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE " . $destination['cat'] . " DROP `old_pid`");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE " . $destination['downloads'] . " DROP `old_cid`");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE " . $destination['downloads'] . " DROP `old_lid`");
return null;
}
@@ -481,111 +480,109 @@
// =========================================================================================
function import_wmpdownloads_to_wfdownloads()
{
- global $xoopsDB;
-
echo "<br />";
echo _AM_WFDOWNLOADS_IMPORT_IMPORTINGDATA;
echo "<br />";
$destination = array(
- "cat" => $xoopsDB->prefix("wfdownloads_cat"),
- "downloads" => $xoopsDB->prefix("wfdownloads_downloads"),
- "broken" => $xoopsDB->prefix("wfdownloads_broken"),
- "mod" => $xoopsDB->prefix("wfdownloads_mod"),
- "votes" => $xoopsDB->prefix("wfdownloads_votedata")
+ "cat" => $GLOBALS['xoopsDB']->prefix("wfdownloads_cat"),
+ "downloads" => $GLOBALS['xoopsDB']->prefix("wfdownloads_downloads"),
+ "broken" => $GLOBALS['xoopsDB']->prefix("wfdownloads_broken"),
+ "mod" => $GLOBALS['xoopsDB']->prefix("wfdownloads_mod"),
+ "votes" => $GLOBALS['xoopsDB']->prefix("wfdownloads_votedata")
);
$source = array(
- "cat" => $xoopsDB->prefix("wmpdownloads_cat"),
- "downloads" => $xoopsDB->prefix("wmpdownloads_downloads"),
- "broken" => $xoopsDB->prefix("wmpdownloads_broken"),
- "mod" => $xoopsDB->prefix("wmpdownloads_mod"),
- "votes" => $xoopsDB->prefix("wmpdownloads_votedata"),
- "text" => $xoopsDB->prefix("wmpdownloads_text")
+ "cat" => $GLOBALS['xoopsDB']->prefix("wmpdownloads_cat"),
+ "downloads" => $GLOBALS['xoopsDB']->prefix("wmpdownloads_downloads"),
+ "broken" => $GLOBALS['xoopsDB']->prefix("wmpdownloads_broken"),
+ "mod" => $GLOBALS['xoopsDB']->prefix("wmpdownloads_mod"),
+ "votes" => $GLOBALS['xoopsDB']->prefix("wmpdownloads_votedata"),
+ "text" => $GLOBALS['xoopsDB']->prefix("wmpdownloads_text")
);
//Add temporary field to category table
- $xoopsDB->query("ALTER TABLE " . $destination['cat'] . " ADD `old_cid` int NOT NULL default 0");
- $xoopsDB->query("ALTER TABLE " . $destination['cat'] . " ADD `old_pid` int NOT NULL default 0");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE " . $destination['cat'] . " ADD `old_cid` int NOT NULL default 0");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE " . $destination['cat'] . " ADD `old_pid` int NOT NULL default 0");
//Add temporary fields to downloads table
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"ALTER TABLE " . $destination['downloads'] . " ADD `old_lid` int NOT NULL default 0,
ADD `old_cid` int NOT NULL default 0"
);
//Get latest mod request ID to determine which records will need an updated lid value afterwards
- $result = $xoopsDB->query("SELECT MAX(requestid) FROM " . $destination['mod']);
- list($max_requestid) = $xoopsDB->fetchRow($result);
+ $result = $GLOBALS['xoopsDB']->query("SELECT MAX(requestid) FROM " . $destination['mod']);
+ list($max_requestid) = $GLOBALS['xoopsDB']->fetchRow($result);
//Get latest report ID to determine, which records will need an updated lid value afterwards
- $result = $xoopsDB->query("SELECT MAX(reportid) FROM " . $destination['broken']);
- list($max_reportid) = $xoopsDB->fetchRow($result);
+ $result = $GLOBALS['xoopsDB']->query("SELECT MAX(reportid) FROM " . $destination['broken']);
+ list($max_reportid) = $GLOBALS['xoopsDB']->fetchRow($result);
//Get latest vote ID to determine which records will need an updated lid value afterwards
- $result = $xoopsDB->query("SELECT MAX(ratingid) FROM " . $destination['votes']);
- list($max_ratingid) = $xoopsDB->fetchRow($result);
+ $result = $GLOBALS['xoopsDB']->query("SELECT MAX(ratingid) FROM " . $destination['votes']);
+ list($max_ratingid) = $GLOBALS['xoopsDB']->fetchRow($result);
//Import data into category table
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"INSERT"
. " INTO " . $destination['cat']
. " (`old_cid`, `old_pid`, `title`, `imgurl`, `summary`)"
. " SELECT `cid`, `pid`, `title`, `imgurl`, ''"
. " FROM " . $source['cat']
);
- echo "Imported " . $xoopsDB->getAffectedRows() . " categories into " . $destination['cat'] . "<br />";
+ echo "Imported " . $GLOBALS['xoopsDB']->getAffectedRows() . " categories into " . $destination['cat'] . "<br />";
//Import data into downloads table
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"INSERT"
. " INTO " . $destination['downloads']
. " (`cid`, `old_lid`, `old_cid`, `title`, `url`, `homepage`, `version`, `size`, `platform`, `screenshot`, `submitter`, `status`, `published`, `hits`, `rating`, `votes`, `comments`, `features`, `requirements`, `dhistory`, `summary`, `description`)"
. " SELECT 0,`lid`, `cid`, `title`, `url`, `homepage`, `version`, `size`, `platform`, `logourl`, `submitter`, `status`, `date`, `hits`, `rating`, `votes`, `comments`, '', '','','', ''"
. " FROM " . $source['downloads']
);
- echo "Imported " . $xoopsDB->getAffectedRows() . " downloads into " . $destination['downloads'] . "<br />";
+ echo "Imported " . $GLOBALS['xoopsDB']->getAffectedRows() . " downloads into " . $destination['downloads'] . "<br />";
//Import data into brokens table
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"INSERT"
. " INTO " . $destination['broken']
. " (`lid`, `sender`, `ip`)"
. " SELECT `lid`, `sender`, `ip`"
. " FROM " . $source['broken']
);
- echo "Imported " . $xoopsDB->getAffectedRows() . " broken reports into " . $destination['broken'] . "<br />";
+ echo "Imported " . $GLOBALS['xoopsDB']->getAffectedRows() . " broken reports into " . $destination['broken'] . "<br />";
//Import data into votedata table
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"INSERT"
. " INTO " . $destination['votes']
. " (`lid`, `ratinguser`, `rating`, `ratinghostname`, `ratingtimestamp`)"
. "SELECT `lid`, `ratinguser`, `rating`, `ratinghostname`, `ratingtimestamp`"
. " FROM " . $source['votes']
);
- echo "Imported " . $xoopsDB->getAffectedRows() . " votes into " . $destination['votes'] . "<br />";
+ echo "Imported " . $GLOBALS['xoopsDB']->getAffectedRows() . " votes into " . $destination['votes'] . "<br />";
//Import data into mod request table
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"INSERT INTO " . $destination['mod']
. " (`lid`, `cid`, `title`, `url`, `homepage`, `version`, `size`, `platform`, `screenshot`, `description`, `modifysubmitter`,`features`, `requirements`, `publisher`, `dhistory`, `summary`)"
. " SELECT `lid`, `cid`, `title`, `url`, `homepage`, `version`, `size`, `platform`, `logourl`, `description`, `modifysubmitter`,'','','','',''"
. " FROM " . $source['mod']
);
- echo "Imported " . $xoopsDB->getAffectedRows() . " modification requests into " . $destination['mod'] . "<br />";
+ echo "Imported " . $GLOBALS['xoopsDB']->getAffectedRows() . " modification requests into " . $destination['mod'] . "<br />";
//Update category ID to new value
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"UPDATE " . $destination['downloads'] . " d, " . $destination['cat'] . " c SET d.cid=c.cid"
. " WHERE d.old_cid=c.old_cid AND d.old_cid != 0"
);
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"UPDATE " . $destination['cat'] . " c1, " . $destination['cat'] . " c2 SET c1.pid=c2.cid"
. " WHERE c1.old_pid=c2.old_cid AND c1.old_pid != 0"
);
if ($max_requestid) {
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"UPDATE " . $destination['mod'] . " m, " . $destination['cat'] . " c SET m.cid=c.cid"
. " WHERE m.requestid > " . $max_requestid
. " AND c.old_cid=m.cid"
);
//Update lid values in mod table
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"UPDATE " . $destination['mod'] . " m, " . $destination['downloads'] . " d SET m.lid=d.lid"
. " WHERE m.requestid > " . $max_requestid
. " AND m.lid=d.old_lid"
@@ -593,7 +590,7 @@
}
if ($max_ratingid) {
//Update lid values in votedata table
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"UPDATE " . $destination['votes'] . " v, " . $destination['downloads'] . " d SET v.lid=d.lid"
. " WHERE v.ratingid > " . $max_ratingid
. " AND v.lid=d.old_lid"
@@ -601,21 +598,21 @@
}
if ($max_reportid) {
//Update lid values in brokens table
- $xoopsDB->query(
+ $GLOBALS['xoopsDB']->query(
"UPDATE " . $destination['broken'] . " b, " . $destination['downloads'] . " d SET b.lid=d.lid"
. " WHERE b.reportid > " . $max_reportid
. " AND b.lid=d.old_lid"
);
}
//Update description
- $xoopsDB->query("UPDATE " . $destination['downloads'] . " d, " . $source['text'] . " t SET d.description=t.description"
+ $GLOBALS['xoopsDB']->query("UPDATE " . $destination['downloads'] . " d, " . $source['text'] . " t SET d.description=t.description"
. " WHERE t.lid=d.old_lid");
//Remove temporary fields
- $xoopsDB->query("ALTER TABLE ." . $destination['cat'] . " DROP `old_cid`");
- $xoopsDB->query("ALTER TABLE ." . $destination['cat'] . " DROP `old_pid`");
- $xoopsDB->query("ALTER TABLE ." . $destination['downloads'] . " DROP `old_cid`");
- $xoopsDB->query("ALTER TABLE ." . $destination['downloads'] . " DROP `old_lid`");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE ." . $destination['cat'] . " DROP `old_cid`");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE ." . $destination['cat'] . " DROP `old_pid`");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE ." . $destination['downloads'] . " DROP `old_cid`");
+ $GLOBALS['xoopsDB']->query("ALTER TABLE ." . $destination['downloads'] . " DROP `old_lid`");
}
@@ -624,106 +621,104 @@
// =========================================================================================
function import_pddownloads_to_wfdownloads()
{
...
[truncated message content] |
|
From: <luc...@us...> - 2014-09-22 19:57:20
|
Revision: 12797
http://sourceforge.net/p/xoops/svn/12797
Author: luciorota
Date: 2014-09-22 19:57:08 +0000 (Mon, 22 Sep 2014)
Log Message:
-----------
fixed bug in var names, standardize var names
fixed bug in db
uses screenshots filed and improved update function (task: add possibility to have all the screenshots you wish IN PROGRESS)
changed some configuration default values
Modified Paths:
--------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/img_uploader.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/notification.inc.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/oninstall.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onuninstall.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/ratefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/rss.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/singlefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/sql/mysql.sql
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_download.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_singlefile.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/viewcat.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-09-22 08:23:59 UTC (rev 12796)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-09-22 19:57:08 UTC (rev 12797)
@@ -273,14 +273,14 @@
}
// Define URL
if (empty($_FILES['userfile']['name'])) {
- if ($_POST['url'] && $_POST['url'] != '' && $_POST['url'] != "http://") {
- $url = ($_POST['url'] != "http://") ? $_POST['url'] : '';
+ if ($_POST['url'] && $_POST['url'] != '' && $_POST['url'] != 'http://') {
+ $url = ($_POST['url'] != 'http://') ? $_POST['url'] : '';
$filename = '';
$filetype = '';
// Get size from form
- $size = (empty($_POST['size']) || !is_numeric($_POST['size'])) ? 0 : (int) $_POST["size"];
+ $size = (empty($_POST['size']) || !is_numeric($_POST['size'])) ? 0 : (int) $_POST['size'];
} else {
- $url = ($_POST["url"] != "http://") ? $_POST['url'] : '';
+ $url = ($_POST['url'] != 'http://') ? $_POST['url'] : '';
$filename = $_POST['filename'];
$filetype = $_POST['filetype'];
$filePath = $wfdownloads->getConfig('uploaddir') . '/' . $filename;
@@ -292,7 +292,7 @@
$downloadObj->setVar('filetype', $filetype);
} else {
$down = wfdownloads_uploading($_FILES, $wfdownloads->getConfig('uploaddir'), '', $currentFile, 0, false, true);
- $url = ($_POST['url'] != "http://") ? $_POST["url"] : '';
+ $url = ($_POST['url'] != 'http://') ? $_POST['url'] : '';
$size = $down['size'];
$title = $_FILES['userfile']['name'];
@@ -306,12 +306,13 @@
$downloadObj->setVar('filetype', $filetype);
}
// Get data from form
- $screenshot = ($_POST['screenshot'] != 'blank.png') ? $_POST['screenshot'] : '';
- $screenshot2 = ($_POST['screenshot2'] != 'blank.png') ? $_POST['screenshot2'] : '';
- $screenshot3 = ($_POST['screenshot3'] != 'blank.png') ? $_POST['screenshot3'] : '';
- $screenshot4 = ($_POST['screenshot4'] != 'blank.png') ? $_POST['screenshot4'] : '';
+ $screenshots = array();
+ $screenshots[] = ($_POST['screenshot'] != 'blank.png') ? $_POST['screenshot'] : '';
+ $screenshots[] = ($_POST['screenshot2'] != 'blank.png') ? $_POST['screenshot2'] : '';
+ $screenshots[] = ($_POST['screenshot3'] != 'blank.png') ? $_POST['screenshot3'] : '';
+ $screenshots[] = ($_POST['screenshot4'] != 'blank.png') ? $_POST['screenshot4'] : '';
- if (!empty($_POST['homepage']) || $_POST['homepage'] != "http://") {
+ if (!empty($_POST['homepage']) || $_POST['homepage'] != 'http://') {
$downloadObj->setVar('homepage', trim($_POST['homepage']));
$downloadObj->setVar('homepagetitle', trim($_POST['homepagetitle']));
}
@@ -349,10 +350,11 @@
$downloadObj->setVar('title', $title);
$downloadObj->setVar('status', $status);
$downloadObj->setVar('size', $size);
- $downloadObj->setVar('screenshot', $screenshot);
- $downloadObj->setVar('screenshot2', $screenshot2);
- $downloadObj->setVar('screenshot3', $screenshot3);
- $downloadObj->setVar('screenshot4', $screenshot4);
+ $downloadObj->setVar('screenshot', $screenshots[0]); // old style
+ $downloadObj->setVar('screenshot2', $screenshots[1]); // old style
+ $downloadObj->setVar('screenshot3', $screenshots[2]); // old style
+ $downloadObj->setVar('screenshot4', $screenshots[3]); // old style
+ $downloadObj->setVar('screenshots', $screenshots); // new style
$downloadObj->setVar('platform', trim($_POST['platform']));
$downloadObj->setVar('summary', trim($_POST['summary']));
$downloadObj->setVar('description', trim($_POST['description']));
@@ -438,7 +440,7 @@
if ($fid) {
include_once XOOPS_ROOT_PATH . '/modules/formulize/include/formread.php';
include_once XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php';
- $formulize_mgr =& xoops_getmodulehandler('elements', 'formulize');
+ $formulizeElements_handler = xoops_getmodulehandler('elements', 'formulize');
if ($lid) {
$entries[$fid][0] = $downloadObj->getVar('formulize_idreq');
if ($entries[$fid][0]) {
@@ -461,7 +463,7 @@
$uid = !empty($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
$groups = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
$entries = handleSubmission(
- $formulize_mgr,
+ $formulizeElements_handler,
$entries,
$uid,
$owner,
@@ -687,14 +689,14 @@
foreach ($publishedDownloadObjs as $publishedDownloadObj) {
$publishedDownload_array = $publishedDownloadObj->toArray();
$publishedDownload_array['title_html'] = $myts->htmlSpecialChars(trim($publishedDownload_array['title']));
- $publishedDownload_array['category_title'] = $categories[$publishedDownload_array['cid']]['title'];
+ $publishedDownload_array['category_title'] = $categoryObjs[$publishedDownload_array['cid']]['title'];
$publishedDownload_array['submitter_uname'] = XoopsUserUtility::getUnameFromId($publishedDownload_array['submitter']);
$publishedDownload_array['published_formatted'] = XoopsLocal::formatTimestamp($publishedDownload_array['published'], 'l');
$GLOBALS['xoopsTpl']->append('published_downloads', $publishedDownload_array);
}
}
- $pagenav = new XoopsPageNav($publishedDownloadsCount, $wfdownloads->getConfig('admin_perpage'), $start_published, 'start_published');
+ $pagenav = new XoopsPageNav($publishedDownloadCount, $wfdownloads->getConfig('admin_perpage'), $start_published, 'start_published');
$GLOBALS['xoopsTpl']->assign('filter_title', $filter_title);
$GLOBALS['xoopsTpl']->assign('filter_title_condition', $filter_title_condition);
$GLOBALS['xoopsTpl']->assign('filter_category_title', $filter_category_title);
@@ -733,7 +735,7 @@
$version = $myts->htmlSpecialChars($newDownload_array['version']);
$size = $myts->htmlSpecialChars($newDownload_array['size']);
$platform = $myts->htmlSpecialChars($newDownload_array['platform']);
- $logourl = $myts->htmlSpecialChars($newDownload_array['screenshot']);
+ $logourl = $myts->htmlSpecialChars($newDownload_array['screenshot']); // IN PROGRESS
$newDownload_array['submitter_uname'] = XoopsUserUtility::getUnameFromId($newDownload_array['submitter']);
$newDownload_array['date_formatted'] = XoopsLocal::formatTimestamp($newDownload_array['date'], 'l');
$GLOBALS['xoopsTpl']->append('new_downloads', $newDownload_array);
@@ -780,12 +782,12 @@
$GLOBALS['xoopsTpl']->assign('expired_downloads_count', $expiredDownloadCount);
if ($expiredDownloadCount > 0) {
foreach ($expiredDownloadObjs as $expiredDownloadObj) {
- $expired_download_array = $expiredDownloadObj->toArray();
- $expired_download_array['title_html'] = $myts->htmlSpecialChars(trim($expired_download_array['title']));
- $expired_download_array['category_title'] = $categories[$expired_download_array['cid']]['title'];
- $expired_download_array['submitter_uname'] = XoopsUserUtility::getUnameFromId($expired_download_array['submitter']);
- $expired_download_array['published_formatted'] = XoopsLocal::formatTimestamp($expired_download_array['published'], 'l');
- $GLOBALS['xoopsTpl']->append('expired_downloads', $expired_download_array);
+ $expiredDownload_array = $expiredDownloadObj->toArray();
+ $expiredDownload_array['title_html'] = $myts->htmlSpecialChars(trim($expiredDownload_array['title']));
+ $expiredDownload_array['category_title'] = $categories[$expiredDownload_array['cid']]['title'];
+ $expiredDownload_array['submitter_uname'] = XoopsUserUtility::getUnameFromId($expiredDownload_array['submitter']);
+ $expiredDownload_array['published_formatted'] = XoopsLocal::formatTimestamp($expiredDownload_array['published'], 'l');
+ $GLOBALS['xoopsTpl']->append('expired_downloads', $expiredDownload_array);
}
}
$pagenav = new XoopsPageNav($expiredDownloadCount, $wfdownloads->getConfig('admin_perpage'), $start_expired, 'start_expired');
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php 2014-09-22 08:23:59 UTC (rev 12796)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php 2014-09-22 19:57:08 UTC (rev 12797)
@@ -350,17 +350,17 @@
$submitter = isset($users[$downloadObjs[$reportObj->getVar('lid')]->getVar('submitter')])
? $users[$downloadObjs[$reportObj->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'];
+ $report_array['submitter_uname'] = is_object($submitter) ? $submitter->getVar('uname') : $GLOBALS['xoopsConfig']['anonymous'];
} else {
$report_array['download_lid'] = false;
$download_link = _AM_WFDOWNLOADS_BROKEN_DOWNLOAD_DONT_EXISTS;
$report_array['submitter_email'] = '';
- $report_array['submitter_uname'] = $xoopsConfig['anonymous'];
+ $report_array['submitter_uname'] = $GLOBALS['xoopsConfig']['anonymous'];
}
$sender = isset($users[$reportObj->getVar('sender')]) ? $users[$reportObj->getVar('sender')] : '';
$report_array['reporter_email'] = isset($users[$reportObj->getVar('sender')]) ? $users[$reportObj->getVar('sender')]->getVar('email') : '';
$report_array['reporter_uname'] = isset($users[$reportObj->getVar('sender')]) ? $users[$reportObj->getVar('sender')]->getVar('uname')
- : $xoopsConfig['anonymous'];
+ : $GLOBALS['xoopsConfig']['anonymous'];
$report_array['formatted_date'] = XoopsLocal::formatTimestamp($reportObj->getVar('date'), 'l');
$GLOBALS['xoopsTpl']->append('reports', $report_array);
}
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php 2014-09-22 08:23:59 UTC (rev 12796)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php 2014-09-22 19:57:08 UTC (rev 12797)
@@ -97,16 +97,16 @@
$xoopsMailer = & getMailer();
$xoopsMailer->useMail();
- $template_dir = WFDOWNLOADS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/mail_template';
+ $template_dir = WFDOWNLOADS_ROOT_PATH . '/language/' . $GLOBALS['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->setFromEmail($GLOBALS['xoopsConfig']['adminmail']);
+ $xoopsMailer->setFromName($GLOBALS['xoopsConfig']['sitename']);
$xoopsMailer->assign('X_UNAME', $user->uname());
- $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
- $xoopsMailer->assign('X_ADMINMAIL', $xoopsConfig['adminmail']);
+ $xoopsMailer->assign('SITENAME', $GLOBALS['xoopsConfig']['sitename']);
+ $xoopsMailer->assign('X_ADMINMAIL', $GLOBALS['xoopsConfig']['adminmail']);
$xoopsMailer->assign('X_SITEURL', XOOPS_URL . '/');
$xoopsMailer->assign('X_TITLE', $title);
$xoopsMailer->assign('X_SUB_DATE', $subdate);
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php 2014-09-22 08:23:59 UTC (rev 12796)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php 2014-09-22 19:57:08 UTC (rev 12797)
@@ -321,7 +321,7 @@
$allsubcats_linked_totop = array();
foreach ($this->allCategories as $cid => $category) {
$parentCategoryObjs = $categoryObjsTree->getAllParent($cid);
- if (count($parents) == 0) {
+ if (count($parentCategoryObjs) == 0) {
// is a top category
$allsubcats_linked_totop[$cid] = $cid;
} else {
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php 2014-09-22 08:23:59 UTC (rev 12796)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php 2014-09-22 19:57:08 UTC (rev 12797)
@@ -131,7 +131,6 @@
function getDownloadInfo()
{
- global $xoopsConfig, $myts;
xoops_load('XoopsUserUtility');
$download['id'] = $this->getVar('lid');
@@ -176,95 +175,99 @@
$download['url'] = $this->getVar('url');
$download['filename'] = $this->getVar('filename');
$download['filetype'] = $this->getVar('filetype');
-
- if ($this->getVar('screenshot')) {
- $download['screenshot_full'] = $this->getVar('screenshot');
- if ($this->getVar('screenshot')
+/*
+ if ($this->getVar('screenshot')) { // IN PROGRESS
+ $download['screenshot_full'] = $this->getVar('screenshot'); // IN PROGRESS
+ $download['screenshot_full1'] = $this->getVar('screenshot'); // IN PROGRESS
+ if ($this->getVar('screenshot') // IN PROGRESS
&& file_exists(XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('screenshots') . '/' . xoops_trim($this->getVar('screenshot')))
) {
if ($this->wfdownloads->getConfig('usethumbs') == true) {
$download['screenshot_thumb'] = wfdownloads_createThumb(
- $download['screenshot_full'],
- $this->wfdownloads->getConfig('screenshots'),
- 'thumbs',
- $this->wfdownloads->getConfig('shotwidth'),
- $this->wfdownloads->getConfig('shotheight'),
- $this->wfdownloads->getConfig('imagequality'),
- $this->wfdownloads->getConfig('updatethumbs'),
- $this->wfdownloads->getConfig('keepaspect')
+ $download['screenshot_full'], $this->wfdownloads->getConfig('screenshots'), 'thumbs',
+ $this->wfdownloads->getConfig('shotwidth'), $this->wfdownloads->getConfig('shotheight'),
+ $this->wfdownloads->getConfig('imagequality'), $this->wfdownloads->getConfig('updatethumbs'), $this->wfdownloads->getConfig('keepaspect')
);
} else {
$download['screenshot_thumb'] = XOOPS_URL . '/' . $this->wfdownloads->getConfig('screenshots') . '/' . xoops_trim($this->getVar('screenshot'));
}
+ $download['screenshot_thumb1'] = $download['screenshot_thumb']; // IN PROGRESS
}
}
- if ($this->getVar('screenshot2') && $this->wfdownloads->getConfig('max_screenshot') >= 2) {
+ if ($this->getVar('screenshot2') && $this->wfdownloads->getConfig('max_screenshot') >= 2) { // IN PROGRESS
$download['screenshot_full2'] = $this->getVar('screenshot2');
if ($this->getVar('screenshot2')
&& file_exists(XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('screenshots') . '/' . xoops_trim($this->getVar('screenshot2')))
) {
if ($this->wfdownloads->getConfig('usethumbs') == true) {
$download['screenshot_thumb2'] = wfdownloads_createThumb(
- $download['screenshot_full2'],
- $this->wfdownloads->getConfig('screenshots'),
- 'thumbs',
- $this->wfdownloads->getConfig('shotwidth'),
- $this->wfdownloads->getConfig('shotheight'),
- $this->wfdownloads->getConfig('imagequality'),
- $this->wfdownloads->getConfig('updatethumbs'),
- $this->wfdownloads->getConfig('keepaspect')
+ $download['screenshot_full2'], $this->wfdownloads->getConfig('screenshots'), 'thumbs',
+ $this->wfdownloads->getConfig('shotwidth'), $this->wfdownloads->getConfig('shotheight'),
+ $this->wfdownloads->getConfig('imagequality'), $this->wfdownloads->getConfig('updatethumbs'), $this->wfdownloads->getConfig('keepaspect')
);
} else {
$download['screenshot_thumb2'] = XOOPS_URL . '/' . $this->wfdownloads->getConfig('screenshots') . '/' . xoops_trim($this->getVar('screenshot2'));
}
}
}
- if ($this->getVar('screenshot3') && $this->wfdownloads->getConfig('max_screenshot') >= 3) {
+ if ($this->getVar('screenshot3') && $this->wfdownloads->getConfig('max_screenshot') >= 3) { // IN PROGRESS
$download['screenshot_full3'] = $this->getVar('screenshot3');
if ($this->getVar('screenshot3')
&& file_exists(XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('screenshots') . '/' . xoops_trim($this->getVar('screenshot3')))
) {
if ($this->wfdownloads->getConfig('usethumbs') == true) {
$download['screenshot_thumb3'] = wfdownloads_createThumb(
- $download['screenshot_full3'],
- $this->wfdownloads->getConfig('screenshots'),
- 'thumbs',
- $this->wfdownloads->getConfig('shotwidth'),
- $this->wfdownloads->getConfig('shotheight'),
- $this->wfdownloads->getConfig('imagequality'),
- $this->wfdownloads->getConfig('updatethumbs'),
- $this->wfdownloads->getConfig('keepaspect')
+ $download['screenshot_full3'], $this->wfdownloads->getConfig('screenshots'), 'thumbs',
+ $this->wfdownloads->getConfig('shotwidth'), $this->wfdownloads->getConfig('shotheight'),
+ $this->wfdownloads->getConfig('imagequality'), $this->wfdownloads->getConfig('updatethumbs'), $this->wfdownloads->getConfig('keepaspect')
);
} else {
$download['screenshot_thumb3'] = XOOPS_URL . '/' . $this->wfdownloads->getConfig('screenshots') . '/' . xoops_trim($this->getVar('screenshot3'));
}
}
}
- if ($this->getVar('screenshot4') && $this->wfdownloads->getConfig('max_screenshot') >= 4) {
+ if ($this->getVar('screenshot4') && $this->wfdownloads->getConfig('max_screenshot') >= 4) { // IN PROGRESS
$download['screenshot_full4'] = $this->getVar('screenshot4');
if ($this->getVar('screenshot4')
&& file_exists(XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('screenshots') . '/' . xoops_trim($this->getVar('screenshot4')))
) {
if ($this->wfdownloads->getConfig('usethumbs') == true) {
$download['screenshot_thumb4'] = wfdownloads_createThumb(
- $download['screenshot_full4'],
- $this->wfdownloads->getConfig('screenshots'),
- 'thumbs',
- $this->wfdownloads->getConfig('shotwidth'),
- $this->wfdownloads->getConfig('shotheight'),
- $this->wfdownloads->getConfig('imagequality'),
- $this->wfdownloads->getConfig('updatethumbs'),
- $this->wfdownloads->getConfig('keepaspect')
+ $download['screenshot_full4'], $this->wfdownloads->getConfig('screenshots'), 'thumbs',
+ $this->wfdownloads->getConfig('shotwidth'), $this->wfdownloads->getConfig('shotheight'),
+ $this->wfdownloads->getConfig('imagequality'), $this->wfdownloads->getConfig('updatethumbs'), $this->wfdownloads->getConfig('keepaspect')
);
} else {
$download['screenshot_thumb4'] = XOOPS_URL . '/' . $this->wfdownloads->getConfig('screenshots') . '/' . xoops_trim($this->getVar('screenshot4'));
}
}
}
+*/
+ // IN PROGRESS
+ $screenshots = $this->getVar('screenshots');
+ $download['screenshots'] = array();
+ foreach ($screenshots as $key => $screenshot) {
+ if (file_exists(XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('screenshots') . '/' . xoops_trim($screenshot))) {
+ if ($this->wfdownloads->getConfig('usethumbs') == true
+ && $screenshot != ''
+ ) {
+ $screenshot_thumb = wfdownloads_createThumb(
+ $screenshot, $this->wfdownloads->getConfig('screenshots'), 'thumbs',
+ $this->wfdownloads->getConfig('shotwidth'), $this->wfdownloads->getConfig('shotheight'),
+ $this->wfdownloads->getConfig('imagequality'), $this->wfdownloads->getConfig('updatethumbs'), $this->wfdownloads->getConfig('keepaspect')
+ );
+ } else {
+ $screenshot_thumb = XOOPS_URL . '/' . $this->wfdownloads->getConfig('screenshots') . '/' . xoops_trim($screenshot);
+ }
+ $download['screenshots'][$key]['filename'] = $screenshot;
+ $download['screenshots'][$key]['thumb_url'] = $screenshot_thumb;
+ unset($screenshot_thumb);
+ }
+ }
//
$download['homepage'] = (!$this->getVar('homepage') || $this->getVar('homepage') == 'http://')
? ''
- : $myts->htmlSpecialChars(trim($this->getVar('homepage')));
+ : $GLOBALS['myts']->htmlSpecialChars(trim($this->getVar('homepage')));
//
$homepagetitle = $this->getVar('homepagetitle');
if ($download['homepage'] && !empty($download['homepage'])) {
@@ -306,8 +309,8 @@
// patch for multilanguage summary if xlanguage module is installed
if (wfdownloads_checkModule('xlanguage')) {
global $xlanguage;
- include_once(XOOPS_ROOT_PATH . '/modules/xlanguage/include/vars.php');
- include_once(XOOPS_ROOT_PATH . '/modules/xlanguage/include/functions.php');
+ include_once XOOPS_ROOT_PATH . '/modules/xlanguage/include/vars.php' ;
+ include_once XOOPS_ROOT_PATH . '/modules/xlanguage/include/functions.php';
$download['summary'] = xlanguage_ml($download['summary']);
}
// html or plain text auto summary
@@ -330,17 +333,17 @@
$limitationsArray = $this->wfdownloads->getConfig('limitations');
$download['limitations'] = ($this->getVar('limitations') == '')
? _MD_WFDOWNLOADS_NOTSPECIFIED
- : $myts->htmlSpecialChars(trim($limitationsArray[$this->getVar('limitations')]));
+ : $GLOBALS['myts']->htmlSpecialChars(trim($limitationsArray[$this->getVar('limitations')]));
//
$versiontypesArray = $this->wfdownloads->getConfig('versiontypes');
$download['versiontypes'] = ($this->getVar('versionypes') == '')
? _MD_WFDOWNLOADS_NOTSPECIFIED
- : $myts->htmlSpecialChars(trim($versiontypesArray[$this->getVar('versiontypes')]));
+ : $GLOBALS['myts']->htmlSpecialChars(trim($versiontypesArray[$this->getVar('versiontypes')]));
$licenseArray = $this->wfdownloads->getConfig('license');
//
$download['license'] = ($this->getVar('license') == '')
? _MD_WFDOWNLOADS_NOTSPECIFIED
- : $myts->htmlSpecialChars(trim($licenseArray[$this->getVar('license')]));
+ : $GLOBALS['myts']->htmlSpecialChars(trim($licenseArray[$this->getVar('license')]));
//
$download['submitter'] = XoopsUserUtility::getUnameFromId($this->getVar('submitter'));
//
@@ -350,10 +353,10 @@
: '';
//
$platformArray = $this->wfdownloads->getConfig('platform');
- $download['platform'] = $myts->htmlSpecialChars($platformArray[$this->getVar('platform')]);
+ $download['platform'] = $GLOBALS['myts']->htmlSpecialChars($platformArray[$this->getVar('platform')]);
//
$history = $this->getVar('dhistory', 'n');
- $download['history'] = $myts->displayTarea($history, true);
+ $download['history'] = $GLOBALS['myts']->displayTarea($history, true);
//
$download['features'] = array();
if ($this->getVar('features')) {
@@ -371,9 +374,9 @@
}
}
//
- $download['mail_subject'] = rawurlencode(sprintf(_MD_WFDOWNLOADS_INTFILEFOUND, $xoopsConfig['sitename']));
+ $download['mail_subject'] = rawurlencode(sprintf(_MD_WFDOWNLOADS_INTFILEFOUND, $GLOBALS['xoopsConfig']['sitename']));
//
- $download['mail_body'] = rawurlencode(sprintf(_MD_WFDOWNLOADS_INTFILEFOUND, $xoopsConfig['sitename']) . ': ' . WFDOWNLOADS_URL . '/singlefile.php?cid=' . $download['cid'] . '&lid=' . $download['id']);
+ $download['mail_body'] = rawurlencode(sprintf(_MD_WFDOWNLOADS_INTFILEFOUND, $GLOBALS['xoopsConfig']['sitename']) . ': ' . WFDOWNLOADS_URL . '/singlefile.php?cid=' . $download['cid'] . '&lid=' . $download['id']);
//
$download['isadmin'] = (wfdownloads_userIsAdmin()) ? true : false;
//
@@ -417,7 +420,7 @@
// file url
$fullFilename = trim($download['filename']);
if ((!$download['url'] == '' && !$download['url'] == 'http://') || $fullFilename == '') {
- ...
[truncated message content] |
|
From: <luc...@us...> - 2014-09-23 20:08:00
|
Revision: 12799
http://sourceforge.net/p/xoops/svn/12799
Author: luciorota
Date: 2014-09-23 20:07:56 +0000 (Tue, 23 Sep 2014)
Log Message:
-----------
use screenshots field instead of screenshot, screentshot1, ... IN PROGRESS
Modified Paths:
--------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/modification.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/sql/mysql.sql
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-09-22 20:06:12 UTC (rev 12798)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-09-23 20:07:56 UTC (rev 12799)
@@ -730,12 +730,14 @@
$newDownload_array['rating'] = number_format($newDownload_array['rating'], 2);
$newDownload_array['title_html'] = $myts->htmlSpecialChars($newDownload_array['title']);
$newDownload_array['category_title'] = $categories[$newDownload_array['cid']]['title'];
+/*
$url = urldecode($myts->htmlSpecialChars($newDownload_array['url']));
$homepage = $myts->htmlSpecialChars($newDownload_array['homepage']);
$version = $myts->htmlSpecialChars($newDownload_array['version']);
$size = $myts->htmlSpecialChars($newDownload_array['size']);
$platform = $myts->htmlSpecialChars($newDownload_array['platform']);
$logourl = $myts->htmlSpecialChars($newDownload_array['screenshot']); // IN PROGRESS
+*/
$newDownload_array['submitter_uname'] = XoopsUserUtility::getUnameFromId($newDownload_array['submitter']);
$newDownload_array['date_formatted'] = XoopsLocal::formatTimestamp($newDownload_array['date'], 'l');
$GLOBALS['xoopsTpl']->append('new_downloads', $newDownload_array);
@@ -746,9 +748,9 @@
// Autopublished Downloads
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria('published', time(), ">"));
+ $criteria->add(new Criteria('published', time(), '>'));
$criteria->setSort('published');
- $criteria->setOrder("ASC");
+ $criteria->setOrder('ASC');
$criteria->setStart($start_autopublished);
$criteria->setLimit($wfdownloads->getConfig('admin_perpage'));
$autopublishedDownloadObjs = $wfdownloads->getHandler('download')->getObjects($criteria);
@@ -856,9 +858,9 @@
}
$batchFile = $batchFiles[$batchid];
- $savedFileName = iconv("UTF-8", "ASCII//TRANSLIT", $batchFile);
+ $savedFileName = iconv('UTF-8', "ASCII//TRANSLIT", $batchFile);
$savedFileName = preg_replace('!\s+!', '_', $savedFileName);
- $savedFileName = preg_replace("/[^a-zA-Z0-9\._-]/", "", $savedFileName);
+ $savedFileName = preg_replace('/[^a-zA-Z0-9\._-]/', '', $savedFileName);
$savedFileName = uniqid(time()) . '--' . $savedFileName;
if (!wfdownloads_copyFile($batchPath . '/' . $batchFile, $wfdownloads->getConfig('uploaddir') . '/' . $savedFileName)) {
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php 2014-09-22 20:06:12 UTC (rev 12798)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php 2014-09-23 20:07:56 UTC (rev 12799)
@@ -375,7 +375,11 @@
}
$GLOBALS['xoopsDB']->query($sql);
echo "Imported {$GLOBALS['xoopsDB']->getAffectedRows()} downloads into {$destination['downloads']}<br />";
+// IN PROGRESS
+// IN PROGRESS IMPORT AND UPDATE SCREENSHOTS
+// IN PROGRESS
+
//Import data into mirrors table
$sql = "INSERT INTO {$destination['mirrors']} (";
$sql .= " `lid`, `title`, `homeurl`, `location`, `continent`, `downurl`, `submit`, `date`, `uid`";
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php 2014-09-22 20:06:12 UTC (rev 12798)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php 2014-09-23 20:07:56 UTC (rev 12799)
@@ -98,7 +98,7 @@
// Get common keys
$commonKeys = array_intersect($downloadKeys, $modificationKeys);
// Set not allowed keys
- $notAllowedKeys = array('lid', 'submitter', 'publisher', 'requestid', 'forumid', 'modifysubmitter', 'screenshots', 'paypalemail');
+ $notAllowedKeys = array('lid', 'submitter', 'publisher', 'requestid', 'forumid', 'modifysubmitter', 'paypalemail');
$i = 0;
$mcform->addElement(null, false, null, null);
@@ -156,6 +156,21 @@
//
if ($modificationContent != '') $modificationContent = "<img src='" . XOOPS_URL . "/{$wfdownloads->getConfig('screenshots')}/{$modificationContent}' width='{$wfdownloads->getConfig('shotwidth')}' alt='' title='' />";
break;
+ case 'screenshots':
+ $downloadScreenshots = $downloadContent;
+ $modificationScreenshots = $modificationContent;
+ unset($downloadContent);
+ unset($modificationContent);
+ $downloadContent = '';
+ $modificationContent = '';
+ foreach ($downloadScreenshots as $key => $value) {
+ $downloadScreenshot = $downloadScreenshots[$key];
+ $modificationScreenshot = $modificationScreenshots[$key];
+ if ($downloadScreenshot != '') $downloadContent += "<img src='" . XOOPS_URL . "/{$wfdownloads->getConfig('screenshots')}/{$downloadScreenshot}' width='{$wfdownloads->getConfig('shotwidth')}' alt='' title='' />";
+ //
+ if ($modificationContent != '') $modificationContent += "<img src='" . XOOPS_URL . "/{$wfdownloads->getConfig('screenshots')}/{$modificationScreenshot}' width='{$wfdownloads->getConfig('shotwidth')}' alt='' title='' />";
+ }
+ break;
case 'publisher':
$downloadContent = XoopsUserUtility::getUnameFromId($downloadContent);
//
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/modification.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/modification.php 2014-09-22 20:06:12 UTC (rev 12798)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/modification.php 2014-09-23 20:07:56 UTC (rev 12799)
@@ -81,6 +81,7 @@
// $this->initVar('ipaddress', XOBJ_DTYPE_TXTBOX, '');
// $this->initVar('notifypub', XOBJ_DTYPE_INT, 0);
// added 3.23
+ $this->initVar('screenshots', XOBJ_DTYPE_ARRAY, array()); // IN PROGRESS
$this->initVar('dohtml', XOBJ_DTYPE_INT, false); // boolean
$this->initVar('dosmiley', XOBJ_DTYPE_INT, true); // boolean
$this->initVar('doxcode', XOBJ_DTYPE_INT, true); // boolean
@@ -156,6 +157,7 @@
d.updated = m.updated,
d.summary = m.summary,
d.description = m.description,
+ d.screenshots = m.screenshots,
d.dohtml = m.dohtml,
d.dosmiley = m.dosmiley,
d.doxcode = m.doxcode,
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php 2014-09-22 20:06:12 UTC (rev 12798)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php 2014-09-23 20:07:56 UTC (rev 12799)
@@ -191,6 +191,7 @@
// ???
"formulize_idreq" => array("Type" => "int(5) NOT NULL default '0'", "Default" => true),
// added 3.23
+ "screenshots" => array("Type" => "text NOT NULL", "Default" => true),
"dohtml" => array("Type" => "tinyint(1) NOT NULL default '0'", "Default" => true),
"dosmiley" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true),
"doxcode" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true),
@@ -361,7 +362,7 @@
);
echo "<br /><span style='font-weight: bold;'>Checking Download table</span><br />";
$download_handler = xoops_getmodulehandler('download', 'wfdownloads');
- $download_table = new WfdownloadsTable("wfdownloads_downloads");
+ $download_table = new WfdownloadsTable('wfdownloads_downloads');
$fields = get_table_info($download_handler->table, $download_fields);
// check for renamed fields
rename_fields($download_table, $renamed_fields, $fields, $download_fields);
@@ -425,7 +426,7 @@
);
echo "<br /><span style='font-weight: bold;'>Checking Modified Downloads table</span><br />";
$mod_handler = xoops_getmodulehandler('modification', 'wfdownloads');
- $mod_table = new WfdownloadsTable("wfdownloads_mod");
+ $mod_table = new WfdownloadsTable('wfdownloads_mod');
$fields = get_table_info($mod_handler->table, $mod_fields);
rename_fields($mod_table, $renamed_fields, $fields, $mod_fields);
update_table($mod_fields, $fields, $mod_table);
@@ -455,7 +456,7 @@
);
echo "<br /><span style='font-weight: bold;'>Checking Category table</span><br />";
$cat_handler = xoops_getmodulehandler('category', 'wfdownloads');
- $cat_table = new WfdownloadsTable("wfdownloads_cat");
+ $cat_table = new WfdownloadsTable('wfdownloads_cat');
$fields = get_table_info($cat_handler->table, $cat_fields);
update_table($cat_fields, $fields, $cat_table);
if ($dbupdater->updateTable($cat_table)) {
@@ -475,7 +476,7 @@
);
echo "<br /><span style='font-weight: bold;'>Checking Broken Report table</span><br />";
$broken_handler = xoops_getmodulehandler('report', 'wfdownloads');
- $broken_table = new WfdownloadsTable("wfdownloads_broken");
+ $broken_table = new WfdownloadsTable('wfdownloads_broken');
$fields = get_table_info($broken_handler->table, $broken_fields);
update_table($broken_fields, $fields, $broken_table);
if ($dbupdater->updateTable($broken_table)) {
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/sql/mysql.sql
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/sql/mysql.sql 2014-09-22 20:06:12 UTC (rev 12798)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/sql/mysql.sql 2014-09-23 20:07:56 UTC (rev 12799)
@@ -344,6 +344,7 @@
description text NOT NULL,
modifysubmitter int(11) NOT NULL default '0',
requestdate int(11) NOT NULL default '0',
+ screenshots text NOT NULL,
dohtml tinyint(1) NOT NULL default '0',
dosmiley tinyint(1) NOT NULL default '1',
doxcode tinyint(1) NOT NULL default '1',
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php 2014-09-22 20:06:12 UTC (rev 12798)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php 2014-09-23 20:07:56 UTC (rev 12799)
@@ -357,7 +357,7 @@
$owner_groups,
$groups,
'new'
- ); // "new" causes xoops token check to be skipped, since Wfdownloads should be doing that
+ ); // 'new' causes xoops token check to be skipped, since Wfdownloads should be doing that
if (!$owner) {
$id_req = $entries[$fid][0];
$downloadObj->setVar('formulize_idreq', $id_req);
@@ -445,12 +445,12 @@
$offline = (isset($_POST['offline']) && $_POST['offline'] == 1) ? true : false;
$downloadObj->setVar('offline', $offline);
$downloadObj->setVar('date', time());
-
+/*
$screenshot1 = '';
$screenshot2 = '';
$screenshot3 = '';
$screenshot4 = '';
-
+*/
if ($lid == 0) {
$notifypub = (isset($_POST['notifypub']) && $_POST['notifypub'] == true);
$downloadObj->setVar('notifypub', $notifypub);
|
|
From: <luc...@us...> - 2014-11-26 21:42:23
|
Revision: 12875
http://sourceforge.net/p/xoops/svn/12875
Author: luciorota
Date: 2014-11-26 21:42:17 +0000 (Wed, 26 Nov 2014)
Log Message:
-----------
- update to latest mamba work
- fixed: use DateTime object instead of strtotime function (luciorota)
Modified Paths:
--------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/images.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/index.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/indexpage.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/menu.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mimetypes.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mirrors.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/permissions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/ratings.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reviews.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/swishe.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/top.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/top_by_cat.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/breadcrumb.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/dbupdater.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/ip_log.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mimetype.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mirror.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/modification.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/multicolumnsthemeform.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/rating.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/report.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/review.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/session.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/tree.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/wfdownloads.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/wfdownloads_lists.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/xoopstree.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_new.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/credits.txt
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/install.txt
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/lang_diff.txt
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/readme.txt
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/header.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/comment_functions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/common.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/directorychecker.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/filechecker.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/functions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/notification.inc.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/oninstall.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onuninstall.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/search.inc.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/index.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/admin.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/category_filemodified_notify.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/category_filesubmit_notify.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/category_newfile_notify.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/file_approve_notify.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/file_filemodified_notify.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/filebroken_notify.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/global_filebroken_notify.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/global_filemodified_notify.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/global_filemodify_notify.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/global_filesubmit_notify.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/global_newcategory_notify.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/global_newfile_notify.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/index.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/main.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/modinfo.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/index.html
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/mirror.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/newlist.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/ratefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/review.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/rss.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/singlefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/admin/wfdownloads_am_categorieslist.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_co_letterschoice.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_singlefile.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_viewcat.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/topten.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/viewcat.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/visit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php 2014-11-26 21:38:33 UTC (rev 12874)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php 2014-11-26 21:42:17 UTC (rev 12875)
@@ -18,7 +18,7 @@
* @author Xoops Development Team
* @version svn:$id$
*/
-include_once dirname(__FILE__) . '/admin_header.php';
+include_once __DIR__ . '/admin_header.php';
xoops_cp_header();
@@ -27,4 +27,4 @@
echo $aboutAdmin->addNavigation('about.php');
echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
-include_once dirname(__FILE__) . '/admin_footer.php';
+include_once __DIR__ . '/admin_footer.php';
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php 2014-11-26 21:38:33 UTC (rev 12874)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php 2014-11-26 21:42:17 UTC (rev 12875)
@@ -18,8 +18,8 @@
* @author Xoops Development Team
* @version svn:$id$
*/
-include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php';
-include_once dirname(dirname(__FILE__)) . '/include/common.php';
+include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
+include_once dirname(__DIR__) . '/include/common.php';
// Include xoops admin header
include_once XOOPS_ROOT_PATH . '/include/cp_header.php';
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php 2014-11-26 21:38:33 UTC (rev 12874)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php 2014-11-26 21:42:17 UTC (rev 12875)
@@ -19,7 +19,7 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include_once dirname(__FILE__) . '/admin_header.php';
+include_once __DIR__ . '/admin_header.php';
// Check directories
if (!is_dir($wfdownloads->getConfig('uploaddir'))) {
@@ -39,38 +39,38 @@
exit();
}
-$op = WfdownloadsRequest::getString('op', 'categories.list');
+$op = XoopsRequest::getString('op', 'categories.list');
switch ($op) {
case 'category.move':
case 'move':
- $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
+ $ok = XoopsRequest::getBool('ok', false, 'POST');
if ($ok == false) {
- $cid = WfdownloadsRequest::getInt('cid', 0);
+ $cid = XoopsRequest::getInt('cid', 0);
wfdownloads_xoops_cp_header();
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$sform = new XoopsThemeForm(_AM_WFDOWNLOADS_CCATEGORY_MOVE, 'move', xoops_getenv('PHP_SELF'));
- $categoryObjs = $wfdownloads->getHandler('category')->getObjects();
+ $categoryObjs = $wfdownloads->getHandler('category')->getObjects();
$categoryObjsTree = new XoopsObjectTree($categoryObjs, 'cid', 'pid');
$sform->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_BMODIFY, $categoryObjsTree->makeSelBox('target', 'title')));
- $create_tray = new XoopsFormElementTray('', '');
- $create_tray->addElement(new XoopsFormHidden('source', $cid));
- $create_tray->addElement(new XoopsFormHidden('ok', true));
- $create_tray->addElement(new XoopsFormHidden('op', 'category.move'));
- $butt_save = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BMOVE, 'submit');
- $butt_save->setExtra('onclick="this.form.elements.op.value=\'category.move\'"');
- $create_tray->addElement($butt_save);
- $butt_cancel = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BCANCEL, 'submit');
- $butt_cancel->setExtra('onclick="this.form.elements.op.value=\'cancel\'"');
- $create_tray -> addElement($butt_cancel);
+ $create_tray = new XoopsFormElementTray('', '');
+ $create_tray->addElement(new XoopsFormHidden('source', $cid));
+ $create_tray->addElement(new XoopsFormHidden('ok', true));
+ $create_tray->addElement(new XoopsFormHidden('op', 'category.move'));
+ $butt_save = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BMOVE, 'submit');
+ $butt_save->setExtra('onclick="this.form.elements.op.value=\'category.move\'"');
+ $create_tray->addElement($butt_save);
+ $butt_cancel = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BCANCEL, 'submit');
+ $butt_cancel->setExtra('onclick="this.form.elements.op.value=\'cancel\'"');
+ $create_tray->addElement($butt_cancel);
$sform->addElement($create_tray);
$sform->display();
xoops_cp_footer();
} else {
- $source = WfdownloadsRequest::getInt('source', 0, 'POST');
- $target = WfdownloadsRequest::getInt('target', 0, 'POST');
+ $source = XoopsRequest::getInt('source', 0, 'POST');
+ $target = XoopsRequest::getInt('target', 0, 'POST');
if ($target == $source) {
redirect_header($currentFile . "?op=category.move&ok=0&cid={$source}", 5, _AM_WFDOWNLOADS_CCATEGORY_MODIFY_FAILED);
}
@@ -89,40 +89,40 @@
case 'category.save':
case 'addCat':
- $cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
- $pid = WfdownloadsRequest::getInt('pid', 0, 'POST');
- $weight = (isset($_POST['weight']) && $_POST['weight'] > 0) ? (int) $_POST["weight"] : 0;
- $down_groups = isset($_POST['groups']) ? $_POST['groups'] : array();
- $up_groups = isset($_POST['up_groups']) ? $_POST['up_groups'] : array();
- $spotlighthis = (isset($_POST['lid'])) ? (int) $_POST['lid'] : 0;
+ $cid = XoopsRequest::getInt('cid', 0, 'POST');
+ $pid = XoopsRequest::getInt('pid', 0, 'POST');
+ $weight = (isset($_POST['weight']) && $_POST['weight'] > 0) ? (int)$_POST["weight"] : 0;
+ $down_groups = isset($_POST['groups']) ? $_POST['groups'] : array();
+ $up_groups = isset($_POST['up_groups']) ? $_POST['up_groups'] : array();
+ $spotlighthis = (isset($_POST['lid'])) ? (int)$_POST['lid'] : 0;
$spotlighttop = (isset($_POST['spotlighttop']) && ($_POST['spotlighttop'] == 1)) ? 1 : 0;
include_once XOOPS_ROOT_PATH . '/class/uploader.php';
$allowedMimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');
- $imgurl = 'blank.png';
- $maxFileSize = $wfdownloads->getConfig('maxfilesize');
- $maxImgWidth = $wfdownloads->getConfig('maximgwidth');
- $maxImgHeight = $wfdownloads->getConfig('maximgheight');
- $uploadDirectory = XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('catimage');
- $uploader = new XoopsMediaUploader($uploadDirectory, $allowedMimetypes, $maxFileSize, $maxImgWidth, $maxImgHeight);
+ $imgurl = 'blank.png';
+ $maxFileSize = $wfdownloads->getConfig('maxfilesize');
+ $maxImgWidth = $wfdownloads->getConfig('maximgwidth');
+ $maxImgHeight = $wfdownloads->getConfig('maximgheight');
+ $uploadDirectory = XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('catimage');
+ $uploader = new XoopsMediaUploader($uploadDirectory, $allowedMimetypes, $maxFileSize, $maxImgWidth, $maxImgHeight);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
$uploader->setTargetFileName('wfdownloads_' . uniqid(time()) . '--' . strtolower($_FILES['uploadfile']['name']));
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
$errors = $uploader->getErrors();
- redirect_header('javascript:history.go(-1)',3, $errors);
+ redirect_header('javascript:history.go(-1)', 3, $errors);
} else {
$imgurl = $uploader->getSavedFileName();
}
} else {
- $imgurl = (isset($_POST['imgurl']) && $_POST['imgurl'] != 'blank.png') ? $myts -> addslashes($_POST['imgurl']) : '';
+ $imgurl = (isset($_POST['imgurl']) && $_POST['imgurl'] != 'blank.png') ? $myts->addslashes($_POST['imgurl']) : '';
}
if (!$cid) {
$categoryObj = $wfdownloads->getHandler('category')->create();
} else {
$categoryObj = $wfdownloads->getHandler('category')->get($cid);
- $childcats = $wfdownloads->getHandler('category')->getChildCats($categoryObj);
+ $childcats = $wfdownloads->getHandler('category')->getChildCats($categoryObj);
if ($pid == $cid || in_array($pid, array_keys($childcats))) {
$categoryObj->setErrors(_AM_WFDOWNLOADS_CCATEGORY_CHILDASPARENT);
}
@@ -141,7 +141,7 @@
$categoryObj->setVar('dobr', isset($_POST['dobr']));
// Formulize module support (2006/05/04) jpc - start
if (wfdownloads_checkModule('formulize')) {
- $formulize_fid = (isset($_POST['formulize_fid'])) ? (int) $_POST['formulize_fid'] : 0;
+ $formulize_fid = (isset($_POST['formulize_fid'])) ? (int)$_POST['formulize_fid'] : 0;
$categoryObj->setVar('formulize_fid', $formulize_fid);
}
// Formulize module support (2006/05/04) jpc - end
@@ -153,15 +153,15 @@
}
if (!$cid) {
if ($cid == 0) {
- $newid = (int) $categoryObj->getVar('cid');
+ $newid = (int)$categoryObj->getVar('cid');
}
wfdownloads_savePermissions($down_groups, $newid, 'WFDownCatPerm');
wfdownloads_savePermissions($up_groups, $newid, 'WFUpCatPerm');
// Notify of new category
- $tags = array();
+ $tags = array();
$tags['CATEGORY_NAME'] = $_POST['title'];
- $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . '/viewcat.php?cid=' . $newid;
- $notification_handler = xoops_gethandler('notification');
+ $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . '/viewcat.php?cid=' . $newid;
+ $notification_handler = xoops_gethandler('notification');
$notification_handler->triggerEvent('global', 0, 'new_category', $tags);
$database_mess = _AM_WFDOWNLOADS_CCATEGORY_CREATED;
} else {
@@ -174,11 +174,11 @@
case 'category.delete':
case 'del':
- $cid = WfdownloadsRequest::getInt('cid', 0);
- $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
- $categoryObjs = $wfdownloads->getHandler('category')->getObjects();
+ $cid = XoopsRequest::getInt('cid', 0);
+ $ok = XoopsRequest::getBool('ok', false, 'POST');
+ $categoryObjs = $wfdownloads->getHandler('category')->getObjects();
$categoryObjsTree = new XoopsObjectTree($categoryObjs, 'cid', 'pid');
- if ($ok == true) {
+ if ($ok === true) {
// get all subcategories under the specified category
$childCategoryObjs = $categoryObjsTree->getAllChild($cid);
foreach ($childCategoryObjs as $childCategoryObj) {
@@ -199,7 +199,7 @@
$wfdownloads->getHandler('report')->deleteAll($download_criteria);
$wfdownloads->getHandler('download')->deleteAll($download_criteria);
foreach (array_keys($downloads) as $lid) {
- xoops_comment_delete($wfdownloads->getModule()->mid(), (int) $lid);
+ xoops_comment_delete($wfdownloads->getModule()->mid(), (int)$lid);
}
// all downloads for each category is deleted, now delete the category data
@@ -207,8 +207,8 @@
$error = _AM_WFDOWNLOADS_DBERROR;
foreach ($cids as $cid) {
- xoops_groupperm_deletebymoditem ($wfdownloads->getModule()->mid(), 'WFDownCatPerm', $cid);
- xoops_groupperm_deletebymoditem ($wfdownloads->getModule() -> mid(), 'WFUpCatPerm', $cid);
+ xoops_groupperm_deletebymoditem($wfdownloads->getModule()->mid(), 'WFDownCatPerm', $cid);
+ xoops_groupperm_deletebymoditem($wfdownloads->getModule()->mid(), 'WFUpCatPerm', $cid);
}
redirect_header($currentFile, 1, _AM_WFDOWNLOADS_CCATEGORY_DELETED);
@@ -237,9 +237,9 @@
$categoryObj = $wfdownloads->getHandler('category')->create();
}
$form = $categoryObj->getForm();
- $form -> display();
+ $form->display();
- include_once dirname(__FILE__) . '/admin_footer.php';
+ include_once __DIR__ . '/admin_footer.php';
break;
case 'categories.list':
@@ -257,22 +257,22 @@
if ($totalCategories > 0) {
$sorted_categories = wfdownloads_sortCategories();
$GLOBALS['xoopsTpl']->assign('sorted_categories', $sorted_categories);
- $GLOBALS['xoopsTpl']->assign('token', $GLOBALS['xoopsSecurity']->getTokenHTML() );
+ $GLOBALS['xoopsTpl']->assign('token', $GLOBALS['xoopsSecurity']->getTokenHTML());
$GLOBALS['xoopsTpl']->display("db:{$wfdownloads->getModule()->dirname()}_am_categorieslist.tpl");
} else {
redirect_header("{$currentFile}?op=category.add", 1, _AM_WFDOWNLOADS_CCATEGORY_NOEXISTS);
}
- include_once dirname(__FILE__) . '/admin_footer.php';
+ include_once __DIR__ . '/admin_footer.php';
break;
case 'categories.reorder':
if (!$GLOBALS['xoopsSecurity']->check()) {
- redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors() ));
+ redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
if (isset($_POST['new_weights']) && count($_POST['new_weights']) > 0) {
$new_weights = $_POST['new_weights'];
- $ids = array();
+ $ids = array();
foreach ($new_weights as $cid => $new_weight) {
$categoryObj = $wfdownloads->getHandler('category')->get($cid);
$categoryObj->setVar('weight', $new_weight);
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php 2014-11-26 21:38:33 UTC (rev 12874)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php 2014-11-26 21:42:17 UTC (rev 12875)
@@ -19,7 +19,7 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include_once dirname(__FILE__) . '/admin_header.php';
+include_once __DIR__ . '/admin_header.php';
if (@$_POST['op'] == 'submit') {
if (!$GLOBALS['xoopsSecurity']->check()) {
@@ -71,7 +71,7 @@
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
echo $message;
- include_once dirname(__FILE__) . '/admin_footer.php';
+ include_once __DIR__ . '/admin_footer.php';
exit();
} else {
@@ -86,7 +86,7 @@
$form->addElement(new XoopsFormHidden('op', 'submit'));
$form->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit'));
$form->display();
- include_once dirname(__FILE__) . '/admin_footer.php';
+ include_once __DIR__ . '/admin_footer.php';
exit();
}
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-11-26 21:38:33 UTC (rev 12874)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-11-26 21:42:17 UTC (rev 12875)
@@ -19,7 +19,7 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include_once dirname(__FILE__) . '/admin_header.php';
+include_once __DIR__ . '/admin_header.php';
// Check directories
if (!is_dir($wfdownloads->getConfig('uploaddir'))) {
@@ -39,7 +39,7 @@
exit();
}
-$op = WfdownloadsRequest::getString('op', 'downloads.list');
+$op = XoopsRequest::getString('op', 'downloads.list');
switch ($op) {
case 'download.edit':
case 'download.add':
@@ -52,15 +52,15 @@
$adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, "{$currentFile}?op=downloads.list", 'list');
echo $adminMenu->renderButton();
- $lid = WfdownloadsRequest::getInt('lid', 0);
+ $lid = XoopsRequest::getInt('lid', 0);
$categoriesCount = $wfdownloads->getHandler('category')->getCount();
if ($categoriesCount) {
// Allowed mimetypes list
echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFDOWNLOADS_FILE_ALLOWEDAMIME . "</legend>\n";
echo "<div style='padding: 8px;'>\n";
- $criteria = new Criteria("mime_admin", true);
- $mimetypes = $wfdownloads->getHandler('mimetype')->getList($criteria);
+ $criteria = new Criteria("mime_admin", true);
+ $mimetypes = $wfdownloads->getHandler('mimetype')->getList($criteria);
$allowMimetypes = implode(' | ', $mimetypes);
echo $allowMimetypes;
echo "</div>\n";
@@ -77,16 +77,16 @@
redirect_header($currentFile, 4, _AM_WFDOWNLOADS_DOWN_ERROR_CATEGORYNOTFOUND);
exit();
}
- $title = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FILE_EDIT);
+ $title = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FILE_EDIT);
$title12 = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FFS_1STEP);
$title22 = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FFS_EDITDOWNLOADTITLE);
} else {
// create download
$downloadObj = $wfdownloads->getHandler('download')->create();
- $cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
+ $cid = XoopsRequest::getInt('cid', 0, 'POST');
$categoryObj = $wfdownloads->getHandler('category')->get($cid);
$downloadObj->setVar('cid', $cid);
- $title = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FILE_CREATE);
+ $title = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FILE_CREATE);
$title12 = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FFS_1STEP);
$title22 = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FFS_DOWNLOADTITLE);
}
@@ -97,15 +97,16 @@
$sform = $downloadObj->getAdminForm($title);
} elseif ((isset($_POST['submit_category']) && !empty($_POST['submit_category']))) {
// two steps form: 2nd step
- $fid = $categoryObj->getVar('formulize_fid');
+ $fid = $categoryObj->getVar('formulize_fid');
$customArray = array();
if ($fid) {
include_once XOOPS_ROOT_PATH . '/modules/formulize/include/formdisplay.php';
include_once XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php';
- $customArray['fid'] = $fid;
+ $customArray['fid'] = $fid;
$customArray['formulize_mgr'] = xoops_getmodulehandler('elements', 'formulize');
- $customArray['groups'] = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
- $customArray['prevEntry'] = getEntryValues( // is a Formulize function
+ $customArray['groups'] = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
+ $customArray['prevEntry'] = getEntryValues(
+ // is a Formulize function
$downloadObj->getVar('formulize_idreq'),
$customArray['formulize_mgr'],
$customArray['groups'],
@@ -124,7 +125,7 @@
} else {
$owner = getEntryOwner($customArray['entry'], $fid); // is a Formulize function
}
- $ownerGroups = $member_handler->getGroupsByUser($owner, false);
+ $ownerGroups = $member_handler->getGroupsByUser($owner, false);
$customArray['owner_groups'] = $ownerGroups;
}
$sform = $downloadObj->getAdminForm($title22, $customArray);
@@ -192,9 +193,9 @@
foreach ($regUserRatingObjs as $regUserRatingObj) {
$formatted_date = XoopsLocal::formatTimestamp($regUserRatingObj->getVar('ratingtimestamp'), 'l');
- $userAvgRating = isset($userRatings[$regUserRatingObj->getVar('ratinguser')]) ? $userRatings[$regUserRatingObj->getVar('ratinguser')]['avg'] : 0;
- $userVotes = isset($userRatings[$regUserRatingObj->getVar('ratinguser')]) ? $userRatings[$regUserRatingObj->getVar('ratinguser')]['count'] : 0;
- $ratingUserName = XoopsUser :: getUnameFromId($regUserRatingObj->getVar('ratinguser'));
+ $userAvgRating = isset($userRatings[$regUserRatingObj->getVar('ratinguser')]) ? $userRatings[$regUserRatingObj->getVar('ratinguser')]['avg'] : 0;
+ $userVotes = isset($userRatings[$regUserRatingObj->getVar('ratinguser')]) ? $userRatings[$regUserRatingObj->getVar('ratinguser')]['count'] : 0;
+ $ratingUserName = XoopsUser:: getUnameFromId($regUserRatingObj->getVar('ratinguser'));
echo "
<tr><td class='head'>$ratingUserName</td>\n
@@ -204,8 +205,7 @@
<td class='even'>$userVotes</th>\n
<td class='even'...
[truncated message content] |
|
From: <luc...@us...> - 2015-02-03 22:20:50
|
Revision: 12964
http://sourceforge.net/p/xoops/svn/12964
Author: luciorota
Date: 2015-02-03 22:20:34 +0000 (Tue, 03 Feb 2015)
Log Message:
-----------
xoops 2.5.7.1 compatible
change directory structure
code cleanup
fixed bug when using XoopsFormSelectUser form element
Modified Paths:
--------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/index.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/indexpage.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mimetypes.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mirrors.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/ratings.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reviews.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/swishe.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mimetype.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mirror.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/review.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/common.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/functions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/index.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/mirror.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/newlist.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/ratefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/review.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/singlefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_header.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_reviews.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/topten.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/viewcat.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php
Added Paths:
-----------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/choicebyletter.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/choicebyletter.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/directorychecker.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/filechecker.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/session.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/tree.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/xoopstree.php
Removed Paths:
-------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/breadcrumb.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/session.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/tree.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/xoopstree.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/directorychecker.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/filechecker.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_co_breadcrumb.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_co_letterschoice.tpl
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -49,7 +49,7 @@
wfdownloads_xoops_cp_header();
- include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
+ xoops_load('XoopsFormLoader');
$sform = new XoopsThemeForm(_AM_WFDOWNLOADS_CCATEGORY_MOVE, 'move', xoops_getenv('PHP_SELF'));
$categoryObjs = $wfdownloads->getHandler('category')->getObjects();
@@ -99,7 +99,7 @@
include_once XOOPS_ROOT_PATH . '/class/uploader.php';
$allowedMimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');
- $imgurl = 'blank.png';
+ $imgUrl = 'blank.png';
$maxFileSize = $wfdownloads->getConfig('maxfilesize');
$maxImgWidth = $wfdownloads->getConfig('maximgwidth');
$maxImgHeight = $wfdownloads->getConfig('maximgheight');
@@ -112,17 +112,17 @@
$errors = $uploader->getErrors();
redirect_header('javascript:history.go(-1)', 3, $errors);
} else {
- $imgurl = $uploader->getSavedFileName();
+ $imgUrl = $uploader->getSavedFileName();
}
} else {
- $imgurl = (isset($_POST['imgurl']) && $_POST['imgurl'] != 'blank.png') ? $myts->addslashes($_POST['imgurl']) : '';
+ $imgUrl = (isset($_POST['imgurl']) && $_POST['imgurl'] != 'blank.png') ? $myts->addslashes($_POST['imgurl']) : '';
}
if (!$cid) {
$categoryObj = $wfdownloads->getHandler('category')->create();
} else {
$categoryObj = $wfdownloads->getHandler('category')->get($cid);
- $childcats = $wfdownloads->getHandler('category')->getChildCats($categoryObj);
+ $childcats = $wfdownloads->getHandler('category')->getChildCats($categoryObj);
if ($pid == $cid || in_array($pid, array_keys($childcats))) {
$categoryObj->setErrors(_AM_WFDOWNLOADS_CCATEGORY_CHILDASPARENT);
}
@@ -131,7 +131,7 @@
$categoryObj->setVar('title', $_POST['title']);
$categoryObj->setVar('pid', $pid);
$categoryObj->setVar('weight', $weight);
- $categoryObj->setVar('imgurl', $imgurl);
+ $categoryObj->setVar('imgurl', $imgUrl);
$categoryObj->setVar('description', $_POST['description']);
$categoryObj->setVar('summary', $_POST['summary']);
$categoryObj->setVar('dohtml', isset($_POST['dohtml']));
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -78,7 +78,7 @@
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
- include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
+ xoops_load('XoopsFormLoader');
$form = new XoopsThemeForm(sprintf(_AM_WFDOWNLOADS_CLONE_TITLE, $wfdownloads->getModule()->getVar('name', 'E')), 'clone', $currentFile, 'post', true);
$cloneDirname_text = new XoopsFormText(_AM_WFDOWNLOADS_CLONE_NAME, 'clonedirname', 18, 18, '');
$cloneDirname_text->setDescription(_AM_WFDOWNLOADS_CLONE_NAME_DSC);
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -609,6 +609,8 @@
case 'downloads.list':
case 'downloads.filter':
default :
+ xoops_load('XoopsPageNav');
+ //
// get filter conditions
$filter_title_condition = XoopsRequest::getString('filter_title_condition', '=');
$filter_title = XoopsRequest::getString('filter_title', '');
@@ -623,22 +625,17 @@
$op = 'downloads.list';
}
}
-
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
-
- $categoryObjs = $wfdownloads->getHandler('category')->getObjects();
-
+ //
$start_published = XoopsRequest::getInt('start_published', 0);
$start_new = XoopsRequest::getInt('start_new', 0);
$start_autopublished = XoopsRequest::getInt('start_autopublished', 0);
$start_expired = XoopsRequest::getInt('start_expired', 0);
$start_offline = XoopsRequest::getInt('start_offline', 0);
-
+ //
$totalCategoriesCount = wfdownloads_categoriesCount();
- $categoryObjs = $wfdownloads->getHandler('category')->getObjects(null, true, false);
-
+ $categories = $wfdownloads->getHandler('category')->getObjects(null, true, false); // as array
$totalDownloadsCount = $wfdownloads->getHandler('download')->getCount();
-
+ //
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
@@ -691,7 +688,7 @@
foreach ($publishedDownloadObjs as $publishedDownloadObj) {
$publishedDownload_array = $publishedDownloadObj->toArray();
$publishedDownload_array['title_html'] = $myts->htmlSpecialChars(trim($publishedDownload_array['title']));
- $publishedDownload_array['category_title'] = $categoryObjs[$publishedDownload_array['cid']]['title'];
+ $publishedDownload_array['category_title'] = $categories[$publishedDownload_array['cid']]['title'];
$publishedDownload_array['submitter_uname'] = XoopsUserUtility::getUnameFromId($publishedDownload_array['submitter']);
$publishedDownload_array['published_formatted'] = XoopsLocal::formatTimestamp($publishedDownload_array['published'], 'l');
$GLOBALS['xoopsTpl']->append('published_downloads', $publishedDownload_array);
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -137,7 +137,7 @@
echo "</fieldset>\n";
//ask what to do
- include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
+ xoops_load('XoopsFormLoader');
$form = new XoopsThemeForm(_AM_WFDOWNLOADS_IMPORT_BUTTON_IMPORT, 'form', $_SERVER['REQUEST_URI']);
// Avoid module to import form itself
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/index.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/index.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/index.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -24,8 +24,8 @@
define('INDEX_FILE_PATH', XOOPS_ROOT_PATH . '/uploads/index.html');
define('BLANK_FILE_PATH', XOOPS_ROOT_PATH . '/uploads/blank.gif');
-include_once dirname(__DIR__) . '/include/directorychecker.php';
-include_once dirname(__DIR__) . '/include/filechecker.php';
+include_once dirname(__DIR__) . '/class/common/directorychecker.php';
+include_once dirname(__DIR__) . '/class/common/filechecker.php';
xoops_cp_header();
$indexAdmin = new ModuleAdmin();
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/indexpage.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/indexpage.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/indexpage.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -76,7 +76,7 @@
case "indexpage.form":
default:
include_once WFDOWNLOADS_ROOT_PATH . '/class/wfdownloads_lists.php';
- include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
+ xoops_load('XoopsFormLoader');
$sql = "SELECT indeximage, indexheading, indexheader, indexfooter, nohtml, nosmiley, noxcodes, noimages, nobreak, indexheaderalign, indexfooteralign";
$sql .= " FROM {$GLOBALS['xoopsDB']->prefix('wfdownloads_indexpage')} ";
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mimetypes.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mimetypes.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mimetypes.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -207,7 +207,7 @@
$GLOBALS['xoopsTpl']->append('mimetypes', $mimetype_array);
}
//Include page navigation
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ xoops_load('XoopsPageNav');
$pagenav = new XoopsPageNav($mimetypes_count, 20, $start, 'start');
$GLOBALS['xoopsTpl']->assign('mimetypes_pagenav', $pagenav->renderNav());
}
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mirrors.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mirrors.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mirrors.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -155,7 +155,7 @@
$GLOBALS['xoopsTpl']->append('mirrors_waiting', $mirror_waiting_array);
}
//Include page navigation
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ xoops_load('XoopsPageNav');
$pagenav_waiting = new XoopsPageNav($waiting_count, $wfdownloads->getConfig('admin_perpage'), $start_waiting, 'start_waiting');
$GLOBALS['xoopsTpl']->assign('mirrors_waiting_pagenav', $pagenav_waiting->renderNav());
}
@@ -179,7 +179,7 @@
$GLOBALS['xoopsTpl']->append('mirrors_published', $mirror_published_array);
}
//Include page navigation
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ xoops_load('XoopsPageNav');
$pagenav_published = new XoopsPageNav($published_count, $wfdownloads->getConfig('admin_perpage'), $start_published, 'start_published');
$GLOBALS['xoopsTpl']->assign('mirrors_published_pagenav', $pagenav_published->renderNav());
}
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/ratings.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/ratings.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/ratings.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -74,7 +74,7 @@
}
}
//Include page navigation
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ xoops_load('XoopsPageNav');
$ratings_pagenav = new XoopsPageNav($ratings_count, $wfdownloads->getConfig('admin_perpage'), $start, 'start');
$GLOBALS['xoopsTpl']->assign('ratings_pagenav', $ratings_pagenav->renderNav());
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -401,7 +401,7 @@
$GLOBALS['xoopsTpl']->append('reports', $report_array);
}
//Include page navigation
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ xoops_load('XoopsPageNav');
$pagenav_report = new XoopsPageNav($reports_count, $wfdownloads->getConfig('admin_perpage'), $start_report, 'start_report');
$GLOBALS['xoopsTpl']->assign('reports_pagenav', $pagenav_report->renderNav());
}
@@ -428,7 +428,7 @@
$GLOBALS['xoopsTpl']->append('modifications', $modification_array);
}
//Include page navigation
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ xoops_load('XoopsPageNav');
$pagenav_modification = new XoopsPageNav(
$modifications_count, $wfdownloads->getConfig(
'admin_perpage'
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reviews.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reviews.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reviews.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -161,7 +161,7 @@
$GLOBALS['xoopsTpl']->append('reviews_waiting', $review_waiting_array);
}
//Include page navigation
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ xoops_load('XoopsPageNav');
$pagenav_waiting = new XoopsPageNav($waiting_count, $wfdownloads->getConfig('admin_perpage'), $start_waiting, 'start_waiting');
$GLOBALS['xoopsTpl']->assign('reviews_waiting_pagenav', $pagenav_waiting->renderNav());
}
@@ -191,7 +191,7 @@
$GLOBALS['xoopsTpl']->append('reviews_published', $review_published_array);
}
//Include page navigation
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ xoops_load('XoopsPageNav');
$pagenav_published = new XoopsPageNav($published_count, $wfdownloads->getConfig('admin_perpage'), $start_published, 'start_published');
$GLOBALS['xoopsTpl']->assign('reviews_published_pagenav', $pagenav_published->renderNav());
}
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/swishe.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/swishe.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/swishe.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -48,7 +48,7 @@
echo "OK";
} else {
echo "NOT OK" . "<br />";
- include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
+ xoops_load('XoopsFormLoader');
$form = new XoopsThemeForm(_AM_WFDOWNLOADS_SWISHE_CONFIG, 'config', $currentFile, 'post', true);
$form->addElement(new XoopsFormHidden('op', 'submit'));
$form->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit'));
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -48,7 +48,7 @@
}
// Breadcrumb
-include_once XOOPS_ROOT_PATH . '/class/tree.php';
+xoops_load('XoopsObjectTree');
$categoryObjsTree = new XoopsObjectTree($wfdownloads->getHandler('category')->getObjects(), 'cid', 'pid');
$breadcrumb = new WfdownloadsBreadcrumb();
$breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
@@ -139,7 +139,7 @@
$xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
// Generate form
- include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
+ xoops_load('XoopsFormLoader');
$sform = new XoopsThemeForm(_MD_WFDOWNLOADS_RATETHISFILE, 'reportform', xoops_getenv('PHP_SELF'));
$sform->addElement(new XoopsFormHidden('lid', $lid));
$sform->addElement(new XoopsFormHidden('cid', $cid));
Deleted: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/breadcrumb.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/breadcrumb.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/breadcrumb.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -1,79 +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.
- */
-/**
- * WfdownloadsBreadcrumb Class
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license http://www.fsf.org/copyleft/gpl.html GNU public license
- * @author lucio <luc...@gm...>
- * @package Wfdownloads
- * @since 3.23
- * @version $Id:$
- *
- * Example:
- * $breadcrumb = new WfdownloadsBreadcrumb();
- * $breadcrumb->addLink( 'bread 1', 'index1.php' );
- * $breadcrumb->addLink( 'bread 2', '' );
- * $breadcrumb->addLink( 'bread 3', 'index3.php' );
- * echo $breadcrumb->render();
- */
-defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined');
-
-/**
- * Class WfdownloadsBreadcrumb
- */
-class WfdownloadsBreadcrumb
-{
- var $dirname;
- var $_bread = array();
-
- /**
- *
- */
- function __construct()
- {
- $this->dirname = basename(dirname(__DIR__));
- }
-
- /**
- * Add link to breadcrumb
- *
- * @param string $title
- * @param string $link
- */
- function addLink( $title='', $link='' )
- {
- $this->_bread[] = array(
- 'link' => $link,
- 'title' => $title
- );
- }
-
- /**
- * Render Wfdownloads BreadCrumb
- *
- */
- function render()
- {
- if (!isset($GLOBALS['xoTheme']) || !is_object($GLOBALS['xoTheme'])) {
- include_once $GLOBALS['xoops']->path('/class/theme.php');
- $GLOBALS['xoTheme'] = new xos_opal_Theme();
- }
-
- require_once $GLOBALS['xoops']->path('class/template.php');
- $breadcrumbTpl = new XoopsTpl();
- $breadcrumbTpl->assign('breadcrumb', $this->_bread);
- $html = $breadcrumbTpl->fetch("db:{$this->dirname}_co_breadcrumb.tpl");
- unset($breadcrumbTpl);
-
- return $html;
- }
-}
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php 2015-02-03 22:11:05 UTC (rev 12963)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -85,7 +85,7 @@
}
$title = $this->isNew() ? _AM_WFDOWNLOADS_CCATEGORY_CREATENEW : _AM_WFDOWNLOADS_CCATEGORY_MODIFY;
- include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
+ xoops_load('XoopsFormLoader');
include_once WFDOWNLOADS_ROOT_PATH . '/class/wfdownloads_lists.php';
$form = new XoopsThemeForm($title, 'form_error', $action, 'post', true);
@@ -111,18 +111,18 @@
$groups_up_select->setDescription(_AM_WFDOWNLOADS_FCATEGORY_GROUPPROMPT_UP_DESC);
$form->addElement($groups_up_select);
// category: imgurl
- $imgurl_path = $this->getVar('imgurl') ? $this->wfdownloads->getConfig('catimage') . '/' . $this->getVar('imgurl') : WFDOWNLOADS_IMAGES_URL . '/blank.gif';
- $imgurl_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_FCATEGORY_CIMAGE, '<br />');
- $imgurl_tray->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_DOWN_FUPLOADPATH, XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('catimage')));
- $imgurl_tray->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_DOWN_FUPLOADURL, XOOPS_URL . '/' . $this->wfdownloads->getConfig('catimage')));
+ $imgUrl_path = $this->getVar('imgurl') ? $this->wfdownloads->getConfig('catimage') . '/' . $this->getVar('imgurl') : WFDOWNLOADS_IMAGES_URL . '/blank.gif';
+ $imgUrl_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_FCATEGORY_CIMAGE, '<br />');
+ $imgUrl_tray->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_DOWN_FUPLOADPATH, XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('catimage')));
+ $imgUrl_tray->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_DOWN_FUPLOADURL, XOOPS_URL . '/' . $this->wfdownloads->getConfig('catimage')));
$graph_array = WfsLists::getListTypeAsArray(XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('catimage'), 'images');
- $imgurl_select = new XoopsFormSelect('', 'imgurl', $this->getVar('imgurl'));
- $imgurl_select->addOptionArray($graph_array);
- $imgurl_select->setExtra("onchange='showImgSelected(\"image\", \"imgurl\", \"" . $this->wfdownloads->getConfig('catimage') . "\", \"\", \"" . XOOPS_URL . "\")'");
- $imgurl_tray->addElement($imgurl_select, false);
- $imgurl_tray->addElement(new XoopsFormLabel( '', "<img src='" . XOOPS_URL . "/" . $imgurl_path . "' name='image' id='image' alt='' />"));
- $imgurl_tray->addElement(new XoopsFormFile(_AM_WFDOWNLOADS_BUPLOAD , 'uploadfile', 0), false);
- $form->addElement($imgurl_tray);
+ $imgUrl_select = new XoopsFormSelect('', 'imgurl', $this->getVar('imgurl'));
+ $imgUrl_select->addOptionArray($graph_array);
+ $imgUrl_select->setExtra("onchange='showImgSelected(\"image\", \"imgurl\", \"" . $this->wfdownloads->getConfig('catimage') . "\", \"\", \"" . XOOPS_URL . "\")'");
+ $imgUrl_tray->addElement($imgUrl_select, false);
+ $imgUrl_tray->addElement(new XoopsFormLabel( '', "<img src='" . XOOPS_URL . "/" . $imgUrl_path . "' name='image' id='image' alt='' />"));
+ $imgUrl_tray->addElement(new XoopsFormFile(_AM_WFDOWNLOADS_BUPLOAD , 'uploadfile', 0), false);
+ $form->addElement($imgUrl_tray);
// category: description
$description_textarea = new XoopsFormDhtmlTextArea(_AM_WFDOWNLOADS_FCATEGORY_DESCRIPTION, 'description', $this->getVar('description', 'e'), 15, 60);
$description_textarea->setDescription(_AM_WFDOWNLOADS_FCATEGORY_DESCRIPTION_DESC);
@@ -227,7 +227,7 @@
*/
function getNicePath($cid, $root_filename = 'index.php', $item_filename = 'viewcat.php?op=')
{
- include_once WFDOWNLOADS_ROOT_PATH . '/class/xoopstree.php';
+ //include_once WFDOWNLOADS_ROOT_PATH . '/class/common/xoopstree.php';
$mytree = new WfdownloadsXoopsTree($this->table, $this->keyName, 'pid');
$pathString = $mytree->getNicePathFromId($cid, $this->identifierName, $item_filename);
@@ -299,10 +299,10 @@
*/
function getChildCats($category)
{
+ xoops_load('XoopsObjectTree');
+ //
$categoryObjs = $this->getObjects();
- include_once XOOPS_ROOT_PATH . '/class/tree.php';
$categoryObjsTree = new XoopsObjectTree($categoryObjs, $this->keyName, 'pid');
-
return $categoryObjsTree->getAllChild($category->getVar($this->keyName));
}
@@ -311,11 +311,12 @@
*/
function getAllSubcatsTopParentCid()
{
+ xoops_load('XoopsObjectTree');
+ //
if (!$this->allCategories) {
$this->allCategories = $this->getObjects(null, true);
}
- include_once XOOPS_ROOT_PATH . '/class/tree.php';
$categoryObjsTree = new XoopsObjectTree($this->allCategories, $this->keyName, 'pid');
$allsubcats_linked_totop = array();
Added: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.php (rev 0)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.php 2015-02-03 22:20:34 UTC (rev 12964)
@@ -0,0 +1,86 @@
+<?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.
+ */
+/**
+ * WfdownloadsBreadcrumb Class
+ *
+ * @co...
[truncated message content] |
|
From: <luc...@us...> - 2015-02-13 22:47:44
|
Revision: 12976
http://sourceforge.net/p/xoops/svn/12976
Author: luciorota
Date: 2015-02-13 22:47:42 +0000 (Fri, 13 Feb 2015)
Log Message:
-----------
added: sort downloads by weight
Modified Paths:
--------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/modification.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/common.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/functions.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/main.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/sql/mysql.sql
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/admin/wfdownloads_am_categorieslist.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/admin/wfdownloads_am_downloadslist.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_viewcat.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/viewcat.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2015-02-13 22:47:42 UTC (rev 12976)
@@ -346,6 +346,7 @@
$downloadObj->setVar('version', $version);
$downloadObj->setVar('url', $url);
$downloadObj->setVar('cid', $cid);
+ $downloadObj->setVar('weight', $_POST['weight']);
$downloadObj->setVar('title', $title);
$downloadObj->setVar('status', $status);
$downloadObj->setVar('size', $size);
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php 2015-02-13 22:47:42 UTC (rev 12976)
@@ -115,6 +115,7 @@
switch ($key) {
case 'title':
case 'url':
+ case 'weight':
// NOP
break;
case 'size':
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php 2015-02-13 22:47:42 UTC (rev 12976)
@@ -95,6 +95,7 @@
$this->initVar('doxcode', XOBJ_DTYPE_INT, true); // boolean
$this->initVar('doimage', XOBJ_DTYPE_INT, true); // boolean
$this->initVar('dobr', XOBJ_DTYPE_INT, true); // boolean
+ $this->initVar('weight', XOBJ_DTYPE_INT, 0);
if (isset($id)) {
$item = $this->wfdownloads->getHandler('item')->get($id);
@@ -133,6 +134,8 @@
{
xoops_load('XoopsUserUtility');
+ $download = $this->toArray(); // as array
+
$download['id'] = $this->getVar('lid');
$download['cid'] = $this->getVar('cid');
@@ -456,14 +459,14 @@
$userfile_file = new XoopsFormFile(_MD_WFDOWNLOADS_UPLOAD_FILEC, 'userfile', 0);
// get max file size (setup and php.ini)
$phpiniMaxFileSize = (min((int)(ini_get('upload_max_filesize')), (int)(ini_get('post_max_size')), (int)(ini_get('memory_limit')))) * 1024 * 1024; // bytes
- $maxFileSize = wfdownloads_bytesToSize1024(min($this->wfdownloads->getConfig('maxfilesize'), $phpiniMaxFileSize));
+ $maxFileSize = wfdownloads_bytesToSize1024(min($this->wfdownloads->getConfig('maxfilesize'), $phpiniMaxFileSize));
// get allowed mimetypes
if (wfdownloads_userIsAdmin()) {
- $criteria = new Criteria('mime_admin', true);
+ $mimetypeCriteria = new Criteria('mime_admin', true);
} else {
- $criteria = new Criteria('mime_user', true);
+ $mimetypeCriteria = new Criteria('mime_user', true);
}
- $mimetypes = $this->wfdownloads->getHandler('mimetype')->getList($criteria);
+ $mimetypes = $this->wfdownloads->getHandler('mimetype')->getList($mimetypeCriteria);
$allowedExtensions = implode(' | ', $mimetypes);
$userfile_file->setDescription(
sprintf(
@@ -490,6 +493,8 @@
$categoryObjsTree = new XoopsObjectTree($categoryObjs, 'cid', 'pid');
$sform->addElement(new XoopsFormLabel(_MD_WFDOWNLOADS_CATEGORYC, $categoryObjsTree->makeSelBox('cid', 'title', '-', $this->getVar('cid', 'e'))));
}
+ // download: weight
+ $sform->addElement(new XoopsFormText(_MD_WFDOWNLOADS_WEIGHT, 'weight', 50, 255, $this->getVar('weight', 'e')), false);
if (count($customArray) == 0) {
// download: homepagetitle
@@ -641,7 +646,6 @@
$sform->addElement(new XoopsFormFile(_MD_WFDOWNLOADS_DUPLOADSCRSHOT, 'screenshot4', 0), false); // IN PROGRESS
}
}
-
// download: notifypub
$option_tray = new XoopsFormElementTray(_MD_WFDOWNLOADS_OPTIONS, '<br />');
$notify_checkbox = new XoopsFormCheckBox('', 'notifypub');
@@ -707,11 +711,7 @@
// download: submitter
if (!$this->isNew()) {
$userCount = $member_handler->getUserCount();
-// IN PROGRESS
-// IN PROGRESS
-// IN PROGRESS
if ($userCount > 200) {
- //$sform -> addElement(new XoopsFormText(_AM_WFDOWNLOADS_FILE_SUBMITTERID, 'submitter', 10, 10, $this->getVar('submitter', 'e')), true);
$submitter_select = new XoopsFormSelectUser (
_AM_WFDOWNLOADS_FILE_SUBMITTER, 'submitter', false, $this->getVar(
'submitter',
@@ -742,10 +742,10 @@
$userfile_file = new XoopsFormFile(_MD_WFDOWNLOADS_UPLOAD_FILEC, 'userfile', 0);
// get max file size (setup and php.ini)
$phpiniMaxFileSize = min((int)(ini_get('upload_max_filesize')), (int)(ini_get('post_max_size')), (int)(ini_get('memory_limit'))) * 1024 * 1024; // bytes
- $maxFileSize = wfdownloads_bytesToSize1024(min($this->wfdownloads->getConfig('maxfilesize'), $phpiniMaxFileSize));
+ $maxFileSize = wfdownloads_bytesToSize1024(min($this->wfdownloads->getConfig('maxfilesize'), $phpiniMaxFileSize));
// get allowed mimetypes
- $criteria = new Criteria('mime_admin', true);
- $mimetypes = $this->wfdownloads->getHandler('mimetype')->getList($criteria);
+ $mimetypeCriteria = new Criteria('mime_admin', true);
+ $mimetypes = $this->wfdownloads->getHandler('mimetype')->getList($mimetypeCriteria);
$allowedExtensions = implode(' | ', $mimetypes);
$userfile_file->setDescription(
sprintf(
@@ -759,11 +759,13 @@
);
$sform->addElement($userfile_file, false);
// download: cid
- $categoryObjs = $this->wfdownloads->getHandler('category')->getObjects();
+ $categoryObjs = $this->wfdownloads->getHandler('category')->getObjects();
$categoryObjsTree = new XoopsObjectTree($categoryObjs, 'cid', 'pid');
$sform->addElement(
new XoopsFormLabel(_AM_WFDOWNLOADS_FILE_CATEGORY, $categoryObjsTree->makeSelBox('cid', 'title', '-', $this->getVar('cid', 'e')))
);
+ // download: weight
+ $sform->addElement(new XoopsFormText(_MD_WFDOWNLOADS_WEIGHT, 'weight', 50, 255, $this->getVar('weight', 'e')), false);
// Formulize module support (2006/03/06, 2006/03/08) jpc - start
if (count($customArray) == 0) {
// download: homepagetitle
@@ -1222,17 +1224,17 @@
*
* @return array
*/
- public function getActiveDownloads($crit = null)
+ public function getActiveDownloads($criteria = null)
{
- if (is_object($crit)) {
- $criteria = $crit;
+ if (is_object($criteria)) {
+ $downloadsCriteria = $criteria;
} else {
- $criteria = new CriteriaCompo();
+ $downloadsCriteria = new CriteriaCompo();
}
- $active_crit = $this->getActiveCriteria();
- $criteria->add($active_crit);
+ $activeDownloadsCriteria = $this->getActiveCriteria();
+ $downloadsCriteria->add($activeDownloadsCriteria);
- return $this->getObjects($criteria);
+ return $this->getObjects($downloadsCriteria);
}
/**
@@ -1242,14 +1244,14 @@
*
* @return array/int
*/
- public function getActiveCount($crit = null)
+ public function getActiveCount($criteria = null)
{
- $criteria = $this->getActiveCriteria();
- if (is_object($crit)) {
- $criteria->add($crit);
+ $activeDownloadsCriteria = $this->getActiveCriteria();
+ if (is_object($criteria)) {
+ $activeDownloadsCriteria->add($criteria);
}
- return $this->getCount($criteria);
+ return $this->getCount($activeDownloadsCriteria);
}
/**
@@ -1272,24 +1274,24 @@
*
* @return bool
*/
- public function delete($download, $force = false)
+ public function delete($downloadsObj, $force = false)
{
- if (parent::delete($download, $force)) {
- $criteria = new Criteria('lid', (int)$download->getVar('lid'));
- $this->wfdownloads->getHandler('rating')->deleteAll($criteria);
- $this->wfdownloads->getHandler('mirror')->deleteAll($criteria);
- $this->wfdownloads->getHandler('review')->deleteAll($criteria);
- $this->wfdownloads->getHandler('report')->deleteAll($criteria);
+ if (parent::delete($downloadsObj, $force)) {
+ $downloadsCriteria = new Criteria('lid', (int)$download->getVar('lid'));
+ $this->wfdownloads->getHandler('rating')->deleteAll($downloadsCriteria);
+ $this->wfdownloads->getHandler('mirror')->deleteAll($downloadsCriteria);
+ $this->wfdownloads->getHandler('review')->deleteAll($downloadsCriteria);
+ $this->wfdownloads->getHandler('report')->deleteAll($downloadsCriteria);
// delete comments
- xoops_comment_delete((int)$this->wfdownloads->getModule()->mid(), (int)$download->getVar('lid'));
+ xoops_comment_delete((int)$this->wfdownloads->getModule()->mid(), (int)$downloadsObj->getVar('lid'));
// Formulize module support (2006/05/04) jpc - start
if (wfdownloads_checkModule('formulize')) {
- if (file_exists(XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php') && $download->getVar('formulize_idreq') > 0) {
+ if (file_exists(XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php') && $downloadsObj->getVar('formulize_idreq') > 0) {
include_once XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php';
//deleteFormEntries(array($download->getVar('formulize_idreq')));
- $category = $this->wfdownloads->getHandler('category')->get($download->getVar('cid'));
- deleteFormEntries(array($download->getVar('formulize_idreq')), $category->getVar('formulize_fid'));
+ $categoryObj = $this->wfdownloads->getHandler('category')->get($downloadsObj->getVar('cid'));
+ deleteFormEntries(array($downloadsObj->getVar('formulize_idreq')), $categoryObj->getVar('formulize_fid'));
}
}
// Formulize module support (2006/05/04) jpc - end
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/modification.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/modification.php 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/modification.php 2015-02-13 22:47:42 UTC (rev 12976)
@@ -87,6 +87,7 @@
$this->initVar('doxcode', XOBJ_DTYPE_INT, true); // boolean
$this->initVar('doimage', XOBJ_DTYPE_INT, true); // boolean
$this->initVar('dobr', XOBJ_DTYPE_INT, true); // boolean
+ $this->initVar('weight', XOBJ_DTYPE_INT, 0);
//Obsolete
unset($this->vars['ipaddress']);
@@ -163,7 +164,8 @@
d.dosmiley = m.dosmiley,
d.doxcode = m.doxcode,
d.doimage = m.doimage,
- d.dobr = m.dobr";
+ d.dobr = m.dobr,
+ d.weight = m.weight";
$sql .= " WHERE d.lid = m.lid AND m.requestid='{$requestid}'";
if ($this->db->query($sql)) {
return $this->deleteAll(new Criteria('requestid', (int)$requestid));
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/changelog.txt 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/changelog.txt 2015-02-13 22:47:42 UTC (rev 12976)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 RC5 (2015-02-02)</u></b>
+<b><u>=> Version 3.23 RC5 (2015-02-13)</u></b>
- fixed: use DateTime object instead of strtotime function (luciorota)
- fixed: source code for HTML5/CSS3 (mamba)
- fixed: jQuery bug in templates (luciorota)
@@ -14,6 +14,7 @@
- fixed: deprecated XoopsTree (mamba)
- fixed: English translations (mamba)
- fixed: small changes based on testing tool feedback (mamba)
+- added: sort downloads by weight (luciorota)
- added: directories check (luciorota)
- added: no size limit for uploads by Admin (mamba)
- added: preview for images, audio, video, pdf files (luciorota)
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/common.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/common.php 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/common.php 2015-02-13 22:47:42 UTC (rev 12976)
@@ -30,11 +30,13 @@
xoops_loadLanguage('common', WFDOWNLOADS_DIRNAME);
xoops_load('XoopsFormLoader');
-//include_once XOOPS_ROOT_PATH . '/class/tree.php';
xoops_load('XoopsObjectTree');
xoops_load('XoopsPageNav');
+xoops_load('XoopsUserUtility');
+xoops_load('XoopsLocal');
+xoops_load('XoopsRequest');
-include_once WFDOWNLOADS_ROOT_PATH . '/class/wfdownloads.php'; // WfdownloadsWfdownloads class
+xoops_load('Wfdownloads', WFDOWNLOADS_DIRNAME); // WfdownloadsWfdownloads class
include_once WFDOWNLOADS_ROOT_PATH . '/include/functions.php';
include_once WFDOWNLOADS_ROOT_PATH . '/include/constants.php';
include_once WFDOWNLOADS_ROOT_PATH . '/class/common/session.php'; // WfdownloadsSession class
@@ -44,9 +46,6 @@
include_once WFDOWNLOADS_ROOT_PATH . '/class/common/xoopstree.php'; // WfdownloadsXoopsTree class
include_once WFDOWNLOADS_ROOT_PATH . '/class/multicolumnsthemeform.php'; // WfdownloadsMulticolumnsThemeForm class
-xoops_load('XoopsUserUtility');
-xoops_load('XoopsLocal');
-xoops_load('XoopsRequest');
// MyTextSanitizer object
$myts = MyTextSanitizer::getInstance();
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/functions.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/functions.php 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/functions.php 2015-02-13 22:47:42 UTC (rev 12976)
@@ -781,139 +781,146 @@
return $icons;
}
-if (!function_exists('convertorderbyin')) {
- // Reusable Link Sorting Functions
- /**
- * convertorderbyin()
- *
- * @param $orderby
- *
- * @return string
- */
- function convertorderbyin($orderby)
- {
- switch (trim($orderby)) {
- case 'titleA':
- $orderby = 'title ASC';
- break;
- case 'titleD':
- $orderby = 'title DESC';
- break;
- case 'dateA':
- $orderby = 'published ASC';
- break;
- case 'dateD':
- $orderby = 'published DESC';
- break;
- case 'hitsA':
- $orderby = 'hits ASC';
- break;
- case 'hitsD':
- $orderby = 'hits DESC';
- break;
- case 'ratingA':
- $orderby = 'rating ASC';
- break;
- case 'ratingD':
- $orderby = 'rating DESC';
- break;
- case 'sizeD':
- $orderby = 'size DESC';
- break;
- case 'sizeA':
- $orderby = 'size ASC';
- break;
- default:
- $orderby = 'published DESC';
- break;
- }
+/**
+ * wfdownloads_convertorderbyin()
+ *
+ * @param $orderby
+ *
+ * @return string
+ */
+function wfdownloads_convertorderbyin($orderby)
+{
+ switch (trim($orderby)) {
+ case 'titleA':
+ $orderby = 'title ASC';
+ break;
+ case 'titleD':
+ $orderby = 'title DESC';
+ break;
+ case 'dateA':
+ $orderby = 'published ASC';
+ break;
+ case 'dateD':
+ $orderby = 'published DESC';
+ break;
+ case 'hitsA':
+ $orderby = 'hits ASC';
+ break;
+ case 'hitsD':
+ $orderby = 'hits DESC';
+ break;
+ case 'ratingA':
+ $orderby = 'rating ASC';
+ break;
+ case 'ratingD':
+ $orderby = 'rating DESC';
+ break;
+ case 'sizeD':
+ $orderby = 'size DESC';
+ break;
+ case 'sizeA':
+ $orderby = 'size ASC';
+ break;
+ case 'weightD':
+ $orderby = 'weight DESC';
+ break;
+ case 'weightA':
+ $orderby = 'weight ASC';
+ break;
+ default:
+ $orderby = 'published DESC';
+ break;
+ }
- return $orderby;
- }
+ return $orderby;
}
-if (!function_exists('convertorderbytrans')) {
- /**
- * @param $orderby
- *
- * @return string
- */
- function convertorderbytrans($orderby)
- {
- if ($orderby == 'title ASC') {
- $orderbyTrans = _MD_WFDOWNLOADS_TITLEATOZ;
- }
- if ($orderby == 'title DESC') {
- $orderbyTrans = _MD_WFDOWNLOADS_TITLEZTOA;
- }
- if ($orderby == 'published ASC') {
- $orderbyTrans = _MD_WFDOWNLOADS_DATEOLD;
- }
- if ($orderby == 'published DESC') {
- $orderbyTrans = _MD_WFDOWNLOADS_DATENEW;
- }
- if ($orderby == 'hits ASC') {
- $orderbyTrans = _MD_WFDOWNLOADS_POPULARITYLTOM;
- }
- if ($orderby == 'hits DESC') {
- $orderbyTrans = _MD_WFDOWNLOADS_POPULARITYMTOL;
- }
- if ($orderby == 'rating ASC') {
- $orderbyTrans = _MD_WFDOWNLOADS_RATINGLTOH;
- }
- if ($orderby == 'rating DESC') {
- $orderbyTrans = _MD_WFDOWNLOADS_RATINGHTOL;
- }
- if ($orderby == 'size ASC') {
- $orderbyTrans = _MD_WFDOWNLOADS_SIZELTOH;
- }
- if ($orderby == 'size DESC') {
- $orderbyTrans = _MD_WFDOWNLOADS_SIZEHTOL;
- }
- return $orderbyTrans;
+/**
+ * @param $orderby
+ *
+ * @return string
+ */
+function wfdownloads_convertorderbytrans($orderby)
+{
+ if ($orderby == 'title ASC') {
+ $orderbyTrans = _MD_WFDOWNLOADS_TITLEATOZ;
}
+ if ($orderby == 'title DESC') {
+ $orderbyTrans = _MD_WFDOWNLOADS_TITLEZTOA;
+ }
+ if ($orderby == 'published ASC') {
+ $orderbyTrans = _MD_WFDOWNLOADS_DATEOLD;
+ }
+ if ($orderby == 'published DESC') {
+ $orderbyTrans = _MD_WFDOWNLOADS_DATENEW;
+ }
+ if ($orderby == 'hits ASC') {
+ $orderbyTrans = _MD_WFDOWNLOADS_POPULARITYLTOM;
+ }
+ if ($orderby == 'hits DESC') {
+ $orderbyTrans = _MD_WFDOWNLOADS_POPULARITYMTOL;
+ }
+ if ($orderby == 'rating ASC') {
+ $orderbyTrans = _MD_WFDOWNLOADS_RATINGLTOH;
+ }
+ if ($orderby == 'rating DESC') {
+ $orderbyTrans = _MD_WFDOWNLOADS_RATINGHTOL;
+ }
+ if ($orderby == 'size ASC') {
+ $orderbyTrans = _MD_WFDOWNLOADS_SIZELTOH;
+ }
+ if ($orderby == 'size DESC') {
+ $orderbyTrans = _MD_WFDOWNLOADS_SIZEHTOL;
+ }
+ if ($orderby == 'weight ASC') {
+ $orderbyTrans = _MD_WFDOWNLOADS_WEIGHTLTOH;
+ }
+ if ($orderby == 'weight DESC') {
+ $orderbyTrans = _MD_WFDOWNLOADS_WEIGHTHTOL;
+ }
+
+ return $orderbyTrans;
}
-if (!function_exists('convertorderbyout')) {
- /**
- * @param $orderby
- *
- * @return string
- */
- function convertorderbyout($orderby)
- {
- if ($orderby == 'title ASC') {
- $orderby = 'titleA';
- }
- if ($orderby == 'title DESC') {
- $orderby = 'titleD';
- }
- if ($orderby == 'published ASC') {
- $orderby = 'dateA';
- }
- if ($orderby == 'published DESC') {
- $orderby = 'dateD';
- }
- if ($orderby == 'hits ASC') {
- $orderby = 'hitsA';
- }
- if ($orderby == 'hits DESC') {
- $orderby = 'hitsD';
- }
- if ($orderby == 'rating ASC') {
- $orderby = 'ratingA';
- }
- if ($orderby == 'rating DESC') {
- $orderby = 'ratingD';
- }
- if ($orderby == 'size ASC') {
- $orderby = 'sizeA';
- }
- if ($orderby == 'size DESC') {
- $orderby = 'sizeD';
- }
- return $orderby;
+function wfdownloads_convertorderbyout($orderby)
+{
+ if ($orderby == 'title ASC') {
+ $orderby = 'titleA';
}
+ if ($orderby == 'title DESC') {
+ $orderby = 'titleD';
+ }
+ if ($orderby == 'published ASC') {
+ $orderby = 'dateA';
+ }
+ if ($orderby == 'published DESC') {
+ $orderby = 'dateD';
+ }
+ if ($orderby == 'hits ASC') {
+ $orderby = 'hitsA';
+ }
+ if ($orderby == 'hits DESC') {
+ $orderby = 'hitsD';
+ }
+ if ($orderby == 'rating ASC') {
+ $orderby = 'ratingA';
+ }
+ if ($orderby == 'rating DESC') {
+ $orderby = 'ratingD';
+ }
+ if ($orderby == 'size ASC') {
+ $orderby = 'sizeA';
+ }
+ if ($orderby == 'size DESC') {
+ $orderby = 'sizeD';
+ }
+ if ($orderby == 'weight ASC') {
+ $orderby = 'weightA';
+ }
+ if ($orderby == 'weight DESC') {
+ $orderby = 'weightD';
+ }
+ return $orderby;
}
/**
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php 2015-02-13 22:47:42 UTC (rev 12976)
@@ -113,7 +113,8 @@
"dosmiley" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true),
"doxcode" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true),
"doimage" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true),
- "dobr" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true)
+ "dobr" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true),
+ "weight" => array("Type" => "int(11) NOT NULL default '0'", "Default" => true)
);
//$renamed_fields = array(
// "old_name" => "new_name"
@@ -197,7 +198,8 @@
"dosmiley" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true),
"doxcode" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true),
"doimage" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true),
- "dobr" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true)
+ "dobr" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true),
+ "weight" => array("Type" => "int(11) NOT NULL default '0'", "Default" => true)
);
//$renamed_fields = array(
// "old_name" => "new_name"
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/main.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/main.php 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/main.php 2015-02-13 22:47:42 UTC (rev 12976)
@@ -372,3 +372,8 @@
define('_MD_WFDOWNLOADS_ERROR_CATIMAGEDIRNOTEXISTS', "Warning: contact the administrator, the upload directory does not exist");
define('_MD_WFDOWNLOADS_FFS_SUBMIT1ST_STEP', "1st step: choose category");
+
+// class/download.php
+define('_MD_WFDOWNLOADS_WEIGHT', "Weight");
+define('_MD_WFDOWNLOADS_WEIGHTLTOH', "Weight (lowest to highest value)");
+define('_MD_WFDOWNLOADS_WEIGHTHTOL', "Weight (highest to lowest value)");
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/sql/mysql.sql
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/sql/mysql.sql 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/sql/mysql.sql 2015-02-13 22:47:42 UTC (rev 12976)
@@ -107,6 +107,7 @@
doxcode tinyint(1) NOT NULL default '1',
doimage tinyint(1) NOT NULL default '1',
dobr tinyint(1) NOT NULL default '1',
+ weight int(11) NOT NULL default '0',
PRIMARY KEY (lid),
KEY cid (cid),
KEY status (status),
@@ -350,6 +351,7 @@
doxcode tinyint(1) NOT NULL default '1',
doimage tinyint(1) NOT NULL default '1',
dobr tinyint(1) NOT NULL default '1',
+ weight int(11) NOT NULL default '0',
PRIMARY KEY (requestid)
) ENGINE=MyISAM;
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php 2015-02-13 22:47:42 UTC (rev 12976)
@@ -381,6 +381,7 @@
$downloadObj->setVar('title', $title);
$downloadObj->setVar('url', $url);
$downloadObj->setVar('cid', (int)$cid);
+ $downloadObj->setVar('weight', (int)$weight);
$downloadObj->setVar('filename', $filename);
$downloadObj->setVar('filetype', $filetype);
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/admin/wfdownloads_am_categorieslist.tpl
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/admin/wfdownloads_am_categorieslist.tpl 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/admin/wfdownloads_am_categorieslist.tpl 2015-02-13 22:47:42 UTC (rev 12976)
@@ -17,7 +17,6 @@
<a href='../viewcat.php?cid=<{$sorted_category.category.cid}>'><{$sorted_category.category.title}></a>
</td>
<td>
- <label for="new_weights[<{$sorted_category.category.cid}>]">Category:</label>
<input type="text" name="new_weights[<{$sorted_category.category.cid}>]" id="new_weights[<{$sorted_category.category.cid}>]" size="11" maxlength="11"
value="<{$sorted_category.category.weight}>"/>
</td>
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/admin/wfdownloads_am_downloadslist.tpl
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/admin/wfdownloads_am_downloadslist.tpl 2015-02-11 21:44:09 UTC (rev 12975)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/admin/wfdownloads_am_downloadslist.tpl 2015-02-13 22:47:42 UTC (rev 12976)
@@ -10,6 +10,7 @@
<th><{$smarty.const._AM_WFDOWNLOADS_MINDEX_ID}></th>
<th><{$smarty.const._AM_WFDOWNLOADS_MINDEX_TITLE}></th>
<th><{$smarty.const._AM_WFDOWNLOADS_FCATEGORY_TITLE}></th>
+ <th><{$smarty.const._MD_WFDOWNLOADS_WEIGHT}></th>
<th><{$smarty.const._AM_WFDOWNLOADS_MINDEX_POSTER}></th>
<th><{$smarty.const._AM_WFDOWNLOADS_MINDEX_SUBMITTED}></th>
<th><{$smarty.const._AM_WFDOWNLOADS_MINDEX_ONLINESTATUS}></th>
@@ -35,6 +36,7 @@
</select>
...
[truncated message content] |
|
From: <luc...@us...> - 2015-02-16 19:00:49
|
Revision: 12984
http://sourceforge.net/p/xoops/svn/12984
Author: luciorota
Date: 2015-02-16 19:00:46 +0000 (Mon, 16 Feb 2015)
Log Message:
-----------
code cleanup in templates/wfdownloads_singlefile.tpl
update Magnific Plugin
move Magnific Plugin from php script to template
Modified Paths:
--------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/assets/js/magnific/jquery.magnific-popup.min.js
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/assets/js/magnific/magnific-popup.css
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/common.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/main.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/newlist.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/singlefile.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/admin/wfdownloads_am_categorieslist.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_newlistindex.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_singlefile.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_viewcat.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/viewcat.php
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/assets/js/magnific/jquery.magnific-popup.min.js
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/assets/js/magnific/jquery.magnific-popup.min.js 2015-02-16 14:09:28 UTC (rev 12983)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/assets/js/magnific/jquery.magnific-popup.min.js 2015-02-16 19:00:46 UTC (rev 12984)
@@ -1,430 +1,4 @@
-/*! Magnific Popup - v0.9.9 - 2013-12-27
- * http://dimsemenov.com/plugins/magnific-popup/
- * Copyright (c) 2013 Dmitry Semenov; */
-(function (e) {
- var t, n, i, o, r, a, s, l = "Close", c = "BeforeClose", d = "AfterClose", u = "BeforeAppend", p = "MarkupParse", f = "Open", m = "Change", g = "mfp", h = "." + g, v = "mfp-ready", C = "mfp-removing", y = "mfp-prevent-close", w = function () {
- }, b = !!window.jQuery, I = e(window), x = function (e, n) {
- t.ev.on(g + e + h, n)
- }, k = function (t, n, i, o) {
- var r = document.createElement("div");
- return r.className = "mfp-" + t, i && (r.innerHTML = i), o ? n && n.appendChild(r) : (r = e(r), n && r.appendTo(n)), r
- }, T = function (n, i) {
- t.ev.triggerHandler(g + n, i), t.st.callbacks && (n = n.charAt(0).toLowerCase() + n.slice(1), t.st.callbacks[n] && t.st.callbacks[n].apply(t, e.isArray(i) ? i : [i]))
- }, E = function (n) {
- return n === s && t.currTemplate.closeBtn || (t.currTemplate.closeBtn = e(t.st.closeMarkup.replace("%title%", t.st.tClose)), s = n), t.currTemplate.closeBtn
- }, _ = function () {
- e.magnificPopup.instance || (t = new w, t.init(), e.magnificPopup.instance = t)
- }, S = function () {
- var e = document.createElement("p").style, t = ["ms", "O", "Moz", "Webkit"];
- if (void 0 !== e.transition)return!0;
- for (; t.length;)if (t.pop() + "Transition"in e)return!0;
- return!1
- };
- w.prototype = {constructor: w, init: function () {
- var n = navigator.appVersion;
- t.isIE7 = -1 !== n.indexOf("MSIE 7."), t.isIE8 = -1 !== n.indexOf("MSIE 8."), t.isLowIE = t.isIE7 || t.isIE8, t.isAndroid = /android/gi.test(n), t.isIOS = /iphone|ipad|ipod/gi.test(n), t.supportsTransition = S(), t.probablyMobile = t.isAndroid || t.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent), o = e(document), t.popupsCache = {}
- }, open : function (n) {
- i || (i = e(document.body));
- var r;
- if (n.isObj === !1) {
- t.items = n.items.toArray(), t.index = 0;
- var s, l = n.items;
- for (r = 0; l.length > r; r++)if (s = l[r], s.parsed && (s = s.el[0]), s === n.el[0]) {
- t.index = r;
- break
- }
- } else t.items = e.isArray(n.items) ? n.items : [n.items], t.index = n.index || 0;
- if (t.isOpen)return t.updateItemHTML(), void 0;
- t.types = [], a = "", t.ev = n.mainEl && n.mainEl.length ? n.mainEl.eq(0) : o, n.key ? (t.popupsCache[n.key] || (t.popupsCache[n.key] = {}), t.currTemplate = t.popupsCache[n.key]) : t.currTemplate = {}, t.st = e.extend(!0, {}, e.magnificPopup.defaults, n), t.fixedContentPos = "auto" === t.st.fixedContentPos ? !t.probablyMobile : t.st.fixedContentPos, t.st.modal && (t.st.closeOnContentClick = !1, t.st.closeOnBgClick = !1, t.st.showCloseBtn = !1, t.st.enableEscapeKey = !1), t.bgOverlay || (t.bgOverlay = k("bg").on("click" + h, function () {
- t.close()
- }), t.wrap = k("wrap").attr("tabindex", -1).on("click" + h, function (e) {
- t._checkIfClose(e.target) && t.close()
- }), t.container = k("container", t.wrap)), t.contentContainer = k("content"), t.st.preloader && (t.preloader = k("preloader", t.container, t.st.tLoading));
- var c = e.magnificPopup.modules;
- for (r = 0; c.length > r; r++) {
- var d = c[r];
- d = d.charAt(0).toUpperCase() + d.slice(1), t["init" + d].call(t)
- }
- T("BeforeOpen"), t.st.showCloseBtn && (t.st.closeBtnInside ? (x(p, function (e, t, n, i) {
- n.close_replaceWith = E(i.type)
- }), a += " mfp-close-btn-in") : t.wrap.append(E())), t.st.alignTop && (a += " mfp-align-top"), t.fixedContentPos ? t.wrap.css({overflow: t.st.overflowY, overflowX: "hidden", overflowY: t.st.overflowY}) : t.wrap.css({top: I.scrollTop(), position: "absolute"}), (t.st.fixedBgPos === !1 || "auto" === t.st.fixedBgPos && !t.fixedContentPos) && t.bgOverlay.css({height: o.height(), position: "absolute"}), t.st.enableEscapeKey && o.on("keyup" + h, function (e) {
- 27 === e.keyCode && t.close()
- }), I.on("resize" + h, function () {
- t.updateSize()
- }), t.st.closeOnContentClick || (a += " mfp-auto-cursor"), a && t.wrap.addClass(a);
- var u = t.wH = I.height(), m = {};
- if (t.fixedContentPos && t._hasScrollBar(u)) {
- var g = t._getScrollbarSize();
- g && (m.marginRight = g)
- }
- t.fixedContentPos && (t.isIE7 ? e("body, html").css("overflow", "hidden") : m.overflow = "hidden");
- var C = t.st.mainClass;
- return t.isIE7 && (C += " mfp-ie7"), C && t._addClassToMFP(C), t.updateItemHTML(), T("BuildControls"), e("html").css(m), t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo || i), t._lastFocusedEl = document.activeElement, setTimeout(function () {
- t.content ? (t._addClassToMFP(v), t._setFocus()) : t.bgOverlay.addClass(v), o.on("focusin" + h, t._onFocusIn)
- }, 16), t.isOpen = !0, t.updateSize(u), T(f), n
- }, close : function () {
- t.isOpen && (T(c), t.isOpen = !1, t.st.removalDelay && !t.isLowIE && t.supportsTransition ? (t._addClassToMFP(C), setTimeout(function () {
- t._close()
- }, t.st.removalDelay)) : t._close())
- }, _close : function () {
- T(l);
- var n = C + " " + v + " ";
- if (t.bgOverlay.detach(), t.wrap.detach(), t.container.empty(), t.st.mainClass && (n += t.st.mainClass + " "), t._removeClassFromMFP(n), t.fixedContentPos) {
- var i = {marginRight: ""};
- t.isIE7 ? e("body, html").css("overflow", "") : i.overflow = "", e("html").css(i)
- }
- o.off("keyup" + h + " focusin" + h), t.ev.off(h), t.wrap.attr("class", "mfp-wrap").removeAttr("style"), t.bgOverlay.attr("class", "mfp-bg"), t.container.attr("class", "mfp-container"), !t.st.showCloseBtn || t.st.closeBtnInside && t.currTemplate[t.currItem.type] !== !0 || t.currTemplate.closeBtn && t.currTemplate.closeBtn.detach(), t._lastFocusedEl && e(t._lastFocusedEl).focus(), t.currItem = null, t.content = null, t.currTemplate = null, t.prevHeight = 0, T(d)
- }, updateSize : function (e) {
- if (t.isIOS) {
- var n = document.documentElement.clientWidth / window.innerWidth, i = window.innerHeight * n;
- t.wrap.css("height", i), t.wH = i
- } else t.wH = e || I.height();
- t.fixedContentPos || t.wrap.css("height", t.wH), T("Resize")
- }, updateItemHTML : function () {
- var n = t.items[t.index];
- t.contentContainer.detach(), t.content && t.content.detach(), n.parsed || (n = t.parseEl(t.index));
- var i = n.type;
- if (T("BeforeChange", [t.currItem ? t.currItem.type : "", i]), t.currItem = n, !t.currTemplate[i]) {
- var o = t.st[i] ? t.st[i].markup : !1;
- T("FirstMarkupParse", o), t.currTemplate[i] = o ? e(o) : !0
- }
- r && r !== n.type && t.container.removeClass("mfp-" + r + "-holder");
- var a = t["get" + i.charAt(0).toUpperCase() + i.slice(1)](n, t.currTemplate[i]);
- t.appendContent(a, i), n.preloaded = !0, T(m, n), r = n.type, t.container.prepend(t.contentContainer), T("AfterChange")
- }, appendContent : function (e, n) {
- t.content = e, e ? t.st.showCloseBtn && t.st.closeBtnInside && t.currTemplate[n] === !0 ? t.content.find(".mfp-close").length || t.content.append(E()) : t.content = e : t.content = "", T(u), t.container.addClass("mfp-" + n + "-holder"), t.contentContainer.append(t.content)
- }, parseEl : function (n) {
- var i, o = t.items[n];
- if (o.tagName ? o = {el: e(o)} : (i = o.type, o = {data: o, src: o.src}), o.el) {
- for (var r = t.types, a = 0; r.length > a; a++)if (o.el.hasClass("mfp-" + r[a])) {
- i = r[a];
- break
- }
- o.src = o.el.attr("data-mfp-src"), o.src || (o.src = o.el.attr("href"))
- }
- return o.type = i || t.st.type || "inline", o.index = n, o.parsed = !0, t.items[n] = o, T("ElementParse", o), t.items[n]
- }, addGroup : function (e, n) {
- var i = function (i) {
- i.mfpEl = this, t._openClick(i, e, n)
- };
- n || (n = {});
- var o = "click.magnificPopup";
- n.mainEl = e, n.items ? (n.isObj = !0, e.off(o).on(o, i)) : (n.isObj = !1, n.delegate ? e.off(o).on(o, n.delegate, i) : (n.items = e, e.off(o).on(o, i)))
- }, _openClick : function (n, i, o) {
- var r = void 0 !== o.midClick ? o.midClick : e.magnificPopup.defaults.midClick;
- if (r || 2 !== n.which && !n.ctrlKey && !n.metaKey) {
- var a = void 0 !== o.disableOn ? o.disableOn : e.magnificPopup.defaults.disableOn;
- if (a)if (e.isFunction(a)) {
- if (!a.call(t))return!0
- } else if (a > I.width())return!0;
- n.type && (n.preventDefault(), t.isOpen && n.stopPropagation()), o.el = e(n.mfpEl), o.delegate && (o.items = i.find(o.delegate)), t.open(o)
- }
- }, updateStatus : function (e, i) {
- if (t.preloader) {
- n !== e && t.container.removeClass("mfp-s-" + n), i || "loading" !== e || (i = t.st.tLoading);
- var o = {status: e, text: i};
- T("UpdateStatus", o), e = o.status, i = o.text, t.preloader.html(i), t.preloader.find("a").on("click", function (e) {
- e.stopImmediatePropagation()
- }), t.container.addClass("mfp-s-" + e), n = e
- }
- }, _checkIfClose : function (n) {
- if (!e(n).hasClass(y)) {
- var i = t.st.closeOnContentClick, o = t.st.closeOnBgClick;
- if (i && o)return!0;
- if (!t.content || e(n).hasClass("mfp-close") || t.preloader && n === t.preloader[0])return!0;
- if (n === t.content[0] || e.contains(t.content[0], n)) {
- if (i)return!0
- } else if (o && e.contains(document, n))return!0;
- return!1
- }
- }, _addClassToMFP : function (e) {
- t.bgOverlay.addClass(e), t.wrap.addClass(e)
- }, _removeClassFromMFP : function (e) {
- this.bgOverlay.removeClass(e), t.wrap.removeClass(e)
- }, _hasScrollBar : function (e) {
- return(t.isIE7 ? o.height() : document.body.scrollHeight) > (e || I.height())
- }, _setFocus : function () {
- (t.st.focus ? t.content.find(t.st.focus).eq(0) : t.wrap).focus()
- }, _onFocusIn : function (n) {
- return n.target === t.wrap[0] || e.contains(t.wrap[0], n.target) ? void 0 : (t._setFocus(), !1)
- }, _parseMarkup : function (t, n, i) {
- var o;
- i.data && (n = e.extend(i.data, n)), T(p, [t, n, i]), e.each(n, function (e, n) {
- if (void 0 === n || n === !1)return!0;
- if (o = e.split("_"), o.length > 1) {
- var i = t.find(h + "-" + o[0]);
- if (i.length > 0) {
- var r = o[1];
- "replaceWith" === r ? i[0] !== n[0] && i.replaceWith(n) : "img" === r ? i.is("img") ? i.attr("src", n) : i.replaceWith('<img src="' + n + '" class="' + i.attr("class") + '" />') : i.attr(o[1], n)
- }
- } else t.find(h + "-" + e).html(n)
- })
- }, _getScrollbarSize : function () {
- if (void 0 === t.scrollbarSize) {
- var e = document.createElement("div");
- e.id = "mfp-sbm", e.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(e), t.scrollbarSize = e.offsetWidth - e.clientWidth, document.body.removeChild(e)
- }
- return t.scrollbarSize
- }}, e.magnificPopup = {instance: null, proto: w.prototype, modules: [], open: function (t, n) {
- return _(), t = t ? e.extend(!0, {}, t) : {}, t.isObj = !0, t.index = n || 0, this.instance.open(t)
- }, close : function () {
- return e.magnificPopup.instance && e.magnificPopup.instance.close()
- }, registerModule : function (t, n) {
- n.options && (e.magnificPopup.defaults[t] = n.options), e.extend(this.proto, n.proto), this.modules.push(t)
- }, defaults : {disableOn: 0, key: null, midClick: !1, mainClass: "", preloader: !0, focus: "", closeOnContentClick: !1, closeOnBgClick: !0, closeBtnInside: !0, showCloseBtn: !0, enableEscapeKey: !0, modal: !1, alignTop: !1, removalDelay: 0, prependTo: null, fixedContentPos: "auto", fixedBgPos: "auto", overflowY: "auto", closeMarkup: '<button title="%title%" type="button" class="mfp-close">×</button>', tClose: "Close (Esc)", tLoading: "Loading..."}}, e.fn.magnificPopup = function (n) {
- _();
- var i = e(this);
- if ("string" == typeof n)if ("open" === n) {
- var o, r = b ? i.data("magnificPopup") : i[0].magnificPopup, a = parseInt(arguments[1], 10) || 0;
- r.items ? o = r.items[a] : (o = i, r.delegate && (o = o.find(r.delegate)), o = o.eq(a)), t._openClick({mfpEl: o}, i, r)
- } else t.isOpen && t[n].apply(t, Array.prototype.slice.call(arguments, 1)); else n = e.extend(!0, {}, n), b ? i.data("magnificPopup", n) : i[0].magnificPopup = n, t.addGroup(i, n);
- return i
- };
- var P, O, z, M = "inline", B = function () {
- z && (O.after(z.addClass(P)).detach(), z = null)
- };
- e.magnificPopup.registerModule(M, {options: {hiddenClass: "hide", markup: "", tNotFound: "Content not found"}, proto: {initInline: function () {
- t.types.push(M), x(l + "." + M, function () {
- B()
- })
- }, getInline : function (n, i) {
- if (B(), n.src) {
- var o = t.st.inline, r = e(n.src);
- if (r.length) {
- var a = r[0].parentNode;
- a && a.tagName && (O || (P = o.hiddenClass, O = k(P), P = "mfp-" + P), z = r.after(O).detach().removeClass(P)), t.updateStatus("ready")
- } else t.updateStatus("error", o.tNotFound), r = e("<div>");
- return n.inlineElement = r, r
- }
- return t.updateStatus("ready"), t._parseMarkup(i, {}, n), i
- }}});
- var F, H = "ajax", L = function () {
- F && i.removeClass(F)
- }, A = function () {
- L(), t.req && t.req.abort()
- };
- e.magnificPopup.registerModule(H, {options: {settings: null, cursor: "mfp-ajax-cur", tError: '<a href="%url%">The content</a> could not be loaded.'}, proto: {initAjax: function () {
- t.types.push(H), F = t.st.ajax.cursor, x(l + "." + H, A), x("BeforeChange." + H, A)
- }, getAjax : function (n) {
- F && i.addClass(F), t.updateStatus("loading");
- var o = e.extend({url: n.src, success: function (i, o, r) {
- var a = {data: i, xhr: r};
- T("ParseAjax", a), t.appendContent(e(a.data), H), n.finished = !0, L(), t._setFocus(), setTimeout(function () {
- t.wrap.addClass(v)
- }, 16), t.updateStatus("ready"), T("AjaxContentAdded")
- }, error : function () {
- L(), n.finished = n.loadError = !0, t.updateStatus("error", t.st.ajax.tError.replace("%url%", n.src))
- }}, t.st.ajax.settings);
- return t.req = e.ajax(o), ""
- }}});
- var j, N = function (n) {
- if (n.data && void 0 !== n.data.title)return n.data.title;
- var i = t.st.image.titleSrc;
- if (i) {
- if (e.isFunction(i))return i.call(t, n);
- if (n.el)return n.el.attr(i) || ""
- }
- return""
- };
- e.magnificPopup.registerModule("image", {options: {markup: '<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>', cursor: "mfp-zoom-out-cur", titleSrc: "title", verticalFit: !0, tError: '<a href="%url%">The image</a> could not be loaded.'}, proto: {initImage: function () {
- var e = t.st.image, n = ".image";
- t.types.push("image"), x(f + n, function () {
- "image" === t.currItem.type && e.cursor && i.addClass(e.cursor)
- }), x(l + n, function () {
- e.cursor && i.removeClass(e.cursor), I.off("resize" + h)
- }), x("Resize" + n, t.resizeImage), t.isLowIE && x("AfterChange", t.resizeImage)
- }, resizeImage : function () {
- var e = t.currItem;
- if (e && e.img && t.st.image.verticalFit) {
- var n = 0;
- t.isLowIE && (n = parseInt(e.img.css("padding-top"), 10) + parseInt(e.img.css("padding-bottom"), 10)), e.img.css("max-height", t.wH - n)
- }
- }, _onImageHasSize : function (e) {
- e.img && (e.hasSize = !0, j && clearInterval(j), e.isCheckingImgSize = !1, T("ImageHasSize", e), e.imgHidden && (t.content && t.content.removeClass("mfp-loading"), e.imgHidden = !1))
- }, findImageSize : function (e) {
- var n = 0, i = e.img[0], o = function (r) {
- j && clearInterval(j), j = setInterval(function () {
- return i.naturalWidth > 0 ? (t._onImageHasSize(e), void 0) : (n > 200 && clearInterval(j), n++, 3 === n ? o(10) : 40 === n ? o(50) : 100 === n && o(500), void 0)
- }, r)
- };
- o(1)
- }, getImage : function (n, i) {
- var o = 0, r = function () {
- n && (n.img[0].complete ? (n.img.off(".mfploader"), n === t.currItem && (t._onImageHasSize(n), t.updateStatus("ready")), n.hasSize = !0, n.loaded = !0, T("ImageLoadComplete")) : (o++, 200 > o ? setTimeout(r, 100) : a()))
- }, a = function () {
- n && (n.img.off(".mfploader"), n === t.currItem && (t._onImageHasSize(n), t.updateStatus("error", s.tError.replace("%url%", n.src))), n.hasSize = !0, n.loaded = !0, n.loadError = !0)
- }, s = t.st.image, l = i.find(".mfp-img");
- if (l.length) {
- var c = document.createElement("img");
- c.className = "mfp-img", n.img = e(c).on("load.mfploader", r).on("error.mfploader", a), c.src = n.src, l.is("img") && (n.img = n.img.clone()), c = n.img[0], c.naturalWidth > 0 ? n.hasSize = !0 : c.width || (n.hasSize = !1)
- }
- return t._parseMarkup(i, {title: N(n), img_replaceWith: n.img}, n), t.resizeImage(), n.hasSize ? (j && clearInterval(j), n.loadError ? (i.addClass("mfp-loading"), t.updateStatus("error", s.tError.replace("%url%", n.src))) : (i.removeClass("mfp-loading"), t.updateStatus("ready")), i) : (t.updateStatus("loading"), n.loading = !0, n.hasSize || (n.imgHidden = !0, i.addClass("mfp-loading"), t.findImageSize(n)), i)
- }}});
- var W, R = function () {
- return void 0 === W && (W = void 0 !== document.createElement("p").style.MozTransform), W
- };
- e.magnificPopup.registerModule("zoom", {options: {enabled: !1, easing: "ease-in-out", duration: 300, opener: function (e) {
- return e.is("img") ? e : e.find("img")
- }}, proto : {initZoom: function () {
- var e, n = t.st.zoom, i = ".zoom";
- if (n.enabled && t.supportsTransition) {
- var o, r, a = n.duration, s = function (e) {
- var t = e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"), i = "all " + n.duration / 1e3 + "s " + n.easing, o = {position: "fixed", zIndex: 9999, left: 0, top: 0, "-webkit-backface-visibility": "hidden"}, r = "transition";
- return o["-webkit-" + r] = o["-moz-" + r] = o["-o-" + r] = o[r] = i, t.css(o), t
- }, d = function () {
- t.content.css("visibility", "visible")
- };
- x("BuildControls" + i, function () {
- if (t._allowZoom()) {
- if (clearTimeout(o), t.content.css("visibility", "hidden"), e = t._getItemToZoom(), !e)return d(), void 0;
- r = s(e), r.css(t._getOffset()), t.wrap.append(r), o = setTimeout(function () {
- r.css(t._getOffset(!0)), o = setTimeout(function () {
- d(), setTimeout(function () {
- r.remove(), e = r = null, T("ZoomAnimationEnded")
- }, 16)
- }, a)
- }, 16)
- }
- }), x(c + i, function () {
- if (t._allowZoom()) {
- if (clearTimeout(o), t.st.removalDelay = a, !e) {
- if (e = t._getItemToZoom(), !e)return;
- r = s(e)
- }
- r.css(t._getOffset(!0)), t.wrap.append(r), t.content.css("visibility", "hidden"), setTimeout(function () {
- r.css(t._getOffset())
- }, 16)
- }
- }), x(l + i, function () {
- t._allowZoom() && (d(), r && r.remove(), e = null)
- })
- }
- }, _allowZoom : function () {
- return"image" === t.currItem.type
- }, _getItemToZoom : function () {
- return t.currItem.hasSize ? t.currItem.img : !1
- }, _getOffset : function (n) {
- var i;
- i = n ? t.currItem.img : t.st.zoom.opener(t.currItem.el || t.currItem);
- var o = i.offset(), r = parseInt(i.css("padding-top"), 10), a = parseInt(i.css("padding-bottom"), 10);
- o.top -= e(window).scrollTop() - r;
- var s = {width: i.width(), height: (b ? i.innerHeight() : i[0].offsetHeight) - a - r};
- return R() ? s["-moz-transform"] = s.transform = "translate(" + o.left + "px," + o.top + "px)" : (s.left = o.left, s.top = o.top), s
- }}});
- var Z = "iframe", q = "//about:blank", D = function (e) {
- if (t.currTemplate[Z]) {
- var n = t.currTemplate[Z].find("iframe");
- n.length && (e || (n[0].src = q), t.isIE8 && n.css("display", e ? "block" : "none"))
- }
- };
- e.magnificPopup.registerModule(Z, {options: {markup: '<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>', srcAction: "iframe_src", patterns: {youtube: {index: "youtube.com", id: "v=", src: "//www.youtube.com/embed/%id%?autoplay=1"}, vimeo: {index: "vimeo.com/", id: "/", src: "//player.vimeo.com/video/%id%?autoplay=1"}, gmaps: {index: "//maps.google.", src: "%id%&output=embed"}}}, proto: {initIframe: function () {
- t.types.push(Z), x("BeforeChange", function (e, t, n) {
- t !== n && (t === Z ? D() : n === Z && D(!0))
- }), x(l + "." + Z, function () {
- D()
- })
- }, getIframe : function (n, i) {
- var o = n.src, r = t.st.iframe;
- e.each(r.patterns, function () {
- return o.indexOf(this.index) > -1 ? (this.id && (o = "string" == typeof this.id ? o.substr(o.lastIndexOf(this.id) + this.id.length, o.length) : this.id.call(this, o)), o = this.src.replace("%id%", o), !1) : void 0
- });
- var a = {};
- return r.srcAction && (a[r.srcAction] = o), t._parseMarkup(i, a, n), t.updateStatus("ready"), i
- }}});
- var K = function (e) {
- var n = t.items.length;
- return e > n - 1 ? e - n : 0 > e ? n + e : e
- }, Y = function (e, t, n) {
- return e.replace(/%curr%/gi, t + 1).replace(/%total%/gi, n)
- };
- e.magnificPopup.registerModule("gallery", {options: {enabled: !1, arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', preload: [0, 2], navigateByImgClick: !0, arrows: !0, tPrev: "Previous (Left arrow key)", tNext: "Next (Right arrow key)", tCounter: "%curr% of %total%"}, proto: {initGallery: function () {
- var n = t.st.gallery, i = ".mfp-gallery", r = Boolean(e.fn.mfpFastClick);
- return t.direction = !0, n && n.enabled ? (a += " mfp-gallery", x(f + i, function () {
- n.navigateByImgClick && t.wrap.on("click" + i, ".mfp-img", function () {
- return t.items.length > 1 ? (t.next(), !1) : void 0
- }), o.on("keydown" + i, function (e) {
- 37 === e.keyCode ? t.prev() : 39 === e.keyCode && t.next()
- })
- }), x("UpdateStatus" + i, function (e, n) {
- n.text && (n.text = Y(n.text, t.currItem.index, t.items.length))
- }), x(p + i, function (e, i, o, r) {
- var a = t.items.length;
- o.counter = a > 1 ? Y(n.tCounter, r.index, a) : ""
- }), x("BuildControls" + i, function () {
- if (t.items.length > 1 && n.arrows && !t.arrowLeft) {
- var i = n.arrowMarkup, o = t.arrowLeft = e(i.replace(/%title%/gi, n.tPrev).replace(/%dir%/gi, "left")).addClass(y), a = t.arrowRight = e(i.replace(/%title%/gi, n.tNext).replace(/%dir%/gi, "right")).addClass(y), s = r ? "mfpFastClick" : "click";
- o[s](function () {
- t.prev()
- }), a[s](function () {
- t.next()
- }), t.isIE7 && (k("b", o[0], !1, !0), k("a", o[0], !1, !0), k("b", a[0], !1, !0), k("a", a[0], !1, !0)), t.container.append(o.add(a))
- }
- }), x(m + i, function () {
- t._preloadTimeout && clearTimeout(t._preloadTimeout), t._preloadTimeout = setTimeout(function () {
- t.preloadNearbyImages(), t._preloadTimeout = null
- }, 16)
- }), x(l + i, function () {
- o.off(i), t.wrap.off("click" + i), t.arrowLeft && r && t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(), t.arrowRight = t.arrowLeft = null
- }), void 0) : !1
- }, next ...
[truncated message content] |
|
From: <luc...@us...> - 2015-02-18 17:22:47
|
Revision: 12994
http://sourceforge.net/p/xoops/svn/12994
Author: luciorota
Date: 2015-02-18 17:22:44 +0000 (Wed, 18 Feb 2015)
Log Message:
-----------
fixed bug in install, uninstall, update
move all .tpl to templates folder
Modified Paths:
--------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/choicebyletter.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/oninstall.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onuninstall.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php
Added Paths:
-----------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_co_breadcrumb.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_co_choicebyletter.tpl
Removed Paths:
-------------
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.tpl
XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/choicebyletter.tpl
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.php 2015-02-18 16:22:25 UTC (rev 12993)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.php 2015-02-18 17:22:44 UTC (rev 12994)
@@ -26,12 +26,19 @@
* echo $breadcrumb->render();
*/
defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined');
+include_once dirname(dirname(__DIR__)) . '/include/common.php';
/**
* Class WfdownloadsBreadcrumb
*/
class WfdownloadsBreadcrumb
{
+ /**
+ * @var WfdownloadsWfdownloads
+ * @access public
+ */
+ public $wfdownloads = null;
+
private $dirname;
private $_bread = array();
@@ -40,7 +47,8 @@
*/
public function __construct()
{
- $this->dirname = basename(dirname(dirname(__DIR__)));
+ $this->wfdownloads = WfdownloadsWfdownloads::getInstance();
+ $this->dirname = basename(dirname(dirname(__DIR__)));
}
/**
@@ -75,10 +83,7 @@
// IN PROGRESS
// IN PROGRESS
// IN PROGRESS
- //$ret .= $breadcrumbTpl->fetch(__DIR__ . '_breadcrumb.tpl');
- $tplSource = file_get_contents(__DIR__ . '/breadcrumb.tpl');
-// $ret .= $choiceByLetterTpl->fetchFromData($tplSource, false, null);
- $ret .= $breadcrumbTpl->fetchFromData($tplSource, false, null);
+ $ret .= $breadcrumbTpl->fetch("db:{$this->wfdownloads->getModule()->dirname()}_co_breadcrumb.tpl");
unset($breadcrumbTpl);
return $ret;
Deleted: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.tpl
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.tpl 2015-02-18 16:22:25 UTC (rev 12993)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/breadcrumb.tpl 2015-02-18 17:22:44 UTC (rev 12994)
@@ -1,16 +0,0 @@
-<div class="wfdownloads_headertable">
- <div class="wfdownloads_breadcrumb">
- <{foreach item=bread from=$breadcrumb name=bcloop}>
- <span class="bread">
- <{if ($bread.link)}>
- <a href="<{$bread.link}>" title="<{$bread.title}>"><{$bread.title}></a>
- <{else}>
- <{$bread.title}>
- <{/if}>
- </span>
- <{if !$smarty.foreach.bcloop.last}>
- <span class="delimiter">></span>
- <{/if}>
- <{/foreach}>
- </div>
-</div>
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/choicebyletter.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/choicebyletter.php 2015-02-18 16:22:25 UTC (rev 12993)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/choicebyletter.php 2015-02-18 17:22:44 UTC (rev 12994)
@@ -23,6 +23,7 @@
* echo $choicebyletter->render();
*/
defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined');
+include_once dirname(dirname(__DIR__)) . '/include/common.php';
/**
* Class WfdownloadsChoiceByLetter
@@ -30,6 +31,12 @@
class WfdownloadsChoiceByLetter
{
/**
+ * @var WfdownloadsWfdownloads
+ * @access public
+ */
+ public $wfdownloads = null;
+
+ /**
* *#@+
*
* @access private
@@ -61,6 +68,7 @@
*/
public function __construct($objHandler, $criteria = null, $field_name = null, $alphabet = array(), $arg_name = 'letter', $url = null, $extra_arg = '', $caseSensitive = false)
{
+ $this->wfdownloads = WfdownloadsWfdownloads::getInstance();
$this->objHandler = $objHandler;
$this->criteria = is_null($criteria) ? new CriteriaCompo() : $criteria;
$this->field_name = is_null($field_name) ? $this->objHandler->identifierName : $field_name;
@@ -128,9 +136,7 @@
// IN PROGRESS
// IN PROGRESS
// IN PROGRESS
- //$ret .= $choiceByLetterTpl->fetch(__DIR__ . '/choicebyletter.tpl');
- $tplSource = file_get_contents(__DIR__ . '/choicebyletter.tpl');
- $ret .= $choiceByLetterTpl->fetchFromData($tplSource, false, null);
+ $ret .= $choiceByLetterTpl->fetch("db:{$this->wfdownloads->getModule()->dirname()}_co_choicebyletter.tpl");
unset($choiceByLetterTpl);
return $ret;
Deleted: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/choicebyletter.tpl
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/choicebyletter.tpl 2015-02-18 16:22:25 UTC (rev 12993)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/common/choicebyletter.tpl 2015-02-18 17:22:44 UTC (rev 12994)
@@ -1,96 +0,0 @@
-<style type="text/css">
- .button_green {
- -moz-box-shadow: inset 0 1px 0 0 #d9fbbe;
- -webkit-box-shadow: inset 0 1px 0 0 #d9fbbe;
- box-shadow: inset 0 1px 0 0 #d9fbbe;
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #d9fbbe), color-stop(1, #d9fbbe));
- background: -moz-linear-gradient(center top, #a5cc52 5%, #d9fbbe 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d9fbbe', endColorstr='#b8e356');
- background-color: #d9fbbe;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
- border-radius: 2px;
- text-indent: 0;
- border: 1px solid #83c41a;
- display: inline-block;
- color: inherit;
- font-family: inherit;
- font-size: 12px;
- font-weight: bold;
- font-style: normal;
- height: 20px;
- line-height: 20px;
- width: auto;
- min-width: 10px;
- text-decoration: none;
- text-align: center;
- text-shadow: 1px 1px 0 #d9fbbe;
- margin: 2px 0;
- padding: 0 4px;
- }
-
- .button_green:hover {
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #b8e356), color-stop(1, #a5cc52));
- background: -moz-linear-gradient(center top, #b8e356 5%, #a5cc52 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b8e356', endColorstr='#a5cc52');
- background-color: #86ae47;
- }
-
- .button_green:active {
- position: relative;
- top: 1px;
- }
-
- .button_grey {
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf));
- background: -moz-linear-gradient(center top, #ededed 5%, #dfdfdf 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
- background-color: #ededed;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
- border-radius: 2px;
- text-indent: 0;
- border: 1px solid #dcdcdc;
- display: inline-block;
- color: inherit;
- font-family: inherit;
- font-size: 12px;
- font-weight: bold;
- font-style: normal;
- height: 20px;
- line-height: 20px;
- width: auto;
- min-width: 10px;
- text-decoration: none;
- text-align: center;
- text-shadow: 1px 1px 0 #ffffff;
- margin: 2px 0;
- padding: 0 4px;
- }
-
- .button_grey:hover {
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed));
- background: -moz-linear-gradient(center top, #dfdfdf 5%, #ededed 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed');
- background-color: #dfdfdf;
- }
-
- .button_grey:active {
- position: relative;
- top: 1px;
- }
-</style>
-<br/>
-<div>
- <{assign var="alphabetcount" value=$alphabet|@count}>
- <{foreach name=letters item=letter from=$alphabet}>
- <{if ($letter.count > 0)}>
- <a class='button_green' href='<{$letter.url}>' title='<{$letter.count}>'><{$letter.letter}></a>
- <{else}>
- <span class='button_grey'><{$letter.letter}></span>
- <{/if}>
- <{if ($smarty.foreach.letters.iteration == (round($alphabetcount/2))+1)}>
-</div>
-<div><{else}><{/if}>
- <{/foreach}>
-</div>
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php 2015-02-18 16:22:25 UTC (rev 12993)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php 2015-02-18 17:22:44 UTC (rev 12994)
@@ -459,14 +459,14 @@
$userfile_file = new XoopsFormFile(_MD_WFDOWNLOADS_UPLOAD_FILEC, 'userfile', 0);
// get max file size (setup and php.ini)
$phpiniMaxFileSize = (min((int)(ini_get('upload_max_filesize')), (int)(ini_get('post_max_size')), (int)(ini_get('memory_limit')))) * 1024 * 1024; // bytes
- $maxFileSize = wfdownloads_bytesToSize1024(min($this->wfdownloads->getConfig('maxfilesize'), $phpiniMaxFileSize));
+ $maxFileSize = wfdownloads_bytesToSize1024(min($this->wfdownloads->getConfig('maxfilesize'), $phpiniMaxFileSize));
// get allowed mimetypes
if (wfdownloads_userIsAdmin()) {
- $mimetypeCriteria = new Criteria('mime_admin', true);
+ $criteria = new Criteria('mime_admin', true);
} else {
- $mimetypeCriteria = new Criteria('mime_user', true);
+ $criteria = new Criteria('mime_user', true);
}
- $mimetypes = $this->wfdownloads->getHandler('mimetype')->getList($mimetypeCriteria);
+ $mimetypes = $this->wfdownloads->getHandler('mimetype')->getList($criteria);
$allowedExtensions = implode(' | ', $mimetypes);
$userfile_file->setDescription(
sprintf(
@@ -711,7 +711,11 @@
// download: submitter
if (!$this->isNew()) {
$userCount = $member_handler->getUserCount();
+// IN PROGRESS
+// IN PROGRESS
+// IN PROGRESS
if ($userCount > 200) {
+ //$sform -> addElement(new XoopsFormText(_AM_WFDOWNLOADS_FILE_SUBMITTERID, 'submitter', 10, 10, $this->getVar('submitter', 'e')), true);
$submitter_select = new XoopsFormSelectUser (
_AM_WFDOWNLOADS_FILE_SUBMITTER, 'submitter', false, $this->getVar(
'submitter',
@@ -742,10 +746,10 @@
$userfile_file = new XoopsFormFile(_MD_WFDOWNLOADS_UPLOAD_FILEC, 'userfile', 0);
// get max file size (setup and php.ini)
$phpiniMaxFileSize = min((int)(ini_get('upload_max_filesize')), (int)(ini_get('post_max_size')), (int)(ini_get('memory_limit'))) * 1024 * 1024; // bytes
- $maxFileSize = wfdownloads_bytesToSize1024(min($this->wfdownloads->getConfig('maxfilesize'), $phpiniMaxFileSize));
+ $maxFileSize = wfdownloads_bytesToSize1024(min($this->wfdownloads->getConfig('maxfilesize'), $phpiniMaxFileSize));
// get allowed mimetypes
- $mimetypeCriteria = new Criteria('mime_admin', true);
- $mimetypes = $this->wfdownloads->getHandler('mimetype')->getList($mimetypeCriteria);
+ $criteria = new Criteria('mime_admin', true);
+ $mimetypes = $this->wfdownloads->getHandler('mimetype')->getList($criteria);
$allowedExtensions = implode(' | ', $mimetypes);
$userfile_file->setDescription(
sprintf(
@@ -759,7 +763,7 @@
);
$sform->addElement($userfile_file, false);
// download: cid
- $categoryObjs = $this->wfdownloads->getHandler('category')->getObjects();
+ $categoryObjs = $this->wfdownloads->getHandler('category')->getObjects();
$categoryObjsTree = new XoopsObjectTree($categoryObjs, 'cid', 'pid');
$sform->addElement(
new XoopsFormLabel(_AM_WFDOWNLOADS_FILE_CATEGORY, $categoryObjsTree->makeSelBox('cid', 'title', '-', $this->getVar('cid', 'e')))
@@ -1224,17 +1228,17 @@
*
* @return array
*/
- public function getActiveDownloads($criteria = null)
+ public function getActiveDownloads($crit = null)
{
- if (is_object($criteria)) {
- $downloadsCriteria = $criteria;
+ if (is_object($crit)) {
+ $criteria = $crit;
} else {
- $downloadsCriteria = new CriteriaCompo();
+ $criteria = new CriteriaCompo();
}
- $activeDownloadsCriteria = $this->getActiveCriteria();
- $downloadsCriteria->add($activeDownloadsCriteria);
+ $active_crit = $this->getActiveCriteria();
+ $criteria->add($active_crit);
- return $this->getObjects($downloadsCriteria);
+ return $this->getObjects($criteria);
}
/**
@@ -1244,14 +1248,14 @@
*
* @return array/int
*/
- public function getActiveCount($criteria = null)
+ public function getActiveCount($crit = null)
{
- $activeDownloadsCriteria = $this->getActiveCriteria();
- if (is_object($criteria)) {
- $activeDownloadsCriteria->add($criteria);
+ $criteria = $this->getActiveCriteria();
+ if (is_object($crit)) {
+ $criteria->add($crit);
}
- return $this->getCount($activeDownloadsCriteria);
+ return $this->getCount($criteria);
}
/**
@@ -1274,24 +1278,24 @@
*
* @return bool
*/
- public function delete($downloadsObj, $force = false)
+ public function delete($download, $force = false)
{
- if (parent::delete($downloadsObj, $force)) {
- $downloadsCriteria = new Criteria('lid', (int)$download->getVar('lid'));
- $this->wfdownloads->getHandler('rating')->deleteAll($downloadsCriteria);
- $this->wfdownloads->getHandler('mirror')->deleteAll($downloadsCriteria);
- $this->wfdownloads->getHandler('review')->deleteAll($downloadsCriteria);
- $this->wfdownloads->getHandler('report')->deleteAll($downloadsCriteria);
+ if (parent::delete($download, $force)) {
+ $criteria = new Criteria('lid', (int)$download->getVar('lid'));
+ $this->wfdownloads->getHandler('rating')->deleteAll($criteria);
+ $this->wfdownloads->getHandler('mirror')->deleteAll($criteria);
+ $this->wfdownloads->getHandler('review')->deleteAll($criteria);
+ $this->wfdownloads->getHandler('report')->deleteAll($criteria);
// delete comments
- xoops_comment_delete((int)$this->wfdownloads->getModule()->mid(), (int)$downloadsObj->getVar('lid'));
+ xoops_comment_delete((int)$this->wfdownloads->getModule()->mid(), (int)$download->getVar('lid'));
// Formulize module support (2006/05/04) jpc - start
if (wfdownloads_checkModule('formulize')) {
- if (file_exists(XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php') && $downloadsObj->getVar('formulize_idreq') > 0) {
+ if (file_exists(XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php') && $download->getVar('formulize_idreq') > 0) {
include_once XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php';
//deleteFormEntries(array($download->getVar('formulize_idreq')));
- $categoryObj = $this->wfdownloads->getHandler('category')->get($downloadsObj->getVar('cid'));
- deleteFormEntries(array($downloadsObj->getVar('formulize_idreq')), $categoryObj->getVar('formulize_fid'));
+ $category = $this->wfdownloads->getHandler('category')->get($download->getVar('cid'));
+ deleteFormEntries(array($download->getVar('formulize_idreq')), $category->getVar('formulize_fid'));
}
}
// Formulize module support (2006/05/04) jpc - end
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/oninstall.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/oninstall.php 2015-02-18 16:22:25 UTC (rev 12993)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/oninstall.php 2015-02-18 17:22:44 UTC (rev 12994)
@@ -20,8 +20,6 @@
*/
defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined');
include_once __DIR__ . '/common.php';
-//@include_once WFDOWNLOADS_ROOT_PATH . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/admin.php';
-xoops_loadLanguage('admin', $wfdownloads->getModule()->dirname());
define('INDEX_FILE_PATH', XOOPS_ROOT_PATH . '/uploads/index.html');
define('BLANK_FILE_PATH', XOOPS_ROOT_PATH . '/uploads/blank.gif');
@@ -33,6 +31,7 @@
*/
function xoops_module_pre_install_wfdownloads(&$xoopsModule)
{
+ xoops_loadLanguage('admin', $xoopsModule->dirname());
// NOP
return true;
}
@@ -44,6 +43,7 @@
*/
function xoops_module_install_wfdownloads(&$xoopsModule)
{
+ xoops_loadLanguage('admin', $xoopsModule->dirname());
// get module config values
$hModConfig = xoops_gethandler('config');
$configArray = $hModConfig->getConfigsByCat(0, $xoopsModule->getVar('mid'));
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onuninstall.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onuninstall.php 2015-02-18 16:22:25 UTC (rev 12993)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onuninstall.php 2015-02-18 17:22:44 UTC (rev 12994)
@@ -20,8 +20,6 @@
*/
defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined');
include_once __DIR__ . '/common.php';
-//@include_once WFDOWNLOADS_ROOT_PATH . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/admin.php';
-xoops_loadLanguage('admin', $wfdownloads->getModule()->dirname());
/**
* @param $xoopsModule
@@ -30,6 +28,7 @@
*/
function xoops_module_pre_uninstall_wfdownloads(&$xoopsModule)
{
+ xoops_loadLanguage('admin', $xoopsModule->dirname());
// NOP
return true;
}
@@ -39,5 +38,6 @@
*/
function xoops_module_uninstall_wfdownloads(&$xoopsModule)
{
+ xoops_loadLanguage('admin', $xoopsModule->dirname());
// NOP
}
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php 2015-02-18 16:22:25 UTC (rev 12993)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php 2015-02-18 17:22:44 UTC (rev 12994)
@@ -20,8 +20,7 @@
*/
defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined');
include_once __DIR__ . '/common.php';
-$wfdownloads = WfdownloadsWfdownloads::getInstance();
-xoops_loadLanguage('admin', $wfdownloads->getModule()->dirname());
+
include_once WFDOWNLOADS_ROOT_PATH . '/class/dbupdater.php';
/**
@@ -32,6 +31,7 @@
*/
function xoops_module_update_wfdownloads(&$xoopsModule, $previousVersion)
{
+ xoops_loadLanguage('admin', $xoopsModule->dirname());
ob_start();
invert_nohtm_dohtml_values();
if ($previousVersion < 322) {
Added: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_co_breadcrumb.tpl
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_co_breadcrumb.tpl (rev 0)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_co_breadcrumb.tpl 2015-02-18 17:22:44 UTC (rev 12994)
@@ -0,0 +1,16 @@
+<div class="wfdownloads_headertable">
+ <div class="wfdownloads_breadcrumb">
+ <{foreach item=bread from=$breadcrumb name=bcloop}>
+ <span class="bread">
+ <{if ($bread.link)}>
+ <a href="<{$bread.link}>" title="<{$bread.title}>"><{$bread.title}></a>
+ <{else}>
+ <{$bread.title}>
+ <{/if}>
+ </span>
+ <{if !$smarty.foreach.bcloop.last}>
+ <span class="delimiter">></span>
+ <{/if}>
+ <{/foreach}>
+ </div>
+</div>
Added: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_co_choicebyletter.tpl
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_co_choicebyletter.tpl (rev 0)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_co_choicebyletter.tpl 2015-02-18 17:22:44 UTC (rev 12994)
@@ -0,0 +1,96 @@
+<style type="text/css">
+ .button_green {
+ -moz-box-shadow: inset 0 1px 0 0 #d9fbbe;
+ -webkit-box-shadow: inset 0 1px 0 0 #d9fbbe;
+ box-shadow: inset 0 1px 0 0 #d9fbbe;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #d9fbbe), color-stop(1, #d9fbbe));
+ background: -moz-linear-gradient(center top, #a5cc52 5%, #d9fbbe 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d9fbbe', endColorstr='#b8e356');
+ background-color: #d9fbbe;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+ border-radius: 2px;
+ text-indent: 0;
+ border: 1px solid #83c41a;
+ display: inline-block;
+ color: inherit;
+ font-family: inherit;
+ font-size: 12px;
+ font-weight: bold;
+ font-style: normal;
+ height: 20px;
+ line-height: 20px;
+ width: auto;
+ min-width: 10px;
+ text-decoration: none;
+ text-align: center;
+ text-shadow: 1px 1px 0 #d9fbbe;
+ margin: 2px 0;
+ padding: 0 4px;
+ }
+
+ .button_green:hover {
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #b8e356), color-stop(1, #a5cc52));
+ background: -moz-linear-gradient(center top, #b8e356 5%, #a5cc52 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b8e356', endColorstr='#a5cc52');
+ background-color: #86ae47;
+ }
+
+ .button_green:active {
+ position: relative;
+ top: 1px;
+ }
+
+ .button_grey {
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf));
+ background: -moz-linear-gradient(center top, #ededed 5%, #dfdfdf 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
+ background-color: #ededed;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+ border-radius: 2px;
+ text-indent: 0;
+ border: 1px solid #dcdcdc;
+ display: inline-block;
+ color: inherit;
+ font-family: inherit;
+ font-size: 12px;
+ font-weight: bold;
+ font-style: normal;
+ height: 20px;
+ line-height: 20px;
+ width: auto;
+ min-width: 10px;
+ text-decoration: none;
+ text-align: center;
+ text-shadow: 1px 1px 0 #ffffff;
+ margin: 2px 0;
+ padding: 0 4px;
+ }
+
+ .button_grey:hover {
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed));
+ background: -moz-linear-gradient(center top, #dfdfdf 5%, #ededed 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed');
+ background-color: #dfdfdf;
+ }
+
+ .button_grey:active {
+ position: relative;
+ top: 1px;
+ }
+</style>
+<br/>
+<div>
+ <{assign var="alphabetcount" value=$alphabet|@count}>
+ <{foreach name=letters item=letter from=$alphabet}>
+ <{if ($letter.count > 0)}>
+ <a class='button_green' href='<{$letter.url}>' title='<{$letter.count}>'><{$letter.letter}></a>
+ <{else}>
+ <span class='button_grey'><{$letter.letter}></span>
+ <{/if}>
+ <{if ($smarty.foreach.letters.iteration == (round($alphabetcount/2))+1)}>
+</div>
+<div><{else}><{/if}>
+ <{/foreach}>
+</div>
Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php
===================================================================
--- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php 2015-02-18 16:22:25 UTC (rev 12993)
+++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php 2015-02-18 17:22:44 UTC (rev 12994)
@@ -42,8 +42,8 @@
$modversion['onUpdate'] = 'include/onupdate.php';
$modversion['onUninstall'] = 'include/onuninstall.php';
-$modversion['date'] = '2015-02-13';
-$modversion['release_date'] = '2015-02-13';
+$modversion['date'] = '2015-02-18';
+$modversion['release_date'] = '2015-02-18';
$modversion['status'] = 'RC5';
$modversion['teammembers'] = 'Bender, David, FrankBlack, Xpider, M0nty, Mithrandir, Marcan, felix[fx2024], Sudhaker, Jegelstaff';
@@ -327,9 +327,20 @@
);
// Common templates
+$modversion['templates'][] = array(
+ 'file' => $modversion['dirname'] . '_co_breadcrumb.tpl',
+ 'type' => 'class/common',
+ 'description' => ''
+);
+$modversion['templates'][] = array(
+ 'file' => $modversion['dirname'] . '_co_choicebyletter.tpl',
+ 'type' => 'class/common',
+ 'description' => ''
+);
+
// ------------------- Preferences -------------------
xoops_load('XoopsEditorHandler');
|