• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

XOOPS Cube Legacy base repository


Commit MetaInfo

Revisionb031b35ad9683e6211895229475de9e3bf143b2c (tree)
Time2011-11-16 22:04:56
Authornbuy <nbuy@704c...>
Commiternbuy

Log Message

single quote using for speedup

git-svn-id: https://xoopscube.svn.sourceforge.net/svnroot/xoopscube/Package_Legacy/trunk@1051 704cf05f-ae62-4b0e-a484-234ee0250e75

Change Summary

Incremental Difference

--- a/html/include/functions.php
+++ b/html/include/functions.php
@@ -68,11 +68,11 @@ function xoops_error($message, $title='', $style='errorMsg')
6868 $renderTarget =& $renderSystem->createRenderTarget('main');
6969
7070 $renderTarget->setAttribute('legacy_module', 'legacy');
71- $renderTarget->setTemplateName("legacy_xoops_error.html");
71+ $renderTarget->setTemplateName('legacy_xoops_error.html');
7272
73- $renderTarget->setAttribute("style", $style);
74- $renderTarget->setAttribute("title", $title);
75- $renderTarget->setAttribute("message", $message);
73+ $renderTarget->setAttribute('style', $style);
74+ $renderTarget->setAttribute('title', $title);
75+ $renderTarget->setAttribute('message', $message);
7676
7777 $renderSystem->render($renderTarget);
7878
@@ -90,10 +90,10 @@ function xoops_result($message, $title='')
9090 $renderTarget =& $renderSystem->createRenderTarget('main');
9191
9292 $renderTarget->setAttribute('legacy_module', 'legacy');
93- $renderTarget->setTemplateName("legacy_xoops_result.html");
93+ $renderTarget->setTemplateName('legacy_xoops_result.html');
9494
95- $renderTarget->setAttribute("title", $title);
96- $renderTarget->setAttribute("message", $message);
95+ $renderTarget->setAttribute('title', $title);
96+ $renderTarget->setAttribute('message', $message);
9797
9898 $renderSystem->render($renderTarget);
9999
@@ -119,14 +119,14 @@ function xoops_confirm($hiddens, $action, $message, $submit = '', $addToken = tr
119119 $renderTarget =& $renderSystem->createRenderTarget('main');
120120
121121 $renderTarget->setAttribute('legacy_module', 'legacy');
122- $renderTarget->setTemplateName("legacy_xoops_confirm.html");
122+ $renderTarget->setTemplateName('legacy_xoops_confirm.html');
123123
124- $renderTarget->setAttribute("action", $action);
125- $renderTarget->setAttribute("message", $message);
126- $renderTarget->setAttribute("hiddens", $hiddens);
127- $renderTarget->setAttribute("submit", $submit);
128- $renderTarget->setAttribute("tokenName", $token->getTokenName());
129- $renderTarget->setAttribute("tokenValue", $token->getTokenValue());
124+ $renderTarget->setAttribute('action', $action);
125+ $renderTarget->setAttribute('message', $message);
126+ $renderTarget->setAttribute('hiddens', $hiddens);
127+ $renderTarget->setAttribute('submit', $submit);
128+ $renderTarget->setAttribute('tokenName', $token->getTokenName());
129+ $renderTarget->setAttribute('tokenValue', $token->getTokenValue());
130130
131131 $renderSystem->render($renderTarget);
132132
@@ -161,12 +161,12 @@ function xoops_refcheck($docheck=1)
161161 return true;
162162 }
163163
164-function xoops_getUserTimestamp($time, $timeoffset="")
164+function xoops_getUserTimestamp($time, $timeoffset='')
165165 {
166166 global $xoopsConfig, $xoopsUser;
167167 if ($timeoffset == '') {
168168 if ($xoopsUser) {
169- $timeoffset = $xoopsUser->getVar("timezone_offset");
169+ $timeoffset = $xoopsUser->getVar('timezone_offset', 'n');
170170 } else {
171171 $timeoffset = $xoopsConfig['default_TZ'];
172172 }
@@ -178,7 +178,7 @@ function xoops_getUserTimestamp($time, $timeoffset="")
178178 /*
179179 * Function to display formatted times in user timezone
180180 */
181-function formatTimestamp($time, $format="l", $timeoffset="")
181+function formatTimestamp($time, $format='l', $timeoffset='')
182182 {
183183 global $xoopsConfig, $xoopsUser;
184184 $usertimestamp = xoops_getUserTimestamp($time, $timeoffset);
@@ -188,13 +188,13 @@ function formatTimestamp($time, $format="l", $timeoffset="")
188188 /*
189189 * Function to display formatted times in user timezone
190190 */
191-function formatTimestampGMT($time, $format="l", $timeoffset="")
191+function formatTimestampGMT($time, $format='l', $timeoffset='')
192192 {
193193 global $xoopsConfig, $xoopsUser;
194194
195195 if ($timeoffset == '') {
196196 if ($xoopsUser) {
197- $timeoffset = $xoopsUser->getVar("timezone_offset");
197+ $timeoffset = $xoopsUser->getVar('timezone_offset', 'n');
198198 } else {
199199 $timeoffset = $xoopsConfig['default_TZ'];
200200 }
@@ -204,7 +204,7 @@ function formatTimestampGMT($time, $format="l", $timeoffset="")
204204 return _formatTimeStamp($usertimestamp, $format);
205205 }
206206
207-function _formatTimeStamp($time, $format="l")
207+function _formatTimeStamp($time, $format='l')
208208 {
209209 switch (strtolower($format)) {
210210 case 's':
@@ -214,10 +214,10 @@ function _formatTimeStamp($time, $format="l")
214214 $datestring = _MEDIUMDATESTRING;
215215 break;
216216 case 'mysql':
217- $datestring = "Y-m-d H:i:s";
217+ $datestring = 'Y-m-d H:i:s';
218218 break;
219219 case 'rss':
220- $datestring = "r";
220+ $datestring = 'r';
221221 break;
222222 case 'l':
223223 $datestring = _DATESTRING;
@@ -248,13 +248,13 @@ function userTimeToServerTime($timestamp, $userTZ=null)
248248
249249 function xoops_makepass() {
250250 $makepass = '';
251- $syllables = array("er","in","tia","wol","fe","pre","vet","jo","nes","al","len","son","cha","ir","ler","bo","ok","tio","nar","sim","ple","bla","ten","toe","cho","co","lat","spe","ak","er","po","co","lor","pen","cil","li","ght","wh","at","the","he","ck","is","mam","bo","no","fi","ve","any","way","pol","iti","cs","ra","dio","sou","rce","sea","rch","pa","per","com","bo","sp","eak","st","fi","rst","gr","oup","boy","ea","gle","tr","ail","bi","ble","brb","pri","dee","kay","en","be","se");
251+ $syllables = array('er','in','tia','wol','fe','pre','vet','jo','nes','al','len','son','cha','ir','ler','bo','ok','tio','nar','sim','ple','bla','ten','toe','cho','co','lat','spe','ak','er','po','co','lor','pen','cil','li','ght','wh','at','the','he','ck','is','mam','bo','no','fi','ve','any','way','pol','iti','cs','ra','dio','sou','rce','sea','rch','pa','per','com','bo','sp','eak','st','fi','rst','gr','oup','boy','ea','gle','tr','ail','bi','ble','brb','pri','dee','kay','en','be','se');
252252 srand((double)microtime()*1000000);
253253 for ($count = 1; $count <= 4; $count++) {
254254 if (rand()%10 == 1) {
255- $makepass .= sprintf("%0.0f",(rand()%50)+1);
255+ $makepass .= sprintf('%0.0f',(rand()%50)+1);
256256 } else {
257- $makepass .= sprintf("%s",$syllables[rand()%62]);
257+ $makepass .= sprintf('%s',$syllables[rand()%62]);
258258 }
259259 }
260260 return $makepass;
@@ -265,14 +265,14 @@ function xoops_makepass() {
265265 */
266266 function OpenWaitBox()
267267 {
268- echo "<div id='waitDiv' style='position:absolute;left:40%;top:50%;visibility:hidden;text-align: center;'>
269- <table cellpadding='6' border='2' class='bg2'>
268+ echo '<div id="waitDiv" style="position:absolute;left:40%;top:50%;visibility:hidden;text-align: center;">
269+ <table cellpadding="6" border="2" class="bg2">
270270 <tr>
271- <td align='center'><b><big>" ._FETCHING."</big></b><br /><img src='".XOOPS_URL."/images/await.gif' alt='' /><br />" ._PLEASEWAIT."</td>
271+ <td align="center"><b><big>' ._FETCHING.'</big></b><br /><img src="'.XOOPS_URL.'/images/await.gif" alt="" /><br />' ._PLEASEWAIT.'</td>
272272 </tr>
273273 </table>
274274 </div>
275- <script type='text/javascript'>
275+ <script type="text/javascript">
276276 <!--//
277277 var DHTML = (document.getElementById || document.all || document.layers);
278278 function ap_getObj(name) {
@@ -289,7 +289,7 @@ function OpenWaitBox()
289289 return;
290290 }
291291 var x = ap_getObj(div);
292- x.visibility = (flag) ? 'visible' : 'hidden';
292+ x.visibility = (flag) ? "visible" : "hidden";
293293 if (!document.getElementById) {
294294 if (document.layers) {
295295 x.left=280/2;
@@ -297,29 +297,29 @@ function OpenWaitBox()
297297 }
298298 return true;
299299 }
300- ap_showWaitMessage('waitDiv', 1);
300+ ap_showWaitMessage("waitDiv", 1);
301301 //-->
302- </script>";
302+ </script>';
303303 }
304304
305305 function CloseWaitBox()
306306 {
307- echo "<script type='text/javascript'>
307+ echo '<script type="text/javascript">
308308 <!--//
309- ap_showWaitMessage('waitDiv', 0);
309+ ap_showWaitMessage("waitDiv", 0);
310310 //-->
311311 </script>
312- ";
312+ ';
313313 }
314314
315315 function checkEmail($email,$antispam = false)
316316 {
317- if (!$email || !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i",$email)){
317+ if (!$email || !preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i',$email)){
318318 return false;
319319 }
320320 if ($antispam) {
321- $email = str_replace("@", " at ", $email);
322- $email = str_replace(".", " dot ", $email);
321+ $email = str_replace('@', ' at ', $email);
322+ $email = str_replace('.', ' dot ', $email);
323323 return $email;
324324 } else {
325325 return true;
@@ -330,7 +330,7 @@ function formatURL($url)
330330 {
331331 $url = trim($url);
332332 if ($url != '') {
333- if ((!preg_match("/^http[s]*:\/\//i", $url)) && (!preg_match("/^ftp*:\/\//i", $url)) && (!preg_match("/^ed2k*:\/\//i", $url)) ) {
333+ if ((!preg_match('/^http[s]*:\/\//i', $url)) && (!preg_match('/^ftp*:\/\//i', $url)) && (!preg_match('/^ed2k*:\/\//i', $url)) ) {
334334 $url = 'http://'.$url;
335335 }
336336 }
@@ -404,7 +404,7 @@ function xoops_getbanner()
404404 function redirect_header($url, $time = 3, $message = '', $addredirect = true)
405405 {
406406 global $xoopsConfig, $xoopsRequestUri;
407- if (preg_match("/[\\0-\\31]/", $url) || preg_match("/^(javascript|vbscript|about):/i", $url)) {
407+ if (preg_match('/[\\0-\\31]/', $url) || preg_match('/^(javascript|vbscript|about):/i', $url)) {
408408 $url = XOOPS_URL;
409409 }
410410 if (!defined('XOOPS_CPFUNC_LOADED')) {
@@ -532,7 +532,7 @@ function xoops_getcss($theme = '')
532532 $uagent = xoops_getenv('HTTP_USER_AGENT');
533533 if (stristr($uagent, 'mac')) {
534534 $str_css = 'styleMAC.css';
535- } elseif (preg_match("/MSIE ([0-9]\.[0-9]{1,2})/i", $uagent)) {
535+ } elseif (preg_match('/MSIE ([0-9]\.[0-9]{1,2})/i', $uagent)) {
536536 $str_css = 'style.css';
537537 } else {
538538 $str_css = 'styleNN.css';
@@ -551,10 +551,10 @@ function &getMailer()
551551 {
552552 global $xoopsConfig;
553553 $ret = null;
554- require_once XOOPS_ROOT_PATH."/class/xoopsmailer.php";
555- if ( file_exists(XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/xoopsmailerlocal.php") ) {
556- require_once XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/xoopsmailerlocal.php";
557- if ( XC_CLASS_EXISTS("XoopsMailerLocal") ) {
554+ require_once XOOPS_ROOT_PATH.'/class/xoopsmailer.php';
555+ if ( file_exists(XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/xoopsmailerlocal.php') ) {
556+ require_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/xoopsmailerlocal.php';
557+ if ( XC_CLASS_EXISTS('XoopsMailerLocal') ) {
558558 $ret = new XoopsMailerLocal();
559559 return $ret;
560560 }
@@ -602,7 +602,7 @@ function &xoops_getmodulehandler($name = null, $module_dir = null, $optional = f
602602 if (!isset($module_dir)) {
603603 //if a module is loaded
604604 if (is_object($GLOBALS['xoopsModule'])) {
605- $module_dir = $GLOBALS['xoopsModule']->getVar('dirname');
605+ $module_dir = $GLOBALS['xoopsModule']->getVar('dirname', 'n');
606606 } else {
607607 trigger_error('No Module is loaded', E_USER_ERROR);
608608 }
@@ -646,9 +646,9 @@ function xoops_getrank($rank_id =0, $posts = 0)
646646 $myts =& MyTextSanitizer::getInstance();
647647 $rank_id = (int)$rank_id;
648648 if ($rank_id != 0) {
649- $sql = "SELECT rank_title AS title, rank_image AS image, rank_id AS id FROM ".$db->prefix('ranks')." WHERE rank_id = ".$rank_id;
649+ $sql = 'SELECT rank_title AS title, rank_image AS image, rank_id AS id FROM '.$db->prefix('ranks').' WHERE rank_id = '.$rank_id;
650650 } else {
651- $sql = "SELECT rank_title AS title, rank_image AS image, rank_id AS id FROM ".$db->prefix('ranks')." WHERE rank_min <= ".$posts." AND rank_max >= ".$posts." AND rank_special = 0";
651+ $sql = 'SELECT rank_title AS title, rank_image AS image, rank_id AS id FROM '.$db->prefix('ranks').' WHERE rank_min <= '.$posts.' AND rank_max >= '.$posts.' AND rank_special = 0';
652652 }
653653 $rank = $db->fetchArray($db->query($sql));
654654 $rank['title'] = $myts->makeTboxData4Show($rank['title']);
@@ -742,7 +742,7 @@ function xoops_comment_delete($module_id, $item_id)
742742 for ($i = 0; $i < $count; $i++) {
743743 if (false != $comment_handler->delete($comments[$i])) {
744744 // store poster ID and deleted post number into array for later use
745- $poster_id = $comments[$i]->getVar('com_uid');
745+ $poster_id = $comments[$i]->getVar('com_uid', 'n');
746746 if ($poster_id != 0) {
747747 $deleted_num[$poster_id] = !isset($deleted_num[$poster_id]) ? 1 : ($deleted_num[$poster_id] + 1);
748748 }
@@ -753,7 +753,7 @@ function xoops_comment_delete($module_id, $item_id)
753753 // update user posts
754754 $com_poster = $member_handler->getUser($user_id);
755755 if (is_object($com_poster)) {
756- $member_handler->updateUserByField($com_poster, 'posts', $com_poster->getVar('posts') - $post_num);
756+ $member_handler->updateUserByField($com_poster, 'posts', $com_poster->getVar('posts', 'n') - $post_num);
757757 }
758758 }
759759 return true;