Completed
Push — master ( 7c5656...a50592 )
by Michael
01:55
created
class/xml.php 1 patch
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -81,100 +81,100 @@
 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
-        {
98
-            $this->filename = XOOPS_CACHE_PATH . '/feed.xml';
99
-            $this->version  = $version;
100
-        }
101
-
102
-        /**
103
-         * @param      $var
104
-         * @param      $val
105
-         * @param bool $encoding
106
-         */
107
-        public function setVar($var, $val, $encoding = false)
108
-        {
109
-            if (!empty($encoding)) {
110
-                $val = $this->convert_encoding($val);
111
-            }
112
-            $this->$var = $val;
113
-        }
114
-
115
-        /**
116
-         * @param $val
117
-         * @return array|mixed|string
118
-         */
119
-        public function convert_encoding($val)
120
-        {
121
-            if (is_array($val)) {
122
-                foreach (array_keys($val) as $key) {
123
-                    $val[$key] = $this->convert_encoding($val[$key]);
124
-                }
125
-            } else {
126
-                $val = XoopsLocal::convert_encoding($val, $this->encoding, _CHARSET);
127
-            }
128
-
129
-            return $val;
130
-        }
131
-
132
-        /**
133
-         * @param $var
134
-         * @return mixed
135
-         */
136
-        public function getVar($var)
137
-        {
138
-            return $this->$var;
139
-        }
140
-
141
-        /**
142
-         * @param $img
143
-         */
144
-        public function setImage(&$img)
145
-        {
146
-            $image = new FeedImage();
147
-            foreach ($img as $key => $val) {
148
-                $image->$key = $this->convert_encoding($val);
149
-            }
150
-            $this->setVar('image', $image);
151
-        }
152
-
153
-        /**
154
-         * @param $itm
155
-         */
156
-        public function _addItem(&$itm)
157
-        {
158
-            $item = new FeedItem();
159
-            foreach ($itm as $key => $val) {
160
-                $item->$key = $this->convert_encoding($val);
161
-            }
162
-            $this->addItem($item);
163
-        }
164
-
165
-        /**
166
-         * @param $items
167
-         */
168
-        public function addItems(&$items)
169
-        {
170
-            if (!is_array($items) || count($items) == 0) {
171
-                return;
172
-            }
173
-            foreach ($items as $item) {
174
-                $this->_addItem($item);
175
-            }
176
-        }
177
-    }
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
+		{
98
+			$this->filename = XOOPS_CACHE_PATH . '/feed.xml';
99
+			$this->version  = $version;
100
+		}
101
+
102
+		/**
103
+		 * @param      $var
104
+		 * @param      $val
105
+		 * @param bool $encoding
106
+		 */
107
+		public function setVar($var, $val, $encoding = false)
108
+		{
109
+			if (!empty($encoding)) {
110
+				$val = $this->convert_encoding($val);
111
+			}
112
+			$this->$var = $val;
113
+		}
114
+
115
+		/**
116
+		 * @param $val
117
+		 * @return array|mixed|string
118
+		 */
119
+		public function convert_encoding($val)
120
+		{
121
+			if (is_array($val)) {
122
+				foreach (array_keys($val) as $key) {
123
+					$val[$key] = $this->convert_encoding($val[$key]);
124
+				}
125
+			} else {
126
+				$val = XoopsLocal::convert_encoding($val, $this->encoding, _CHARSET);
127
+			}
128
+
129
+			return $val;
130
+		}
131
+
132
+		/**
133
+		 * @param $var
134
+		 * @return mixed
135
+		 */
136
+		public function getVar($var)
137
+		{
138
+			return $this->$var;
139
+		}
140
+
141
+		/**
142
+		 * @param $img
143
+		 */
144
+		public function setImage(&$img)
145
+		{
146
+			$image = new FeedImage();
147
+			foreach ($img as $key => $val) {
148
+				$image->$key = $this->convert_encoding($val);
149
+			}
150
+			$this->setVar('image', $image);
151
+		}
152
+
153
+		/**
154
+		 * @param $itm
155
+		 */
156
+		public function _addItem(&$itm)
157
+		{
158
+			$item = new FeedItem();
159
+			foreach ($itm as $key => $val) {
160
+				$item->$key = $this->convert_encoding($val);
161
+			}
162
+			$this->addItem($item);
163
+		}
164
+
165
+		/**
166
+		 * @param $items
167
+		 */
168
+		public function addItems(&$items)
169
+		{
170
+			if (!is_array($items) || count($items) == 0) {
171
+				return;
172
+			}
173
+			foreach ($items as $item) {
174
+				$this->_addItem($item);
175
+			}
176
+		}
177
+	}
178 178
 }
