@@ -88,7 +88,9 @@ discard block |
||
88 | 88 | "FOREIGN KEY (poster_id) REFERENCES $adminTableName($adminIdColumnName)"); |
89 | 89 | } |
90 | 90 | $attributes = array('ENGINE' => 'InnoDB'); |
91 | - if (!$this->ci->dbforge->create_table($blogName, true, $attributes)) return false; |
|
91 | + if (!$this->ci->dbforge->create_table($blogName, true, $attributes)) { |
|
92 | + return false; |
|
93 | + } |
|
92 | 94 | return true; |
93 | 95 | } |
94 | 96 | /** |
@@ -172,7 +174,9 @@ discard block |
||
172 | 174 | } elseif ($action == "publish" || $action == "createAndPublish") { |
173 | 175 | if ($action == "publish") { |
174 | 176 | $id = $this->ci->security->xss_clean($this->ci->input->post("id")); |
175 | - if ($id == "") return self::ABORT; |
|
177 | + if ($id == "") { |
|
178 | + return self::ABORT; |
|
179 | + } |
|
176 | 180 | $this->ci->bmanager->savePost($id, $this->ci->security->xss_clean($this->ci->input->post("title")), $this->ci->security->xss_clean($this->ci->input->post("editor")), $posterId); |
177 | 181 | $this->ci->bmanager->publishPost($id, true); |
178 | 182 | return self::PUBLISH; |
@@ -181,7 +185,9 @@ discard block |
||
181 | 185 | return self::CREATE_AND_PUBLISH; |
182 | 186 | } |
183 | 187 | } elseif ($action == "delete") { |
184 | - if ($this->ci->bmanager->deletePost($this->ci->security->xss_clean($this->ci->input->post("id")))) return self::DELETE; |
|
188 | + if ($this->ci->bmanager->deletePost($this->ci->security->xss_clean($this->ci->input->post("id")))) { |
|
189 | + return self::DELETE; |
|
190 | + } |
|
185 | 191 | } |
186 | 192 | return false; |
187 | 193 | } |
@@ -208,7 +214,9 @@ discard block |
||
208 | 214 | * @return [type] [description] |
209 | 215 | */ |
210 | 216 | public function renderPostItems($view=null, $callback=null, $empty_view=null, $page=1, $limit=5, $filter=false, $hits=false, $slug=true) { |
211 | - if ($view == null || $empty_view == null) $this->ci->load->bind("francis94c/blog", $blogger); |
|
217 | + if ($view == null || $empty_view == null) { |
|
218 | + $this->ci->load->bind("francis94c/blog", $blogger); |
|
219 | + } |
|
212 | 220 | $posts = $this->getPosts($page, $limit, $filter, $hits); |
213 | 221 | if (count($posts) == 0) { |
214 | 222 | if ($empty_view == null) { $blogger->load->view("empty"); } else { |
@@ -242,7 +250,9 @@ discard block |
||
242 | 250 | * @return [type] [description] |
243 | 251 | */ |
244 | 252 | public function renderPost($post, $view=null) { |
245 | - if (!is_array($post)) $post = $this->ci->bmanager->getPost($post); |
|
253 | + if (!is_array($post)) { |
|
254 | + $post = $this->ci->bmanager->getPost($post); |
|
255 | + } |
|
246 | 256 | $post["content"] = $this->ci->parsedown->text($post["content"]); |
247 | 257 | if ($view == null) { |
248 | 258 | $this->ci->load->splint("francis94c/blog", "-post_item", $post); |
@@ -259,7 +269,9 @@ discard block |
||
259 | 269 | $data = array(); |
260 | 270 | $data["title"] = $post["title"]; |
261 | 271 | $data["description"] = substr($post["content"], 0, 154); |
262 | - if (isset($post["share_image"])) $data["image_link"] = $post["share_image"]; |
|
272 | + if (isset($post["share_image"])) { |
|
273 | + $data["image_link"] = $post["share_image"]; |
|
274 | + } |
|
263 | 275 | $data["url"] = current_url(); |
264 | 276 | return $this->ci->load->splint(self::PACKAGE, "-meta_og", $data, true); |
265 | 277 | } |