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); |