Completed
Push — master ( 15a86c...ff0242 )
by Michael
03:23
created
class/xml.php 2 patches
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -81,93 +81,93 @@
 block discarded – undo
81 81
  * @link
82 82
  */
83 83
 if (!class_exists('Xmlfeed')) {
84
-    /**
85
-     * Class Bxmlfeed
86
-     */
87
-    class Bxmlfeed extends UniversalFeedCreator
88
-    {
89
-        public $version;
90
-        public $filename = '';
91
-
92
-        /**
93
-         * Bxmlfeed constructor.
94
-         * @param $version
95
-         */
96
-        public function __construct($version) {
97
-            $this->filename = XOOPS_CACHE_PATH . '/feed.xml';
98
-            $this->version  = $version;
99
-        }
100
-
101
-        /**
102
-         * @param      $var
103
-         * @param      $val
104
-         * @param bool $encoding
105
-         */
106
-        public function setVar($var, $val, $encoding = false) {
107
-            if (!empty($encoding)) {
108
-                $val = $this->convert_encoding($val);
109
-            }
110
-            $this->$var = $val;
111
-        }
112
-
113
-        /**
114
-         * @param $val
115
-         * @return array|mixed|string
116
-         */
117
-        public function convert_encoding($val) {
118
-            if (is_array($val)) {
119
-                foreach (array_keys($val) as $key) {
120
-                    $val[$key] = $this->convert_encoding($val[$key]);
121
-                }
122
-            } else {
123
-                $val = XoopsLocal::convert_encoding($val, $this->encoding, _CHARSET);
124
-            }
125
-
126
-            return $val;
127
-        }
128
-
129
-        /**
130
-         * @param $var
131
-         * @return mixed
132
-         */
133
-        public function getVar($var) {
134
-            return $this->$var;
135
-        }
136
-
137
-        /**
138
-         * @param $img
139
-         */
140
-        public function setImage(&$img) {
141
-            $image = new FeedImage();
142
-            foreach ($img as $key => $val) {
143
-                $image->$key = $this->convert_encoding($val);
144
-            }
145
-            $this->setVar('image', $image);
146
-        }
147
-
148
-        /**
149
-         * @param $itm
150
-         */
151
-        public function _addItem(&$itm) {
152
-            $item = new FeedItem();
153
-            foreach ($itm as $key => $val) {
154
-                $item->$key = $this->convert_encoding($val);
155
-            }
156
-            $this->addItem($item);
157
-        }
158
-
159
-        /**
160
-         * @param $items
161
-         */
162
-        public function addItems(&$items) {
163
-            if (!is_array($items) || count($items) == 0) {
164
-                return;
165
-            }
166
-            foreach ($items as $item) {
167
-                $this->_addItem($item);
168
-            }
169
-        }
170
-    }
84
+	/**
85
+	 * Class Bxmlfeed
86
+	 */
87
+	class Bxmlfeed extends UniversalFeedCreator
88
+	{
89
+		public $version;
90
+		public $filename = '';
91
+
92
+		/**
93
+		 * Bxmlfeed constructor.
94
+		 * @param $version
95
+		 */
96
+		public function __construct($version) {
97
+			$this->filename = XOOPS_CACHE_PATH . '/feed.xml';
98
+			$this->version  = $version;
99
+		}
100
+
101
+		/**
102
+		 * @param      $var
103
+		 * @param      $val
104
+		 * @param bool $encoding
105
+		 */
106
+		public function setVar($var, $val, $encoding = false) {
107
+			if (!empty($encoding)) {
108
+				$val = $this->convert_encoding($val);
109
+			}
110
+			$this->$var = $val;
111
+		}
112
+
113
+		/**
114
+		 * @param $val
115
+		 * @return array|mixed|string
116
+		 */
117
+		public function convert_encoding($val) {
118
+			if (is_array($val)) {
119
+				foreach (array_keys($val) as $key) {
120
+					$val[$key] = $this->convert_encoding($val[$key]);
121
+				}
122
+			} else {
123
+				$val = XoopsLocal::convert_encoding($val, $this->encoding, _CHARSET);
124
+			}
125
+
126
+			return $val;
127
+		}
128
+
129
+		/**
130
+		 * @param $var
131
+		 * @return mixed
132
+		 */
133
+		public function getVar($var) {
134
+			return $this->$var;
135
+		}
136
+
137
+		/**
138
+		 * @param $img
139
+		 */
140
+		public function setImage(&$img) {
141
+			$image = new FeedImage();
142
+			foreach ($img as $key => $val) {
143
+				$image->$key = $this->convert_encoding($val);
144
+			}
145
+			$this->setVar('image', $image);
146
+		}
147
+
148
+		/**
149
+		 * @param $itm
150
+		 */
151
+		public function _addItem(&$itm) {
152
+			$item = new FeedItem();
153
+			foreach ($itm as $key => $val) {
154
+				$item->$key = $this->convert_encoding($val);
155
+			}
156
+			$this->addItem($item);
157
+		}
158
+
159
+		/**
160
+		 * @param $items
161
+		 */
162
+		public function addItems(&$items) {
163
+			if (!is_array($items) || count($items) == 0) {
164
+				return;
165
+			}
166
+			foreach ($items as $item) {
167
+				$this->_addItem($item);
168
+			}
169
+		}
170
+	}
171 171
 }
172 172
 
173 173
 planet_parse_class('
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 
28 28
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
29
-include_once dirname(__DIR__) . '/include/vars.php';
29
+include_once dirname(__DIR__).'/include/vars.php';
30 30
 mod_loadFunctions('', $GLOBALS['moddirname']);
31 31
 
32 32
 /*** GENERAL USAGE *********************************************************
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
  */
65 65
 
66 66
 // your local timezone, set to "" to disable or for GMT
67
-$server_TZ = abs((int)($GLOBALS['xoopsConfig']['server_TZ'] * 3600.0));
68
-$prefix    = ($GLOBALS['xoopsConfig']['server_TZ'] < 0) ? '-' : '+';
69
-$TIME_ZONE = $prefix . date('H:i', $server_TZ);
67
+$server_TZ = abs((int) ($GLOBALS['xoopsConfig']['server_TZ']*3600.0));
68
+$prefix    = ($GLOBALS['xoopsConfig']['server_TZ']<0) ? '-' : '+';
69
+$TIME_ZONE = $prefix.date('H:i', $server_TZ);
70 70
 define('TIME_ZONE', $TIME_ZONE);
71 71
 // Version string.
72 72
 define('FEEDCREATOR_VERSION', 'ARTICLE @ XOOPS powered by FeedCreator');
73 73
 
74
-require_once __DIR__ . '/feedcreator.class.php';
74
+require_once __DIR__.'/feedcreator.class.php';
75 75
 
76 76
 /**
77 77
  * Description
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
          * @param $version
95 95
          */
96 96
         public function __construct($version) {
97
-            $this->filename = XOOPS_CACHE_PATH . '/feed.xml';
97
+            $this->filename = XOOPS_CACHE_PATH.'/feed.xml';
98 98
             $this->version  = $version;
99 99
         }
100 100
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                 foreach (array_keys($val) as $key) {
120 120
                     $val[$key] = $this->convert_encoding($val[$key]);
121 121
                 }
122
-            } else {
122
+            }else {
123 123
                 $val = XoopsLocal::convert_encoding($val, $this->encoding, _CHARSET);
124 124
             }
