function boards_content_store($pContent, $pParamHash) { global $gBitDb, $gBitSmarty, $gBitSystem; require_once BOARDS_PKG_PATH . 'BitBoardTopic.php'; // do not allow unassigning topics. the UI should prevent this, but just to make sure... if ($pContent->isValid() && !$pContent->isContentType(BITBOARDTOPIC_CONTENT_TYPE_GUID) && !$pContent->isContentType(BITBOARD_CONTENT_TYPE_GUID)) { // wipe out all previous assignments for good measure. Not the sanest thing to do, but edits are infrequent - at least for now if ($gBitSystem->isFeatureActive('boards_link_by_pigeonholes') && $gBitSystem->isPackageActive('pigeonholes')) { // Delete all old mappings $pContent->mDb->query("DELETE FROM `" . BIT_DB_PREFIX . "boards_map` WHERE `topic_content_id`=?", array($pContent->mContentId)); // Get the pigeonholes this content is in $p = null; if (!empty($pParamHash['pigoneholes'])) { foreach ($pParamHash['pigeonholes']['pigeonhole'] as $p_id) { require_once PIGEONHOLES_PKG_PATH . 'Pigeonholes.php'; if (empty($p)) { $p = new Pigeonholes(); } // What boards are in the same pigeonhole? $params = array('content_type_guid' => BITBOARD_CONTENT_TYPE_GUID, 'content_id' => $p_id); $boards = $p->getMemberList($params); // Insert into these boards foreach ($boards as $board) { if (@BitBase::verifyId($board['content_id'])) { $pContent->mDb->query("INSERT INTO `" . BIT_DB_PREFIX . "boards_map` (`board_content_id`,`topic_content_id`) VALUES (?,?)", array($board['content_id'], $pContent->mContentId)); } } } } } else { $pContent->mDb->query("DELETE FROM `" . BIT_DB_PREFIX . "boards_map` WHERE `topic_content_id`=?", array($pContent->mContentId)); if (@BitBase::verifyId($pParamHash['linked_board_cid'])) { $pContent->mDb->query("INSERT INTO `" . BIT_DB_PREFIX . "boards_map` (`board_content_id`,`topic_content_id`) VALUES (?,?)", array($pParamHash['linked_board_cid'], $pContent->mContentId)); } } $gBitSmarty->assign('boardInfo', BitBoard::getLinkedBoard($pContent->mContentId)); } else { if (@BitBase::verifyId($pParamHash['content_id']) && @BitBase::verifyId($pParamHash['linked_board_cid'])) { $pContent->mDb->query("INSERT INTO `" . BIT_DB_PREFIX . "boards_map` (`board_content_id`,`topic_content_id`) VALUES (?,?)", array($pParamHash['linked_board_cid'], $pParamHash['content_id'])); } } }
if (!isset($pos_var['children'])) { $pos_var['children'] = array(); } if (!isset($pos_var['children'][$pos_v - 1])) { $pos_var['children'][$pos_v - 1] = array(); } $pos_var =& $pos_var['children'][$pos_v - 1]; } } if (empty($pos_var['data'])) { $pos_var['children'] = array(); $pos_var['data'] = $c; $mlHash = array(); $mlHash['content_id'] = $c['content_id']; $mlHash['content_type_guid'] = BITBOARD_CONTENT_TYPE_GUID; $pos_var['members'] = $p->getMemberList($mlHash); $board_cids = array(); foreach ($pos_var['members'] as $boardKey) { $board_cids[] = $boardKey['content_id']; } if (count($board_cids) > 0) { $listHash = array('boards' => $board_cids, 'paginationOff' => 'y'); $board = new BitBoard(); $pos_var['members'] = $board->getList($listHash); $pos_var['pagination'] = $listHash['listInfo']; $board_all_cids = array_merge($board_all_cids, $board_cids); } } } $ns[] = $d_o; }