179 179
 
180 180
 PlanetUtility::planetParseClass('
Please login to merge, or discard this patch.
action.rate.php 1 patch
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -33,61 +33,61 @@
 block discarded – undo
33 33
 $blog_id    = Request::getInt('blog', Request::getInt('blog', 0, 'POST'), 'GET'); //(int)(!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0));
34 34
 
35 35
 if (empty($article_id) && empty($blog_id)) {
36
-    redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID'));
36
+	redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID'));
37 37
 }
38 38
 
39 39
 $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']);
40 40
 $blogHandler    = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
41 41
 if (empty($xoopsModuleConfig['anonymous_rate']) && !is_object($xoopsUser)) {
42
-    $message = planet_constant('MD_NOACCESS');
42
+	$message = planet_constant('MD_NOACCESS');
43 43
 } else {
44
-    $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
45
-    $ip  = PlanetUtility::planetGetIP();
46
-    if ($article_id > 0) {
47
-        $criteria = new CriteriaCompo(new Criteria('art_id', $article_id));
48
-    } else {
49
-        $criteria = new CriteriaCompo(new Criteria('blog_id', $blog_id));
50
-    }
51
-    if ($uid > 0) {
52
-        $criteria->add(new Criteria('rate_uid', $uid));
53
-    } else {
54
-        $criteria->add(new Criteria('rate_ip', $ip));
55
-        $criteria->add(new Criteria('rate_time', time() - 24 * 3600, '>'));
56
-    }
57
-    $rateHandler = xoops_getModuleHandler('rate', $GLOBALS['moddirname']);
58
-    if ($count = $rateHandler->getCount($criteria)) {
59
-        $message = planet_constant('MD_ALREADYRATED');
60
-    } else {
61
-        $rate_obj = $rateHandler->create();
62
-        if ($article_id > 0) {
63
-            $rate_obj->setVar('art_id', $article_id);
64
-        } else {
65
-            $rate_obj->setVar('blog_id', $blog_id);
66
-        }
67
-        $rate_obj->setVar('rate_uid', $uid);
68
-        $rate_obj->setVar('rate_ip', $ip);
69
-        $rate_obj->setVar('rate_rating', $rate);
70
-        $rate_obj->setVar('rate_time', time());
71
-        if (!$rate_id = $rateHandler->insert($rate_obj, true)) {
72
-            redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_NOTSAVED'));
73
-        }
74
-        if ($article_id > 0) {
75
-            $article_obj = $articleHandler->get($article_id);
76
-            $article_obj->setVar('art_rating', $article_obj->getVar('art_rating') + $rate);
77
-            $article_obj->setVar('art_rates', $article_obj->getVar('art_rates') + 1);
78
-            $articleHandler->insert($article_obj, true);
79
-        } else {
80
-            $blog_obj = $blogHandler->get($blog_id);
81
-            $blog_obj->setVar('blog_rating', $blog_obj->getVar('blog_rating') + $rate);
82
-            $blog_obj->setVar('blog_rates', $blog_obj->getVar('blog_rates') + 1);
83
-            $blogHandler->insert($blog_obj, true);
84
-        }
85
-        $message = planet_constant('MD_ACTIONDONE');
86
-    }
44
+	$uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
45
+	$ip  = PlanetUtility::planetGetIP();
46
+	if ($article_id > 0) {
47
+		$criteria = new CriteriaCompo(new Criteria('art_id', $article_id));
48
+	} else {
49
+		$criteria = new CriteriaCompo(new Criteria('blog_id', $blog_id));
50
+	}
51
+	if ($uid > 0) {
52
+		$criteria->add(new Criteria('rate_uid', $uid));
53
+	} else {
54
+		$criteria->add(new Criteria('rate_ip', $ip));
55
+		$criteria->add(new Criteria('rate_time', time() - 24 * 3600, '>'));
56
+	}
57
+	$rateHandler = xoops_getModuleHandler('rate', $GLOBALS['moddirname']);
58
+	if ($count = $rateHandler->getCount($criteria)) {
59
+		$message = planet_constant('MD_ALREADYRATED');
60
+	} else {
61
+		$rate_obj = $rateHandler->create();
62
+		if ($article_id > 0) {
63
+			$rate_obj->setVar('art_id', $article_id);
64
+		} else {
65
+			$rate_obj->setVar('blog_id', $blog_id);
66
+		}
67
+		$rate_obj->setVar('rate_uid', $uid);
68
+		$rate_obj->setVar('rate_ip', $ip);
69
+		$rate_obj->setVar('rate_rating', $rate);
70
+		$rate_obj->setVar('rate_time', time());
71
+		if (!$rate_id = $rateHandler->insert($rate_obj, true)) {
72
+			redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_NOTSAVED'));
73
+		}
74
+		if ($article_id > 0) {
75
+			$article_obj = $articleHandler->get($article_id);
76
+			$article_obj->setVar('art_rating', $article_obj->getVar('art_rating') + $rate);
77
+			$article_obj->setVar('art_rates', $article_obj->getVar('art_rates') + 1);
78
+			$articleHandler->insert($article_obj, true);
79
+		} else {
80
+			$blog_obj = $blogHandler->get($blog_id);
81
+			$blog_obj->setVar('blog_rating', $blog_obj->getVar('blog_rating') + $rate);
82
+			$blog_obj->setVar('blog_rates', $blog_obj->getVar('blog_rates') + 1);
83
+			$blogHandler->insert($blog_obj, true);
84
+		}
85
+		$message = planet_constant('MD_ACTIONDONE');
86
+	}
87 87
 }
88 88
 if ($article_id > 0) {
89
-    redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_id, 2, $message);
89
+	redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_id, 2, $message);
90 90
 } else {
91
-    redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, $message);
91
+	redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, $message);
92 92
 }