125 125
 
Please login to merge, or discard this patch.
class/category.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -44,22 +44,22 @@
 block discarded – undo
44 44
  **/
45 45
 if (!class_exists('Bcategory')):
46 46
 
47
-    /**
48
-     * Class Bcategory
49
-     */
50
-    class Bcategory extends XoopsObject
51
-    {
52
-        /**
53
-         * Constructor
54
-         */
55
-        public function __construct() {
56
-            //            $this->ArtObject();
57
-            $this->table = planet_DB_prefix('category');
58
-            $this->initVar('cat_id', XOBJ_DTYPE_INT, null, false);
59
-            $this->initVar('cat_title', XOBJ_DTYPE_TXTBOX, '', true);
60
-            $this->initVar('cat_order', XOBJ_DTYPE_INT, 1, false);
61
-        }
62
-    }
47
+	/**
48
+	 * Class Bcategory
49
+	 */
50
+	class Bcategory extends XoopsObject
51
+	{
52
+		/**
53
+		 * Constructor
54
+		 */
55
+		public function __construct() {
56
+			//            $this->ArtObject();
57
+			$this->table = planet_DB_prefix('category');
58
+			$this->initVar('cat_id', XOBJ_DTYPE_INT, null, false);
59
+			$this->initVar('cat_title', XOBJ_DTYPE_TXTBOX, '', true);
60
+			$this->initVar('cat_order', XOBJ_DTYPE_INT, 1, false);
61
+		}
62
+	}
63 63
 
64 64
 endif;
65 65
 /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
  */
31 31
 
32 32
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
33
-include_once dirname(__DIR__) . '/include/vars.php';
33
+include_once dirname(__DIR__).'/include/vars.php';
34 34
 mod_loadFunctions('', $GLOBALS['moddirname']);
35 35
 
36 36
 /**
Please login to merge, or discard this patch.
class/xmlpc.php 2 patches
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -30,70 +30,70 @@
 block discarded – undo
30 30
 mod_loadFunctions('', $GLOBALS['moddirname']);
31 31
 
32 32
 if (!class_exists('Xmlrpc_client')) {
33
-    /**
34
-     * Class Xmlrpc_client
35
-     */
36
-    class Xmlrpc_client
37
-    {
38
-        /**
39
-         * Xmlrpc_client constructor.
40
-         */
41
-        public function __construct() {
42
-        }
33
+	/**
34
+	 * Class Xmlrpc_client
35
+	 */
36
+	class Xmlrpc_client
37
+	{
38
+		/**
39
+		 * Xmlrpc_client constructor.
40
+		 */
41
+		public function __construct() {
42
+		}
43 43
 
44
-        /**
45
-         * @param $article
46
-         */
47
-        public function setObject(&$article) {
48
-            $this->$var = $val;
49
-        }
44
+		/**
45
+		 * @param $article
46
+		 */
47
+		public function setObject(&$article) {
48
+			$this->$var = $val;
49
+		}
50 50
 
51
-        /**
52
-         * @param $var
53
-         * @param $val
54
-         */
55
-        public function setVar($var, $val) {
56
-            $this->$var = $val;
57
-        }
51
+		/**
52
+		 * @param $var
53
+		 * @param $val
54
+		 */
55
+		public function setVar($var, $val) {
56
+			$this->$var = $val;
57
+		}
58 58
 
59
-        /**
60
-         * @param $var
61
-         * @return mixed
62
-         */
63
-        public function getVar($var) {
64
-            return $this->$var;
65
-        }
66
-    }
59
+		/**
60
+		 * @param $var
61
+		 * @return mixed
62
+		 */
63
+		public function getVar($var) {
64
+			return $this->$var;
65
+		}
66
+	}
67 67
 }
68 68
 
69 69
 if (!class_exists('Xmlrpc_server')) {
70
-    /**
71
-     * Class Xmlrpc_server
72
-     */
73
-    class Xmlrpc_server
74
-    {
75
-        /**
76
-         * Xmlrpc_server constructor.
77
-         */
78
-        public function __construct() {
79
-        }
70
+	/**
71
+	 * Class Xmlrpc_server
72
+	 */
73
+	class Xmlrpc_server
74
+	{
75
+		/**
76
+		 * Xmlrpc_server constructor.
77
+		 */
78
+		public function __construct() {
79
+		}
80 80
 
81
-        /**
82
-         * @param $var
83
-         * @param $val
84
-         */
85
-        public function setVar($var, $val) {
86
-            $this->$var = $val;
87
-        }
81
+		/**
82
+		 * @param $var
83
+		 * @param $val
84
+		 */
85
+		public function setVar($var, $val) {
86
+			$this->$var = $val;
87
+		}
88 88
 
89
-        /**
90
-         * @param $var
91
-         * @return mixed
92
-         */
93
-        public function getVar($var) {
94
-            return $this->$var;
95
-        }
96
-    }
89
+		/**
90
+		 * @param $var
91
+		 * @return mixed
92
+		 */
93
+		public function getVar($var) {
94
+			return $this->$var;
95
+		}
96
+	}
97 97
 }
98 98
 
