本文整理汇总了PHP中BxDolAlerts类的典型用法代码示例。如果您正苦于以下问题:PHP BxDolAlerts类的具体用法?PHP BxDolAlerts怎么用?PHP BxDolAlerts使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BxDolAlerts类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCode
public function getCode($sUrl, $sTitle, $aCustomVars = false)
{
// define markers for replacments
$aMarkers = array('url' => $sUrl, 'url_encoded' => rawurlencode($sUrl), 'lang' => $GLOBALS['sCurrentLanguage'], 'locale' => $this->_getLocaleFacebook($GLOBALS['sCurrentLanguage']), 'twit' => _t('_sys_social_sharing_twit'), 'title' => $sTitle, 'title_encoded' => rawurlencode($sTitle));
if (!empty($aCustomVars) && is_array($aCustomVars)) {
$aMarkers = array_merge($aMarkers, $aCustomVars);
}
// alert
$sOverrideOutput = null;
bx_import('BxDolAlerts');
$oAlert = new BxDolAlerts('system', 'social_sharing_display', '', '', array('buttons' => &$this->_aSocialButtons, 'markers' => &$aMarkers, 'override_output' => &$sOverrideOutput));
$oAlert->alert();
// return custom code if there is one
if ($sOverrideOutput) {
return $sOverrideOutput;
}
// return empty string of there is no buttons
if (empty($this->_aSocialButtons)) {
return '';
}
// prepare buttons
$aButtons = array();
foreach ($this->_aSocialButtons as $aButton) {
$sButton = $this->_replaceMarkers($aButton['content'], $aMarkers);
if (preg_match('/{[A-Za-z0-9_]+}/', $sButton)) {
// if not all markers are replaced skip it
continue;
}
$aButtons[] = array('button' => $sButton);
}
// output
$aTemplateVars = array('bx_repeat:buttons' => $aButtons);
return $GLOBALS['oSysTemplate']->parseHtmlByName('social_sharing.html', $aTemplateVars);
}
示例2: post
function post($sSystem, $iId, $iCmtAuthorId, $iCmtParentId, $iMood, $sFileId)
{
global $sIncPath;
global $sModule;
global $sHomeUrl;
$iId = (int) $iId;
$iCmtParentId = (int) $iCmtParentId;
$iMood = (int) $iMood;
bx_import('BxDolCmts');
$oCmts = BxDolCmts::getObjectInstance($sSystem, $iId);
if (!$oCmts) {
return 0;
}
$sText = '<iframe width="100%" height="240" src="[ray_url]modules/video_comments/embed.php?id=' . $sFileId . '" frameborder="0" allowfullscreen></iframe>';
$mixedOverrideResult = null;
$oAlert = new BxDolAlerts('bx_video_comments', 'post', $sFileId, getLoggedId(), array('override' => &$mixedOverrideResult, 'text' => &$sText, 'file_id' => &$sFileId, 'object_id' => &$iId, 'author' => &$iCmtAuthorId, 'parent_id' => &$iCmtParentId, 'mood' => &$iMood));
$oAlert->alert();
if (null !== $mixedOverrideResult) {
return $mixedOverrideResult;
}
$iCmtNewId = $oCmts->_oQuery->addComment($iId, $iCmtParentId, $iCmtAuthorId, $sText, $iMood);
if (false === $iCmtNewId) {
return 0;
}
bx_import('BxDolAlerts');
$oZ = new BxDolAlerts($sSystem, 'commentPost', $oCmts->getId(), $oCmts->_getAuthorId(), array('comment_id' => $iCmtNewId, 'comment_author_id' => $iCmtAuthorId));
$oZ->alert();
$oCmts->_triggerComment();
return $iCmtNewId;
}
示例3: makeView
function makeView()
{
if (!$this->isEnabled()) {
return false;
}
$iMemberId = getLoggedId() ? getLoggedId() : 0;
$sIp = $_SERVER['REMOTE_ADDR'];
$iTime = time();
if ($iMemberId) {
$sWhere = " AND `viewer` = '{$iMemberId}' ";
} else {
$sWhere = " AND `viewer` = '0' AND `ip` = INET_ATON('{$sIp}') ";
}
$iTs = (int) $GLOBALS['MySQL']->getOne("SELECT `ts` FROM `{$this->_aSystem['table_track']}` WHERE `id` = '" . $this->getId() . "' {$sWhere}");
$iRet = 0;
if (!$iTs) {
$iRet = $GLOBALS['MySQL']->query("INSERT IGNORE INTO `{$this->_aSystem['table_track']}` SET `id` = '" . $this->getId() . "', `viewer` = '{$iMemberId}', `ip` = INET_ATON('{$sIp}'), `ts` = {$iTime}");
} elseif ($iTime - $iTs > $this->_aSystem['period']) {
$iRet = $GLOBALS['MySQL']->query("UPDATE `{$this->_aSystem['table_track']}` SET `ts` = {$iTime} WHERE `id` = '" . $this->getId() . "' AND `viewer` = '{$iMemberId}' AND `ip` = INET_ATON('{$sIp}')");
}
if ($iRet) {
$this->_triggerView();
$oZ = new BxDolAlerts($this->_sSystem, 'view', $this->getId(), $iMemberId);
$oZ->alert();
return true;
}
return false;
}
示例4: onPost
public function onPost($iId)
{
//--- Event -> Post for Alerts Engine ---//
bx_import('BxDolAlerts');
$oAlert = new BxDolAlerts($this->_oConfig->getObject('alert'), 'post', $iId);
$oAlert->alert();
//--- Event -> Post for Alerts Engine ---//
}
示例5: onContact
protected function onContact()
{
$iUserId = $this->getUserId();
$this->isAllowedContact(true);
//--- Event -> Contact for Alerts Engine ---//
$oAlert = new BxDolAlerts($this->_oConfig->getObject('alert'), 'contact', 0, $iUserId);
$oAlert->alert();
//--- Event -> Contact for Alerts Engine ---//
}
示例6: getEmbedCode
function getEmbedCode($iFileId)
{
$sOverride = false;
$oAlert = new BxDolAlerts($this->_oConfig->getMainPrefix(), 'embed_code', $iFileId, getLoggedId(), array('override' => &$sOverride));
$oAlert->alert();
if ($sOverride) {
return $sOverride;
}
$iFileId = (int) $iFileId;
return getEmbedCode('mp3', 'player', array('id' => $iFileId));
}
示例7: generateUserNewPwd
function generateUserNewPwd($ID)
{
$sPwd = genRndPwd();
$sSalt = genRndSalt();
$sQuery = "\n UPDATE `Profiles`\n SET\n `Password` = '" . encryptUserPwd($sPwd, $sSalt) . "',\n `Salt` = '{$sSalt}'\n WHERE\n `ID`='{$ID}'\n ";
db_res($sQuery);
createUserDataFile($ID);
require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php';
$oZ = new BxDolAlerts('profile', 'edit', $ID);
$oZ->alert();
return $sPwd;
}
示例8: blockUser
function blockUser($iUserId, $iBlockedId, $bBlock)
{
bx_import('BxDolAlerts');
if ($bBlock) {
getResult("REPLACE INTO `sys_block_list` SET `ID` = '" . $iUserId . "', `Profile` = '" . $iBlockedId . "'");
$oZ = new BxDolAlerts('block', 'add', $iBlockedId, $iUserId);
} else {
getResult("DELETE FROM `sys_block_list` WHERE `ID` = '" . $iUserId . "' AND `Profile` = '" . $iBlockedId . "'");
$oZ = new BxDolAlerts('block', 'delete', $iBlockedId, $iUserId);
}
$oZ->alert();
}
示例9: PageCodeAdd
function PageCodeAdd()
{
$oInstallerUi = new BxDolInstallerUi();
$sResult = '';
if (isset($_POST['submit_upload']) && isset($_FILES['module']) && !empty($_FILES['module']['tmp_name']) && isset($GLOBALS['aEnabledTemplateAction']['upload'])) {
$sResult = $oInstallerUi->actionUpload('template', $_FILES['module'], $_POST);
}
$sContent = $oInstallerUi->getUploader($sResult, '_Template', true, $GLOBALS['aPages']['add']['url']);
$sContent = DesignBoxAdmin($GLOBALS['sPageTitle'], $sContent, $GLOBALS['aTopItems'], '', 11);
$oZ = new BxDolAlerts('system', 'admin_templates_blocks_add', 0, 0, array('title' => &$GLOBALS['sPageTitle'], 'code' => &$sContent));
$oZ->alert();
return $sContent;
}
示例10: insertEvent
function insertEvent($aParams)
{
if ((int) $this->query("INSERT INTO `" . $this->_sPrefix . "events`(`" . implode("`, `", array_keys($aParams)) . "`, `date`) VALUES('" . implode("', '", array_values($aParams)) . "', UNIX_TIMESTAMP())") <= 0) {
return 0;
}
$iId = (int) $this->lastId();
if ($iId > 0 && isset($aParams['owner_id']) && (int) $aParams['owner_id'] > 0) {
//--- Wall -> Update for Alerts Engine ---//
bx_import('BxDolAlerts');
$oAlert = new BxDolAlerts('bx_' . $this->_oConfig->getUri(), 'update', $aParams['owner_id']);
$oAlert->alert();
//--- Wall -> Update for Alerts Engine ---//
}
return $iId;
}
示例11: getUploaders
/**
* Get uploaders array
* @return array of uploaders
*/
function getUploaders()
{
if ($this->aUploaders) {
return $this->aUploaders;
}
// uploaders list with the following keys:
// 'title' - uploader title
// 'action' - uploader action name, action name must be passed with the submitted form as well as 'action'
// 'form' - uploader class method to get the uploader form, or service call array to get the form
// 'handle' - uploader class method to handle uploader form, or service call array to process form upload
$this->aUploaders = array('html5' => array('title' => '_sys_txt_uploader_html5', 'action' => 'accept_html5', 'form' => 'getUploadHtml5File', 'handle' => 'serviceAcceptHtml5File'), 'regular' => array('title' => '_' . $this->sPrefix . '_regular', 'action' => 'accept_upload', 'form' => 'getUploadFormFile', 'handle' => 'serviceAcceptFile'), 'record' => array('title' => '_' . $this->sPrefix . '_record', 'action' => 'accept_record', 'form' => 'getRecordFormFile', 'handle' => 'serviceAcceptRecordFile'), 'embed' => array('title' => '_' . $this->sPrefix . '_embed', 'action' => 'accept_embed', 'form' => 'getEmbedFormFile', 'handle' => 'serviceAcceptEmbedFile'));
$oAlert = new BxDolAlerts($this->getMainPrefix(), 'uploaders_init', 0, getLoggedId(), array('uploaders' => &$this->aUploaders, 'config' => $this));
$oAlert->alert();
return $this->aUploaders;
}
示例12: getCode
public function getCode($sContentId, $sModuleName, $sUrl, $sTitle, $aCustomVars = false)
{
// define markers for replacments
bx_import('BxDolLanguages');
$sLang = BxDolLanguages::getInstance()->getCurrentLanguage();
$aMarkers = array('id' => $sContentId, 'module' => $sModuleName, 'url' => $sUrl, 'url_encoded' => rawurlencode($sUrl), 'lang' => $sLang, 'locale' => $this->_getLocaleFacebook($sLang), 'title' => $sTitle, 'title_encoded' => rawurlencode($sTitle));
if (!empty($aCustomVars) && is_array($aCustomVars)) {
$aMarkers = array_merge($aMarkers, $aCustomVars);
}
// alert
$sOverrideOutput = null;
bx_import('BxDolAlerts');
$oAlert = new BxDolAlerts('system', 'social_sharing_display', '', '', array('buttons' => &$this->_aSocialButtons, 'markers' => &$aMarkers, 'override_output' => &$sOverrideOutput));
$oAlert->alert();
// return custom code if there is one
if ($sOverrideOutput) {
return $sOverrideOutput;
}
// return empty string of there is no buttons
if (empty($this->_aSocialButtons)) {
return '';
}
// prepare buttons
$aButtons = array();
foreach ($this->_aSocialButtons as $aButton) {
switch ($aButton['type']) {
case 'html':
$sButton = $this->_replaceMarkers($aButton['content'], $aMarkers);
break;
case 'service':
$a = @unserialize($aButton['content']);
if (false === $a || !is_array($a)) {
break;
}
$a = $this->_replaceMarkers($a, $aMarkers);
$sButton = BxDolService::call($a['module'], $a['method'], isset($a['params']) ? $a['params'] : array(), isset($a['class']) ? $a['class'] : 'Module');
break;
}
if (!isset($sButton) || preg_match('/{[A-Za-z0-9_]+}/', $sButton)) {
// if not all markers are replaced skip it
continue;
}
$aButtons[] = array('button' => $sButton, 'object' => $aButton['object']);
}
// output
$aTemplateVars = array('bx_repeat:buttons' => $aButtons);
return $this->_oTemplate->parseHtmlByName('social_sharing.html', $aTemplateVars);
}
示例13: actionCmtPost
function actionCmtPost()
{
$mixedResult = parent::actionCmtPost();
if (empty($mixedResult)) {
return $mixedResult;
}
$aEvent = $this->_oModule->_oDb->getEvents(array('browse' => 'id', 'object_id' => (int) $this->getId()));
if (isset($aEvent['owner_id']) && (int) $aEvent['owner_id'] > 0) {
//--- Wall -> Update for Alerts Engine ---//
bx_import('BxDolAlerts');
$oAlert = new BxDolAlerts('bx_' . $this->_oModule->_oConfig->getUri(), 'update', $aEvent['owner_id']);
$oAlert->alert();
//--- Wall -> Update for Alerts Engine ---//
}
return $mixedResult;
}
示例14: processing
function processing()
{
$aIds = array();
if ($this->_oModule->_oDb->publish($aIds)) {
foreach ($aIds as $iId) {
//--- Entry -> Publish for Alerts Engine ---//
$oAlert = new BxDolAlerts($this->_oModule->_oConfig->getAlertsSystemName(), 'publish', $iId);
$oAlert->alert();
//--- Entry -> Publish for Alerts Engine ---//
//--- Reparse Global Tags ---//
$oTags = new BxDolTags();
$oTags->reparseObjTags($this->_oModule->_oConfig->getTagsSystemName(), $iId);
//--- Reparse Global Tags ---//
//--- Reparse Global Categories ---//
$oCategories = new BxDolCategories();
$oCategories->reparseObjTags($this->_oModule->_oConfig->getCategoriesSystemName(), $iId);
//--- Reparse Global Categories ---//
}
}
}
示例15: insertEvent
function insertEvent($aParams)
{
$aSet = array();
foreach ($aParams as $sKey => $sValue) {
$aSet[] = "`" . $sKey . "`='" . $sValue . "'";
}
if (!array_key_exists('date', $aParams)) {
$aSet[] = "`date`=UNIX_TIMESTAMP()";
}
if ((int) $this->query("INSERT INTO `" . $this->_sPrefix . "events` SET " . implode(", ", $aSet)) <= 0) {
return 0;
}
$iId = (int) $this->lastId();
if ($iId > 0 && isset($aParams['owner_id']) && (int) $aParams['owner_id'] > 0) {
//--- Wall -> Update for Alerts Engine ---//
bx_import('BxDolAlerts');
$oAlert = new BxDolAlerts('bx_' . $this->_oConfig->getUri(), 'update', $aParams['owner_id']);
$oAlert->alert();
//--- Wall -> Update for Alerts Engine ---//
}
return $iId;
}