93 93
 include __DIR__ . '/footer.php';
Please login to merge, or discard this patch.
include/vars.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 
28 28
 if (!defined('PLANET_INI')) {
29
-    define('PLANET_INI', 1);
29
+	define('PLANET_INI', 1);
30 30
 }
31 31
 
32 32
 require_once __DIR__ . '/../class/utility.php';
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
 // include customized variables
57 57
 if (is_object($GLOBALS['xoopsModule']) && $GLOBALS['moddirname'] == $GLOBALS['xoopsModule']->getVar('dirname', 'n')) {
58
-    $GLOBALS['xoopsModuleConfig'] = planet_load_config();
58
+	$GLOBALS['xoopsModuleConfig'] = planet_load_config();
59 59
 }
60 60
 
61 61
 planet_load_object();
Please login to merge, or discard this patch.
comment_new.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@
 block discarded – undo
27 27
 include __DIR__ . '/header.php';
28 28
 $com_itemid = isset($_GET['com_itemid']) ? (int)$_GET['com_itemid'] : 0;
29 29
 if ($com_itemid > 0) {
30
-    $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']);
31
-    $article_obj    = $articleHandler->get($com_itemid);
32
-    $com_replytitle = $article_obj->getVar('art_title');
33
-    require_once XOOPS_ROOT_PATH . '/include/comment_new.php';
30
+	$articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']);
31
+	$article_obj    = $articleHandler->get($com_itemid);
32
+	$com_replytitle = $article_obj->getVar('art_title');
33
+	require_once XOOPS_ROOT_PATH . '/include/comment_new.php';
34 34
 }
Please login to merge, or discard this patch.
action.bookmark.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 $blog_id = Request::getInt('blog', Request::getInt('blog', 0, 'POST'), 'GET'); //(int)(isset($_GET['blog']) ? $_GET['blog'] : (isset($_POST['blog']) ? $_POST['blog'] : 0));
32 32
 
33 33
 if (!is_object($xoopsUser) || empty($blog_id)) {
34
-    redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID'));
34
+	redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID'));
35 35
 }
36 36
 
37 37
 $bookmarkHandler = xoops_getModuleHandler('bookmark', $GLOBALS['moddirname']);
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
 $criteria        = new CriteriaCompo(new Criteria('blog_id', $blog_id));
40 40
 $criteria->add(new Criteria('bm_uid', $uid));
41 41
 if ($count = $bookmarkHandler->getCount($criteria)) {
42
-    $message = planet_constant('MD_ALREADYBOOKMARKED');
43
-    redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $uid, 2, $message);
42
+	$message = planet_constant('MD_ALREADYBOOKMARKED');
43
+	redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $uid, 2, $message);
44 44
 }
45 45
 $bookmark_obj = $bookmarkHandler->create();
46 46
 $bookmark_obj->setVar('blog_id', $blog_id);