99 99
 planet_parse_class('
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 
28 28
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
29
-include_once dirname(__DIR__) . '/include/vars.php';
29
+include_once dirname(__DIR__).'/include/vars.php';
30 30
 mod_loadFunctions('', $GLOBALS['moddirname']);
31 31
 
32 32
 if (!class_exists('Xmlrpc_client')) {
Please login to merge, or discard this patch.
class/bookmark.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -44,24 +44,24 @@
 block discarded – undo
44 44
  **/
45 45
 if (!class_exists('Bookmark')):
46 46
 
47
-    /**
48
-     * Class Bookmark
49
-     */
50
-    class Bookmark extends XoopsObject
51
-    {
52
-        /**
53
-         * Constructor
54
-         */
55
-        public function __construct() {
56
-            //            $this->ArtObject();
57
-            $this->table = planet_DB_prefix('bookmark');
58
-            $this->initVar('bm_id', XOBJ_DTYPE_INT, null, false);
59
-            /* user ID */
60
-            $this->initVar('bm_uid', XOBJ_DTYPE_INT, 0, true);
61
-            /* blog ID */
62
-            $this->initVar('blog_id', XOBJ_DTYPE_INT, 0, true);
63
-        }
64
-    }
47
+	/**
48
+	 * Class Bookmark
49
+	 */
50
+	class Bookmark extends XoopsObject
51
+	{
52
+		/**
53
+		 * Constructor
54
+		 */
55
+		public function __construct() {
56
+			//            $this->ArtObject();
57
+			$this->table = planet_DB_prefix('bookmark');
58
+			$this->initVar('bm_id', XOBJ_DTYPE_INT, null, false);
59
+			/* user ID */
60
+			$this->initVar('bm_uid', XOBJ_DTYPE_INT, 0, true);
61
+			/* blog ID */
62
+			$this->initVar('blog_id', XOBJ_DTYPE_INT, 0, true);
63
+		}
64
+	}
65 65
 endif;
66 66
 /**
67 67
  * Topic object handler class.
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
  */
31 31
 
32 32
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
33
-include_once dirname(__DIR__) . '/include/vars.php';
33
+include_once dirname(__DIR__).'/include/vars.php';
34 34
 mod_loadFunctions('', $GLOBALS['moddirname']);
35 35
 
36 36
 /**
Please login to merge, or discard this patch.
counter.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@
 block discarded – undo
27 27
 include __DIR__ . '/header.php';
28 28
 $article_id = empty($_GET['article']) ? 0 : (int)$_GET['article'];
29 29
 if (empty($article_id)) {
30
-    return;
30
+	return;
31 31
 }
32 32
 if (planet_getcookie('art_' . $article_id) > 0) {
33
-    return;
33
+	return;
34 34
 }
35 35
 $article_handler = xoops_getModuleHandler('article', $xoopsModule->getVar('dirname'));
36 36
 $article_obj     =& $article_handler->get($article_id);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,18 +24,18 @@
 block discarded – undo
24 24
 // URL: http://xoops.org                         //
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27
-include __DIR__ . '/header.php';
28
-$article_id = empty($_GET['article']) ? 0 : (int)$_GET['article'];
27
+include __DIR__.'/header.php';
28
+$article_id = empty($_GET['article']) ? 0 : (int) $_GET['article'];
29 29
 if (empty($article_id)) {
30 30
     return;
31 31
 }
32
-if (planet_getcookie('art_' . $article_id) > 0) {
32
+if (planet_getcookie('art_'.$article_id)>0) {
33 33
     return;
34 34
 }
35 35
 $article_handler = xoops_getModuleHandler('article', $xoopsModule->getVar('dirname'));
36
-$article_obj     =& $article_handler->get($article_id);
37
-$article_obj->setVar('art_views', $article_obj->getVar('art_views') + 1, true);
36
+$article_obj     = & $article_handler->get($article_id);
37
+$article_obj->setVar('art_views', $article_obj->getVar('art_views')+1, true);
38 38
 $article_handler->insert($article_obj, true);
39
-planet_setcookie('art_' . $article_id, time());
39
+planet_setcookie('art_'.$article_id, time());
40 40
 
41 41
 return;
Please login to merge, or discard this patch.
comment_delete.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,5 +24,5 @@
 block discarded – undo
24 24
 // URL: http://xoops.org                         //
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27
-include dirname(dirname(__DIR__)) . '/mainfile.php';
28
-include XOOPS_ROOT_PATH . '/include/comment_delete.php';
27
+include dirname(dirname(__DIR__)).'/mainfile.php';
28
+include XOOPS_ROOT_PATH.'/include/comment_delete.php';
Please login to merge, or discard this patch.
view.article.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -32,17 +32,17 @@  discard block
 block discarded – undo
32 32
  *
33 33
  */
34 34
 if (preg_match("/(\/comment_[^\.]*\.php\?.*=.*)/i", $_SERVER['REQUEST_URI'], $matches)) {
35
-    header('location: ' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . $matches[1]);
36
-    exit();
35
+	header('location: ' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . $matches[1]);
36
+	exit();
37 37
 }
38 38
 if (preg_match("/\/notification_update\.php/i", $_SERVER['REQUEST_URI'], $matches)) {
39
-    include XOOPS_ROOT_PATH . '/include/notification_update.php';
40
-    exit();
39
+	include XOOPS_ROOT_PATH . '/include/notification_update.php';
40
+	exit();
41 41
 }
42 42
 
43 43
 if ($REQUEST_URI_parsed = planet_parse_args($args_num, $args, $args_str)) {
44
-    $args['article'] = @$args_num[0];
45
-    $args['blog']    = @$args['blog'];
44
+	$args['article'] = @$args_num[0];
45
+	$args['blog']    = @$args['blog'];
46 46
 }
47 47
 
48 48
 $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']);
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 
56 56
 // restore $_SERVER['REQUEST_URI']
57 57
 if (!empty($REQUEST_URI_parsed)) {
58
-    $_SERVER['REQUEST_URI'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php'
59
-                              . (empty($article_id) ? '' : '?article=' . $article_id);
58
+	$_SERVER['REQUEST_URI'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php'
59
+							  . (empty($article_id) ? '' : '?article=' . $article_id);
60 60
 }
61 61
 
62 62
 $xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name') . ' - ' . $article_obj->getVar('art_title');
@@ -65,32 +65,32 @@  discard block
 block discarded – undo
65 65
 include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
66 66
 
67 67
 $article_data = array(
68
-    'id'       => $article_id,
69
-    'title'    => $article_obj->getVar('art_title'),
70
-    'content'  => $article_obj->getVar('art_content'),
71
-    'author'   => $article_obj->getVar('art_author'),
72
-    'time'     => $article_obj->getTime(),
73
-    'link'     => $article_obj->getVar('art_link'),
74
-    'views'    => $article_obj->getVar('art_views'),
75
-    'comments' => $article_obj->getVar('art_comments'),
76
-    'star'     => $article_obj->getStar(),
77
-    'rates'    => $article_obj->getVar('art_rates'),
78
-    'blog'     => array('id' => $article_obj->getVar('blog_id'), 'title' => $blog_obj->getVar('blog_title'))
68
+	'id'       => $article_id,
69
+	'title'    => $article_obj->getVar('art_title'),
70
+	'content'  => $article_obj->getVar('art_content'),
71
+	'author'   => $article_obj->getVar('art_author'),
72
+	'time'     => $article_obj->getTime(),
73
+	'link'     => $article_obj->getVar('art_link'),
74
+	'views'    => $article_obj->getVar('art_views'),
75
+	'comments' => $article_obj->getVar('art_comments'),
76
+	'star'     => $article_obj->getStar(),
77
+	'rates'    => $article_obj->getVar('art_rates'),
78
+	'blog'     => array('id' => $article_obj->getVar('blog_id'), 'title' => $blog_obj->getVar('blog_title'))
79 79
 );
80 80
 
81 81
 if (!empty($xoopsModuleConfig['do_sibling'])) {
82
-    $articles_sibling =& $article_handler->getSibling($article_obj, $blog_id);
83
-    if (!empty($articles_sibling['previous'])) {
84
-        $articles_sibling['previous']['url']   = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php'
85
-                                                 . URL_DELIMITER . '' . $articles_sibling['previous']['id'] . '/b'
86
-                                                 . $blog_id;
87
-        $articles_sibling['previous']['title'] = $articles_sibling['previous']['title'];
88
-    }
89
-    if (!empty($articles_sibling['next'])) {
90
-        $articles_sibling['next']['url']   = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php'
91
-                                             . URL_DELIMITER . '' . $articles_sibling['next']['id'] . '/b' . $blog_id;
92
-        $articles_sibling['next']['title'] = $articles_sibling['next']['title'];
93
-    }
82
+	$articles_sibling =& $article_handler->getSibling($article_obj, $blog_id);
83
+	if (!empty($articles_sibling['previous'])) {
84
+		$articles_sibling['previous']['url']   = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php'
85
+												 . URL_DELIMITER . '' . $articles_sibling['previous']['id'] . '/b'
86
+												 . $blog_id;
87
+		$articles_sibling['previous']['title'] = $articles_sibling['previous']['title'];
88
+	}
89
+	if (!empty($articles_sibling['next'])) {
90
+		$articles_sibling['next']['url']   = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php'
91
+											 . URL_DELIMITER . '' . $articles_sibling['next']['id'] . '/b' . $blog_id;
92
+		$articles_sibling['next']['title'] = $articles_sibling['next']['title'];
93
+	}
94 94
 }
95 95
 
96 96
 $xoopsTpl->assign('modulename', $xoopsModule->getVar('name'));
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
 $xoopsTpl->assign('user_level', !is_object($xoopsUser) ? 0 : ($xoopsUser->isAdmin() ? 2 : 1));
102 102
 if (empty($xoopsModuleConfig['anonymous_rate']) && !is_object($xoopsUser)) {
103 103
 } else {
104
-    $xoopsTpl->assign('canrate', 1);
104
+	$xoopsTpl->assign('canrate', 1);
105 105
 }
106 106
 
107 107
 if ($transferbar = @include XOOPS_ROOT_PATH . '/Frameworks/transfer/bar.transfer.php') {
108
-    $xoopsTpl->assign('transfer', $transferbar);
108
+	$xoopsTpl->assign('transfer', $transferbar);
109 109
 }
110 110
 
111 111
 // Loading module meta data, NOT THE RIGHT WAY DOING IT
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 // URL: http://xoops.org                         //
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27
-include __DIR__ . '/header.php';
27
+include __DIR__.'/header.php';
28 28
 
29 29
 /**
30 30
  * The comment detection scripts should be removed once absolute url is used in comment_view.php
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
  *
33 33
  */
34 34
 if (preg_match("/(\/comment_[^\.]*\.php\?.*=.*)/i", $_SERVER['REQUEST_URI'], $matches)) {
35
-    header('location: ' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . $matches[1]);
35
+    header('location: '.XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].$matches[1]);
36 36
     exit();
37 37
 }
38 38
 if (preg_match("/\/notification_update\.php/i", $_SERVER['REQUEST_URI'], $matches)) {
39
-    include XOOPS_ROOT_PATH . '/include/notification_update.php';
39
+    include XOOPS_ROOT_PATH.'/include/notification_update.php';
40 40
     exit();
41 41
 }
42 42
 
@@ -45,24 +45,24 @@  discard block
 block discarded – undo
45 45
     $args['blog']    = @$args['blog'];
46 46
 }
47 47
 
48
-$article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']);
49
-$blog_id    = (int)(empty($_GET['blog']) ? @$args['blog'] : $_GET['blog']);
48
+$article_id = (int) (empty($_GET['article']) ? @$args['article'] : $_GET['article']);
49
+$blog_id    = (int) (empty($_GET['blog']) ? @$args['blog'] : $_GET['blog']);
50 50
 
51 51
 $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']);
52 52
 $blog_handler    = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
53
-$article_obj     =& $article_handler->get($article_id);
54
-$blog_obj        =& $blog_handler->get($article_obj->getVar('blog_id'));
53
+$article_obj     = & $article_handler->get($article_id);
54
+$blog_obj        = & $blog_handler->get($article_obj->getVar('blog_id'));
55 55
 
56 56
 // restore $_SERVER['REQUEST_URI']
57 57
 if (!empty($REQUEST_URI_parsed)) {
58
-    $_SERVER['REQUEST_URI'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php'
59
-                              . (empty($article_id) ? '' : '?article=' . $article_id);
58
+    $_SERVER['REQUEST_URI'] = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'
59
+                              . (empty($article_id) ? '' : '?article='.$article_id);
60 60
 }
61 61
 
62
-$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name') . ' - ' . $article_obj->getVar('art_title');
62
+$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name').' - '.$article_obj->getVar('art_title');
63 63
 $xoopsOption['template_main']   = planet_getTemplate('article');
64
-include_once XOOPS_ROOT_PATH . '/header.php';
65
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
64
+include_once XOOPS_ROOT_PATH.'/header.php';
65
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
66 66
 
67 67
 $article_data = array(
68 68
     'id'       => $article_id,
@@ -79,16 +79,16 @@  discard block
 block discarded – undo
79 79
 );
80 80
 
81 81
 if (!empty($xoopsModuleConfig['do_sibling'])) {
82
-    $articles_sibling =& $article_handler->getSibling($article_obj, $blog_id);
82
+    $articles_sibling = & $article_handler->getSibling($article_obj, $blog_id);
83 83
     if (!empty($articles_sibling['previous'])) {
84
-        $articles_sibling['previous']['url']   = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php'
85
-                                                 . URL_DELIMITER . '' . $articles_sibling['previous']['id'] . '/b'
84
+        $articles_sibling['previous']['url']   = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'
85
+                                                 . URL_DELIMITER.''.$articles_sibling['previous']['id'].'/b'
86 86
                                                  . $blog_id;
87 87
         $articles_sibling['previous']['title'] = $articles_sibling['previous']['title'];
88 88
     }
89 89
     if (!empty($articles_sibling['next'])) {
90
-        $articles_sibling['next']['url']   = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php'
91
-                                             . URL_DELIMITER . '' . $articles_sibling['next']['id'] . '/b' . $blog_id;
90
+        $articles_sibling['next']['url']   = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'
91
+                                             . URL_DELIMITER.''.$articles_sibling['next']['id'].'/b'.$blog_id;
92 92
         $articles_sibling['next']['title'] = $articles_sibling['next']['title'];
93 93
     }
94 94
 }
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
 
101 101
 $xoopsTpl->assign('user_level', !is_object($xoopsUser) ? 0 : ($xoopsUser->isAdmin() ? 2 : 1));
102 102
 if (empty($xoopsModuleConfig['anonymous_rate']) && !is_object($xoopsUser)) {
103
-} else {
103
+}else {
104 104
     $xoopsTpl->assign('canrate', 1);
105 105
 }
106 106
 
107
-if ($transferbar = @include XOOPS_ROOT_PATH . '/Frameworks/transfer/bar.transfer.php') {
107
+if ($transferbar = @include XOOPS_ROOT_PATH.'/Frameworks/transfer/bar.transfer.php') {
108 108
     $xoopsTpl->assign('transfer', $transferbar);
109 109
 }
110 110
 
@@ -114,6 +114,6 @@  discard block
 block discarded – undo
114 114
 // for comment and notification
115 115
 //$_SERVER['REQUEST_URI'] = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php";
116 116
 $_GET['article'] = $article_id;
117
-include XOOPS_ROOT_PATH . '/include/comment_view.php';
117
+include XOOPS_ROOT_PATH.'/include/comment_view.php';
118 118
 
119
-include_once __DIR__ . '/footer.php';
119
+include_once __DIR__.'/footer.php';
Please login to merge, or discard this patch.
comment_edit.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,5 +24,5 @@
 block discarded – undo
24 24
 // URL: http://xoops.org                         //
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27
-include dirname(dirname(__DIR__)) . '/mainfile.php';
28
-include XOOPS_ROOT_PATH . '/include/comment_edit.php';
27
+include dirname(dirname(__DIR__)).'/mainfile.php';
28
+include XOOPS_ROOT_PATH.'/include/comment_edit.php';
Please login to merge, or discard this patch.
search.php 2 patches
Indentation   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 $config_handler    = xoops_getHandler('config');
32 32
 $xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH);
33 33
 if (empty($xoopsConfigSearch['enable_search'])) {
34
-    redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php', 2, planet_constant('MD_NOACCESS'));
34
+	redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php', 2, planet_constant('MD_NOACCESS'));
35 35
 }
36 36
 
37 37
 $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] = 0;
@@ -49,92 +49,92 @@  discard block
 block discarded – undo
49 49
 $blog     = (int)(isset($_POST['blog']) ? $_POST['blog'] : (isset($_GET['blog']) ? $_GET['blog'] : null));
50 50
 $uid      = (int)(isset($_POST['uid']) ? $_POST['uid'] : (isset($_GET['uid']) ? $_GET['uid'] : null));
51 51
 $searchin = isset($_POST['searchin']) ? $_POST['searchin'] : (isset($_GET['searchin']) ? explode('|',
52
-                                                                                                 $_GET['searchin']) : array());
52
+																								 $_GET['searchin']) : array());
53 53
 $sortby   = isset($_POST['sortby']) ? $_POST['sortby'] : (isset($_GET['sortby']) ? $_GET['sortby'] : null);
