From: shizuki Date: Sat, 28 Feb 2009 15:20:07 +0000 (+0000) Subject: Fix 6 undefined variables. X-Git-Tag: release-3-41@1002~28 X-Git-Url: http://git.osdn.net/view?p=nucleus-jp%2Fnucleus-jp-ancient.git;a=commitdiff_plain;h=a3c8c63550c183f4978ba8a674890bd0cd585fab Fix 6 undefined variables. git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk/utf8@962 1ca29b6e-896d-4ea0-84a5-967f57386b96 --- diff --git a/nucleus/libs/ADMIN.php b/nucleus/libs/ADMIN.php index 2ed2514..ff53f1b 100755 --- a/nucleus/libs/ADMIN.php +++ b/nucleus/libs/ADMIN.php @@ -335,7 +335,7 @@ class ADMIN { $amount = intPostVar('amount'); else { $amount = intval($CONF['DefaultListSize']); - if ($amount < 1) + if ($amount < 1) $amount = 10; } @@ -902,7 +902,7 @@ class ADMIN { $amount = intPostVar('amount'); else { $amount = intval($CONF['DefaultListSize']); - if ($amount < 1) + if ($amount < 1) $amount = 10; } @@ -957,7 +957,7 @@ class ADMIN { $amount = intPostVar('amount'); else { $amount = intval($CONF['DefaultListSize']); - if ($amount < 1) + if ($amount < 1) $amount = 10; } @@ -1001,7 +1001,7 @@ class ADMIN { $amount = intPostVar('amount'); else { $amount = intval($CONF['DefaultListSize']); - if ($amount < 1) + if ($amount < 1) $amount = 10; } @@ -1057,7 +1057,7 @@ class ADMIN { $amount = intPostVar('amount'); else { $amount = intval($CONF['DefaultListSize']); - if ($amount < 1) + if ($amount < 1) $amount = 10; } @@ -1225,7 +1225,7 @@ class ADMIN { $wasdraft = 0; $publish = 0; $timestamp = 0; - break; + break; case 'edit': default: $publish = 1; @@ -1520,7 +1520,7 @@ class ADMIN { } if ($result['status'] == 'newcategory') { // $distURI = ($nextAction == 'sendping') ? $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=' -// . $nextAction . '&blogid=' . intval($blogid)) : +// . $nextAction . '&blogid=' . intval($blogid)) : // ''; $distURI = $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=' . $nextAction . '&blogid=' . intval($blogid)); $this->action_categoryedit($result['catid'], $blogid, $distURI); @@ -2101,7 +2101,7 @@ class ADMIN { $mem->setCanLogin($canlogin); } - $autosave = postVar ('autosave'); + $autosave = postVar ('autosave'); $mem->setAutosave($autosave); $mem->write(); @@ -4006,7 +4006,7 @@ selector(); $this->_templateEditRow($template, $pfdesc, $pffield, '',++$tab,0); } } -?> +?> @@ -4028,6 +4028,7 @@ selector(); */ function _templateEditRow(&$template, $description, $name, $help = '', $tabindex = 0, $big = 0) { static $count = 1; + if (!isset($template[$name])) $template[$name] = ''; ?> @@ -4914,14 +4915,14 @@ selector(); input_yesno('DebugVars',$CONF['DebugVars'],10078); - + ?> - ' . _ADMIN_SYSTEMOVERVIEW_MODULES . "\n"; echo "\t\n"; echo "\t\t" . 'mod_rewrite' . "\n"; - $modrewrite = (strstr($im, 'mod_rewrite') != '') ? + $modrewrite = (strstr($im, 'mod_rewrite') != '') ? _ADMIN_SYSTEMOVERVIEW_ENABLE : _ADMIN_SYSTEMOVERVIEW_DISABLE; echo "\t\t" . '' . $modrewrite . "\n"; echo "\t\n"; echo "\n"; - // Information about the used Nucleus CMS + // Information about the used Nucleus CMS echo '

' . _ADMIN_SYSTEMOVERVIEW_NUCLEUSSYSTEM . "

