/** * Load the data from the database * @param pParamHash be sure to pass by reference in case we need to make modifcations to the hash **/ function load() { if ($this->verifyId($this->mBitForumTopicId) || $this->verifyId($this->mContentId)) { // LibertyContent::load()assumes you have joined already, and will not execute any sql! // This is a significant performance optimization $lookupColumn = $this->verifyId($this->mBitForumTopicId) ? 'bitforum_topic_id' : 'content_id'; $bindVars = array(); $selectSql = $joinSql = $whereSql = ''; array_push($bindVars, $lookupId = @BitBase::verifyId($this->mBitForumTopicId) ? $this->mBitForumTopicId : $this->mContentId); $this->getServicesSql('content_load_sql_function', $selectSql, $joinSql, $whereSql, $bindVars); $query = "SELECT bft.*, lc.*, uue.`login` AS modifier_user, uue.`real_name` AS modifier_real_name, uuc.`login` AS creator_user, uuc.`real_name` AS creator_real_name {$selectSql} \n\t\t\tFROM `" . BIT_DB_PREFIX . "bitforums_topics` bft \n\t\t\t\tINNER JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON( lc.`content_id` = bft.`content_id` ) {$joinSql}\n\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uue ON( uue.`user_id` = lc.`modifier_user_id` )\n\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uuc ON( uuc.`user_id` = lc.`user_id` )\n\t\t\tWHERE bft.`{$lookupColumn}`=? {$whereSql}"; $result = $this->mDb->query($query, $bindVars); if ($result && $result->numRows()) { $this->mInfo = $result->fields; $this->mContentId = $result->fields['content_id']; $this->mBitForumTopicId = $result->fields['bitforum_topic_id']; $this->mInfo['creator'] = isset($result->fields['creator_real_name']) ? $result->fields['creator_real_name'] : $result->fields['creator_user']; $this->mInfo['editor'] = isset($result->fields['modifier_real_name']) ? $result->fields['modifier_real_name'] : $result->fields['modifier_user']; $this->mInfo['display_url'] = $this->getDisplayUrl(); $this->mInfo['parsed_data'] = $this->parseData(); LibertyAttachable::load(); } } return count($this->mInfo); }
/** * Load the data from the database * @param pParamHash be sure to pass by reference in case we need to make modifcations to the hash **/ function load() { if (!empty($this->mYellowPagesId) || !empty($this->mContentId)) { // LibertyContent::load()assumes you have joined already, and will not execute any sql! // This is a significant performance optimization $lookupColumn = !empty($this->mYellowPagesId) ? 'yellowpages_id' : 'content_id'; $lookupId = !empty($this->mYellowPagesId) ? $this->mYellowPagesId : $this->mContentId; $query = "SELECT yp.*, tc.*, " . "uue.`login` AS modifier_user, uue.`real_name` AS modifier_real_name, " . "uuc.`login` AS creator_user, uuc.`real_name` AS creator_real_name " . "FROM `" . BIT_DB_PREFIX . "yellowpages` yp " . "INNER JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON( lc.`content_id` = yp.`content_id` )" . "LEFT JOIN `" . BIT_DB_PREFIX . "users_users` uue ON( uue.`user_id` = lc.`modifier_user_id` )" . "LEFT JOIN `" . BIT_DB_PREFIX . "users_users` uuc ON( uuc.`user_id` = lc.`user_id` )" . "WHERE yp.`{$lookupColumn}`=?"; $result = $this->mDb->query($query, array($lookupId)); if ($result && $result->numRows()) { $this->mInfo = $result->fields; $this->mContentId = $result->fields['content_id']; $this->mYellowPagesId = $result->fields['yellowpages_id']; $this->mInfo['creator'] = isset($result->fields['creator_real_name']) ? $result->fields['creator_real_name'] : $result->fields['creator_user']; $this->mInfo['editor'] = isset($result->fields['modifier_real_name']) ? $result->fields['modifier_real_name'] : $result->fields['modifier_user']; $this->mInfo['display_url'] = $this->getDisplayUrl(); LibertyAttachable::load(); } } return count($this->mInfo); }
/** * Load a Contact content Item * * (Describe Contact object here ) */ function load($pContentId = NULL) { if ($pContentId) { $this->mContentId = (int) $pContentId; } if ($this->verifyId($this->mContentId)) { $query = "select con.*, lc.*,\n\t\t\t\tuue.`login` AS modifier_user, uue.`real_name` AS modifier_real_name,\n\t\t\t\tuuc.`login` AS creator_user, uuc.`real_name` AS creator_real_name\n\t\t\t\tFROM `" . BIT_DB_PREFIX . "contact` con\n\t\t\t\tINNER JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON ( lc.`content_id` = con.`content_id` )\n\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uue ON (uue.`user_id` = lc.`modifier_user_id`)\n\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uuc ON (uuc.`user_id` = lc.`user_id`)\n\t\t\t\tWHERE lc.`content_id`=?"; $result = $this->mDb->query($query, array($this->mContentId)); if ($result && $result->numRows()) { $this->mInfo = $result->fields; $this->mContentId = (int) $result->fields['content_id']; $this->mContactId = (int) $result->fields['contact_id']; $this->mParentId = (int) $result->fields['contact_id']; $this->mContactName = $result->fields['title']; $this->mInfo['creator'] = isset($result->fields['creator_real_name']) ? $result->fields['creator_real_name'] : $result->fields['creator_user']; $this->mInfo['editor'] = isset($result->fields['modifier_real_name']) ? $result->fields['modifier_real_name'] : $result->fields['modifier_user']; $this->mInfo['display_url'] = $this->getDisplayUrl(); } } LibertyAttachable::load(); return; }
/** * Load the data from the database * @param pParamHash be sure to pass by reference in case we need to make modifcations to the hash **/ function load($pContentId = NULL, $pPluginParams = NULL) { global $gBitSystem; if ($this->verifyId($this->mNlpgId) || $this->verifyId($this->mContentId)) { // LibertyContent::load()assumes you have joined already, and will not execute any sql! // This is a significant performance optimization $lookupColumn = $this->verifyId($this->mNlpgId) ? 'nlpg_id' : 'content_id'; $bindVars = array(); $selectSql = ''; $joinSql = ''; $whereSql = ''; array_push($bindVars, $lookupId = @BitBase::verifyId($this->mNlpgId) ? $this->mNlpgId : $this->mContentId); $this->getServicesSql('content_load_sql_function', $selectSql, $joinSql, $whereSql, $bindVars); $query = "SELECT n.*, lc.*, " . "uue.`login` AS modifier_user, uue.`real_name` AS modifier_real_name, " . "uuc.`login` AS creator_user, uuc.`real_name` AS creator_real_name " . "{$selectSql} " . "FROM `" . BIT_DB_PREFIX . "nlpg_metadata` n " . "INNER JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON( lc.`content_id` = n.`content_id` ) {$joinSql}" . "LEFT JOIN `" . BIT_DB_PREFIX . "users_users` uue ON( uue.`user_id` = lc.`modifier_user_id` )" . "LEFT JOIN `" . BIT_DB_PREFIX . "users_users` uuc ON( uuc.`user_id` = lc.`user_id` )" . "WHERE e.`{$lookupColumn}`=? {$whereSql}"; $result = false; // $this->mDb->query( $query, $bindVars ); if ($result && $result->numRows()) { $this->mInfo = $result->fields; $this->mContentId = $result->fields['content_id']; $this->mNlpgId = $result->fields['nlpg_id']; $this->mInfo['creator'] = isset($result->fields['creator_real_name']) ? $result->fields['creator_real_name'] : $result->fields['creator_user']; $this->mInfo['editor'] = isset($result->fields['modifier_real_name']) ? $result->fields['modifier_real_name'] : $result->fields['modifier_user']; $this->mInfo['display_url'] = $this->getDisplayUrl(); $this->mInfo['parsed_data'] = $this->parseData($this->mInfo['data'], $this->mInfo['format_guid']); $prefChecks = array('show_start_time', 'show_end_time'); foreach ($prefChecks as $key => $var) { if ($this->getPreference($var) == 'on') { $this->mInfo[$var] = 1; } else { $this->mInfo[$var] = 0; } } LibertyAttachable::load(); } } return count($this->mInfo); }