54 54
 $term     = isset($_POST['term']) ? $_POST['term'] : (isset($_GET['term']) ? $_GET['term'] : '');
55 55
 
56 56
 $andor  = in_array(strtoupper($andor), array('OR', 'AND', 'EXACT')) ? strtoupper($andor) : 'OR';
57 57
 $sortby = in_array(strtolower($sortby), array(
58
-    'a.art_id desc',
59
-    'a.art_time desc',
60
-    'a.art_title',
61
-    'a.blog_id',
62
-    'b.blog_id',
63
-    'b.blog_feed',
64
-    'b.blog_title',
65
-    'b.blog_time'
58
+	'a.art_id desc',
59
+	'a.art_time desc',
60
+	'a.art_title',
61
+	'a.blog_id',
62
+	'b.blog_id',
63
+	'b.blog_feed',
64
+	'b.blog_title',
65
+	'b.blog_time'
66 66
 )) ? strtolower($sortby) : '';
67 67
 
68 68
 if (!(empty($_POST['submit']) && empty($_GET['term']))) {
69
-    $next_search['category'] = $category;
70
-    $next_search['blog']     = $blog;
71
-    $next_search['uid']      = $uid;
72
-    $next_search['andor']    = $andor;
69
+	$next_search['category'] = $category;
70
+	$next_search['blog']     = $blog;
71
+	$next_search['uid']      = $uid;
72
+	$next_search['andor']    = $andor;
73 73
 
74
-    $next_search['term'] = $term;
75
-    $query               = trim($term);
74
+	$next_search['term'] = $term;
75
+	$query               = trim($term);
76 76
 
77
-    if ($andor !== 'EXACT') {
78
-        $ignored_queries = array(); // holds kewords that are shorter than allowed minmum length
79
-        $temp_queries    = preg_split("/[\s,]+/", $query);
80
-        foreach ($temp_queries as $q) {
81
-            $q = trim($q);
82
-            if (strlen($q) >= $xoopsConfigSearch['keyword_min']) {
83
-                $queries[] = $myts->addSlashes($q);
84
-            } else {
85
-                $ignored_queries[] = $myts->addSlashes($q);
86
-            }
87
-        }
88
-        if (count($queries) == 0) {
89
-            redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2,
90
-                            sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min']));
91
-        }
92
-    } else {
93
-        if (strlen($query) < $xoopsConfigSearch['keyword_min']) {
94
-            redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2,
95
-                            sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min']));
96
-        }
97
-        $queries = array($myts->addSlashes($query));
98
-    }
77
+	if ($andor !== 'EXACT') {
78
+		$ignored_queries = array(); // holds kewords that are shorter than allowed minmum length
79
+		$temp_queries    = preg_split("/[\s,]+/", $query);
80
+		foreach ($temp_queries as $q) {
81
+			$q = trim($q);
82
+			if (strlen($q) >= $xoopsConfigSearch['keyword_min']) {
83
+				$queries[] = $myts->addSlashes($q);
84
+			} else {
85
+				$ignored_queries[] = $myts->addSlashes($q);
86
+			}
87
+		}
88
+		if (count($queries) == 0) {
89
+			redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2,
90
+							sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min']));
91
+		}
92
+	} else {
93
+		if (strlen($query) < $xoopsConfigSearch['keyword_min']) {
94
+			redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2,
95
+							sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min']));
96
+		}
97
+		$queries = array($myts->addSlashes($query));
98
+	}
99 99
 
100
-    $next_search['sortby']   = $sortby;
101
-    $next_search['searchin'] = implode('|', $searchin);
100
+	$next_search['sortby']   = $sortby;
101
+	$next_search['searchin'] = implode('|', $searchin);
102 102
 
103
-    /* To be added: year-month
103
+	/* To be added: year-month
104 104
      * see view.archive.php
105 105
      */
106
-    if (!empty($time)) {
107
-        $extra = '';
108
-    } else {
109
-        $extra = '';
110
-    }
106
+	if (!empty($time)) {
107
+		$extra = '';
108
+	} else {
109
+		$extra = '';
110
+	}
111 111
 
112
-    $results = planet_search($queries, $andor, $limit, $start, $uid, $category, $blog, $sortby, $searchin, $extra);
112
+	$results = planet_search($queries, $andor, $limit, $start, $uid, $category, $blog, $sortby, $searchin, $extra);
113 113
 
114
-    /*
114
+	/*
115 115
     if ( count($results) < 1 ) {
116 116
         redirect_header("javascript:history.go(-1);", 2, _SR_NOMATCH);
117 117
     } else
118 118
     */
119
-    {
120
-        $xoopsTpl->assign('results', $results);
119
+	{
120
+		$xoopsTpl->assign('results', $results);
121 121
 
122
-        if (count($next_search) > 0) {
123
-            $items = array();
124
-            foreach ($next_search as $para => $val) {
125
-                if (!empty($val)) {
126
-                    $items[] = "$para=$val";
127
-                }
128
-            }
129
-            if (count($items) > 0) {
130
-                $paras = implode('&', $items);
131
-            }
132
-            unset($next_search);
133
-            unset($items);
134
-        }
135
-        $search_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php?' . $paras;
122
+		if (count($next_search) > 0) {
123
+			$items = array();
124
+			foreach ($next_search as $para => $val) {
125
+				if (!empty($val)) {
126
+					$items[] = "$para=$val";
127
+				}
128
+			}
129
+			if (count($items) > 0) {
130
+				$paras = implode('&', $items);
131
+			}
132
+			unset($next_search);
133
+			unset($items);
134
+		}
135
+		$search_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php?' . $paras;
136 136
 
137
-        /*
137
+		/*
138 138
          $next_results =& planet_search($queries, $andor, 1, $start + $limit, $uid, $category, $sortby, $searchin, $extra);
139 139
       $next_count = count($next_results);
140 140
       $has_next = false;
@@ -143,41 +143,41 @@  discard block
 block discarded – undo
143 143
       }
144 144
       if (false != $has_next)
145 145
       */
146
-        if (count($results)) {
147
-            $next            = $start + $limit;
148
-            $queries         = implode(',', $queries);
149
-            $search_url_next = $search_url . "&start=$next";
150
-            $search_next     = "<a href=\"" . htmlspecialchars($search_url_next) . "\">" . _SR_NEXT . '</a>';
151
-            $xoopsTpl->assign('search_next', $search_next);
152
-        }
153
-        if ($start > 0) {
154
-            $prev            = $start - $limit;
155
-            $search_url_prev = $search_url . "&start=$prev";
156
-            $search_prev     = "<a href=\"" . htmlspecialchars($search_url_prev) . "\">" . _SR_PREVIOUS . '</a>';
157
-            $xoopsTpl->assign('search_prev', $search_prev);
158
-        }
159
-    }
146
+		if (count($results)) {
147
+			$next            = $start + $limit;
148
+			$queries         = implode(',', $queries);
149
+			$search_url_next = $search_url . "&start=$next";
150
+			$search_next     = "<a href=\"" . htmlspecialchars($search_url_next) . "\">" . _SR_NEXT . '</a>';
151
+			$xoopsTpl->assign('search_next', $search_next);
152
+		}
153
+		if ($start > 0) {
154
+			$prev            = $start - $limit;
155
+			$search_url_prev = $search_url . "&start=$prev";
156
+			$search_prev     = "<a href=\"" . htmlspecialchars($search_url_prev) . "\">" . _SR_PREVIOUS . '</a>';
157
+			$xoopsTpl->assign('search_prev', $search_prev);
158
+		}
159
+	}
160 160
 
161
-    unset($results);
162
-    $search_info = _SR_KEYWORDS . ': ' . $myts->htmlSpecialChars($term);
163
-    $xoopsTpl->assign('search_info', $search_info);
161
+	unset($results);
162
+	$search_info = _SR_KEYWORDS . ': ' . $myts->htmlSpecialChars($term);
163
+	$xoopsTpl->assign('search_info', $search_info);
164 164
 }
