|
From: <luc...@us...> - 2013-09-25 17:04:44
|
Revision: 12094
http://sourceforge.net/p/xoops/svn/12094
Author: luciorota
Date: 2013-09-25 17:04:40 +0000 (Wed, 25 Sep 2013)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-25 01:50:08 UTC (rev 12093)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-25 17:04:40 UTC (rev 12094)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 Beta (2013-09-24)</u></b>
+<b><u>=> Version 3.23 Beta (2013-09-25)</u></b>
- module standardization: header.php, admin/admin_header.php, xoops_version.php
- module standardization: standardize directories/files names/structures
- module standardization: standardize code headers
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-09-25 01:50:08 UTC (rev 12093)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-09-25 17:04:40 UTC (rev 12094)
@@ -32,33 +32,6 @@
-function wfdownloads_cleanVars(&$global, $key, $default = '', $type = 'int') {
- switch ($type) {
- case 'array':
- $ret = (isset($global[$key]) && is_array($global[$key])) ? $global[$key] : $default;
- break;
- case 'date':
- $ret = (isset($global[$key])) ? strtotime($global[$key]) : $default;
- break;
- case 'formatdate':
- $t = strptime( $global[$key] , _MI_REGPRES_SHORTDATESTRING_STRPTIME );
- $ret = mktime($t['tm_sec'], $t['tm_min'], $t['tm_hour'], $t['tm_mon']+1, $t['tm_mday'], $t['tm_year'] + 1900);
- break;
- case 'string':
- $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_SANITIZE_MAGIC_QUOTES) : $default;
- break;
- case 'int': default:
- $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_SANITIZE_NUMBER_INT) : $default;
- break;
- }
- if ($ret === false) {
- return $default;
- }
- return $ret;
-}
-
-
-
/**
* This function transforms a numerical size (like 2048) to a letteral size (like 2MB)
* @param integer $bytes numerical size
@@ -146,12 +119,12 @@
// Just to add spacing to the list, to better show the directory tree.
if(is_dir("$path/$file")) {
// Its a directory, so we need to keep reading down...
- $ret[] = "<strong>$spaces $file</strong>";
+ $ret[] = "<strong>{$spaces $file}</strong>";
$ret = array_merge($ret, wfdownloads_getDir($path . DIRECTORY_SEPARATOR . $file, ($level+1)));
// Re-call this same function but on a new directory.
// this is what makes function recursive.
} else {
- $ret[] = "$spaces $file";
+ $ret[] = "{$spaces $file}";
// Just print out the filename
}
}
@@ -211,12 +184,11 @@
@mkdir($destination);
while(false !== ( $file = readdir($dirHandler)) ) {
if (( $file != '.' ) && ( $file != '..' )) {
- if ( is_dir($source . '/' . $file) ) {
- if (!wfdownloads_copyDir($source . '/' . $file, $destination . '/' . $file))
+ if ( is_dir("{$source}/{$file}") ) {
+ if (!wfdownloads_copyDir("{$source}/{$file}", "{$destination}/{$file}"))
return false;
- }
- else {
- if (!copy($source . '/' . $file, $destination . '/' . $file))
+ } else {
+ if (!copy("{$source}/{$file}", "{$destination}/{$file}"))
return false;
}
}
@@ -237,7 +209,7 @@
if (!is_dir($dir)) return unlink($dir);
foreach (scandir($dir) as $item) {
if ($item == '.' || $item == '..') continue;
- if (!wfdownloads_delDir($dir . '/' . $item)) return false;
+ if (!wfdownloads_delDir("{$dir}/{$item}")) return false;
}
} else {
// NOP
@@ -402,7 +374,7 @@
if (!$withLink) {
return $wfdownloadsModuleName;
} else {
- return '<a href="' . WFDOWNLOADS_URL . '/">' . $wfdownloadsModuleName . '</a>';
+ return '<a href="' . WFDOWNLOADS_URL . '/">{$wfdownloadsModuleName}</a>';
}
}
@@ -491,27 +463,6 @@
-function wfdownloads_getHandler($name, $optional = false )
-{
- static $handlers;
- $name = strtolower(trim($name));
- if (!isset($handlers[$name])) {
- if ( file_exists( $hnd_file = WFDOWNLOADS_ROOT_PATH . '/class/' . $name . '.php' ) ) {
- require_once $hnd_file;
- }
- $class = "Wfdownloads" . ucfirst($name).'Handler';
- if (class_exists($class)) {
- $handlers[$name] = new $class($GLOBALS['xoopsDB']);
- }
- }
- if (!isset($handlers[$name]) && !$optional ) {
- trigger_error('Class <b>' . $class . '</b> does not exist<br />Handler Name: '.$name . ' | Module path : ' . WFDOWNLOADS_ROOT_PATH . '/', E_USER_ERROR);
- }
- return isset($handlers[$name]) ? $handlers[$name] : false;
-}
-
-
-
function wfdownloads_setCookieVar($name, $value, $time=0)
{
if ($time == 0) {
@@ -566,8 +517,8 @@
function wfdownloads_formatErrors($errors=array())
{
$ret = '';
- foreach ($errors as $key=>$value) {
- $ret .= "<br /> - " . $value;
+ foreach ($errors as $key => $value) {
+ $ret .= "<br /> - {$value}";
}
return $ret;
@@ -657,9 +608,9 @@
$toolbar = "[ ";
if ($submissions == 1) {
$category_suffix = !empty($_GET['cid']) ? "?cid=" . (int)$_GET['cid']: ""; //Added by Lankford
- $toolbar .= "<a href='submit.php$category_suffix'>" . _MD_WFDOWNLOADS_SUBMITDOWNLOAD . "</a> | ";
+ $toolbar .= "<a href='submit.php{$category_suffix}'>" . _MD_WFDOWNLOADS_SUBMITDOWNLOAD . "</a> | ";
}
- $toolbar .= "<a href='newlist.php'>" . _MD_WFDOWNLOADS_LATESTLIST . "</a>";
+ $toolbar.= "<a href='newlist.php'>" . _MD_WFDOWNLOADS_LATESTLIST . "</a>";
$toolbar.= " | ";
$toolbar.= "<a href='topten.php?list=hit'>" . _MD_WFDOWNLOADS_POPULARITY . "</a>";
if ($wfdownloads->getConfig('enable_ratings')) {
@@ -767,7 +718,7 @@
}
}
}
- $icons = $new . " " . $pop;
+ $icons = "{$new} {$pop}";
return $icons;
}
@@ -1279,25 +1230,25 @@
-function wfdownloads_getForum($forumId)
+function wfdownloads_getForum($selectedForumId)
{
global $xoopsDB;
- $forumId = (int)$forumId;
+ $selectedForumId = (int)$selectedForumId;
echo "<select name='forumid'>";
echo "<option value='0'>----------------------</option>";
$result = $xoopsDB->query("SELECT forum_name, forum_id FROM " . $xoopsDB->prefix("bb_forums") . " ORDER BY forum_id");
- while (list($forum_name, $forum_id) = $xoopsDB->fetchRow($result)) {
- if ($forum_id == $forumId) {
- $opt_selected = "selected='selected'";
+ while (list($forumName, $forumId) = $xoopsDB->fetchRow($result)) {
+ if ($forumId == $selectedForumId) {
+ $optionSelected = "selected='selected'";
} else {
- $opt_selected = "";
+ $optionSelected = "";
}
- echo "<option value='" . $forum_id . "' $opt_selected>" . $forum_name . "</option>";
+ echo "<option value='{$forumId}' {$optionSelected}>{$forumName}</option>";
}
echo "</select></div>";
- return $forumId;
+ return $selectedForumId;
}
@@ -1388,7 +1339,7 @@
$total_length += $content_length;
}
// if the maximum length is reached, get off the loop
- if($total_length>= $length) {
+ if($total_length >= $length) {
break;
}
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-25 01:50:08 UTC (rev 12093)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-25 17:04:40 UTC (rev 12094)
@@ -47,9 +47,9 @@
$modversion['onUpdate'] = 'include/module.php';
$modversion['onUninstall'] = 'include/module.php';
-$modversion['date'] = '2013-09-24';
-$modversion['release_date'] = '2013/09/24';
-$modversion['releasedate'] = '2013-09-24';
+$modversion['date'] = '2013-09-25';
+$modversion['release_date'] = '2013/09/25';
+$modversion['releasedate'] = '2013-09-25';
$modversion['status'] = 'BETA 1';
$modversion['teammembers'] = "Bender, David, FrankBlack, Xpider, M0nty, Mithrandir, Marcan, felix[fx2024], Sudhaker, Jegelstaff";
|