protected function getUserSettingsDB() { $start = ""; $limit = ""; $where = "#__quipforum_user_settings.user_id = '" . $this->userData->id . "'"; $order = ""; $query = comQuipForumHelper::buildQuery("SELECT #__quipforum_user_settings.*, " . "FROM #__quipforum_user_settings ", $start, $limit, $where, $order); $db =& JFactory::getDBO(); $db->setQuery($query); $this->userSettings = $db->loadObject(); }
protected function getBoardsDataDB() { $start = ""; $limit = ""; $where = ""; $order = ""; $query = comQuipForumHelper::buildQuery("SELECT #__quipforum_boards.* " . "FROM #__quipforum_boards", $start, $limit, $where, $order); $db =& JFactory::getDBO(); $db->setQuery($query); $this->data = $db->loadObjectList('id'); }
protected function getForumObjectListDB($order = null) { $start = ""; $limit = ""; $where = "published = '1' "; if ($order == null) { $order = "#__quipforum_boards.ordering"; } $query = comQuipForumHelper::buildQuery("SELECT #__quipforum_boards.id, " . "#__quipforum_boards.topic, " . "#__quipforum_boards.description, " . "#__quipforum_boards.tag, " . "#__quipforum_boards.thread_count " . "FROM #__quipforum_boards", $start, $limit, $where, $order); $db =& JFactory::getDBO(); $db->setQuery($query); $this->forumObjectList = $db->loadObjectList(); }
protected function getPostDataDB($id = null) { if (!$id) { JError::raiseError('404', JText::_('Post not found')); } $start = ""; $limit = ""; $where = "#__quipforum_posts.id = '" . $id . "'"; $order = ""; $query = comQuipForumHelper::buildQuery("SELECT #__quipforum_posts.* " . "FROM #__quipforum_posts ", $start, $limit, $where, $order); $db =& JFactory::getDBO(); $db->setQuery($query); $this->postData = $db->loadObject(); // Now for the board ID code(s) #plural after singular works.. $start = ""; $limit = ""; $where = "#__quipforum_post_references.id = '" . $id . "'"; $order = ""; $query = comQuipForumHelper::buildQuery("SELECT #__quipforum_post_references.board_id " . "FROM #__quipforum_post_references ", $start, $limit, $where, $order); $db =& JFactory::getDBO(); $db->setQuery($query); $this->postData->board_id = $db->loadObject()->board_id; return $this->postData; }
public static function getLog($post_id) { $log = null; $start = ""; $limit = ""; $where = "post_id = '" . $post_id . "' "; $order = ""; $query = comQuipForumHelper::buildQuery("SELECT #__quipforum_post_logs.log " . "FROM #__quipforum_post_logs ", $start, $limit, $where, $order); $db =& JFactory::getDBO(); $db->setQuery($query); $logs = $db->loadObjectList(); foreach ((array) $logs as $k => $v) { $log .= " <li>" . $v->log . "</li>"; } $log = "<h3>Post activity log</h3> <ul>" . $log . "</ul>"; return $log; }
protected function getBlobConversionDB() { $start = ""; $limit = "15000"; $where = "#__text_duplicate.checked = '0'"; $order = ""; $query = comQuipForumHelper::buildQuery("SELECT #__text_duplicate.body, " . "#__text_duplicate.id, " . "#__text_duplicate.checked, " . "#__text_duplicate.compressed, " . "#__text_duplicate.bodyblob " . "FROM #__text_duplicate ", $start, $limit, $where, $order); $db =& JFactory::getDBO(); $db->setQuery($query); $this->boardData = $db->loadObjectList(); }
protected function getPostLinksDB($id) { $start = ""; $limit = ""; $where = "#__quipforum_links.post_id = '" . $id . "'"; $order = ""; $query = comQuipForumHelper::buildQuery("SELECT #__quipforum_links.id, " . "#__quipforum_links.url " . "FROM #__quipforum_links", $start, $limit, $where, $order); $db =& JFactory::getDBO(); $db->setQuery($query); return $db->loadObjectList(); }
protected function getThreadDB() { $query = comQuipForumHelper::buildQuery("SELECT " . "#__quipforum_threads.thread_cache " . "FROM #__quipforum_threads " . "WHERE #__quipforum_threads.id = '" . $this->postData->thread_id . "'"); $db =& JFactory::getDBO(); $db->setQuery($query); $this->threadData = $db->loadObjectList(); }
protected function getPreBoardDB() { $admin_where = ""; $userData = JFactory::getUser(); if ($userData->authorise('core.manage', 'com_quipforum')) { $admin_where = ""; } else { $admin_where = " AND (#__quipforum_flagged_posts.type = 'sticky' OR #__quipforum_flagged_posts.type = 'announcement') "; } $start = ""; $limit = ""; $where = "#__quipforum_flagged_posts.board_id = '" . JRequest::getInt('id') . "'" . $admin_where; $order = ""; $query = comQuipForumHelper::buildQuery("SELECT " . "#__quipforum_flagged_posts.*, " . "#__quipforum_posts.* " . "FROM #__quipforum_flagged_posts " . "LEFT JOIN #__quipforum_posts " . "ON #__quipforum_posts.id = " . "#__quipforum_flagged_posts.post_id ", $start, $limit, $where, $order); $db =& JFactory::getDBO(); $db->setQuery($query); $this->preBoardData = $db->loadObjectList(); }