本文整理匯總了PHP中BxDolSubscription::subscribeVisitor方法的典型用法代碼示例。如果您正苦於以下問題:PHP BxDolSubscription::subscribeVisitor方法的具體用法?PHP BxDolSubscription::subscribeVisitor怎麽用?PHP BxDolSubscription::subscribeVisitor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BxDolSubscription
的用法示例。
在下文中一共展示了BxDolSubscription::subscribeVisitor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: BxDolSubscription
require_once BX_DIRECTORY_PATH_INC . 'languages.inc.php';
require_once BX_DIRECTORY_PATH_PLUGINS . 'Services_JSON.php';
bx_import('BxDolSubscription');
$oSubscription = new BxDolSubscription();
$aResult = array();
if (isset($_POST['direction'])) {
$sUnit = process_db_input($_POST['unit']);
$sAction = process_db_input($_POST['action']);
$iObjectId = (int) $_POST['object_id'];
switch ($_POST['direction']) {
case 'subscribe':
if (isset($_POST['user_id']) && (int) $_POST['user_id'] != 0) {
$aResult = $oSubscription->subscribeMember((int) $_POST['user_id'], $sUnit, $sAction, $iObjectId);
} else {
if (isset($_POST['user_name']) && isset($_POST['user_email'])) {
$aResult = $oSubscription->subscribeVisitor($_POST['user_name'], $_POST['user_email'], $sUnit, $sAction, $iObjectId);
}
}
break;
case 'unsubscribe':
if (isset($_POST['user_id']) && (int) $_POST['user_id'] != 0) {
$aResult = $oSubscription->unsubscribeMember((int) $_POST['user_id'], $sUnit, $sAction, $iObjectId);
} else {
if (isset($_POST['user_name']) && isset($_POST['user_email'])) {
$aResult = $oSubscription->unsubscribeVisitor($_POST['user_name'], $_POST['user_email'], $sUnit, $sAction, $iObjectId);
}
}
break;
}
header('Content-Type:text/javascript');
$oJson = new Services_JSON();