本文整理汇总了PHP中process_db_input函数的典型用法代码示例。如果您正苦于以下问题:PHP process_db_input函数的具体用法?PHP process_db_input怎么用?PHP process_db_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了process_db_input函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getList
function _getList($mixedResult, $bActive = false)
{
$aForm = array('form_attrs' => array('id' => 'adm-email-templates', 'action' => $GLOBALS['site']['url_admin'] . 'email_templates.php', 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array('db' => array('table' => 'sys_email_templates', 'key' => 'ID', 'uri' => '', 'uri_title' => '', 'submit_name' => 'adm-emial-templates-save')), 'inputs' => array());
$aLanguages = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Title` AS `title` FROM `sys_localization_languages`");
$aLanguageChooser = array(array('key' => 0, 'value' => 'default'));
foreach ($aLanguages as $aLanguage) {
$aLanguageChooser[] = array('key' => $aLanguage['id'], 'value' => $aLanguage['title']);
}
$sLanguageCpt = _t('_adm_txt_email_language');
$sSubjectCpt = _t('_adm_txt_email_subject');
$sBodyCpt = _t('_adm_txt_email_body');
$aEmails = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Name` AS `name`, `Subject` AS `subject`, `Body` AS `body`, `Desc` AS `description` FROM `sys_email_templates` WHERE `LangID`='0' ORDER BY `ID`");
foreach ($aEmails as $aEmail) {
$aForm['inputs'] = array_merge($aForm['inputs'], array($aEmail['name'] . '_Beg' => array('type' => 'block_header', 'caption' => $aEmail['description'], 'collapsable' => true, 'collapsed' => true), $aEmail['name'] . '_Language' => array('type' => 'select', 'name' => $aEmail['name'] . '_Language', 'caption' => $sLanguageCpt, 'value' => 0, 'values' => $aLanguageChooser, 'db' => array('pass' => 'Int'), 'attrs' => array('onchange' => "javascript:getTranslations(this)")), $aEmail['name'] . '_Subject' => array('type' => 'text', 'name' => $aEmail['name'] . '_Subject', 'caption' => $sSubjectCpt, 'value' => $aEmail['subject'], 'db' => array('pass' => 'Xss')), $aEmail['name'] . '_Body' => array('type' => 'textarea', 'name' => $aEmail['name'] . '_Body', 'caption' => $sBodyCpt, 'value' => $aEmail['body'], 'db' => array('pass' => 'XssHtml')), $aEmail['name'] . '_End' => array('type' => 'block_end')));
}
$aForm['inputs']['adm-emial-templates-save'] = array('type' => 'submit', 'name' => 'adm-emial-templates-save', 'value' => _t('_adm_btn_email_save'));
$oForm = new BxTemplFormView($aForm);
$oForm->initChecker();
$sResult = "";
if ($oForm->isSubmittedAndValid()) {
$iResult = 0;
foreach ($aEmails as $aEmail) {
$iEmailId = (int) $GLOBALS['MySQL']->getOne("SELECT `ID` FROM `sys_email_templates` WHERE `Name`='" . process_db_input($aEmail['name']) . "' AND `LangID`='" . (int) $_POST[$aEmail['name'] . '_Language'] . "' LIMIT 1");
if ($iEmailId != 0) {
$iResult += (int) $GLOBALS['MySQL']->query("UPDATE `sys_email_templates` SET `Subject`='" . process_db_input($_POST[$aEmail['name'] . '_Subject']) . "', `Body`='" . process_db_input($_POST[$aEmail['name'] . '_Body']) . "' WHERE `ID`='" . $iEmailId . "'");
} else {
$iResult += (int) $GLOBALS['MySQL']->query("INSERT INTO `sys_email_templates` SET `Name`='" . process_db_input($aEmail['name']) . "', `Subject`='" . process_db_input($_POST[$aEmail['name'] . '_Subject']) . "', `Body`='" . process_db_input($_POST[$aEmail['name'] . '_Body']) . "', `LangID`='" . (int) $_POST[$aEmail['name'] . '_Language'] . "'");
}
}
$bActive = true;
$sResult .= MsgBox(_t($iResult > 0 ? "_adm_txt_email_success_save" : "_adm_txt_email_nothing_changed"), 3);
}
$sResult .= $oForm->getCode();
return $GLOBALS['oAdmTemplate']->parseHtmlByName('email_templates_list.html', array('display' => $bActive ? 'block' : 'none', 'content' => stripslashes($sResult), 'loading' => LoadingBox('adm-email-loading')));
}
示例2: _checkProfileMatch
function _checkProfileMatch($iProfileId, $sAction)
{
$aProfile = getProfileInfo($iProfileId);
if ($aProfile['Status'] == 'Active' && ($aProfile['UpdateMatch'] || $sAction == 'join')) {
$oDb = new BxDolDb();
// clear field "UpdateMatch"
$oDb->query("UPDATE `Profiles` SET `UpdateMatch` = 0 WHERE `ID`= {$iProfileId}");
// clear cache
$oDb->query("DELETE FROM `sys_profiles_match`");
// get send mails
$aSendMails = $oDb->getRow("SELECT `profiles_match` FROM `sys_profiles_match_mails` WHERE `profile_id` = {$iProfileId}");
$aSend = !empty($aSendMails) ? unserialize($aSendMails['profiles_match']) : array();
$aProfiles = getMatchProfiles($iProfileId);
foreach ($aProfiles as $iProfId) {
if (!isset($aSend[(int) $iProfId])) {
$oEmailTemplate = new BxDolEmailTemplates();
$aMessage = $oEmailTemplate->parseTemplate('t_CupidMail', array('StrID' => $iProfId, 'MatchProfileLink' => getProfileLink($iProfileId)), $iProfId);
$aProfile = getProfileInfo($iProfId);
if (!empty($aProfile) && $aProfile['Status'] == 'Active') {
$oDb->query("INSERT INTO `sys_sbs_queue`(`email`, `subject`, `body`) VALUES('" . $aProfile['Email'] . "', '" . process_db_input($aMessage['subject'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "', '" . process_db_input($aMessage['body'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "')");
}
$aSend[(int) $iProfId] = 0;
}
}
if (empty($aSendMails)) {
$oDb->query("INSERT INTO `sys_profiles_match_mails`(`profile_id`, `profiles_match`) VALUES({$iProfileId}, '" . serialize($aSend) . "')");
} else {
$oDb->query("UPDATE `sys_profiles_match_mails` SET `profiles_match` = '" . serialize($aSend) . "' WHERE `profile_id` = {$iProfileId}");
}
}
}
示例3: BxBaseBrowse
/**
* Class constructor ;
*
* @param : $aFilteredSettings (array) ;
* : sex (string) - set filter by sex,
* : age (string) - set filter by age,
* : country (string) - set filter by country,
* : photos_only (string) - set filter 'with photo only',
* : online_only (string) - set filter 'online only',
* @param : $aDisplaySettings (array) ;
* : page (integer) - current page,
* : per_page (integer) - number ellements for per page,
* : sort (string) - sort parameters for SQL instructions,
* : mode (mode) - switch mode to extended and simple,
* @param : $sPageName (string) - page name (need for page builder);
*/
function BxBaseBrowse(&$aFilteredSettings, &$aDisplaySettings, $sPageName)
{
if (isset($aFilteredSettings['sex']) and $aFilteredSettings['sex'] == 'all') {
$aFilteredSettings['sex'] = null;
}
if (isset($aFilteredSettings['age']) and $aFilteredSettings['age'] == 'all') {
$aFilteredSettings['age'] = null;
}
if (isset($aFilteredSettings['country']) and $aFilteredSettings['country'] == 'all') {
$aFilteredSettings['country'] = null;
}
$this->aParameters = array('sex' => process_db_input($aFilteredSettings['sex'], BX_TAGS_STRIP), 'age' => process_db_input($aFilteredSettings['age'], BX_TAGS_STRIP), 'country' => process_db_input($aFilteredSettings['country'], BX_TAGS_STRIP));
$this->aAdditionalParameters = array('photos_only' => process_db_input($aFilteredSettings['photos_only'], BX_TAGS_STRIP), 'online_only' => process_db_input($aFilteredSettings['online_only'], BX_TAGS_STRIP));
$this->aDisplaySettings =& $aDisplaySettings;
// fill sKeyName with parameters for search into cache file ;
$this->sKeyName .= $this->aParameters['sex'] ? $this->aParameters['sex'] . '|' : '';
$this->sKeyName .= $this->aParameters['age'] ? $this->aParameters['age'] . '|' : '';
$this->sKeyName .= $this->aParameters['country'] ? $this->aParameters['country'] . '|' : '';
$this->sKeyName .= $this->aAdditionalParameters['photos_only'] ? 'photo|' : '';
$this->sKeyName .= $this->aAdditionalParameters['online_only'] ? 'online|' : '';
$this->sKeyName = preg_replace("|\\|\$|", '', $this->sKeyName);
parent::BxDolBrowse();
// fill global array with the needed parameters ;
$this->_getGlobalStatistics($this->aParameters['sex'], $this->aParameters['age'], $this->aParameters['country'], $aFilteredSettings['photos_only'], $aFilteredSettings['online_only']);
$this->oSearchProfileTmpl = new BxTemplSearchProfile();
// return all page's blocks from DB ;
$this->BxDolPageView($sPageName);
}
示例4: getSearchResultsKeyword
function getSearchResultsKeyword($sUser, $sPwd, $sLang, $sKeyword, $isOnlineOnly, $isWithPhotosOnly, $iStart, $iPP)
{
if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) {
return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct"));
}
BxDolXMLRPCUtil::setLanguage($sLang);
$sKeyword = process_db_input($sKeyword, BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION);
$sMatch = '';
if ($sKeyword && strlen($sKeyword) > 2) {
$sMatch .= " MATCH (`NickName`, `City`, `Headline`, `DescriptionMe`, `Tags`) AGAINST ('{$sKeyword}') ";
$sWhere .= " AND {$sMatch} ";
}
if ($isWithPhotosOnly) {
$sWhere .= " AND `Avatar` ";
}
if ($isOnlineOnly) {
$iOnlineTime = getParam('member_online_time');
$sWhere .= " AND `DateLastNav` >= DATE_SUB(NOW(), INTERVAL {$iOnlineTime} MINUTE)";
}
$iStart = (int) $iStart;
if (!$iStart || $iStart < 0) {
$iStart = 0;
}
$iPP = (int) $iPP;
if (!$iPP || $iPP < 1) {
$iPP = 1;
}
$r = db_res("\r\n SELECT * " . ($sMatch ? ", {$sMatch}" : '') . " FROM `Profiles`\r\n WHERE 1 {$sWhere}\r\n ORDER BY `DateLastNav` DESC\r\n LIMIT {$iStart}, {$iPP}");
while ($aRow = mysql_fetch_array($r)) {
$aProfiles[] = new xmlrpcval(BxDolXMLRPCUtil::fillProfileArray($aRow, 'thumb'), 'struct');
}
return new xmlrpcval($aProfiles, "array");
}
示例5: onPositiveDetection
public function onPositiveDetection($sIP, $sExtraData = '', $sType = 'dnsbl')
{
$iIP = sprintf("%u", ip2long($sIP));
$iMemberId = getLoggedId();
$sExtraData = process_db_input($sExtraData);
return $GLOBALS['MySQL']->query("INSERT INTO `sys_antispam_block_log` SET `ip` = '{$iIP}', `member_id` = '{$iMemberId}', `type` = '{$sType}', `extra` = '{$sExtraData}', `added` = " . time());
}
示例6: finalizeCheckout
function finalizeCheckout(&$aData)
{
$this->_logInfo(__METHOD__, $aData);
$iPending = (int) $aData['pendingid'];
$aPending = $this->_oDb->getPending(array('type' => 'id', 'id' => $iPending));
if (!empty($aPending['order']) || !empty($aPending['error_code']) || !empty($aPending['error_msg']) || (int) $aPending['processed'] != 0) {
return array('code' => 0, 'message' => _t($this->_sLangsPrefix . 'err_already_processed'));
}
$sToken = process_db_input($aData['token'], BX_TAGS_STRIP);
$sPayerId = process_db_input($aData['payerid'], BX_TAGS_STRIP);
$sPayerName = process_db_input($aData['payername'], BX_TAGS_STRIP);
$sPayerEmail = process_db_input($aData['payeremail'], BX_TAGS_STRIP);
$sAmt = process_db_input($aData['amt'], BX_TAGS_STRIP);
$this->_doExpressCheckout($sToken, $sPayerId, $sAmt);
$aResponse = $this->_executeCall();
if ($aResponse === false) {
return array('code' => 0, 'message' => _t($this->_sLangsPrefix . 'err_unknown'));
}
$this->_logInfo(__METHOD__, $aResponse);
$iResponseCode = (int) $aResponse['RESULT'];
$sResponseMessage = process_db_input($aResponse['RESPMSG'], BX_TAGS_STRIP);
$aResult = array('code' => $iResponseCode == 0 ? 1 : 0, 'message' => $iResponseCode == 0 ? _t($this->_sLangsPrefix . 'msg_accepted') : $sResponseMessage, 'pending_id' => $iPending, 'payer_name' => $sPayerName, 'payer_email' => $sPayerEmail);
//--- Update pending transaction ---//
$this->_oDb->updatePending($iPending, array('order' => process_db_input($aResponse['PPREF'], BX_TAGS_STRIP), 'order_ref' => process_db_input($aResponse['PNREF'], BX_TAGS_STRIP), 'error_code' => $aResult['code'], 'error_msg' => $sResponseMessage));
return $aResult;
}
示例7: uploadImage
function uploadImage($sUser, $sPwd, $sAlbum, $binImageData, $iDataLength, $sTitle, $sTags, $sDesc)
{
if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) {
return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct"));
}
if (!BxDolXMLRPCMedia::_isMembershipEnabledFor($iIdProfileViewer, 'BX_PHOTOS_ADD', true)) {
return new xmlrpcval("fail access");
}
// write tmp file
$sTmpFilename = BX_DIRECTORY_PATH_ROOT . "tmp/" . time() . '_' . $iId;
$f = fopen($sTmpFilename, "wb");
if (!$f) {
return new xmlrpcval("fail fopen");
}
if (!fwrite($f, $binImageData, (int) $iDataLength)) {
fclose($f);
return new xmlrpcval("fail write");
}
fclose($f);
// upload
$aFileInfo = array();
$aFileInfo['medTitle'] = process_db_input($sTitle, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION);
$aFileInfo['medDesc'] = process_db_input($sDesc, BX_TAGS_VALIDATE, BX_SLASHES_NO_ACTION);
$aFileInfo['medTags'] = process_db_input($sTags, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION);
$aFileInfo['Categories'] = array(process_db_input($sAlbum, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION));
$aFileInfo['album'] = process_db_input($sAlbum, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION);
$isUpdateThumb = (int) db_value("SELECT `Avatar` FROM `Profiles` WHERE `ID` = '{$iId}' LIMIT 1") ? false : true;
if (BxDolService::call('photos', 'perform_photo_upload', array($sTmpFilename, $aFileInfo, $isUpdateThumb), 'Uploader')) {
return new xmlrpcval("ok");
} else {
return new xmlrpcval("fail upload");
}
}
示例8: PageCompSearchResults
function PageCompSearchResults()
{
global $dir;
global $tmpl;
$keyword = process_db_input($_REQUEST['keyword']);
$sMembersQuery = "\n\t\tSELECT *\n\t\tFROM `Profiles`\n\t\tWHERE\n\t\t" . (is_numeric($keyword) ? "`ID` = '{$keyword}'" : "`NickName` LIKE '%{$keyword}%'") . "";
$rMembers = db_res($sMembersQuery);
if (!mysql_num_rows($rMembers)) {
return '<div class="qsearch_notfound">' . _t('_Sorry, no members found') . '</div>';
}
$sRowTmpl = file_get_contents("{$dir['root']}templates/tmpl_{$tmpl}/qsearch_row.html");
$ret = '';
while ($aMember = mysql_fetch_assoc($rMembers)) {
$aRowTmpl = array();
$aRowTmpl['thumbnail'] = get_member_thumbnail($aMember['ID'], 'none');
$aRowTmpl['NickName'] = "<a href=\"" . getProfileLink($aMember['ID']) . "\" target=\"_blank\">" . htmlspecialchars_adv($aMember['NickName']) . "</a>";
$aRowTmpl['actions'] = "<a href=\"javascript:void(0);\" onclick=\"hMemberAction({$aMember['ID']}, '{$aMember['NickName']}')\">" . _t('_Add member') . "</a>";
$sRow = $sRowTmpl;
foreach ($aRowTmpl as $what => $to) {
$sRow = str_replace("__{$what}__", $to, $sRow);
}
$ret .= $sRow;
}
return $ret;
}
示例9: writeMessage
/**
* Function will create new message
*
* @param : $sMessage (string) - message;
* @param : $iOwnerId (integer) - message's owner Id;
* @param $iIP integer
* @return : void;
*/
function writeMessage($sMessage, $iOwnerId = 0, $iIP = 0)
{
$sMessage = process_db_input($sMessage, 0, BX_SLASHES_AUTO);
$iOwnerId = (int) $iOwnerId;
$iIP = (int) $iIP;
$sQuery = "\n INSERT INTO \n `{$this->sTablePrefix}messages`\n SET\n `OwnerID` = {$iOwnerId},\n `Message` = '{$sMessage}',\n `Date` = TIMESTAMP( NOW() ),\n `IP`\t = {$iIP}\n ";
$this->query($sQuery);
}
示例10: BxDolPrivacySearch
function BxDolPrivacySearch($iOwnerId, $sValue)
{
parent::BxTemplSearchResultText();
global $oSysTemplate;
$this->aCurrent['restriction']['owner']['value'] = $iOwnerId;
$this->aCurrent['restriction']['keyword']['value'] = process_db_input($sValue, BX_TAGS_STRIP);
$this->_sSearchUnitTmpl = $oSysTemplate->getHtml('ps_search_unit.html');
}
示例11: collectFilteredSettings
function collectFilteredSettings()
{
//$this->aFilterSortSettings
$sSort = isset($_GET['sort']) ? process_db_input($_GET['sort'], BX_TAGS_STRIP) : null;
// $sPhotos = (isset($_GET['photos_only'])) ? $_GET['photos_only'] : null;
// $sOnline = (isset($_GET['online_only'])) ? $_GET['online_only'] : null;
// $sInfoMode = (isset($_GET['search_result_mode']) && $_GET['search_result_mode'] == 'ext') ? 'ext' : 'sim';
$this->aFilterSortSettings = array('sort' => $sSort);
}
示例12: getMemberAdsCnt
function getMemberAdsCnt($iMemberID, $sStatus = '', $bTimeCheck = FALSE)
{
$sStatus = $sStatus ? " AND`Status`='" . process_db_input($sStatus, BX_TAGS_STRIP) . "'" : "";
if ($bTimeCheck) {
$this->_oConfig->bAdminMode = FALSE;
}
$sTimeRestriction = $this->_oConfig->bAdminMode == true ? '' : "AND UNIX_TIMESTAMP() - `{$this->_oConfig->sSQLPostsTable}`.`LifeTime`*24*60*60 < `{$this->_oConfig->sSQLPostsTable}`.`DateTime`";
$sMemberAdsSQL = "\n SELECT COUNT(*) FROM `{$this->_oConfig->sSQLPostsTable}` WHERE `IDProfile` = '{$iMemberID}'\n {$sStatus}\n {$sTimeRestriction}\n ";
return (int) db_value($sMemberAdsSQL);
}
示例13: getBlockCode_Owner
function getBlockCode_Owner()
{
bx_sites_import('SearchResult');
$oSearchResult = new BxSitesSearchResult('user', process_db_input($this->_aProfile['NickName'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION));
if ($s = $oSearchResult->displayResultBlock(true)) {
return $s;
} else {
return MsgBox(_t('_Empty'));
}
}
示例14: getSystem
/**
* Common public methods.
* Is used to display events on the Wall.
*/
function getSystem($aEvent, $sDisplayType = BX_WALL_VIEW_TIMELINE)
{
$sResult = "";
$sHandler = $aEvent['type'] . '_' . $aEvent['action'];
if (!$this->_oConfig->isHandler($sHandler)) {
return '';
}
$aHandler = $this->_oConfig->getHandlers($sHandler);
if (empty($aHandler['module_uri']) && empty($aHandler['module_class']) && empty($aHandler['module_method'])) {
$sMethod = 'display' . str_replace(' ', '', ucwords(str_replace('_', ' ', $aHandler['alert_unit'] . '_' . $aHandler['alert_action'])));
if (!method_exists($this, $sMethod)) {
return '';
}
$aResult = $this->{$sMethod}($aEvent, $sDisplayType);
} else {
$aEvent['js_mode'] = $this->_oConfig->getJsMode();
$sMethod = $aHandler['module_method'] . ($sDisplayType == BX_WALL_VIEW_OUTLINE ? '_' . BX_WALL_VIEW_OUTLINE : '');
$aResult = BxDolService::call($aHandler['module_uri'], $sMethod, array($aEvent), $aHandler['module_class']);
if (isset($aResult['save'])) {
$this->_oDb->updateEvent($aResult['save'], $aEvent['id']);
}
}
$bResult = !empty($aResult);
if ($bResult && isset($aResult['perform_delete']) && $aResult['perform_delete'] == true) {
$this->_oDb->deleteEvent(array('id' => $aEvent['id']));
return '';
} else {
if (!$bResult || $bResult && empty($aResult['content'])) {
return '';
}
}
$sComments = "";
if ($sDisplayType == BX_WALL_VIEW_TIMELINE) {
if (empty($aEvent['title']) && !empty($aResult['title']) || empty($aEvent['description']) && !empty($aResult['description'])) {
$this->_oDb->updateEvent(array('title' => process_db_input($aResult['title'], BX_TAGS_STRIP), 'description' => process_db_input($aResult['description'], BX_TAGS_STRIP)), $aEvent['id']);
}
if (!in_array($aEvent['type'], array('profile', 'friend')) && $aEvent['action'] != 'commentPost') {
$sType = $aEvent['type'];
$iObjectId = $aEvent['object_id'];
if (strpos($iObjectId, ',') !== false) {
$sType = isset($aResult['grouped']['group_cmts_name']) ? $aResult['grouped']['group_cmts_name'] : '';
$iObjectId = isset($aResult['grouped']['group_id']) ? (int) $aResult['grouped']['group_id'] : 0;
}
$oComments = new BxWallCmts($sType, $iObjectId);
if ($oComments->isEnabled()) {
$sComments = $oComments->getCommentsFirstSystem('comment', $aEvent['id']);
} else {
$sComments = $this->getDefaultComments($aEvent['id']);
}
} else {
$sComments = $this->getDefaultComments($aEvent['id']);
}
}
return $this->parseHtmlByContent($aResult['content'], array('post_id' => $aEvent['id'], 'post_owner_icon' => get_member_icon($aEvent['owner_id'], 'none'), 'comments_content' => $sComments));
}
示例15: response
/**
* Overwtire the method of parent class.
*
* @param BxDolAlerts $oAlert an instance of alert.
*/
function response($oAlert)
{
$bFromWall = !empty($oAlert->aExtras) && (int) $oAlert->aExtras['from_wall'] == 1;
if (is_array($oAlert->aExtras) && isset($oAlert->aExtras['privacy_view']) && $oAlert->aExtras['privacy_view'] == BX_DOL_PG_HIDDEN) {
return;
}
if ($bFromWall) {
$this->_oModule->_iOwnerId = (int) $oAlert->aExtras['owner_id'];
$sMedia = $this->_oModule->_oConfig->getCommonType($oAlert->sUnit);
$aMedia = $this->_oModule->_oTemplate->_getCommonMedia($sMedia, $oAlert->iObject);
$iOwnerId = $this->_oModule->_iOwnerId;
$iObjectId = $this->_oModule->_getAuthorId();
$sType = $this->_oModule->_oConfig->getCommonPostPrefix() . $sMedia;
$sAction = '';
$sContent = serialize(array('type' => $sMedia, 'id' => $oAlert->iObject));
$sTitle = $aMedia['title'];
$sDescription = $aMedia['description'];
} else {
if ($this->_oModule->_oConfig->isSystemComment($oAlert->sUnit, $oAlert->sAction)) {
$sType = $oAlert->aExtras['object_system'];
$sAction = $oAlert->sUnit . '_' . $oAlert->sAction;
if (!$this->_oModule->_oConfig->isHandler($sType . '_' . $sAction)) {
return;
}
$iOwnerId = $oAlert->iSender;
$iObjectId = $oAlert->iObject;
$sContent = serialize(array('object_id' => $oAlert->aExtras['object_id']));
$sTitle = $sDescription = '';
} else {
$iOwnerId = $oAlert->iSender;
$iObjectId = $oAlert->iObject;
$sType = $oAlert->sUnit;
$sAction = $oAlert->sAction;
$sContent = is_array($oAlert->aExtras) && !empty($oAlert->aExtras) ? serialize($oAlert->aExtras) : '';
$sTitle = $sDescription = '';
}
}
if ($oAlert->sUnit == 'profile' && $oAlert->sAction == 'delete') {
$this->_oModule->_oDb->deleteEvent(array('owner_id' => $oAlert->iObject));
$this->_oModule->_oDb->deleteEventCommon(array('object_id' => $oAlert->iObject));
//delete all subscriptions
$oSubscription = BxDolSubscription::getInstance();
$oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => 'bx_wall', 'object_id' => $oAlert->iObject));
return;
}
if ($oAlert->sUnit == 'profile' && $oAlert->sAction == 'edit' && $iOwnerId != $iObjectId) {
return;
}
$iId = $this->_oModule->_oDb->insertEvent(array('owner_id' => $iOwnerId, 'object_id' => $iObjectId, 'type' => $sType, 'action' => $sAction, 'content' => process_db_input($sContent, BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION), 'title' => process_db_input($sTitle, BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION), 'description' => process_db_input($sDescription, BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION)));
if ($bFromWall) {
echo "<script>parent." . $this->_oModule->_oConfig->getJsObject('post') . "._getPost(null, " . $iId . ")</script>";
} else {
$this->_oModule->_oDb->updateSimilarObject($iId, $oAlert);
}
}