\n"; global $nucleus; $nv = getNucleusVersion() / 100 . '(' . $nucleus['version'] . ')'; @@ -5239,7 +5240,7 @@ selector(); else { echo _ADMIN_SYSTEMOVERVIEW_NOT_ADMIN; } - + $this->pagefoot(); } diff --git a/nucleus/libs/ITEMACTIONS.php b/nucleus/libs/ITEMACTIONS.php index b09a4ca..82f7470 100644 --- a/nucleus/libs/ITEMACTIONS.php +++ b/nucleus/libs/ITEMACTIONS.php @@ -58,7 +58,7 @@ class ITEMACTIONS extends BaseActions { /** * Returns an array with the actions that are defined - * in the ITEMACTIONS class + * in the ITEMACTIONS class */ function getDefinedActions() { return array( @@ -115,23 +115,23 @@ class ITEMACTIONS extends BaseActions { function setLastVisit($lastVisit) { $this->lastVisit = $lastVisit; } - + function setParser(&$parser) { $this->parser =& $parser; } - + function setCurrentItem(&$item) { $this->currentItem =& $item; } - + function setBlog(&$blog) { $this->blog =& $blog; } - + function setTemplate($template) { $this->template =& $template; } - + function setShowComments($val) { $this->showComments = $val; } @@ -145,21 +145,21 @@ class ITEMACTIONS extends BaseActions { function parse_blogid() { echo $this->blog->getID(); } - + /** * Parse templatevar body */ function parse_body() { $this->highlightAndParse($this->currentItem->body); } - + /** * Parse templatevar more */ function parse_more() { $this->highlightAndParse($this->currentItem->more); } - + /** * Parse templatevar itemid */ @@ -169,32 +169,32 @@ class ITEMACTIONS extends BaseActions { /** * Parse templatevar category - */ + */ function parse_category() { echo $this->currentItem->category; } - + /** * Parse templatevar categorylink */ function parse_categorylink() { echo createLink('category', array('catid' => $this->currentItem->catid, 'name' => $this->currentItem->category)); } - + /** * Parse templatevar catid */ function parse_catid() { echo $this->currentItem->catid; } - + /** * Parse templatevar authorid */ function parse_authorid() { echo $this->currentItem->authorid; } - + /** * Parse templatevar authorlink */ @@ -208,14 +208,14 @@ class ITEMACTIONS extends BaseActions { ) ); } - + /** * Parse templatevar query */ function parse_query() { echo $this->strHighlight; } - + /** * Parse templatevar itemlink */ @@ -230,21 +230,21 @@ class ITEMACTIONS extends BaseActions { ) ); } - + /** * Parse templatevar blogurl */ function parse_blogurl() { echo $this->blog->getURL(); } - + /** * Parse templatevar closed */ function parse_closed() { echo $this->currentItem->closed; } - + /** * Parse templatevar relevance */ @@ -254,8 +254,8 @@ class ITEMACTIONS extends BaseActions { /** * Parse templatevar title - * - * @param string $format defines in which format the title is shown + * + * @param string $format defines in which format the title is shown */ function parse_title($format = '') { if (is_array($this->currentItem)) { @@ -363,19 +363,21 @@ class ITEMACTIONS extends BaseActions { /** * Parse templatevar date - * - * @param format optional strftime format + * + * @param format optional strftime format */ function parse_date($format = '') { + if (!isset($this->template['FORMAT_DATE'])) $this->template['FORMAT_DATE'] = ''; echo formatDate($format, $this->currentItem->timestamp, $this->template['FORMAT_DATE'], $this->blog); } /** * Parse templatevar time - * + * * @param format optional strftime format */ function parse_time($format = '') { + if (!isset($this->template['FORMAT_TIME'])) $this->template['FORMAT_TIME'] = ''; echo strftime($format ? $format : $this->template['FORMAT_TIME'],$this->currentItem->timestamp); } diff --git a/nucleus/libs/PAGEFACTORY.php b/nucleus/libs/PAGEFACTORY.php index 4275143..c071cfc 100755 --- a/nucleus/libs/PAGEFACTORY.php +++ b/nucleus/libs/PAGEFACTORY.php @@ -275,10 +275,12 @@ class PAGEFACTORY extends BaseActions { } function parse_contents($which) { + if (!isset($this->variables[$which])) $this->variables[$which] = ''; echo htmlspecialchars($this->variables[$which],ENT_QUOTES); } function parse_checkedonval($value, $name) { + if (!isset($this->variables[$name])) $this->variables[$name] = ''; if ($this->variables[$name] == $value) echo 'checked="checked"'; } diff --git a/nucleus/libs/TEMPLATE.php b/nucleus/libs/TEMPLATE.php index 3cd32e2..7f972d8 100755 --- a/nucleus/libs/TEMPLATE.php +++ b/nucleus/libs/TEMPLATE.php @@ -143,7 +143,7 @@ class TEMPLATE { $template[$obj->tpartname] = $obj->tcontent; // set locale according to template: - if ($template['LOCALE']) + if (isset($template['LOCALE'])) setlocale(LC_TIME,$template['LOCALE']); else setlocale(LC_TIME,'');