165 165
 
166 166
 /* type */
167 167
 $type_select = "<select name=\"andor\">";
168 168
 $type_select .= "<option value=\"OR\"";
169 169
 if ('OR' === $andor) {
170
-    $type_select .= " selected=\"selected\"";
170
+	$type_select .= " selected=\"selected\"";
171 171
 }
172 172
 $type_select .= '>' . _SR_ANY . '</option>';
173 173
 $type_select .= "<option value=\"AND\"";
174 174
 if ('AND' === $andor) {
175
-    $type_select .= " selected=\"selected\"";
175
+	$type_select .= " selected=\"selected\"";
176 176
 }
177 177
 $type_select .= '>' . _SR_ALL . '</option>';
178 178
 $type_select .= "<option value=\"EXACT\"";
179 179
 if ('exact' === $andor) {
180
-    $type_select .= " selected=\"selected\"";
180
+	$type_select .= " selected=\"selected\"";
181 181
 }
182 182
 $type_select .= '>' . _SR_EXACT . '</option>';
183 183
 $type_select .= '</select>';
@@ -186,32 +186,32 @@  discard block
 block discarded – undo
186 186
 $searchin_select = '';
187 187
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"title\"";
188 188
 if (in_array('title', $searchin)) {
189
-    $searchin_select .= ' checked';
189
+	$searchin_select .= ' checked';
190 190
 }
