|
From: <luc...@us...> - 2014-02-14 18:11:12
|
Revision: 12310
http://sourceforge.net/p/xoops/svn/12310
Author: luciorota
Date: 2014-02-14 18:11:08 +0000 (Fri, 14 Feb 2014)
Log Message:
-----------
added: dohtm, dosmiley ,doxcode, doimage, dobr fields to download object
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/modification.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/include/common.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php
XoopsModules/wfdownloads/trunk/wfdownloads/sql/mysql.sql
XoopsModules/wfdownloads/trunk/wfdownloads/submit.php
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Added Paths:
-----------
XoopsModules/wfdownloads/trunk/wfdownloads/class/multicolumnsthemeform.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2014-02-14 04:30:50 UTC (rev 12309)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2014-02-14 18:11:08 UTC (rev 12310)
@@ -161,24 +161,24 @@
$criteria = new Criteria("ratinguser", "(" . implode(',', $uids) . ")", "IN");
$criteria->setGroupby("ratinguser");
- $userratings = $wfdownloads->getHandler('rating')->getUserAverage($criteria);
+ $userRatings = $wfdownloads->getHandler('rating')->getUserAverage($criteria);
foreach (array_keys($regvotes) as $i) {
$formatted_date = formatTimestamp($regvotes[$i]->getVar('ratingtimestamp'), _DATESTRING);
- $useravgrating = isset($userratings[$regvotes[$i]->getVar('ratinguser')]) ? $userratings[$regvotes[$i]->getVar(
+ $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(
+ $userVotes = isset($userRatings[$regvotes[$i]->getVar('ratinguser')]) ? $userRatings[$regvotes[$i]->getVar(
'ratinguser'
)]["count"] : 0;
- $ratinguname = XoopsUser :: getUnameFromId($regvotes[$i]->getVar('ratinguser'));
+ $ratingUserName = XoopsUser :: getUnameFromId($regvotes[$i]->getVar('ratinguser'));
echo "
- <tr><td class='head'>$ratinguname</td>\n
+ <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'>$useravgrating</th>\n
- <td class='even'>$uservotes</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') . "'>"
@@ -205,22 +205,22 @@
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);
+ $userRatings = $wfdownloads->getHandler('rating')->getUserAverage($criteria);
$anonymousVotes = $wfdownloads->getHandler('rating')->getObjects($anonymousCriteria);
foreach (array_keys($anonymousVotes) as $i) {
$formatted_date = formatTimestamp($anonymousVotes[$i]->getVar('ratingtimestamp'), _DATESTRING);
- $useravgrating = isset($userratings['avg']) ? $userratings["avg"] : 0;
- $uservotes = isset($userratings['count']) ? $userratings["count"] : 0;
+ $userAvgRating = isset($userRatings['avg']) ? $userRatings["avg"] : 0;
+ $userVotes = isset($userRatings['count']) ? $userRatings["count"] : 0;
- $ratinguname = $GLOBALS['xoopsConfig']['anonymous'];
+ $ratingUserName = $GLOBALS['xoopsConfig']['anonymous'];
echo "
- <tr><td class='head'>$ratinguname</td>\n
+ <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'>$useravgrating</th>\n
- <td class='even'>$uservotes</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') . "'>"
@@ -328,6 +328,11 @@
$download->setVar('platform', trim($_POST['platform']));
$download->setVar('summary', trim($_POST['summary']));
$download->setVar('description', trim($_POST['description']));
+ $download->setVar('dohtml', isset($_POST['dohtml']));
+ $download->setVar('dosmiley', isset($_POST['dosmiley']));
+ $download->setVar('doxcode', isset($_POST['doxcode']));
+ $download->setVar('doimage', isset($_POST['doimage']));
+ $download->setVar('dobr', isset($_POST['dobr']));
$download->setVar('submitter', trim($_POST['submitter']));
$download->setVar('publisher', trim($_POST['publisher']));
$download->setVar('price', trim($_POST['price']));
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2014-02-14 04:30:50 UTC (rev 12309)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2014-02-14 18:11:08 UTC (rev 12310)
@@ -61,34 +61,35 @@
redirect_header($currentFile, 1, _AM_WFDOWNLOADS_BROKEN_FILEIGNORED);
break;
- case "modification.show" :
+
+
+ case "modification.show":
$requestid = WfdownloadsRequest::getInt('requestid', 0);
$modification = $wfdownloads->getHandler('modification')->get($requestid);
$modify_user = new XoopsUser($modification->getVar('modifysubmitter'));
- $modifyName = XoopsUserUtility::getUnameFromId((int)$modify_user->getVar('uid'));
- $modifyEmail = $modify_user->getVar('email');
+ $modifyname = XoopsUserUtility::getUnameFromId((int)$modify_user->getVar('uid'));
+ $modifyemail = $modify_user->getVar('email');
$download = $wfdownloads->getHandler('download')->get($modification->getVar('lid'));
$orig_user = new XoopsUser($download->getVar('submitter'));
- $submitterName = XoopsUserUtility::getUnameFromId($download->getVar('submitter')); // $orig_user->getvar("uname");
- $submitterEmail = $orig_user->getVar('email');
+ $submittername = XoopsUserUtility::getUnameFromId($download->getVar('submitter')); // $orig_user->getvar("uname");
+ $submitteremail = $orig_user->getVar('email');
$categories = $wfdownloads->getHandler('category')->getObjects();
- $categoriesTree = new WfdownloadsObjectTree($categories, 'cid', 'pid');
+ $categoriesTree = new XoopsObjectTree($categories, 'cid', 'pid');
wfdownloads_xoops_cp_header();
-// IN PROGRESS NEW FROM HERE
-// IN PROGRESS NEW FROM HERE
-// IN PROGRESS NEW FROM HERE
+ // IN PROGRESS
+ // IN PROGRESS
+ // IN PROGRESS
+ // IN PROGRESS NEW FROM HERE
- echo "<div><b>" . _AM_WFDOWNLOADS_MOD_MODPOSTER . "</b> $submitterName</div>";
- echo "<div><b>" . _AM_WFDOWNLOADS_MOD_MODIFYSUBMITTER . "</b> $modifyName</div>";
+ echo "<div><b>" . _AM_WFDOWNLOADS_MOD_MODPOSTER . "</b> $submittername</div>";
+ echo "<div><b>" . _AM_WFDOWNLOADS_MOD_MODIFYSUBMITTER . "</b> $modifyname</div>";
- define ('_BUTTON_1', 'original');
- define ('_BUTTON_2', 'proposed');
- $sform = new XoopsThemeForm(_AM_WFDOWNLOADS_MOD_PROPOSED, 'storyform', 'reportsmodifications.php');
+ $mcform = new WfdownloadsMulticolumnsThemeForm('', 'modificationform', 'index.php');
// Get download keys
$downloadVars = $download->getVars();
@@ -101,262 +102,139 @@
// Set not allowed keys
$notAllowedKeys = array('lid', 'submitter', 'publisher', 'requestid', 'forumid', 'modifysubmitter', 'screenshots', 'paypalemail');
+ $i = 0;
+ $mcform->addElement('', false, 0, 0);
+ $mcform->setTitles(array('', _AM_WFDOWNLOADS_MOD_ORIGINAL, _AM_WFDOWNLOADS_MOD_PROPOSED));
+ $i = 1;
foreach ($commonKeys as $key) {
if (in_array($key, $notAllowedKeys)) {
continue;
}
- $caption = (defined("_AM_WFDOWNLOADS_MOD_" . strtoupper($key)) ? constant("_AM_WFDOWNLOADS_MOD_" . strtoupper($key)) : $key);
- $description = (defined("_AM_WFDOWNLOADS_MOD_" . strtoupper($key) . "_DESC") ? constant("_AM_WFDOWNLOADS_MOD_" . strtoupper($key) . "_DESC") : '');
- $editContent = '';
+ $caption = constant("_AM_WFDOWNLOADS_MOD_" . strtoupper($key));
+ $downloadContent = $download->getVar($key);
+ $modificationContent = $modification->getVar($key);
// Extra jobs for some keys
switch ($key) {
case "title" :
case "url" :
- $downloadContent = $download->getVar($key, 'e');
- $modificationContent = $modification->getVar($key, 'e');
- $editContentFormElement = new XoopsFormText($caption, $key, 50, 255, $download->getVar($key, 'e'));
+ // NOP
break;
- case "cid":
- $category_list = $wfdownloads->getHandler('category')->getObjects(new Criteria("cid", $download->getVar($key)));
- if (!isset($category_list[0])) continue;
- // array(value, name)
- $downloadContent = array(
- $download->getVar($key),
- $category_list[0]->getVar('title', 'e')
- );
- $category_list = $wfdownloads->getHandler('category')->getObjects(new Criteria("cid", $modification->getVar($key)));
- if (!isset($category_list[0])) continue;
- // array(value, name)
- $modificationContent = array(
- $modification->getVar($key),
- $category_list[0]->getVar('title', 'e')
- );
- $editContentFormElement = new XoopsFormSelect($caption, 'cid', $download->getVar($key, 'e'), 1, false);
- $editContentFormElement->addOptionArray($categoriesTree->makeSelBoxOptionsArray('title', '-'));
- break;
case "size" :
- // array(value, name)
- $downloadContent = array(
- $download->getVar($key, 'e'),
- wfdownloads_bytesToSize1024($downloadContent)
- );
- // array(value, name)
- $modificationContent = array(
- $modification->getVar($key, 'e'),
- wfdownloads_bytesToSize1024($modificationContent)
- );
- $editContentFormElement = new XoopsFormText($caption, 'size', 50, 255, $download->getVar($key, 'e'));
+ $downloadContent = wfdownloads_bytesToSize1024($downloadContent);
+ //
+ $modificationContent = wfdownloads_bytesToSize1024($modificationContent);
break;
case "date" :
case "published" :
case "expired" :
case "updated" :
- // array(value, name)
- $downloadContent = array(
- $download->getVar($key, 'e'),
- ($download->getVar($key, 'e') != false) ? formatTimestamp($download->getVar($key, 'e'), _DATESTRING) : _NO
- );
- // array(value, name)
- $modificationContent = array(
- $modification->getVar($key, 'e'),
- ($modification->getVar($key, 'e') != false) ? formatTimestamp($modification->getVar($key, 'e'), _DATESTRING) : _NO
- );
- $editContentFormElement = new XoopsFormDateTime($caption, $key, 15, $download->getVar($key, 'e'), true);
+ $downloadContent = ($downloadContent != false) ? formatTimestamp($downloadContent, _DATESTRING) : _NO;
+ //
+ $modificationContent = ($modificationContent != false) ? formatTimestamp($modificationContent, _DATESTRING) : _NO;
break;
case "platform":
case "license":
case "limitations":
case "versiontypes":
$tempArray = $wfdownloads->getConfig($key);
- // array(value, name)
- $downloadContent = array(
- $download->getVar($key),
- isset($tempArray[$download->getVar($key)]) ? $tempArray[$download->getVar($key)] : ''
- );
- // array(value, name)
- $modificationContent = array(
- $modification->getVar($key),
- isset($tempArray[$modification->getVar($key)]) ? $tempArray[$modification->getVar($key)] : ''
- );
- $editContentFormElement = new XoopsFormSelect($caption, $key, $download->getVar($key));
- $editContentFormElement->addOptionArray($tempArray);
+ $downloadContent = isset($tempArray[$download->getVar($key)]) ? $tempArray[$download->getVar($key)] : '';
+ //
+ $modificationContent = isset($tempArray[$modification->getVar($key)]) ? $tempArray[$modification->getVar($key)] : '';
break;
+ case "cid":
+ $category_list = $wfdownloads->getHandler('category')->getObjects(new Criteria("cid", $download->getVar($key)));
+ if (!isset($category_list[0])) continue;
+ $downloadContent = $category_list[0]->getVar('title', 'e');
+ //
+ $category_list = $wfdownloads->getHandler('category')->getObjects(new Criteria("cid", $modification->getVar($key)));
+ if (!isset($category_list[0])) continue;
+ $modificationContent = $category_list[0]->getVar('title', 'e');
+ break;
+ case "screenshot":
+ case "screenshot2":
+ case "screenshot3":
+ case "screenshot4":
+ if ($downloadContent != '') $downloadContent = "<img src='" . XOOPS_URL . "/{$wfdownloads->getConfig('screenshots')}/{$downloadContent}' width='{$wfdownloads->getConfig('shotwidth')}' alt='' title='' />";
+ //
+ if ($modificationContent != '') $modificationContent = "<img src='" . XOOPS_URL . "/{$wfdownloads->getConfig('screenshots')}/{$modificationContent}' width='{$wfdownloads->getConfig('shotwidth')}' alt='' title='' />";
+ break;
case "publisher" :
- case "submitter" :
- $downloadUserId = $download->getVar($key);
- // array(value, name)
- $downloadContent = array(
- $downloadUserId,
- !empty($downloadUserId) ? XoopsUserUtility::getUnameFromId($downloadUserId) : ''
- );
- $modificationUserId = $modification->getVar($key);
- // array(value, name)
- $modificationContent = array(
- $modificationUserId,
- !empty($modificationUserId) ? XoopsUserUtility::getUnameFromId($modificationUserId) : ''
- );
- //$editContentFormElement = new XoopsFormText($caption, $key, 50, 255, $downloadUserId);
- $editContentFormElement = new XoopsFormSelectUser ($caption, $key, false, $downloadUserId, 1, false);
+ $downloadContent = XoopsUserUtility::getUnameFromId($downloadContent);
+ //
+ $modificationContent = XoopsUserUtility::getUnameFromId($modificationContent);
break;
- case "features" :
- case "requirements" :
- if ($download->getVar($key) != '') {
- $downloadName = "<ul>";
- $values = explode('|', trim($download->getVar($key)));
- foreach ($values as $value) {$downloadName .= "<li>{$value}</li>";}
- $downloadName .= "</ul>";
- } else {
- $downloadName = '';
+ case "features":
+ case "requirements":
+ if ($downloadContent != '') {
+ $downrequirements = explode('|', trim($downloadContent));
+ $downloadContent = "<ul>";
+ foreach ($downrequirements as $bi) { $downloadContent.= "<li>{$bi}</li>"; }
+ $downloadContent.= "</ul>";
}
-
- $downloadContent = array(
- $download->getVar($key),
- $downloadName
- );
- if ($modification->getVar($key) != '') {
- $modificationName = "<ul>";
- $values = explode('|', trim($modification->getVar($key)));
- foreach ($values as $value) {$modificationName .= "<li>{$value}</li>";}
- $modificationName .= "</ul>";
- } else {
- $modificationName = '';
+ //
+ if ($modificationContent != '') {
+ $downrequirements = explode('|', trim($modificationContent));
+ $modificationContent = "<ul>";
+ foreach ($downrequirements as $bi) { $modificationContent .= "<li>{$bi}</li>"; }
+ $modificationContent.= "</ul>";
}
- // array(value, name)
- $modificationContent = array(
- $modification->getVar($key),
- $modificationName
- );
- $editContentFormElement = new XoopsFormTextArea($caption, $key, $download->getVar($key, 'e'), 7, 60);
break;
- case "dhistory" :
- // array(value, name)
- $downloadContent = array(
- $download->getVar($key, 'e'),
- $myts->displayTarea($download->getVar($key), true, false, false, false, true)
- );
- // array(value, name)
- $modificationContent = array(
- $modification->getVar($key, 'e'),
- $myts->displayTarea($modification->getVar($key), true, false, false, false, true)
- );
- $editContentFormElement = new XoopsFormTextArea($caption, $key, $download->getVar($key, 'e'), 7, 60);
+ case "dhistory":
+ $downloadContent = $myts->displayTarea($downloadContent, true, false, false, false, true);
+ //
+ $modificationContent = $myts->displayTarea($modificationContent, true, false, false, false, true);
break;
-// IN PROGRESS FROM HERE
-// IN PROGRESS FROM HERE
-// IN PROGRESS FROM HERE
- case "summary" :
-// IN PROGRESS $wfdownloads->getConfig('autosummary') check
- // array(value, name)
- $downloadContent = array(
- $download->getVar($key, 'e'),
- $myts->displayTarea($download->getVar($key), true, false, false, false, true)
- );
- // array(value, name)
- $modificationContent = array(
- $modification->getVar($key, 'e'),
- $myts->displayTarea($modification->getVar($key), true, false, false, false, true)
- );
- $editContentFormElement = new XoopsFormDhtmlTextArea($caption, $key, $download->getVar($key, 'e'), 10, 60, 'smartHiddenSummary');
- break;
- case "description" :
- // array(value, name)
- $downloadContent = array(
- $download->getVar($key, 'e'),
- $myts->displayTarea($download->getVar($key), true, false, false, false, true)
- );
- // array(value, name)
- $modificationContent = array(
- $modification->getVar($key, 'e'),
- $myts->displayTarea($modification->getVar($key), true, false, false, false, true)
- );
- $editContentFormElement = new XoopsFormDhtmlTextArea($caption, $key, $download->getVar($key, 'e'), 15, 60, 'smartHiddenDescription');
- break;
- case "screenshot":
- case "screenshot2":
- case "screenshot3":
- case "screenshot4":
- if ($download->getVar($key) != '') $downloadContent = "<img src='" . XOOPS_URL . "/{$wfdownloads->getConfig('screenshots')}/{$download->getVar($key)}' width='{$wfdownloads->getConfig('shotwidth')}' alt='' title='' />";
+ case "summary":
+ case "description":
+ $downloadContent = $downloadContent;
//
- if ($modification->getVar($key) != '') $modificationContent = "<img src='" . XOOPS_URL . "/{$wfdownloads->getConfig('screenshots')}/{$modification->getVar($key)}' width='{$wfdownloads->getConfig('shotwidth')}' alt='' title='' />";
+ $modificationContent = $modificationContent;
break;
case "offline":
- $downloadContent = $download->getVar($key) ? _YES : _NO;
+ case "dohtml":
+ case "dosmiley":
+ case "doxcode":
+ case "doimage":
+ case "dobr":
+ $downloadContent = $downloadContent ? _YES : _NO;
//
- $modificationContent = $modification->getVar($key) ? _YES : _NO;
-
+ $modificationContent = $modificationContent ? _YES : _NO;
}
- if (isset($editContentFormElement)) {
- $editContentFormElement->setName($key); // patch to solve a XoopsFormDateTime bug
- $editContentFormElement->setCaption($caption);
- $editContentFormElement->setDescription($description);
- $sform->addElement(new WfdownloadsFormElementChoose($editContentFormElement, $downloadContent, $modificationContent));
- unset($editContentFormElement);
+ $mcform->addElement($caption, false, $i, 0);
+ if ($downloadContent != $modificationContent) {
+ $modificationContent = "<span style='color:red'>" . $modificationContent . "</span>";
}
+ $downloadFormElement = new XoopsFormLabel('', $downloadContent);
+ $modificationFormElement = new XoopsFormLabel('', $modificationContent);
+ $mcform->addElement($downloadFormElement, false, $i, 1);
+ $mcform->addElement($modificationFormElement, false, $i, 2);
+ $i++;
}
$button_tray = new XoopsFormElementTray('', '');
$button_tray->addElement(new XoopsFormHidden('requestid', $requestid));
$button_tray->addElement(new XoopsFormHidden('lid', (int)$modification->getVar('lid')));
- $hidden = new XoopsFormHidden('op', 'modification.change');
+ $hidden = new XoopsFormHidden('op', 'modification.change');
$button_tray->addElement($hidden);
if (!$modification->isNew()) {
- $button_approve = new XoopsFormButton('', '', _SUBMIT, 'submit');
- $button_approve->setExtra('onclick="this.form.elements.op.value=\'modification.save\'"');
- $button_tray->addElement($button_approve);
+ $approve_button = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BAPPROVE, 'submit');
+ $approve_button->setExtra('onclick="this.form.elements.op.value=\'modification.change\'"');
+ $button_tray->addElement($approve_button);
}
- $button_ignore = new XoopsFormButton('', '', _AM_WFDOWNLOADS_MOD_IGNORE, 'submit');
- $button_ignore->setExtra('onclick="this.form.elements.op.value=\'modification.ignore\'"');
- $button_tray->addElement($button_ignore);
- $button_reset = new XoopsFormButton('', '', _RESET, 'reset');
- $button_tray->addElement($button_reset);
+ $ignore_button = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BIGNORE, 'submit');
+ $ignore_button->setExtra('onclick="this.form.elements.op.value=\'modification.ignore\'"');
+ $button_tray->addElement($ignore_button);
$button_cancel = new XoopsFormButton('', '', _CANCEL, 'button');
$button_cancel->setExtra('onclick="history.go(-1)"');
$button_tray->addElement($button_cancel);
- $sform->addElement($button_tray);
- $sform->display();
+ $mcform->addElement($button_tray, false, $i, 2);
+ $mcform->display();
+
xoops_cp_footer();
exit();
break;
- case "modification.save" :
- $requestid = WfdownloadsRequest::getInt('requestid', 0);
-
- $modification = $wfdownloads->getHandler('modification')->get($requestid);
- $download = $wfdownloads->getHandler('download')->get($modification->getVar('lid'));
-
- if ($modification->getVar('version') == $download->getVar('version')) {
- $raiseModifyEvents = false;
- } else {
- $raiseModifyEvents = true;
- }
-// IN PROGRESS FROM HERE
-// IN PROGRESS FROM HERE
-// IN PROGRESS FROM HERE
- // SAVE MODIFIED FIELDS
-
- // DELETE MODIFICATIONREQUEST
-// IN PROGRESS FROM HERE
-// IN PROGRESS FROM HERE
-// IN PROGRESS FROM HERE
- if ($raiseModifyEvents) {
- // Trigger the three events related to modified files (one for the file, category, and global event categories respectively)
- $tags = array();
- $tags['FILE_NAME'] = $download->getVar('title');
- $tags['FILE_URL'] = WFDOWNLOADS_URL . '/singlefile.php?cid=' . $cid . '&lid=' . $lid;
- $category = $wfdownloads->getHandler('category')->get($cid);
- $tags['FILE_VERSION'] = $download->getVar('version');
- $tags['CATEGORY_NAME'] = $category->getVar('title');
- $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . '/viewcat.php?cid=' . $cid;
-
- $notification_handler->triggerEvent('global', 0, 'filemodified', $tags);
- $notification_handler->triggerEvent('category', $cid, 'filemodified', $tags);
- $notification_handler->triggerEvent('file', $lid, 'filemodified', $tags);
- }
-
- redirect_header(WFDOWNLOADS_URL . '/admin/index.php', 1, _AM_WFDOWNLOADS_MOD_REQUPDATED);
- break;
-
case "modification.change" :
/* Added by Lankford on 2007/3/21 */
// Get a pointer to the download record and the modification record, then compare their 'versions' to see if they are different. If they are, then raise filemodify events.
@@ -505,7 +383,7 @@
$start_modification = WfdownloadsRequest::getInt('start_modification', 0);
$modifications_count = $wfdownloads->getHandler('modification')->getCount();
- $criteria = new CriteriaCompo();
+ $criteria = new CriteriaCompo();
$criteria->setLimit($wfdownloads->getConfig('admin_perpage'));
$criteria->setStart($start_modification);
$criteria->setSort("requestdate");
@@ -536,7 +414,7 @@
$xoopsTpl->assign('use_reviews', $wfdownloads->getConfig('enable_reviews'));
$xoopsTpl->assign('use_brokenreports', $wfdownloads->getConfig('enable_brokenreports'));
- $GLOBALS['xoopsTpl']->display("db:" . $wfdownloads->getModule()->dirname() . "_admin_reportsmodificationslist.html");
+ $GLOBALS['xoopsTpl']->display("db:{$wfdownloads->getModule()->dirname()}_admin_reportsmodificationslist.html");
include 'admin_footer.php';
break;
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2014-02-14 04:30:50 UTC (rev 12309)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2014-02-14 18:11:08 UTC (rev 12310)
@@ -82,19 +82,17 @@
$this->initVar('description', XOBJ_DTYPE_TXTAREA, '');
$this->initVar('ipaddress', XOBJ_DTYPE_TXTBOX, '');
$this->initVar('notifypub', XOBJ_DTYPE_INT, 0);
-
- $this->initVar('dohtml', XOBJ_DTYPE_INT, 1, false); // boolean
- $this->initVar('dosmiley', XOBJ_DTYPE_INT, 1, false); // boolean
- $this->initVar('doxcode', XOBJ_DTYPE_INT, 1, false); // boolean
- $this->initVar('doimage', XOBJ_DTYPE_INT, 1, false); // boolean
- $this->initVar('dobr', XOBJ_DTYPE_INT, 1, false); // boolean
-
- // Added Formulize module support (2006/05/04) jpc
+ // added Formulize module support (2006/05/04) jpc
$this->initVar('formulize_idreq', XOBJ_DTYPE_INT, 0);
-
- // Added 3.23
+ // added 3.23
$this->initVar('screenshots', XOBJ_DTYPE_ARRAY, array());
+ $this->initVar('dohtml', XOBJ_DTYPE_INT, false); // boolean
+ $this->initVar('dosmiley', XOBJ_DTYPE_INT, true); // boolean
+ $this->initVar('doxcode', XOBJ_DTYPE_INT, true); // boolean
+ $this->initVar('doimage', XOBJ_DTYPE_INT, true); // boolean
+ $this->initVar('dobr', XOBJ_DTYPE_INT, true); // boolean
+
if (isset($id)) {
$item = $this->wfdownloads->getHandler('item')->get($id);
foreach ($item->vars as $k => $v) {
@@ -576,9 +574,29 @@
), 15, 60, 'smartHiddenDescription');
$description_dhtmltextarea->setDescription(_MD_WFDOWNLOADS_DESCRIPTION_DESC);
$sform->addElement($description_dhtmltextarea, true);
+ // download: dohtml, dosmiley, doxcode, doimage, dobr
+ $options_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_TEXTOPTIONS, '<br />');
+ $html_checkbox = new XoopsFormCheckBox('', 'dohtml', $this->getVar('dohtml'));
+ $html_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWHTML);
+ $options_tray->addElement($html_checkbox);
+ $smiley_checkbox = new XoopsFormCheckBox('', 'dosmiley', $this->getVar('dosmiley'));
+ $smiley_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWSMILEY);
+ $options_tray->addElement($smiley_checkbox);
+ $xcodes_checkbox = new XoopsFormCheckBox('', 'doxcode', $this->getVar('doxcode'));
+ $xcodes_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWXCODE);
+ $options_tray->addElement($xcodes_checkbox);
+ $noimages_checkbox = new XoopsFormCheckBox('', 'doimage', $this->getVar('doimage'));
+ $noimages_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWIMAGES);
+ $options_tray->addElement($noimages_checkbox);
+ $breaks_checkbox = new XoopsFormCheckBox('', 'dobr', $this->getVar('dobr'));
+ $breaks_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWBREAK);
+ $options_tray->addElement($breaks_checkbox);
+ $sform->addElement($options_tray);
+ // download: features
$features_textarea = new XoopsFormTextArea(_MD_WFDOWNLOADS_KEYFEATURESC, 'features', $this->getVar('features', 'e'), 7, 60);
$features_textarea->setDescription(_MD_WFDOWNLOADS_KEYFEATURESC_DESC);
$sform->addElement($features_textarea, false);
+ // download: requirements
$requirements_textarea = new XoopsFormTextArea(_MD_WFDOWNLOADS_REQUIREMENTSC, 'requirements', $this->getVar(
'requirements',
'e'
@@ -817,6 +835,24 @@
$description_tray->addElement($description_editor, true);
$description_tray->setDescription(_MD_WFDOWNLOADS_DESCRIPTION_DESC);
$sform->addElement($description_tray);
+ // download: dohtml, dosmiley, doxcode, doimage, dobr
+ $options_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_TEXTOPTIONS, '<br />');
+ $html_checkbox = new XoopsFormCheckBox('', 'dohtml', $this->getVar('dohtml'));
+ $html_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWHTML);
+ $options_tray->addElement($html_checkbox);
+ $smiley_checkbox = new XoopsFormCheckBox('', 'dosmiley', $this->getVar('dosmiley'));
+ $smiley_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWSMILEY);
+ $options_tray->addElement($smiley_checkbox);
+ $xcodes_checkbox = new XoopsFormCheckBox('', 'doxcode', $this->getVar('doxcode'));
+ $xcodes_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWXCODE);
+ $options_tray->addElement($xcodes_checkbox);
+ $noimages_checkbox = new XoopsFormCheckBox('', 'doimage', $this->getVar('doimage'));
+ $noimages_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWIMAGES);
+ $options_tray->addElement($noimages_checkbox);
+ $breaks_checkbox = new XoopsFormCheckBox('', 'dobr', $this->getVar('dobr'));
+ $breaks_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWBREAK);
+ $options_tray->addElement($breaks_checkbox);
+ $sform->addElement($options_tray);
// download: features
$sform->addElement(new XoopsFormTextArea(_AM_WFDOWNLOADS_FILE_KEYFEATURES, 'features', $this->getVar('features', 'e'), 7, 60), false);
// download: requirements
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/modification.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/modification.php 2014-02-14 04:30:50 UTC (rev 12309)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/modification.php 2014-02-14 18:11:08 UTC (rev 12310)
@@ -31,14 +31,10 @@
{
$this->WfdownloadsDownload();
$this->initVar('requestid', XOBJ_DTYPE_INT);
-
+ //
$this->initVar('modifysubmitter', XOBJ_DTYPE_INT, 0);
$this->initVar('requestdate', XOBJ_DTYPE_INT, 0);
-
-
-//
-// $this->wfdownloads = WfdownloadsWfdownloads::getInstance();
-// $this->db = XoopsDatabaseFactory::getDatabaseConnection();
+ //
$this->initVar('lid', XOBJ_DTYPE_INT);
$this->initVar('cid', XOBJ_DTYPE_INT, 0);
$this->initVar('title', XOBJ_DTYPE_TXTBOX, '');
@@ -80,6 +76,12 @@
$this->initVar('description', XOBJ_DTYPE_TXTAREA, '');
// $this->initVar('ipaddress', XOBJ_DTYPE_TXTBOX, '');
// $this->initVar('notifypub', XOBJ_DTYPE_INT, 0);
+ // added 3.23
+ $this->initVar('dohtml', XOBJ_DTYPE_INT, false); // boolean
+ $this->initVar('dosmiley', XOBJ_DTYPE_INT, true); // boolean
+ $this->initVar('doxcode', XOBJ_DTYPE_INT, true); // boolean
+ $this->initVar('doimage', XOBJ_DTYPE_INT, true); // boolean
+ $this->initVar('dobr', XOBJ_DTYPE_INT, true); // boolean
//Obsolete
@@ -142,7 +144,12 @@
d.dhistory = m.dhistory,
d.updated = m.updated,
d.summary = m.summary,
- d.description = m.description";
+ d.description = m.description,
+ d.dohtml = m.dohtml,
+ d.dosmiley = m.dosmiley,
+ d.doxcode = m.doxcode,
+ d.doimage = m.doimage,
+ d.dobr = m.dobr";
$sql .= " WHERE d.lid = m.lid AND m.requestid='{$requestid}'";
if ($this->db->query($sql)) {
return $this->deleteAll(new Criteria('requestid', (int)$requestid));
Added: XoopsModules/wfdownloads/trunk/wfdownloads/class/multicolumnsthemeform.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/multicolumnsthemeform.php (rev 0)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/multicolumnsthemeform.php 2014-02-14 18:11:08 UTC (rev 12310)
@@ -0,0 +1,237 @@
+<?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.
+ */
+/**
+ * WfdownloadsMulticolumnsThemeForm 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:$
+ */
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+xoops_load('XoopsForm');
+
+/**
+ * Form that will output formatted as a HTML table
+ *
+ * No styles and no JavaScript to check for required fields.
+ */
+class WfdownloadsMulticolumnsThemeForm extends XoopsForm
+{
+ /**
+ * number of two-dimensional array (matrix) rows
+ *
+ * @var int
+ */
+ var $_rows = 0;
+
+ /**
+ * return number of rows
+ *
+ * @return int
+ */
+ public function getCountRows()
+ {
+ return $this->_rows;
+ }
+
+ /**
+ * number of two-dimensional array (matrix) columns
+ *
+ * @var int
+ */
+ var $_columns = 0;
+
+ /**
+ * return number of columns
+ *
+ * @return int
+ */
+ public function getCountColumns()
+ {
+ return $this->_columns;
+ }
+
+ /**
+ * two-dimensional array (matrix) of {@link XoopsFormElement} objects
+ *
+ * @var array
+ */
+ var $_elements = array();
+
+ /**
+ * mono-dimensional array of column titles
+ *
+ * @var array
+ */
+ var $_titles = array();
+
+ /**
+ * Add an element to the form
+ *
+ * @param object $ &$formElement reference to a {@link XoopsFormElement}
+ * @param bool $required is this a "required" element?
+ * @param int $row two-dimensional array (matrix) row (0 first key)
+ * @param int $column two-dimensional array (matrix) column (0 first key)
+ */
+ public function addElement($formElement, $required = false, $row = null, $column = null)
+ {
+ if (is_null($row))
+ $row = $this->_rows;
+ if (is_null($column))
+ $column = ($this->_columns == 0) ? $this->_columns : $this->_columns - 1; // add new element as new row of the last column
+ if (is_string($formElement)) {
+ $this->_elements[$row][$column] = $formElement;
+ if ($row >= $this->_rows)
+ $this->_rows = $row + 1;
+ if ($column >= $this->_columns)
+ $this->_columns = $column + 1;
+ } elseif (is_subclass_of($formElement, 'xoopsformelement')) {
+ $this->_elements[$row][$column] = &$formElement;
+ if ($row >= $this->_rows)
+ $this->_rows = $row + 1;
+ if ($column >= $this->_columns)
+ $this->_columns = $column + 1;
+ if (! $formElement->isContainer()) {
+ if ($required) {
+ $formElement->_required = true;
+ $this->_required[] = &$formElement;
+ }
+ } else {
+ $required_elements = &$formElement->getRequired();
+ $count = count($required_elements);
+ for ($i = 0; $i < $count; $i ++) {
+ $this->_required[] = &$required_elements[$i];
+ }
+ }
+ }
+ }
+
+ public function addRow($elements)
+ {
+ foreach ($elements as $key => $element) {
+ $this->addElement($element, false, $this->_rows, $key);
+ }
+ }
+
+ public function addColumn($elements)
+ {
+ foreach ($elements as $key => $element) {
+ $this->addElement($element, false, $key, $this->_columns);
+ }
+ }
+
+ public function addForm($form)
+ {
+ foreach ($form->getElements() as $element) {
+ $this->addElement($element, $element->isRequired(), $key, $this->_columns);
+ }
+ }
+
+ public function setTitles($titles)
+ {
+ if (is_array($titles)) {
+ foreach($titles as $key => $title) {
+ $this->_titles[$key] = $title;
+ }
+ } else {
+ $this->_title = $titles;
+ }
+ }
+
+ /**
+ * create HTML to output the form as a theme-enabled table with validation.
+ *
+ * YOU SHOULD AVOID TO USE THE FOLLOWING Nocolspan METHOD, IT WILL BE REMOVED
+ *
+ * To use the noColspan simply use the following example:
+ *
+ * $colspan = new XoopsFormDhtmlTextArea( '', 'key', $value, '100%', '100%' );
+ * $colspan->setNocolspan();
+ * $form->addElement( $colspan );
+ *
+ * @return string
+ */
+ function render()
+ {
+ $ele_name = $this->getName();
+ $ret = "";
+ $ret .= "<form name='{$ele_name}' id='{$ele_name}' action='{$this->getAction()}' method='{$this->getMethod()}' onsubmit='return xoopsFormValidate_{$ele_name}();' {$this->getExtra()} >" . NWLINE;
+ $ret .= "<table width='100%' class='outer' cellspacing='1'>" . NWLINE;
+ $ret .= "<tr><th colspan='{$this->_columns}'>{$this->getTitle()}</th></tr>" . NWLINE;
+ if (count($this->_titles) > 0) {
+ $ret .= "<tr>";
+ for ($column = 0; $column < $this->_columns; $column++) {
+ $ret .= "<th>";
+ $ret .= (isset($this->_titles[$column])) ? "{$this->_titles[$column]}" : " ";
+ $ret .= "</th>" . NWLINE;
+ }
+ $ret .= "</tr>";
+ }
+ $hidden = '';
+ $class = 'even';
+ for ($row = 0; $row < $this->_rows; $row++) {
+ $ret .= "<tr>";
+ for ($column = 0; $column < $this->_columns; $column++) {
+ $ret .= "<td class='{$class}'>";
+ if (isset($this->_elements[$row][$column])) {
+ $ele = $this->_elements[$row][$column];
+ } else {
+ $ele = ' ';
+ }
+ if (!is_object($ele)) {
+ $ret .= $ele;
+ } else if (!$ele->isHidden()) {
+ if (!$ele->getNocolspan()) {
+ //$ret .= '<tr valign="top" align="left"><td class="head">';
+ if (($caption = $ele->getCaption()) != '') {
+ $ret .= "<div class='xoops-form-element-caption" . ($ele->isRequired() ? '-required' : '') . "'>";
+ $ret .= "<span class='caption-text'>{$caption}</span>";
+ $ret .= "<span class='caption-marker'>*</span>";
+ $ret .= "</div>";
+ }
+ if (($desc = $ele->getDescription()) != '') {
+ $ret .= "<div class='xoops-form-element-help'>{$desc}</div>";
+ }
+ //$ret .= '</td><td class="' . $class . '">';
+ $ret .= $ele->render();
+ //$ret .= '</td></tr>' . NWLINE;
+ } else {
+ //$ret .= '<tr valign="top" align="left"><td class="head" colspan="2">';
+ if (($caption = $ele->getCaption()) != '') {
+ $ret .= "<div class='xoops-form-element-caption" . ($ele->isRequired() ? '-required' : '') . "'>";
+ $ret .= "<span class='caption-text'>{$caption}</span>";
+ $ret .= "<span class='caption-marker'>*</span>";
+ $ret .= "</div>";
+ }
+ //$ret .= '</td></tr>' . NWLINE;
+ //$ret .= '<tr valign="top" align="left"><td class="' . $class . '" colspan="' . $this->_columns . '">';
+ $ret .= $ele->render();
+ //$ret .= '</td></tr>' . NWLINE;
+ }
+ } else {
+ $hidden .= $ele->render();
+ }
+ $ret .= "</td>";
+ }
+ $ret .= "</tr>";
+ }
+ $ret .= "</table>" . NWLINE;
+ $ret .= "{$hidden}" . NWLINE;
+ $ret .= "</form>" . NWLINE;
+ $ret .= $this->renderValidationJS(true);
+ return $ret;
+ }
+}
\ No newline at end of file
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2014-02-14 04:30:50 UTC (rev 12309)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2014-02-14 18:11:08 UTC (rev 12310)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 Beta (2014-02-04)</u></b>
+<b><u>=> Version 3.23 Beta (2014-02-14)</u></b>
- update jQuery Thickbox plugin to 3.1 (luciorota)
- fixed: jQuery bug in templates (luciorota)
- standardization of English language files (cesag)
@@ -16,8 +16,9 @@
- fixed: html errors in templates (luciorota)
- fixed: deprecated XoopsTree (mamba)
- fixed: English translations (mamba)
-- added: admin can upload images directly form category/indexpage form (luciorota)
+- added: dohtm, dosmiley ,doxcode, doimage, dobr fields to download object (luciorota)
- added: updating to XOOPS 2.5.7 Multi-page help (mamba)
+- added: updating to XOOPS 2.5.7 Multi-page help (mamba)
- added: enable/disable reviews system (luciorota)
- added: enable/disable ratings system (luciorota)
- added: enable/disable brokens reports system (luciorota)
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/common.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/common.php 2014-02-14 04:30:50 UTC (rev 12309)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/common.php 2014-02-14 18:11:08 UTC (rev 12310)
@@ -41,8 +41,10 @@
include_once WFDOWNLOADS_ROOT_PATH . '/class/breadcrumb.php'; // WfdownloadsBreadcrumb class
include_once WFDOWNLOADS_ROOT_PATH . '/class/tree.php'; // WfdownloadsObjectTree class
include_once WFDOWNLOADS_ROOT_PATH . '/class/xoopstree.php'; // WfdownloadsXoopsTree class
-include_once WFDOWNLOADS_ROOT_PATH . '/class/formelementchoose.php'; // WfdownloadsFormElementChoose class
+//include_once WFDOWNLOADS_ROOT_PATH . '/class/formelementchoose.php'; // WfdownloadsFormElementChoose class
+include_once WFDOWNLOADS_ROOT_PATH . '/class/multicolumnsthemeform.php'; // WfdownloadsMulticolumnsThemeForm class
+
xoops_load('XoopsUserUtility');
// MyTextSanitizer object
$myts = MyTextSanitizer::getInstance();
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php 2014-02-14 04:30:50 UTC (rev 12309)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php 2014-02-14 18:11:08 UTC (rev 12310)
@@ -78,6 +78,7 @@
{
$dbupdater = new WfdownloadsDbupdater();
+ // update wfdownloads_downloads table
$download_fields = array(
"lid" => array("Type" => "int(11) unsigned NOT NULL auto_increment", "Default" => false),
"cid" => array("Type" => "int(5) unsigned NOT NULL default '0'", "Default" => true),
@@ -121,23 +122,101 @@
"notifypub" => array("Type" => "int(1) NOT NULL default '0'", "Default" => true),
"summary" => array("Type" => "text NOT NULL", "Default" => false),
"formulize_idreq" => array("Type" => "int(5) NOT NULL default '0'", "Default" => true),
- "screenshots" => array("Type" => "text NOT NULL default ''", "Default" => true)
+ // added 3.23
+ "screenshots" => array("Type" => "text NOT NULL default ''", "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),
+ "doimage" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true),
+ "dobr" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true)
);
//$renamed_fields = array(
// "old_name" => "new_name"
//);
- echo "<br /><B>Checking Download table</B><br />";
+ echo "<br /><b>Checking Download table</b><br />";
$download_handler = xoops_getmodulehandler('download', 'wfdownloads');
$download_table = new WfdownloadsTable("wfdownloads_downloads");
$fields = get_table_info($download_handler->table, $download_fields);
- // Check for renamed fields
+ // check for renamed fields
//rename_fields($download_table, $renamed_fields, $fields, $download_fields);
+ // check for updated fields
update_table($download_fields, $fields, $download_table);
if ($dbupdater->updateTable($download_table)) {
echo "Downloads table updated<br />";
}
unset($fields);
+ // update wfdownloads_mod table
+ $mod_fields = array(
+ "requestid" => array("Type" => "int(11) NOT NULL auto_increment", "Default" => false),
+ //
+ "modifysubmitter" => array("Type" => "int(11) NOT NULL default '0'", "Default" => true),
+ "requestdate" => array("Type" => "int(11) NOT NULL default '0'", "Default" => true),
+ //
+ "lid" => array("Type" => "int(11) unsigned NOT NULL default '0'", "Default" => true),
+ "cid" => array("Type" => "int(5) unsigned NOT NULL default '0'", "Default" => true),
+ "title" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
+ "url" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
+ "filename" => array("Type" => "varchar(150) NOT NULL default ''", "Default" => true),
+ "filetype" => array("Type" => "varchar(100) NOT NULL default ''", "Default" => true),
+ "homepage" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
+ "version" => array("Type" => "varchar(20) NOT NULL default ''", "Default" => true),
+ "size" => array("Type" => "int(8) NOT NULL default '0'", "Default" => true),
+ "platform" => array("Type" => "varchar(50) NOT NULL default ''", "Default" => true),
+ "screenshot" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
+ "screenshot2" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
+ "screenshot3" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
+ "screenshot4" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
+ "submitter" => array("Type" => "int(11) NOT NULL default '0'", "Default" => true),
+ "publisher" => array("Type" => "text NOT NULL", "Default" => false),
+ "status" => array("Type" => "tinyint(2) NOT NULL default '" . _WFDOWNLOADS_STATUS_WAITING . "'", "Default" => true),
+ "date" => array("Type" => "int(10) NOT NULL default '0'", "Default" => true),
+ "hits" => array("Type" => "int(11) unsigned NOT NULL default '0'", "Default" => true),
+ "rating" => array("Type" => "double(6,4) NOT NULL default '0.0000'", "Default" => true),
+ "votes" => array("Type" => "int(11) unsigned NOT NULL default '0'", "Default" => true),
+ "comments" => array("Type" => "int(11) unsigned NOT NULL default '0'", "Default" => true),
+ "license" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
+ "mirror" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
+ "price" => array("Type" => "varchar(10) NOT NULL default 'Free'", "Default" => true),
+ "paypalemail" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
+ "features" => array("Type" => "text NOT NULL", "Default" => false),
+ "requirements" => array("Type" => "text NOT NULL", "Default" => false),
+ "homepagetitle" => array("Type" => "varchar(255) NOT NULL default ''", "Default" => true),
+ "forumid" => array("Type" => "int(11) NOT NULL default '0'", "Default" => true),
+ "limitations" => array("Type" => "varchar(255) NOT NULL default '30 day trial'", "Default" => true),
+ "versiontypes" => array("Type" => "varchar(255) NOT NULL default 'None'", "Default" => true),
+ "dhistory" => array("Type" => "text NOT NULL", "Default" => false),
+ 'published' => array("Type" => "int(10) NOT NULL default '0'", "Default" => true),
+ "expired" => array("Type" => "int(10) NOT NULL default '0'", "Default" => true),
+ "updated" => array("Type" => "int(11) NOT NULL default '0'", "Default" => true),
+ "offline" => array("Type" => "tinyint(1) NOT NULL default '0'", "Default" => true),
+ "summary" => array("Type" => "text NOT NULL", "Default" => false),
+ "description" => array("Type" => "text NOT NULL", "Default" => false),
+ // ???
+ "formulize_idreq" => array("Type" => "int(5) NOT NULL default '0'", "Default" => true),
+ // added 3.23
+ "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),
+ "doimage" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true),
+ "dobr" => array("Type" => "tinyint(1) NOT NULL default '1'", "Default" => true)
+ );
+ //$renamed_fields = array(
+ // "old_name" => "new_name"
+ //);
+ echo "<br /><B>Checking Modified Downloads table</B><br />";
+ $mod_handler = xoops_getmodulehandler('modification', 'wfdownloads');
+ $mod_table = new WfdownloadsTable("wfdownloads_mod");
+ $fields = get_table_info($mod_handler->table, $mod_fields);
+ // check for renamed fields
+ //rename_fields($mod_table, $renamed_fields, $fields, $mod_fields);
+ // check for updated fields
+ update_table($mod_fields, $fields, $mod_table);
+ if ($dbupdater->updateTable($mod_table)) {
+ echo "Modified Downloads table updated <br />";
+ }
+ unset($fields);
+
}
// =========================================================================================
@@ -172,15 +251,15 @@
{
$dbupdater = new WfdownloadsDbupdater();
+ // create wfdownloads_meta table
if (!wfdownloads_tableExists('wfdownloads_meta')) {
- // Create table wfdownloads_meta
$table = new WfdownloadsTable('wfdownloads_meta');
$table->setStructure(
"CREATE TABLE %s (
- metakey varchar(50) NOT NULL default '',
- metavalue varchar(255) NOT NULL default '',
- PRIMARY KEY (metakey))
- ENGINE=MyISAM;"
+ metakey varchar(50) NOT NULL default '',
+ metavalue varchar(255) NOT NULL default '',
+ PRIMARY KEY (metakey))
+ ENGINE=MyISAM;"
);
$table->setData(sprintf("'version', %s", round($GLOBALS['xoopsModule']->getVar('version') / 100, 2)));
if ($dbupdater->updateTable($table)) {
@@ -188,48 +267,49 @@
}
}
+ // create wfdownloads_mirror table
if (!wfdownloads_tableExists('wfdownloads_mirrors')) {
- // Create table wfdownloads_mirror
$table = new WfdownloadsTable('wfdownloads_mirrors');
$table->setStructure(
"CREATE TABLE %s (
- mirror_id int(11) unsigned NOT NULL auto_increment,
- lid int(11) NOT NULL default '0',
- title varchar(255) NOT NULL default '',
- homeurl varchar(100) NOT NULL default '',
- location varchar(255) NOT NULL default '',
- continent varchar(255) NOT NULL default '',
- downurl varchar(255) NOT NULL default '',
- submit int(11) NOT NULL default '0',
- date int(11) NOT NULL default '0',
- uid int(10) NOT NULL default '0',
- PRIMARY KEY (mirror_id),
- KEY categoryid (lid))
- ENGINE=MyISAM;"
+ mirror_id int(11) unsigned NOT NULL auto_increment,
+ lid int(11) NOT NULL default '0',
+ title varchar(255) NOT NULL default '',
+ homeurl varchar(100) NOT NULL default '',
+ location varchar(255) NOT NULL default '',
+ continent varchar(255) NOT NULL default '',
+ downurl varchar(255) NOT NULL default '',
+ submit int(11) NOT NULL default '0',
+ date int(11) NOT NULL default '0',
+ uid int(10) NOT NULL default '0',
+ PRIMARY KEY (mirror_id),
+ KEY categoryid (lid))
+ ENGINE=MyISAM;"
);
if ($dbupdater->updateTable($...
[truncated message content] |