OSDN Git Service

Fix Undefined variable
authorshizuki17xx <shizuki17xx"@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Wed, 4 Mar 2009 17:54:34 +0000 (17:54 +0000)
committershizuki17xx <shizuki17xx"@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Wed, 4 Mar 2009 17:54:34 +0000 (17:54 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk@964 1ca29b6e-896d-4ea0-84a5-967f57386b96

utf8/nucleus/libs/BLOG.php

index aef93a5..6948fe9 100755 (executable)
@@ -553,8 +553,10 @@ class BLOG {
        function showArchiveList($template, $mode = 'month', $limit = 0) {
                global $CONF, $catid, $manager;
 
-               if ($catid)
+               $linkparams = array();
+               if ($catid) {
                        $linkparams = array('catid' => $catid);
+               }
 
                $template =& $manager->getTemplate($template);
                $data['blogid'] = $this->getID();
@@ -671,7 +673,7 @@ class BLOG {
                                        'listitem' => &$data
                                )
                        );
-                       
+
                        echo TEMPLATE::fill((isset($template['CATLIST_LISTITEM']) ? $template['CATLIST_LISTITEM'] : null), $data);
                        //$temp = TEMPLATE::fill((isset($template['CATLIST_LISTITEM']) ? $template['CATLIST_LISTITEM'] : null), $data);
                        //echo strftime($temp, $current->itime);
@@ -687,15 +689,15 @@ class BLOG {
                                                                'self' => $CONF['Self']
                                                        ));
        }
-       
+
        /**
          * Shows a list of all blogs in the system using a given template
          * ordered by  number, name, shortname or description
-         * in ascending or descending order        
+         * in ascending or descending order
          */
        function showBlogList($template, $bnametype, $orderby, $direction) {
                global $CONF, $manager;
-               
+
                switch ($orderby) {
                        case 'number':
                                $orderby='bnumber';
@@ -713,7 +715,7 @@ class BLOG {
                                $orderby='bnumber';
                                break;
                }
-               
+
                $direction=strtolower($direction);
                switch ($direction) {
                        case 'asc':
@@ -726,49 +728,49 @@ class BLOG {
                                $direction='ASC';
                                break;
                }
-               
+
                $template =& $manager->getTemplate($template);
-               
+
                echo TEMPLATE::fill((isset($template['BLOGLIST_HEADER']) ? $template['BLOGLIST_HEADER'] : null),
                                                        array(
                                                                'sitename' => $CONF['SiteName'],
                                                                'siteurl' => $CONF['IndexURL']
                                                        ));
-               
+
                $query = 'SELECT bnumber, bname, bshortname, bdesc, burl FROM '.sql_table('blog').' ORDER BY '.$orderby.' '.$direction;
                $res = sql_query($query);
-               
+
                while ($data = mysql_fetch_assoc($res)) {
-               
+
                        $list = array();
-               
+
 //                     $list['bloglink'] = createLink('blog', array('blogid' => $data['bnumber']));
                        $list['bloglink'] = createBlogidLink($data['bnumber']);
-               
+
                        $list['blogdesc'] = $data['bdesc'];
-                       
+
                        $list['blogurl'] = $data['burl'];
-                       
+
                        if ($bnametype=='shortname') {
                                $list['blogname'] = $data['bshortname'];
                        }
                        else { // all other cases
                                $list['blogname'] = $data['bname'];
                        }
-                       
+
                        $manager->notify(
                                'PreBlogListItem',
                                array(
                                        'listitem' => &$list
                                )
                        );
-                       
+
                        echo TEMPLATE::fill((isset($template['BLOGLIST_LISTITEM']) ? $template['BLOGLIST_LISTITEM'] : null), $list);
-                       
+
                }
-               
+
                mysql_free_result($res);
-               
+
                echo TEMPLATE::fill((isset($template['BLOGLIST_FOOTER']) ? $template['BLOGLIST_FOOTER'] : null),
                                                        array(
                                                                'sitename' => $CONF['SiteName'],
@@ -1156,8 +1158,8 @@ class BLOG {
                                // clear all expired future posts
                                sql_query("UPDATE " . sql_table('item') . " SET iposted='1' WHERE iblog=" . $blogid . " AND itime<NOW()");
 
-                               // check to see any pending future post, clear the flag is none 
-                               $result = sql_query("SELECT * FROM " . sql_table('item') 
+                               // check to see any pending future post, clear the flag is none
+                               $result = sql_query("SELECT * FROM " . sql_table('item')
                                          . " WHERE iposted=0 AND iblog=" . $blogid);
                                if (mysql_num_rows($result) == 0) {
                                        $this->clearFuturePost();
@@ -1165,14 +1167,14 @@ class BLOG {
                        }
                }
        }
-       
+
        /**
         * Shows the given list of items for this blog
         *
         * @param $itemarray
         *              array of item numbers to be displayed
         * @param $template
-        *              String representing the template _NAME_ (!)      
+        *              String representing the template _NAME_ (!)
         * @param $highlight
         *              contains a query that should be highlighted
         * @param $comments
@@ -1188,7 +1190,7 @@ class BLOG {
 
                return $this->showUsingQuery($template, $query, $highlight, $comments, $dateheads);
        }
-       
+
        /**
         * Returns the SQL query used to fill out templates for a list of items
         *
@@ -1226,7 +1228,7 @@ class BLOG {
                                        .   ' c.cname as category,'
                                        .   ' i.icat as catid,'
                                        .   ' i.iclosed as closed';
-                       
+
                        $query .= ' FROM '
                                        . sql_table('item') . ' as i, '
                                        . sql_table('member') . ' as m, '
@@ -1245,7 +1247,7 @@ class BLOG {
                        $i--;
                        if ($i) $query .= ' UNION ';
                }
-               
+
                return $query;
        }