191 191
 $searchin_select .= ' />' . planet_constant('MD_TITLE') . '&nbsp;&nbsp;';
192 192
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"text\"";
193 193
 if (in_array('text', $searchin)) {
194
-    $searchin_select .= ' checked';
194
+	$searchin_select .= ' checked';
195 195
 }
196 196
 $searchin_select .= ' />' . planet_constant('MD_BODY') . '&nbsp;&nbsp;||&nbsp;&nbsp;';
197 197
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"blog\"";
198 198
 if (in_array('blog', $searchin)) {
199
-    $searchin_select .= ' checked';
199
+	$searchin_select .= ' checked';
200 200
 }
201 201
 $searchin_select .= ' />' . planet_constant('MD_BLOG') . '&nbsp;&nbsp;';
202 202
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"feed\"";
203 203
 if (in_array('feed', $searchin)) {
204
-    $searchin_select .= ' checked';
204
+	$searchin_select .= ' checked';
205 205
 }
206 206
 $searchin_select .= ' />' . planet_constant('MD_FEED') . '&nbsp;&nbsp;';
207 207
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"desc\"";
208 208
 if (in_array('desc', $searchin)) {
209
-    $searchin_select .= ' checked';
209
+	$searchin_select .= ' checked';
210 210
 }
211 211
 $searchin_select .= ' />' . planet_constant('MD_DESC') . '&nbsp;&nbsp;';
212 212
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"all\"";
213 213
 if (empty($searchin)) {
214
-    $searchin_select .= ' checked';
214
+	$searchin_select .= ' checked';
215 215
 }
216 216
 $searchin_select .= ' />' . _ALL . '&nbsp;&nbsp;';
217 217
 
@@ -219,28 +219,28 @@  discard block
 block discarded – undo
219 219
 $sortby_select = "<select name=\"sortby\">";
220 220
 $sortby_select .= "<option value=\"\"";
221 221
 if (empty($sortby)) {
222
-    $sortby_select .= " selected=\"selected\"";
222
+	$sortby_select .= " selected=\"selected\"";
223 223
 }
224 224
 $sortby_select .= '>' . _NONE . '</option>';
225 225
 $sortby_select .= "<option value=\"a.art_time\"";
226 226
 if ('a.art_time' === $sortby) {
227
-    $sortby_select .= " selected=\"selected\"";
227
+	$sortby_select .= " selected=\"selected\"";
228 228
 }
229 229
 $sortby_select .= '>' . planet_constant('MD_TIME') . '</option>';
230 230
 $sortby_select .= "<option value=\"a.art_title\"";
231 231
 if ('a.art_title' === $sortby) {
232
-    $sortby_select .= " selected=\"selected\"";
232
+	$sortby_select .= " selected=\"selected\"";
233 233
 }