47 47
 $bookmark_obj->setVar('bm_uid', $uid);
48 48
 if (!$bookmark_id = $bookmarkHandler->insert($bookmark_obj, true)) {
49
-    redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, planet_constant('MD_NOTSAVED'));
49
+	redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, planet_constant('MD_NOTSAVED'));
50 50
 }
51 51
 $blogHandler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
52 52
 $blog_obj    = $blogHandler->get($blog_id);
Please login to merge, or discard this patch.
admin/admin_header.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
 if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) {
32 32
 } else {
33
-    $moduleHelper = Xmf\Module\Helper::getHelper('system');
33
+	$moduleHelper = Xmf\Module\Helper::getHelper('system');
34 34
 }
35 35
 $adminObject = \Xmf\Module\Admin::getInstance();
36 36
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 $myts = MyTextSanitizer::getInstance();
47 47
 
48 48
 if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) {
49
-    require_once $GLOBALS['xoops']->path('class/template.php');
50
-    $xoopsTpl = new XoopsTpl();
49
+	require_once $GLOBALS['xoops']->path('class/template.php');
50
+	$xoopsTpl = new XoopsTpl();
51 51
 }
52 52
 
53 53
 require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
Please login to merge, or discard this patch.
admin/admin.article.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -41,18 +41,18 @@  discard block
 block discarded – undo
41 41
 
42 42
 $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']);
43 43
 if (!empty($xoopsModuleConfig['article_expire'])) {
44
-    $criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<');
45
-    if (!empty($_GET['purge'])) {
46
-        $crit = new CriteriaCompo($criteria);
47
-        $crit->add(new Criteria('art_comments', 0));
48
-        $article_expires = $articleHandler->getObjects($criteria);
49
-        foreach ($article_expires as $id => $article_obj) {
50
-            $articleHandler->delete($article_obj);
51
-        }
52
-    }
53
-    $article_count_expire = $articleHandler->getCount($criteria);
44
+	$criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<');
45
+	if (!empty($_GET['purge'])) {
46
+		$crit = new CriteriaCompo($criteria);
47
+		$crit->add(new Criteria('art_comments', 0));
48
+		$article_expires = $articleHandler->getObjects($criteria);
49
+		foreach ($article_expires as $id => $article_obj) {
50
+			$articleHandler->delete($article_obj);
51
+		}
52
+	}
53
+	$article_count_expire = $articleHandler->getCount($criteria);
54 54
 } else {
55
-    $article_count_expire = 0;
55
+	$article_count_expire = 0;
56 56
 }
57 57
 $article_count = $articleHandler->getCount();
58 58
 
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 echo "<br clear=\"all\">" . planet_constant('AM_COUNT') . ': ' . $article_count;
62 62
 echo "<br clear=\"all\">";
63 63
 if ($article_count_expire > 0) {
64
-    echo "<br clear=\"all\"><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire . '</a>';
65
-    echo "<br clear=\"all\">";
64
+	echo "<br clear=\"all\"><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire . '</a>';
65
+	echo "<br clear=\"all\">";
66 66
 }
67 67
 echo '</div>';
68 68
 echo "</fieldset><br clear=\"all\">";
Please login to merge, or discard this patch.
admin/main.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
 echo '</text><br>';
106 106
 echo '<label>' . planet_constant('AM_TOTAL_BLOGS') . ':</label><text>' . $blog_count;
107 107
 if ($blog_count_pending > 0) {
108
-    echo " (<font color=\"red\">" . $blog_count_pending . '</font>)';
108
+	echo " (<font color=\"red\">" . $blog_count_pending . '</font>)';
109 109
 }
110 110
 echo '</text><br>';
111 111
 echo '<label>' . planet_constant('AM_TOTAL_ARTICLES') . ':</label><text>' . $article_count;
Please login to merge, or discard this patch.
counter.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@
 block discarded – undo
29 29
 include __DIR__ . '/header.php';
30 30
 $article_id = Request::getInt('article', 0, 'GET');//empty($_GET['article']) ? 0 : (int)$_GET['article'];
31 31
 if (empty($article_id)) {
32
-    return;
32
+	return;
33 33
 }
34 34
 if (planetGetCookie('art_' . $article_id) > 0) {
35
-    return;
35
+	return;
36 36
 }
37 37
 $articleHandler = xoops_getModuleHandler('article', $xoopsModule->getVar('dirname'));
38 38
 $article_obj    = $articleHandler->get($article_id);
Please login to merge, or discard this patch.