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(); echo $oJson->encode($aResult); } else if(isset($_GET['sid'])) { $aResult = $oSubscription->unsubscribe(array('type' => 'sid', 'sid' => $_GET['sid'])); if(isset($_GET['js']) && (int)$_GET['js'] == 1) { $oJson = new Services_JSON(); echo $oJson->encode($aResult); exit; } $_page['name_index'] = 0; $_page['header'] = $GLOBALS['site']['title']; $_page['header_text'] = $GLOBALS['site']['title']; $_page_cont[0]['page_main_code'] = MsgBox($aResult['message']); PageCode(); } ?>