234 234
 $sortby_select .= '>' . planet_constant('MD_TITLE') . '</option>';
235 235
 $sortby_select .= "<option value=\"\">&nbsp;&nbsp;----&nbsp;&nbsp;</option>";
236 236
 $sortby_select .= "<option value=\"a.blog_title\"";
237 237
 if ('a.blog_title' === $sortby) {
238
-    $sortby_select .= " selected=\"selected\"";
238
+	$sortby_select .= " selected=\"selected\"";
239 239
 }
240 240
 $sortby_select .= '>' . planet_constant('MD_BLOG') . '</option>';
241 241
 $sortby_select .= "<option value=\"a.blog_time\"";
242 242
 if ('b.blog_time' === $sortby) {
243
-    $sortby_select .= " selected=\"selected\"";
243
+	$sortby_select .= " selected=\"selected\"";
244 244
 }
245 245
 $sortby_select .= '>' . planet_constant('MD_UPDATE') . '</option>';
246 246
 $sortby_select .= '</select>';
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 $xoopsTpl->assign('uid', $uid);
258 258
 
259 259
 if ($xoopsConfigSearch['keyword_min'] > 0) {
260
-    $xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min']));
260
+	$xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min']));
261 261
 }
262 262
 
263 263
 include XOOPS_ROOT_PATH . '/footer.php';
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -26,28 +26,28 @@  discard block
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 
28 28
 $xoopsOption['pagetype'] = 'search';
29
-include __DIR__ . '/header.php';
29
+include __DIR__.'/header.php';
30 30
 $xoopsModule->loadLanguage('main');
31 31
 $config_handler    = xoops_getHandler('config');
32
-$xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH);
32
+$xoopsConfigSearch = & $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH);
33 33
 if (empty($xoopsConfigSearch['enable_search'])) {
34
-    redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php', 2, planet_constant('MD_NOACCESS'));
34
+    redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php', 2, planet_constant('MD_NOACCESS'));
35 35
 }
36 36
 
37 37
 $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] = 0;
38 38
 $xoopsOption['template_main']                             = planet_getTemplate('search');
39
-include XOOPS_ROOT_PATH . '/header.php';
40
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
39
+include XOOPS_ROOT_PATH.'/header.php';
40
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
41 41
 
42
-include_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/search.inc.php';
42
+include_once XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/search.inc.php';
43 43
 $limit = $xoopsModuleConfig['articles_perpage'];
44 44
 
45 45
 $queries  = array();
46 46
 $andor    = isset($_POST['andor']) ? $_POST['andor'] : (isset($_GET['andor']) ? $_GET['andor'] : '');
47 47
 $start    = isset($_GET['start']) ? $_GET['start'] : 0;
48
-$category = (int)(isset($_POST['category']) ? $_POST['category'] : (isset($_GET['category']) ? $_GET['category'] : null));
49
-$blog     = (int)(isset($_POST['blog']) ? $_POST['blog'] : (isset($_GET['blog']) ? $_GET['blog'] : null));
50
-$uid      = (int)(isset($_POST['uid']) ? $_POST['uid'] : (isset($_GET['uid']) ? $_GET['uid'] : null));
48
+$category = (int) (isset($_POST['category']) ? $_POST['category'] : (isset($_GET['category']) ? $_GET['category'] : null));
49
+$blog     = (int) (isset($_POST['blog']) ? $_POST['blog'] : (isset($_GET['blog']) ? $_GET['blog'] : null));
50
+$uid      = (int) (isset($_POST['uid']) ? $_POST['uid'] : (isset($_GET['uid']) ? $_GET['uid'] : null));
51 51
 $searchin = isset($_POST['searchin']) ? $_POST['searchin'] : (isset($_GET['searchin']) ? explode('|',
52 52
                                                                                                  $_GET['searchin']) : array());
53 53
 $sortby   = isset($_POST['sortby']) ? $_POST['sortby'] : (isset($_GET['sortby']) ? $_GET['sortby'] : null);
@@ -79,19 +79,19 @@  discard block
 block discarded – undo
79 79
         $temp_queries    = preg_split("/[\s,]+/", $query);
