@@ -143,7 +143,9 @@ discard block |
||
| 143 | 143 | $this->ci->dbforge->add_field($fields); |
| 144 | 144 | $this->ci->dbforge->add_field("date_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP"); |
| 145 | 145 | $attributes = array('ENGINE' => 'InnoDB'); |
| 146 | - if (!$this->ci->dbforge->create_table($blogName, true, $attributes)) return false; |
|
| 146 | + if (!$this->ci->dbforge->create_table($blogName, true, $attributes)) { |
|
| 147 | + return false; |
|
| 148 | + } |
|
| 147 | 149 | return true; |
| 148 | 150 | } |
| 149 | 151 | /** |
@@ -263,7 +265,9 @@ discard block |
||
| 263 | 265 | } elseif ($action == "publish" || $action == "createAndPublish") { |
| 264 | 266 | if ($action == "publish") { |
| 265 | 267 | $id = $this->ci->security->xss_clean($this->ci->input->post("id")); |
| 266 | - if ($id == "") return self::ABORT; |
|
| 268 | + if ($id == "") { |
|
| 269 | + return self::ABORT; |
|
| 270 | + } |
|
| 267 | 271 | $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); |
| 268 | 272 | $this->ci->bmanager->publishPost($id, true); |
| 269 | 273 | return self::PUBLISH; |
@@ -274,7 +278,9 @@ discard block |
||
| 274 | 278 | return self::ABORT; |
| 275 | 279 | } |
| 276 | 280 | } elseif ($action == "delete") { |
| 277 | - if ($this->ci->bmanager->deletePost($this->ci->security->xss_clean($this->ci->input->post("id")))) return self::DELETE; |
|
| 281 | + if ($this->ci->bmanager->deletePost($this->ci->security->xss_clean($this->ci->input->post("id")))) { |
|
| 282 | + return self::DELETE; |
|
| 283 | + } |
|
| 278 | 284 | } |
| 279 | 285 | return self::NO_ACTION; |
| 280 | 286 | } |
@@ -307,7 +313,9 @@ discard block |
||
| 307 | 313 | * @return [type] [description] |
| 308 | 314 | */ |
| 309 | 315 | public function renderPostItems($view=null, $callback=null, $empty_view=null, $page=1, $limit=5, $filter=false, $hits=false, $slug=true) { |
| 310 | - if ($view == null || $empty_view == null) $this->ci->load->bind("francis94c/blog", $blogger); |
|
| 316 | + if ($view == null || $empty_view == null) { |
|
| 317 | + $this->ci->load->bind("francis94c/blog", $blogger); |
|
| 318 | + } |
|
| 311 | 319 | $posts = $this->getPosts($page, $limit, $filter, $hits); |
| 312 | 320 | if (count($posts) == 0) { |
| 313 | 321 | if ($empty_view == null) { $blogger->load->view("empty"); } else { |
@@ -342,8 +350,12 @@ discard block |
||
| 342 | 350 | * @return [type] [description] |
| 343 | 351 | */ |
| 344 | 352 | public function renderPost($post, $view=null) { |
| 345 | - if (!is_array($post)) $post = $this->ci->bmanager->getPost($post); |
|
| 346 | - if (!$post) return false; |
|
| 353 | + if (!is_array($post)) { |
|
| 354 | + $post = $this->ci->bmanager->getPost($post); |
|
| 355 | + } |
|
| 356 | + if (!$post) { |
|
| 357 | + return false; |
|
| 358 | + } |
|
| 347 | 359 | $post["content"] = $this->ci->parsedown->text($post["content"]); |
| 348 | 360 | if ($view == null) { |
| 349 | 361 | $this->ci->load->splint("francis94c/blog", "-post_item", $post); |
@@ -361,7 +373,9 @@ discard block |
||
| 361 | 373 | $data = array(); |
| 362 | 374 | $data["title"] = $post["title"]; |
| 363 | 375 | $data["description"] = substr($post["content"], 0, 154); |
| 364 | - if (isset($post["share_image"])) $data["image_link"] = $post["share_image"]; |
|
| 376 | + if (isset($post["share_image"])) { |
|
| 377 | + $data["image_link"] = $post["share_image"]; |
|
| 378 | + } |
|
| 365 | 379 | $data["url"] = current_url(); |
| 366 | 380 | return $this->ci->load->splint(self::PACKAGE, "-meta_og", $data, true); |
| 367 | 381 | } |