// Db include 'config/db.php'; include_once 'root.php'; include_once 'lib/database.php'; include_once 'lib/auth.php'; include_once 'controllers/master_controller.php'; include_once 'controllers/users.php'; include_once 'models/master.php'; include_once 'models/user.php'; include_once 'models/topic.php'; $db = \Lib\Database::get_instance()->get_db(); $auth = \Lib\Auth::get_instance(); $register_controller = new \Controllers\Users_Controller(); // $topics_model = new \Models\Topic_Model(); $user_model = new \Models\User_Model(); $message = ''; $message1 = ''; if (isset($_GET['mid'])) { $mid = $_GET['mid']; $user = $user_model->find(array('where' => 'id = "' . $mid . '"')); if (empty($user)) { header('Location: ' . DX_ROOT_URL); exit; } } else { header('Location: ' . DX_ROOT_URL); exit; } $member = $user_model->get($mid);
<?php header('Content-Type: text/html; charset=utf-8'); // Db include 'config/db.php'; include_once 'root.php'; include_once 'lib/database.php'; include_once 'lib/auth.php'; include_once 'controllers/master_controller.php'; include_once 'models/master.php'; include_once 'models/category.php'; include_once 'models/topic.php'; $db = \Lib\Database::get_instance()->get_db(); $auth = \Lib\Auth::get_instance(); $topics_model = new \Models\Topic_Model(); if (isset($_GET['cid'])) { $cid = $_GET['cid']; $topics = $topics_model->find(array('where' => 'category_id = "' . $cid . '"')); if (empty($topics)) { header('Location: ' . DX_ROOT_URL); exit; } } else { header('Location: ' . DX_ROOT_URL); exit; } if (isset($_GET['logout'])) { Lib\Auth::get_instance()->logout(); header('Location: ' . DX_ROOT_URL); exit; }
<?php header('Content-Type: text/html; charset=utf-8'); // Db include 'config/db.php'; include_once 'root.php'; include_once 'lib/database.php'; include_once 'lib/auth.php'; include_once 'controllers/master_controller.php'; include_once 'models/master.php'; include_once 'models/category.php'; include_once 'models/topic.php'; include_once 'models/answer.php'; $db = \Lib\Database::get_instance()->get_db(); $auth = \Lib\Auth::get_instance(); $topics_model = new \Models\Topic_Model(); $answer_model = new \Models\Answer_Model(); $message = ''; if (isset($_GET['tid'])) { $tid = $_GET['tid']; $topic = $topics_model->find(array('where' => 'id = "' . $tid . '"')); if (!empty($topic)) { $views = $topic[0]['views'] + 1; $topics_model->update(array('id' => $tid, 'views' => $views)); } else { header('Location: ' . DX_ROOT_URL); } } else { header('Location: ' . DX_ROOT_URL); } $answers = $answer_model->find(array('where' => 'topic_id = "' . $tid . '"'));