80 80
         foreach ($temp_queries as $q) {
81 81
             $q = trim($q);
82
-            if (strlen($q) >= $xoopsConfigSearch['keyword_min']) {
82
+            if (strlen($q)>=$xoopsConfigSearch['keyword_min']) {
83 83
                 $queries[] = $myts->addSlashes($q);
84
-            } else {
84
+            }else {
85 85
                 $ignored_queries[] = $myts->addSlashes($q);
86 86
             }
87 87
         }
88 88
         if (count($queries) == 0) {
89
-            redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2,
89
+            redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/search.php', 2,
90 90
                             sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min']));
91 91
         }
92
-    } else {
93
-        if (strlen($query) < $xoopsConfigSearch['keyword_min']) {
94
-            redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2,
92
+    }else {
93
+        if (strlen($query)<$xoopsConfigSearch['keyword_min']) {
94
+            redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/search.php', 2,
95 95
                             sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min']));
96 96
         }
97 97
         $queries = array($myts->addSlashes($query));
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      */
106 106
     if (!empty($time)) {
107 107
         $extra = '';
108
-    } else {
108
+    }else {
109 109
         $extra = '';
110 110
     }
111 111
 
@@ -119,20 +119,20 @@  discard block
 block discarded – undo
119 119
     {
120 120
         $xoopsTpl->assign('results', $results);
121 121
 
122
-        if (count($next_search) > 0) {
122
+        if (count($next_search)>0) {
123 123
             $items = array();
124 124
             foreach ($next_search as $para => $val) {
125 125
                 if (!empty($val)) {
126 126
                     $items[] = "$para=$val";
127 127
                 }
128 128
             }
129
-            if (count($items) > 0) {
129
+            if (count($items)>0) {
130 130
                 $paras = implode('&', $items);
131 131
             }
132 132
             unset($next_search);
133 133
             unset($items);
134 134
         }
135
-        $search_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php?' . $paras;
135
+        $search_url = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/search.php?'.$paras;
136 136
 
137 137
         /*
138 138
          $next_results =& planet_search($queries, $andor, 1, $start + $limit, $uid, $category, $sortby, $searchin, $extra);
@@ -144,22 +144,22 @@  discard block
 block discarded – undo
144 144
       if (false != $has_next)
145 145
       */
146 146
         if (count($results)) {
147
-            $next            = $start + $limit;
147
+            $next            = $start+$limit;
148 148
             $queries         = implode(',', $queries);
149
-            $search_url_next = $search_url . "&start=$next";
150
-            $search_next     = "<a href=\"" . htmlspecialchars($search_url_next) . "\">" . _SR_NEXT . '</a>';
149
+            $search_url_next = $search_url."&start=$next";
150
+            $search_next     = "<a href=\"".htmlspecialchars($search_url_next)."\">"._SR_NEXT.'</a>';
151 151
             $xoopsTpl->assign('search_next', $search_next);
152 152
         }
153
-        if ($start > 0) {
154
-            $prev            = $start - $limit;
155
-            $search_url_prev = $search_url . "&start=$prev";
156
-            $search_prev     = "<a href=\"" . htmlspecialchars($search_url_prev) . "\">" . _SR_PREVIOUS . '</a>';
153
+        if ($start>0) {
154
+            $prev            = $start-$limit;
155
+            $search_url_prev = $search_url."&start=$prev";
156
+            $search_prev     = "<a href=\"".htmlspecialchars($search_url_prev)."\">"._SR_PREVIOUS.'</a>';
157 157
             $xoopsTpl->assign('search_prev', $search_prev);
158 158
         }
159 159
     }
160 160
 
161 161
     unset($results);
162
-    $search_info = _SR_KEYWORDS . ': ' . $myts->htmlSpecialChars($term);
162
+    $search_info = _SR_KEYWORDS.': '.$myts->htmlSpecialChars($term);
163 163
     $xoopsTpl->assign('search_info', $search_info);
164 164
 }
165 165
 
@@ -169,17 +169,17 @@  discard block
 block discarded – undo
169 169
 if ('OR' === $andor) {
170 170
     $type_select .= " selected=\"selected\"";
171 171
 }
172
-$type_select .= '>' . _SR_ANY . '</option>';
172
+$type_select .= '>'._SR_ANY.'</option>';
173 173
 $type_select .= "<option value=\"AND\"";
174 174
 if ('AND' === $andor) {
175 175
     $type_select .= " selected=\"selected\"";
176 176
 }
177
-$type_select .= '>' . _SR_ALL . '</option>';
177
+$type_select .= '>'._SR_ALL.'</option>';
178 178
 $type_select .= "<option value=\"EXACT\"";
179 179
 if ('exact' === $andor) {
180 180
     $type_select .= " selected=\"selected\"";
181 181
 }
182
-$type_select .= '>' . _SR_EXACT . '</option>';
182
+$type_select .= '>'._SR_EXACT.'</option>';
183 183
 $type_select .= '</select>';
184 184
 
185 185
 /* scope */
@@ -188,32 +188,32 @@  discard block
 block discarded – undo
188 188
 if (in_array('title', $searchin)) {
189 189
     $searchin_select .= ' checked';
190 190
 }
191
-$searchin_select .= ' />' . planet_constant('MD_TITLE') . '&nbsp;&nbsp;';
191
+$searchin_select .= ' />'.planet_constant('MD_TITLE').'&nbsp;&nbsp;';
192 192
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"text\"";
193 193
 if (in_array('text', $searchin)) {
194 194
     $searchin_select .= ' checked';
195 195
 }
196
-$searchin_select .= ' />' . planet_constant('MD_BODY') . '&nbsp;&nbsp;||&nbsp;&nbsp;';
196
+$searchin_select .= ' />'.planet_constant('MD_BODY').'&nbsp;&nbsp;||&nbsp;&nbsp;';
197 197
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"blog\"";
198 198
 if (in_array('blog', $searchin)) {
199 199
     $searchin_select .= ' checked';
200 200
 }
201
-$searchin_select .= ' />' . planet_constant('MD_BLOG') . '&nbsp;&nbsp;';
201
+$searchin_select .= ' />'.planet_constant('MD_BLOG').'&nbsp;&nbsp;';
202 202
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"feed\"";
203 203
 if (in_array('feed', $searchin)) {
204 204
     $searchin_select .= ' checked';
205 205
 }
206
-$searchin_select .= ' />' . planet_constant('MD_FEED') . '&nbsp;&nbsp;';
206
+$searchin_select .= ' />'.planet_constant('MD_FEED').'&nbsp;&nbsp;';
207 207
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"desc\"";
208 208
 if (in_array('desc', $searchin)) {
209 209
     $searchin_select .= ' checked';
210 210
 }
211
-$searchin_select .= ' />' . planet_constant('MD_DESC') . '&nbsp;&nbsp;';
211
+$searchin_select .= ' />'.planet_constant('MD_DESC').'&nbsp;&nbsp;';
212 212
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"all\"";
213 213
 if (empty($searchin)) {
214 214
     $searchin_select .= ' checked';
215 215
 }
216
-$searchin_select .= ' />' . _ALL . '&nbsp;&nbsp;';
216
+$searchin_select .= ' />'._ALL.'&nbsp;&nbsp;';
217 217
 
218 218
 /* sortby */
219 219
 $sortby_select = "<select name=\"sortby\">";
@@ -221,28 +221,28 @@  discard block
 block discarded – undo
221 221
 if (empty($sortby)) {
222 222
     $sortby_select .= " selected=\"selected\"";
223 223
 }
224
-$sortby_select .= '>' . _NONE . '</option>';
224
+$sortby_select .= '>'._NONE.'</option>';
225 225
 $sortby_select .= "<option value=\"a.art_time\"";
226 226
 if ('a.art_time' === $sortby) {
227 227
     $sortby_select .= " selected=\"selected\"";
228 228
 }
229
-$sortby_select .= '>' . planet_constant('MD_TIME') . '</option>';
229
+$sortby_select .= '>'.planet_constant('MD_TIME').'</option>';
230 230
 $sortby_select .= "<option value=\"a.art_title\"";
231 231
 if ('a.art_title' === $sortby) {
232 232
     $sortby_select .= " selected=\"selected\"";
233 233
 }
234
-$sortby_select .= '>' . planet_constant('MD_TITLE') . '</option>';
234
+$sortby_select .= '>'.planet_constant('MD_TITLE').'</option>';
235 235
 $sortby_select .= "<option value=\"\">&nbsp;&nbsp;----&nbsp;&nbsp;</option>";
236 236
 $sortby_select .= "<option value=\"a.blog_title\"";
237 237
 if ('a.blog_title' === $sortby) {
238 238
     $sortby_select .= " selected=\"selected\"";
239 239
 }
240
-$sortby_select .= '>' . planet_constant('MD_BLOG') . '</option>';
240
+$sortby_select .= '>'.planet_constant('MD_BLOG').'</option>';
241 241
 $sortby_select .= "<option value=\"a.blog_time\"";
242 242
 if ('b.blog_time' === $sortby) {
243 243
     $sortby_select .= " selected=\"selected\"";
244 244
 }
245
-$sortby_select .= '>' . planet_constant('MD_UPDATE') . '</option>';
245
+$sortby_select .= '>'.planet_constant('MD_UPDATE').'</option>';
246 246
 $sortby_select .= '</select>';
247 247
 
248 248
 $xoopsTpl->assign('type_select', $type_select);
@@ -256,8 +256,8 @@  discard block
 block discarded – undo
256 256
 $xoopsTpl->assign('blog', $blog);
257 257
 $xoopsTpl->assign('uid', $uid);
258 258
 
259
-if ($xoopsConfigSearch['keyword_min'] > 0) {
259
+if ($xoopsConfigSearch['keyword_min']>0) {
260 260
     $xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min']));
261 261
 }
262 262
 
263
-include XOOPS_ROOT_PATH . '/footer.php';
263
+include XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.