function getDefaultComments($iEventId) { $oComments = new BxWallCmts($this->_oConfig->getCommentSystemName(), $iEventId); return $oComments->getCommentsFirst('comment'); }
function getCommon($aEvent) { $sPrefix = $this->_oConfig->getCommonPostPrefix(); if (strpos($aEvent['type'], $sPrefix) !== 0) { return ""; } if ((int) $aEvent['content'] > 0 && in_array($aEvent['type'], array($sPrefix . 'photos', $sPrefix . 'sounds', $sPrefix . 'videos'))) { $sMediaType = str_replace($sPrefix, '', $aEvent['type']); $aEvent = array_merge($aEvent, $this->_getCommonMedia($sMediaType, (int) $aEvent['content'])); if ((int) $aEvent['content'] > 0) { $aEvent['content'] = _t('_wall_content_not_ready'); } else { $this->_oDb->updateEvent(array('content' => process_db_input($aEvent['content'], BX_TAGS_VALIDATE), 'title' => process_db_input($aEvent['title'], BX_TAGS_STRIP), 'description' => process_db_input($aEvent['description'], BX_TAGS_STRIP)), $aEvent['id']); } } $aAuthor = $this->_oDb->getUser($aEvent['object_id']); $aVariables = array('author_thumbnail' => get_member_icon($aAuthor['id']), 'author_url' => getProfileLink($aAuthor['id']), 'author_username' => $aAuthor['username'], 'post_id' => $aEvent['id'], 'post_ago' => $aEvent['ago'], 'bx_if:post_delete' => array('condition' => $this->_isCommentDeleteAllowed(), 'content' => array('js_view_object' => $this->_sJsViewObject, 'post_id' => $aEvent['id'], 'post_delete_txt' => _t('_wall_post_delete'))), 'post_content' => $aEvent['content']); switch (str_replace($sPrefix, '', $aEvent['type'])) { case 'text': $aVariables = array_merge($aVariables, array('post_wrote' => _t("_wall_wrote"), 'post_content' => $aVariables['post_content'])); break; case 'link': $aVariables = array_merge($aVariables, array('post_wrote' => _t("_wall_shared_link"))); break; case 'photos': $aVariables = array_merge($aVariables, array('post_wrote' => _t("_wall_added_photo"))); break; case 'videos': $aVariables = array_merge($aVariables, array('post_wrote' => _t("_wall_added_video"))); break; case 'sounds': $aVariables = array_merge($aVariables, array('post_wrote' => _t("_wall_added_music"))); break; } $sType = isset($aEvent['action']) && empty($aEvent['action']) ? 'reply' : 'comment'; $oComments = new BxWallCmts($this->_oConfig->getCommentSystemName(), $aEvent['id']); $aVariables = array_merge($aVariables, array('comments_content' => $oComments->getCommentsFirst($sType))); return $this->_oTemplate->parseHtmlByTemplateName('balloon', $aVariables); }