本文整理汇总了PHP中getMemberMembershipInfo函数的典型用法代码示例。如果您正苦于以下问题:PHP getMemberMembershipInfo函数的具体用法?PHP getMemberMembershipInfo怎么用?PHP getMemberMembershipInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getMemberMembershipInfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: isDynamicGroupMember
/**
* Check whethere viewer is a member of dynamic group.
*
* @param mixed $mixedGroupId dynamic group ID.
* @param integer $iObjectOwnerId object owner ID.
* @param integer $iViewerId viewer ID.
* @return boolean result of operation.
*/
function isDynamicGroupMember($mixedGroupId, $iObjectOwnerId, $iViewerId, $iObjectId)
{
if (preg_match('/^m(\\d+)$/', $mixedGroupId, $m)) {
$iMembershipId = $m[1];
require_once BX_DIRECTORY_PATH_INC . 'membership_levels.inc.php';
$aMembershipInfo = getMemberMembershipInfo($iViewerId);
return $iMembershipId == $aMembershipInfo['ID'] && (!$aMembershipInfo['DateStarts'] || $aMembershipInfo['DateStarts'] < time()) && (!$aMembershipInfo['DateExpires'] || $aMembershipInfo['DateExpires'] > time()) ? true : false;
}
return false;
}
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:18,代码来源:BxStorePrivacyFile.php
示例2: isTicketAvailable
/**
* Determines if ticket available to specified member for specified event
*
* @param int $memberID - member ID
* @param int $eventID - event ID
*
* @return float/bool - ticket price if ticket available, false otherwise
*
*
*/
function isTicketAvailable($memberID, $eventID)
{
global $date_format;
// argument validation
$memberID = (int) $memberID;
$eventID = (int) $eventID;
$memberArr = getProfileInfo($memberID);
$memberSex = $memberArr['Sex'];
$membershipArr = getMemberMembershipInfo($memberID);
$eventArr = db_arr("SELECT `ID`, `Title`, `Place`, `EventStart`, `TicketPriceFemale`, `TicketPriceMale`, `TicketCountFemale`, `TicketCountMale` FROM `SDatingEvents`\n\t\t\t\t\tWHERE `ID` = {$eventID}\n\t\t\t\t\tAND `Status` = 'Active'\n\t\t\t\t\tAND NOW() > `TicketSaleStart` AND NOW() < `TicketSaleEnd`\n\t\t\t\t\tAND FIND_IN_SET('{$memberSex}', `EventSexFilter`)\n\t\t\t\t\tAND ( TO_DAYS('{$memberArr['DateOfBirth']}')\n\t\t\t\t\t\tBETWEEN TO_DAYS(DATE_SUB(NOW(), INTERVAL `EventAgeUpperFilter` YEAR))\n\t\t\t\t\t\tAND TO_DAYS(DATE_SUB(NOW(), INTERVAL `EventAgeLowerFilter` YEAR)) )\n\t\t\t\t\tAND ( INSTR(`EventMembershipFilter`, '\\'all\\'') OR INSTR(`EventMembershipFilter`, '\\'{$membershipArr['ID']}\\'') )");
$partNumArr = db_arr("SELECT COUNT(*) FROM `SDatingParticipants`\n\t\t\t\t\t\t\t\tLEFT JOIN `Profiles` ON `SDatingParticipants`.`IDMember` = `Profiles`.`ID`\n\t\t\t\t\t\t\t\tWHERE `SDatingParticipants`.`IDEvent` = {$eventID}\n\t\t\t\t\t\t\t\tAND `Profiles`.`Sex` = '{$memberSex}'");
$ticketsLeft = $memberArr['Sex'] == 'male' ? $eventArr['TicketCountMale'] - $partNumArr[0] : $eventArr['TicketCountFemale'] - $partNumArr[0];
$ticketPrice = (double) ($memberArr['Sex'] == 'male' ? $eventArr['TicketPriceMale'] : $eventArr['TicketPriceFemale']);
$ticketPrice = sprintf("%.2f", $ticketPrice);
if ($eventArr['ID'] && $ticketsLeft > 0) {
$res = $ticketPrice;
} else {
$res = false;
}
return $res;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:31,代码来源:sdating.inc.php
示例3: contr_panel_member_info_g4
//.........这里部分代码省略.........
echo $site['images'];
?>
cp_llogin.gif"></td>
<td valign="middle" class="cp_td" align="left"><?php
echo _t("_Last login");
?>
: </td>
<td valign="middle" class="cp_td_r" align="left">
<?php
if (!$p_arr['LastLoggedIn'] || $p_arr['LastLoggedIn'] == "0000-00-00 00:00:00") {
$p_arr['LastLoggedIn'] = _t("_never");
}
echo $p_arr['LastLoggedIn'];
?>
</td>
</tr>
<!-- SpeedDating info -->
<?php
if ($en_sdating) {
?>
<tr class="table">
<td valign="middle" class="cp_td" align="left"><img src="<?php
echo $site['images'];
?>
cp_lchanges.gif"></td>
<td valign="middle" class="cp_td" align="left"><?php
echo _t('_SpeedDating tickets');
?>
: </td>
<td valign="middle" class="cp_td_r" align="left">
<?php
$membership_arr = getMemberMembershipInfo($p_arr['ID']);
$events_query = "SELECT `SDatingEvents`.`ID`, `Title`, (NOW() > `EventEnd` AND NOW() < DATE_ADD(`EventEnd`, INTERVAL `ChoosePeriod` DAY)) AS `ChooseActive`\r\n\t\t\t\t\tFROM `SDatingEvents`\r\n\t\t\t\t\tLEFT JOIN `SDatingParticipants` ON `SDatingParticipants`.`IDEvent` = `SDatingEvents`.`ID` AND `SDatingParticipants`.`IDMember` = {$p_arr['ID']}\r\n\t\t\t\t\tWHERE `SDatingEvents`.`Status` = 'Active'\r\n\t\t\t\t\tAND `SDatingParticipants`.`ID` IS NOT NULL\r\n\t\t\t\t\tAND NOW() < DATE_ADD(`SDatingEvents`.`EventEnd`, INTERVAL `SDatingEvents`.`ChoosePeriod` DAY)\r\n\t\t\t\t\tAND FIND_IN_SET('{$p_arr['Sex']}', `SDatingEvents`.`EventSexFilter`)\r\n\t\t\t\t\tAND ( TO_DAYS('{$p_arr['DateOfBirth']}')\r\n\t\t\t\t\t\tBETWEEN TO_DAYS(DATE_SUB(NOW(), INTERVAL `SDatingEvents`.`EventAgeUpperFilter` YEAR))\r\n\t\t\t\t\t\tAND TO_DAYS(DATE_SUB(NOW(), INTERVAL `SDatingEvents`.`EventAgeLowerFilter` YEAR)) )\r\n\t\t\t\t\tAND ( INSTR(`SDatingEvents`.`EventMembershipFilter`, '\\'all\\'') OR INSTR(`SDatingEvents`.`EventMembershipFilter`, '\\'{$membership_arr['ID']}\\'') )\r\n\t\t\t\t\tORDER BY `SDatingEvents`.`EventStart` DESC";
$events_res = db_res($events_query);
if (mysql_num_rows($events_res) == 0) {
echo _t('_none');
} else {
$events_links = '';
while ($event_arr = mysql_fetch_assoc($events_res)) {
$events_links .= strlen($events_links) ? ', ' : '';
$events_links .= "<a href=\"{$site['url']}events.php?action=show_info&event_id={$event_arr['ID']}\">" . process_line_output($event_arr['Title']) . "</a>";
}
echo $events_links;
}
?>
</td>
</tr>
<?php
}
?>
<tr>
<td valign="middle" class="cp_td" align="left"><img src="<?php
echo $site['images'];
?>
cp_messages.gif"></td>
<td valign="middle" class="cp_td" align="left"><?php
echo _t("_Messages");
?>
:</td>
<td valign="middle" class="cp_td_r" align="left"><?php
if ($mess) {
echo _t("_ATT_MESSAGE", $mess, $site['url']);
} else {
echo _t("_ATT_MESSAGE_NONE", $site['url']);
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:67,代码来源:member.php
示例4: GetMembershipStatus
/**
* Print code for membership status
* $memberID - member ID
* $offer_upgrade - will this code be printed at [c]ontrol [p]anel
* $credits - will print credits status if $credits == 1
*/
function GetMembershipStatus($memberID, $offer_upgrade = true, $credits = 0)
{
global $oTemplConfig;
$ret = "";
$membership_info = getMemberMembershipInfo($memberID);
$viewMembershipActions = "<br />(<a onclick=\"javascript:window.open('explanation.php?explain=membership&type=" . $membership_info['ID'] . "', '', 'width=500, height=400, menubar=no, status=no, resizable=no, scrollbars=yes, toolbar=no, location=no');\" href=\"javascript:void(0);\">" . _t("_VIEW_MEMBERSHIP_ACTIONS") . "</a>)<br />";
// Show colored membership name
if ($membership_info['ID'] == MEMBERSHIP_ID_STANDARD) {
$ret .= _t("_MEMBERSHIP_STANDARD") . $viewMembershipActions;
if ($offer_upgrade) {
$ret .= " " . _t("_MEMBERSHIP_UPGRADE_FROM_STANDARD");
}
} else {
$ret .= "<font color=\"red\">{$membership_info['Name']}</font>{$viewMembershipActions}";
$days_left = (int) (($membership_info['DateExpires'] - time()) / (24 * 3600));
if (!is_null($membership_info['DateExpires'])) {
if ($days_left > 0) {
$ret .= _t("_MEMBERSHIP_EXPIRES_IN_DAYS", $days_left);
} else {
$ret .= _t("_MEMBERSHIP_EXPIRES_TODAY", date("H:i", $membership_info['DateExpires']), date("H:i"));
}
} else {
$ret .= _t("_MEMBERSHIP_EXPIRES_NEVER");
}
if ($offer_upgrade && !is_null($membership_info['DateExpires'])) {
$ret .= " - <a href=\"membership.php\">" . _t("_MEMBERSHIP_BUY_MORE_DAYS") . "</a>";
}
}
if ($credits) {
$gold_arr_cred_amount = getProfileCredits($memberID);
$ret .= "<br /><u>" . _t("_MEMBERSHIP_CREDITS") . "</u> (<a href=\"javascript: void(0);\" onClick=\"javascript: window.open('explanation.php?explain=credits', '', 'width={$oTemplConfig->popUpWindowWidth},height={$oTemplConfig->popUpWindowHeight},menubar=no,status=no,resizable=no,scrollbars=yes,toolbar=no, location=no' );\">" . _t("_Explanation") . "</a>)<br />";
if ($gold_arr_cred_amount) {
$ret .= _t("_MEMBERSHIP_CREDITS_YES", $gold_arr_cred_amount) . "<br />";
} else {
$ret .= _t("_MEMBERSHIP_CREDITS_NO") . "<br />";
}
if ($offer_upgrade) {
$ret .= " - <a href=\"membership.php\">" . _t("_MEMBERSHIP_CREDITS_BUY_MORE") . "</a>";
}
}
return $ret;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:48,代码来源:profiles.inc.php
示例5: time
$last_timestamp = time() - 24 * 3600;
$last_membership_arr = getMemberMembershipInfo($row['ID'], $last_timestamp);
if ($current_membership_arr['ID'] != $last_membership_arr['ID']) {
modules_update($row['ID']);
// Handle membership level change
if ($further_membership_arr['ID'] == MEMBERSHIP_ID_STANDARD) {
$mail_ret = mem_expiration_letter($row['ID'], $last_membership_arr['Name'], -1);
if ($mail_ret) {
$expire_letters++;
}
}
}
} elseif ($current_membership_arr['ID'] != MEMBERSHIP_ID_STANDARD) {
// Calculate further UNIX Timestamp
$further_timestamp = time() + $expire_notification_days * 24 * 3600;
$further_membership_arr = getMemberMembershipInfo($row['ID'], $further_timestamp);
if ($current_membership_arr['ID'] != $further_membership_arr['ID'] && $further_membership_arr['ID'] == MEMBERSHIP_ID_STANDARD) {
if (!$expire_notify_once || abs($further_timestamp - time()) < 24 * 3600) {
$mail_ret = mem_expiration_letter($row['ID'], $current_membership_arr['Name'], (int) (($current_membership_arr['DateExpires'] - time()) / (24 * 3600)));
if ($mail_ret) {
$expire_letters++;
}
}
}
}
}
echo "Send membership expire letters: {$expire_letters} letters\n";
//========================================================================================================================
// clear tmp folder --------------------------------------------------------------------------
del_old_all_files();
// ----------------------------------------------------------------------------------
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:31,代码来源:cmd.php
示例6: setMembership
/**
* Set a membership for a member
*
* @param int $memberID - member that is going to get the membership
* @param int $membershipID - membership that is going to be assigned to the member
* if $membershipID == MEMBERSHIP_ID_STANDARD then $days
* and $startsNow parameters are not used, so Standard
* membership is always set immediately and `forever`
*
* @param int $days - number of days to set membership for
* if 0, then the membership is set forever
*
* @param boolean $startsNow - if true, the membership will start immediately;
* if false, the membership will start after the current
* membership expires
*
* @return boolean - true in case of success, false in case of failure
*
*
*/
function setMembership($memberID, $membershipID, $days = 0, $startsNow = false, $transactionID = 0)
{
$memberID = (int) $memberID;
$membershipID = (int) $membershipID;
$days = (int) $days;
$startsNow = $startsNow ? true : false;
$SECONDS_IN_DAY = 86400;
$transactionID = (int) $transactionID;
if ($transactionID <= 0) {
$transactionID = 'NULL';
}
//check if member exists
$res = db_res("SELECT COUNT(ID) FROM Profiles WHERE ID = {$memberID}");
$res = mysql_fetch_row($res);
if ($res[0] != 1) {
return false;
}
//check if membership exists
$res = db_res("SELECT COUNT(ID) FROM MemLevels WHERE ID = {$membershipID}");
$res = mysql_fetch_row($res);
if ($res[0] != 1) {
return false;
}
if ($membershipID == MEMBERSHIP_ID_NON_MEMBER) {
return false;
}
$currentMembership = getMemberMembershipInfo($memberID);
$latestMembership = getMemberMembershipInfo_latest($memberID);
if ($membershipID == MEMBERSHIP_ID_STANDARD) {
//return if already Standard
if ($currentMembership['ID'] == MEMBERSHIP_ID_STANDARD) {
return true;
}
//delete any present and future memberships
db_res("\r\n\t\t\tDELETE\tFROM ProfileMemLevels\r\n\t\t\tWHERE\tIDMember = {$memberID}\r\n\t\t\t\t\tAND\t(DateExpires IS NULL OR DateExpires > NOW())");
if (mysql_affected_rows() > 0) {
return true;
} else {
return false;
}
}
if ($days < 0) {
return false;
}
$dateStarts = time();
if (!$startsNow) {
//make the membership start after the current membership expires
if (!is_null($latestMembership['DateExpires'])) {
$dateStarts = $latestMembership['DateExpires'];
// if membership already exists then it's unlimited - just shift or delete it
$res = db_res("\r\n\t\t\t\tSELECT\tIDMember\r\n\t\t\t\tFROM\tProfileMemLevels\r\n\t\t\t\tWHERE\tIDMember = {$memberID}\r\n\t\t\t\t\t\tAND UNIX_TIMESTAMP(DateStarts) = {$dateStarts}\r\n\t\t\t\t\t\tAND IDLevel = {$membershipID}");
$res = mysql_fetch_row($res);
if ($res[0]) {
if ($days == 0) {
db_res("DELETE\tFROM ProfileMemLevels\r\n\t\t\t\t\t\t\tWHERE\tIDMember = {$memberID}\r\n\t\t\t\t\t\t\t\t\tAND UNIX_TIMESTAMP(DateStarts) = {$dateStarts}\r\n\t\t\t\t\t\t\t\t\tAND IDLevel = {$membershipID}");
} else {
db_res("UPDATE\tProfileMemLevels\r\n\t\t\t\t\t\t\tSET\t\tDateStarts = FROM_UNIXTIME(" . ((int) $dateStarts + $days * $SECONDS_IN_DAY) . ")\r\n\t\t\t\t\t\t\tWHERE\tIDMember = {$memberID}\r\n\t\t\t\t\t\t\t\t\tAND UNIX_TIMESTAMP(DateStarts) = {$dateStarts}\r\n\t\t\t\t\t\t\t\t\tAND IDLevel = {$membershipID}");
}
}
}
}
if ($days == 0) {
//if days==0 then set the membership forever
$dateExpires = 'NULL';
} else {
$dateExpires = (int) $dateStarts + $days * $SECONDS_IN_DAY;
}
//insert corresponding record into ProfileMemLevels
db_res("\r\n\t\tINSERT ProfileMemLevels (IDMember, IDLevel, DateStarts, DateExpires, TransactionID)\r\n\t\tVALUES ({$memberID}, {$membershipID}, FROM_UNIXTIME({$dateStarts}), FROM_UNIXTIME({$dateExpires}), {$transactionID})");
if (mysql_affected_rows() <= 0) {
return false;
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:94,代码来源:membership_levels.inc.php
示例7: QueueMessage
function QueueMessage()
{
$msg_id = (int) $_POST['msgs_id'];
$ret = "";
$query = "SELECT `ID` FROM `NotifyMsgs` WHERE `ID` = {$msg_id}";
$arr_arr = db_arr($query);
if (!$arr_arr) {
return "Failed to queue emails (ID: {$msg_id}).";
}
// Initially no emails queued
$emails = 0;
// Send to all emails in NotifyEmails table
if ($_POST['send_to_subscribers'] == 'on') {
$res_eml = db_res("SELECT `ID` FROM `NotifyEmails`");
while ($arr_eml = mysql_fetch_array($res_eml)) {
$res = db_res("SELECT `NotifyEmails`.`Email` FROM `NotifyQueue` INNER JOIN `NotifyEmails` ON (`NotifyQueue`.`Email` = `NotifyEmails`.`ID`) WHERE `NotifyQueue`.`Email` = {$arr_eml['ID']} AND `NotifyQueue`.`Msg` = {$msg_id} AND `From` = 'NotifyEmails'");
if ($res && ($arr = mysql_fetch_array($res))) {
$ret .= "Email(notify) <b><u>{$arr['Email']}</u></b> already exists in queue.<br>";
continue;
}
$res = db_res("INSERT INTO `NotifyQueue` SET `Email` = {$arr_eml['ID']}, `Msg` = {$msg_id}, `From` = 'NotifyEmails', `Creation` = NOW()");
if (!$res) {
$ret .= "Email <b><u>{$arr['Email']}</u></b> was not added to queue.<br>";
continue;
}
$emails++;
}
}
// Send to all profiles
if ($_POST['send_to_members'] == 'on') {
// Sex filter
$apply_filter = false;
$arrpd = db_arr("SELECT `extra` FROM `ProfilesDesc` WHERE `name` = 'Sex'");
$vals = preg_split("/[,\\']+/", $arrpd['extra'], -1, PREG_SPLIT_NO_EMPTY);
foreach ($vals as $v) {
if (!isset($_POST["sex_{$v}"]) || $_POST["sex_{$v}"] != 'on') {
$apply_filter = true;
break;
}
}
if ($apply_filter) {
$sex_string_buffer = "'-1'";
foreach ($vals as $v) {
if (isset($_POST["sex_{$v}"]) && $_POST["sex_{$v}"] == 'on') {
$sex_string_buffer .= ",'{$v}'";
}
}
} else {
$sex_filter_sql = '';
}
// Age filter
$age_start = (int) $_POST['age_start'];
$age_end = (int) $_POST['age_end'];
if ($age_start && $age_end) {
$date_start = (int) (date("Y") - $age_start);
$date_end = (int) (date("Y") - $age_end - 1);
$date_start = $date_start . date("-m-d");
$date_end = $date_end . date("-m-d");
$age_filter_sql = "AND (TO_DAYS(`DateOfBirth`) BETWEEN TO_DAYS('{$date_end}') AND (TO_DAYS('{$date_start}')+1))";
} else {
$age_filter_sql = '';
}
// Country filter
if ($_POST['country'] != 'all') {
$country = process_db_input($_POST['country']);
$country_filter_sql = "AND `Country` = '{$country}'";
} else {
$country_filter_sql = '';
}
// Membership filter
if ($_POST['membership'] != 'all') {
$membershipID = (int) $_POST['membership'];
} else {
$membershipID = -1;
}
$res_eml = db_res("SELECT `ID` FROM `Profiles` WHERE `Status` <> 'Unconfirmed' AND `EmailNotify` = 'NotifyMe' {$sex_filter_sql} {$age_filter_sql} {$country_filter_sql}");
while ($arr_eml = mysql_fetch_array($res_eml)) {
// Dynamic membership filter
$membership_info = getMemberMembershipInfo($arr_eml['ID']);
if ($membershipID != -1 && $membership_info['ID'] != $membershipID) {
continue;
}
$res = db_res("SELECT `Profiles`.`Email` FROM `NotifyQueue` INNER JOIN `Profiles` ON (`NotifyQueue`.`Email` = `Profiles`.`ID`) WHERE `NotifyQueue`.`Email` = {$arr_eml['ID']} AND `NotifyQueue`.`Msg` = {$msg_id} AND `From` = 'Profiles' ");
if ($res && ($arr = mysql_fetch_array($res))) {
$ret .= "Email(profiles) <b><u>{$arr['Email']}</u></b> already exists in queue.<br>";
continue;
}
$res = db_res("INSERT INTO `NotifyQueue` SET `Email` = {$arr_eml['ID']}, `Msg` = {$msg_id}, `From` = 'Profiles', `Creation` = NOW()");
if (!$res) {
$ret .= "Email <b><u>{$arr['Email']}</u></b> was not added to queue.<br>";
continue;
}
$emails++;
}
}
$ret .= (int) $emails . " emails was successfully added to queue.";
return $ret;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:98,代码来源:notifies.php
示例8: QueueMessage
function QueueMessage()
{
global $MySQL;
$iEmails = 0;
$sReturn = "";
$iMsgId = (int) $_POST['msgs_id'];
$aOriginalMessage = $MySQL->getRow("SELECT `id`, `subject`, `body` FROM `sys_sbs_messages` WHERE `id`='" . $iMsgId . "' LIMIT 1");
if (!is_array($aOriginalMessage) || empty($aOriginalMessage)) {
return _t('_adm_mmail_Failed_to_queue_emails_X', $iMsgId);
}
//--- Send to all subscribers
$oEmailTemplates = new BxDolEmailTemplates();
if ($_POST['send_to_subscribers'] == 'non') {
$sSql = "SELECT\n `tsu`.`name` AS `user_name`,\n `tsu`.`email` AS `user_email`,\n `tst`.`template` AS `template_name`\n FROM `sys_sbs_types` AS `tst`\n INNER JOIN `sys_sbs_entries` AS `tse` ON `tst`.`id`=`tse`.`subscription_id` AND `tse`.`subscriber_type`='" . BX_DOL_SBS_TYPE_VISITOR . "'\n INNER JOIN `sys_sbs_users` AS `tsu` ON `tse`.`subscriber_id`=`tsu`.`id`\n WHERE\n `tst`.`unit`='system' AND\n `tst`.`action`='mass_mailer'";
$aSubscribers = $MySQL->getAll($sSql);
foreach ($aSubscribers as $aSubscriber) {
if (empty($aSubscriber['user_email'])) {
continue;
}
$aMessage = $oEmailTemplates->parseTemplate($aSubscriber['template_name'], array('RealName' => $aSubscriber['user_name'], 'Email' => $aSubscriber['user_email'], 'MessageSubject' => $aOriginalMessage['subject'], 'MessageText' => $aOriginalMessage['body']));
$mixedResult = $MySQL->query("INSERT INTO `sys_sbs_queue`(`email`, `subject`, `body`) VALUES('" . $aSubscriber['user_email'] . "', '" . process_db_input($aMessage['subject'], BX_TAGS_STRIP) . "', '" . process_db_input($aMessage['body'], BX_TAGS_VALIDATE) . "')");
if ($mixedResult === false) {
$sReturn .= _t('_adm_mmail_Email_not_added_to_queue_X', $aSubscriber['user_email']);
continue;
}
$iEmails++;
}
}
//--- Send to all profiles
if ($_POST['send_to_members'] == 'memb') {
//--- Sex filter
$sex_filter_sql = '';
if (is_array($_POST['sex']) && !empty($_POST['sex'])) {
$sex_filter_sql = "AND `Sex` IN ('" . implode("','", $_POST['sex']) . "')";
}
//--- Age filter
$age_filter_sql = '';
$age = $_POST['age'];
if ($age != 'all') {
$age_start = (int) $_POST['age_start'];
$age_end = (int) $_POST['age_end'];
if ($age_start && $age_end) {
$date_start = (int) (date("Y") - $age_start);
$date_end = (int) (date("Y") - $age_end - 1);
$date_start = $date_start . date("-m-d");
$date_end = $date_end . date("-m-d");
$age_filter_sql = "AND (TO_DAYS(`DateOfBirth`) BETWEEN TO_DAYS('{$date_end}') AND (TO_DAYS('{$date_start}')+1))";
}
}
//--- Country filter
$country_filter_sql = '';
if ($_POST['country'] != 'all') {
$country = process_db_input($_POST['country']);
$country_filter_sql = "AND `Country` = '{$country}'";
}
//--- Membership filter
$membershipID = $_POST['membership'] != 'all' ? (int) $_POST['membership'] : -1;
$aMembers = $MySQL->getAll("SELECT `ID` AS `id`, `Email` AS `email` FROM `Profiles` WHERE `Status` <> 'Unconfirmed' AND `EmailNotify` = 1 AND (`Couple` = '0' OR `Couple` > `ID`) {$sex_filter_sql} {$age_filter_sql} {$country_filter_sql}");
foreach ($aMembers as $aMember) {
if (empty($aMember['email'])) {
continue;
}
//--- Dynamic membership filter
if ($membershipID != -1) {
$membership_info = getMemberMembershipInfo($aMember['id']);
if ($membership_info['ID'] != $membershipID) {
continue;
}
}
$aMessage = $oEmailTemplates->parseTemplate('t_AdminEmail', array('MessageSubject' => $aOriginalMessage['subject'], 'MessageText' => $aOriginalMessage['body']), $aMember['id']);
$mixedResult = $MySQL->query("INSERT INTO `sys_sbs_queue`(`email`, `subject`, `body`) VALUES('" . $aMember['email'] . "', '" . process_db_input($aMessage['subject'], BX_TAGS_STRIP) . "', '" . process_db_input($aMessage['body'], BX_TAGS_VALIDATE) . "')");
if ($mixedResult === false) {
$sReturn .= _t('_adm_mmail_Email_not_added_to_queue_X', $aMember['email']);
continue;
}
$iEmails++;
}
}
$sReturn .= _t('_adm_mmail_X_emails_was_succ_added_to_queue', (int) $iEmails);
return $sReturn;
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:81,代码来源:notifies.php
示例9: GetMembershipStatus
/**
* Print code for membership status
* $memberID - member ID
* $offer_upgrade - will this code be printed at [c]ontrol [p]anel
*/
function GetMembershipStatus($memberID, $offer_upgrade = true)
{
$ret = '';
$membership_info = getMemberMembershipInfo($memberID);
$viewMembershipActions = "<br />(<a onclick=\"javascript:window.open('explanation.php?explain=membership&type=" . $membership_info['ID'] . "', '', 'width=660, height=500, menubar=no, status=no, resizable=no, scrollbars=yes, toolbar=no, location=no');\" href=\"javascript:void(0);\">" . _t("_VIEW_MEMBERSHIP_ACTIONS") . "</a>)<br />";
// Show colored membership name
if ($membership_info['ID'] == MEMBERSHIP_ID_STANDARD) {
$ret .= _t("_MEMBERSHIP_STANDARD") . $viewMembershipActions;
if ($offer_upgrade) {
$ret .= " " . _t("_MEMBERSHIP_UPGRADE_FROM_STANDARD");
}
} else {
$ret .= "<font color=\"red\">{$membership_info['Name']}</font>{$viewMembershipActions}";
$days_left = (int) (($membership_info['DateExpires'] - time()) / (24 * 3600));
if (!is_null($membership_info['DateExpires'])) {
$ret .= $days_left > 0 ? _t("_MEMBERSHIP_EXPIRES_IN_DAYS", $days_left) : _t("_MEMBERSHIP_EXPIRES_TODAY", date("H:i", $membership_info['DateExpires']), date("H:i"));
} else {
$ret .= _t("_MEMBERSHIP_EXPIRES_NEVER");
}
}
return $ret;
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:27,代码来源:profiles.inc.php
示例10: setMembership
/**
* Set a membership for a member
*
* @param int $iMemberId - member that is going to get the membership
* @param int $iMembershipId - membership that is going to be assigned to the member
* if $iMembershipId == MEMBERSHIP_ID_STANDARD then $days
* and $bStartsNow parameters are not used, so Standard
* membership is always set immediately and `forever`
*
* @param int $days - number of days to set membership for
* if 0, then the membership is set forever
*
* @param boolean $bStartsNow - if true, the membership will start immediately;
* if false, the membership will start after the current
* membership expires
*
* @return boolean - true in case of success, false in case of failure
*
*
*/
function setMembership($iMemberId, $iMembershipId, $iDays = 0, $bStartsNow = false, $sTransactionId = '', $isSendMail = true)
{
$iMemberId = (int) $iMemberId;
$iMembershipId = (int) $iMembershipId;
$iDays = (int) $iDays;
$bStartsNow = $bStartsNow ? true : false;
$SECONDS_IN_DAY = 86400;
if (!$iMemberId) {
$iMemberId = -1;
}
if (empty($sTransactionId)) {
$sTransactionId = 'NULL';
}
//check if member exists
$aProfileInfo = getProfileInfo($iMemberId);
if (!$aProfileInfo) {
return false;
}
//check if membership exists
$iRes = (int) db_value("SELECT COUNT(`ID`) FROM `sys_acl_levels` WHERE `ID`='" . $iMembershipId . "' LIMIT 1");
if ($iRes != 1) {
return false;
}
if ($iMembershipId == MEMBERSHIP_ID_NON_MEMBER) {
return false;
}
$aMembershipCurrent = getMemberMembershipInfo($iMemberId);
$aMembershipLatest = getMemberMembershipInfo_latest($iMemberId);
/**
* Setting Standard membership level
*/
if ($iMembershipId == MEMBERSHIP_ID_STANDARD) {
if ($aMembershipCurrent['ID'] == MEMBERSHIP_ID_STANDARD) {
return true;
}
//delete any present and future memberships
$res = db_res("DELETE FROM `sys_acl_levels_members` WHERE `IDMember`='" . $iMemberId . "' AND (`DateExpires` IS NULL OR `DateExpires`>NOW())");
if (db_affected_rows($res) <= 0) {
return false;
}
}
if ($iDays < 0) {
return false;
}
$iDateStarts = time();
if (!$bStartsNow) {
/**
* make the membership starts after the latest membership expires
* or return false if latest membership isn't Standard and is lifetime membership
*/
if (!is_null($aMembershipLatest['DateExpires'])) {
$iDateStarts = $aMembershipLatest['DateExpires'];
} else {
if (is_null($aMembershipLatest['DateExpires']) && $aMembershipLatest['ID'] != MEMBERSHIP_ID_STANDARD) {
return false;
}
}
} else {
// delete previous profile's membership level and actions traces
db_res("DELETE FROM `sys_acl_levels_members` WHERE `IDMember`='" . $iMemberId . "'");
clearActionsTracksForMember($iMemberId);
}
/**
* set lifetime membership if 0 days is used.
*/
$iDateExpires = $iDays != 0 ? (int) $iDateStarts + $iDays * $SECONDS_IN_DAY : 'NULL';
$res = db_res("INSERT `sys_acl_levels_members` (`IDMember`, `IDLevel`, `DateStarts`, `DateExpires`, `TransactionID`) VALUES ('" . $iMemberId . "', '" . $iMembershipId . "', FROM_UNIXTIME(" . $iDateStarts . "), FROM_UNIXTIME(" . $iDateExpires . "), '" . $sTransactionId . "')");
if (db_affected_rows($res) <= 0) {
return false;
}
//Set Membership Alert
bx_import('BxDolAlerts');
$oZ = new BxDolAlerts('profile', 'set_membership', '', $iMemberId, array('mlevel' => $iMembershipId, 'days' => $iDays, 'starts_now' => $bStartsNow, 'txn_id' => $sTransactionId));
$oZ->alert();
//Notify user about changed membership level
bx_import('BxDolEmailTemplates');
$oEmailTemplate = new BxDolEmailTemplates();
$aTemplate = $oEmailTemplate->getTemplate('t_MemChanged', $iMemberId);
$aMembershipInfo = getMembershipInfo($iMembershipId);
$aTemplateVars = array('MembershipLevel' => $aMembershipInfo['Name']);
//.........这里部分代码省略.........
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:101,代码来源:membership_levels.inc.php
示例11: serviceIsUrlAccessable
function serviceIsUrlAccessable($sURL, $iUserId = 0)
{
if ($iUserId && isRole(BX_DOL_ROLE_ADMIN, $iUserId) || strpos($sURL, '/' . $GLOBALS['admin_dir']) === 0) {
return true;
}
//admin isn't affected by this module also access to admin panel shouldn't ever be protected
$aMemLevel = getMemberMembershipInfo($iUserId);
$iMemLevel = $aMemLevel['ID'];
if ($iMemLevel) {
$aRules = $this->_oDb->getAllRules();
foreach ($aRules as $aRule) {
if ($aRule['MemLevels'][$iMemLevel] && @preg_match('#' . $aRule['Rule'] . '#i', $sURL)) {
return false;
}
}
}
return true;
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:18,代码来源:BxPageACModule.php
示例12: convertEditField2Input
//.........这里部分代码省略.........
break;
case 'select_one':
switch ($aItem['Control']) {
case 'select':
$aInput['type'] = 'select';
break;
case 'radio':
$aInput['type'] = 'radio_set';
break;
default:
return false;
}
$aInput['value'] = $aValues[$iPerson] ? $aValues[$iPerson] : $aItem['Default'];
$aNewValues = $this->convertValues4Input($aItem['Values'], $aItem['UseLKey'], $aItem['Name'], $aItem, $aItem['Default'] ? $aItem['Default'] : $aValues[$iPerson]);
$aInput['attrs'] = $aValues['attrs'] ? $aValues['attrs'] : '';
$aInput['values'] = $aNewValues['values'] ? $aNewValues['values'] : $aNewValues;
break;
case 'select_set':
switch ($aItem['Control']) {
case 'select':
$aInput['type'] = 'select_multiple';
break;
case 'checkbox':
$aInput['type'] = 'checkbox_set';
break;
default:
return false;
}
$aInput['values'] = $this->convertValues4Input($aItem['Values'], $aItem['UseLKey'], $aItem['Name'], $aItem, $aInput['value']);
$aInput['value'] = $aValues[$iPerson];
break;
case 'photo':
$aInput['type'] = 'file';
$aInput['value'] = $aValues[$iPerson];
break;
case 'system':
switch ($aItem['Name']) {
case 'Featured':
$aInput = array('type' => 'checkbox', 'value' => 'yes', 'checked' => $aValues[0]);
break;
case 'Status':
$aInput = array('type' => 'select', 'value' => $aValues[0], 'values' => array());
foreach ($aItem['Values'] as $sValue) {
$aInput['values'][$sValue] = _t("_FieldValues_{$sValue}");
}
break;
case 'Membership':
$aMemberships = getMemberships();
$aMembershipInfo = getMemberMembershipInfo($iProfileID);
$aInput = array('type' => 'custom', 'content' => $this->getInputMembership($aMemberships, $aMembershipInfo));
break;
case 'ID':
case 'Date':
case 'DateLastEdit':
case 'DateLastLogin':
//non editable
return false;
break;
default:
return false;
}
break;
default:
return false;
}
$aInput['name'] = $aItem['Type'] == 'system' ? $aItem['Name'] : $aItem['Name'] . "[{$iPerson}]";
$aInput['caption'] = _t($aItem['Caption']);
$aInput['required'] = $aItem['Type'] == 'pass' ? false : $aItem['Mandatory'];
$aInput['info'] = ($sInfo = _t($aItem['Desc'], $aItem['Min'], $aItem['Max'])) != $aItem['Desc'] ? $sInfo : null;
if ($aItem['Type'] == 'date') {
$aInput['attrs']['min'] = $aItem['Max'] ? date('Y') - $aItem['Max'] . '-' . date('m') . '-' . date('d') : date('Y') - 100 . '-' . date('m') . '-' . date('d');
$aInput['attrs']['max'] = $aItem['Min'] ? date('Y') - $aItem['Min'] . '-' . date('m') . '-' . date('d') : date('Y') + 100 . '-' . date('m') . '-' . date('d');
} else {
$aInput['attrs']['min'] = $aItem['Min'];
$aInput['attrs']['max'] = $aItem['Max'];
}
$aInput['error'] = $aErrors[$iPerson];
if ($aItem['WithPhoto'] || $aItem['MediaType'] == 'map') {
$aVarsUpload = array('display_form' => 'visible', 'input_name' => $aItem['Name'], 'form_submit' => _t('_ml_fields_builder_form_save'), 'draggable' => 'true', 'form_find' => _t('_ml_fields_builder_form_find'), 'Closest_matching_address' => _t('_ml_fields_builder_matching_address'), 'Current_position' => _t('_ml_fields_builder_position'), 'default_address' => $aInput['value'] ? $aInput['value'] : 'New York');
$aInput['type'] = 'custom';
$aInput['content'] = $this->_oMain->_oTemplate->parseHtmlByName('location', $aVarsUpload);
}
if ($aItem['Multiplyable'] && $aItem['MediaType'] == 'none') {
//$aInput['value'] = $aItem['WithPhoto'] ? array() : explode(getParam('ml_clonetwo_multi_divider'), $aInput['value']);
$aInput['value'] = explode($this->_sDelimeter, $aInput['value']);
$aInput['name'] = $aItem['Name'] . '[]';
$aInput['attrs']['multiplyable'] = 'true';
}
if ($aItem['Attribute'] == 'addon') {
$aInput['type'] = 'select_box';
$aInput['name'] = $aItem['Name'];
$aInput['value'] = explode($this->_sDelimeter, $aInput['value']);
}
//elseif ($aItem['WithPhoto'])
//$aInput['value'] = '';
if ($iPerson == 1) {
$aInput['tr_attrs'] = array('class' => 'hidable', 'style' => 'display: ' . ($bCouple ? 'table-row' : 'none'));
}
return $aInput;
}
开发者ID:scriptologist,项目名称:Multi-Module-Creator-Plus,代码行数:101,代码来源:MlClonetwoPageFields.php
示例13: getBlockCode_Membership
function getBlockCode_Membership()
{
if (!isAdmin()) {
return;
}
$sUnlimited = process_line_output(_t('_pfm_unlimited'));
$this->aFormMembership = array('form_attrs' => array('id' => 'profile_edit_membership', 'name' => 'profile_edit_membership', 'action' => BX_DOL_URL_ROOT . 'pedit.php?ID=' . $this->iProfileID, 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array('db' => array('table' => '', 'key' => '', 'uri' => '', 'uri_title' => '', 'submit_name' => 'save_membership')), 'inputs' => array('doSetMembership' => array('type' => 'hidden', 'name' => 'doSetMembership', 'value' => 'yes'), 'MembershipInfo' => array('type' => 'custom', 'caption' => _t('_Membership_current'), 'content' => ''), 'MembershipID' => array('type' => 'select', 'name' => 'MembershipID', 'caption' => _t('_Membership_name'), 'value' => '', 'values' => array(), 'required' => 0, 'attrs' => array('onchange' => 'checkStandard()'), 'checker' => array('func' => 'avail', 'params' => array(), 'error' => _t('_Membership_name_err_empty')), 'db' => array('pass' => 'Int')), 'MembershipDays' => array('type' => 'text', 'name' => 'MembershipDays', 'caption' => _t('_Membership_days'), 'value' => $sUnlimited, 'required' => 0, 'attrs' => array('onfocus' => "if(MembershipDays.value == '" . $sUnlimited . "') MembershipDays.value = ''", 'onblur' => "if(MembershipDays.value == '') MembershipDays.value = '" . $sUnlimited . "'"), 'info' => _t('_Membership_days_info'), 'db' => array('pass' => 'Xss')), 'MembershipImmediately' => array('type' => 'checkbox', 'name' => 'MembershipImmediately', 'caption' => _t('_Membership_starts'), 'value' => 'on', 'required' => 0, 'db' => array('pass' => 'Xss')), 'save_membership' => array('type' => 'submit', 'name' => 'save_membership', 'value' => _t('_Membership_save'))));
$aMemberships = getMemberships();
foreach ($aMemberships as $iId => $sName) {
if ($iId != MEMBERSHIP_ID_NON_MEMBER) {
$this->aFormMembership['inputs']['MembershipID']['values'][] = array('key' => $iId, 'value' => $sName);
}
}
$oForm = new BxTemplFormView($this->aFormMembership);
$oForm->initChecker();
$sContent = "";
if ($oForm->isSubmittedAndValid()) {
$iMshipID = (int) $oForm->getCleanValue('MembershipID');
$iMshipDays = (int) $oForm->getCleanValue('MembershipDays');
//0 = unlim
$bStartsNow = $oForm->getCleanValue('MembershipImmediately') == 'on';
$bSave = setMembership($this->iProfileID, $iMshipID, $iMshipDays, $bStartsNow);
$sContent .= MsgBox(_t($bSave ? '_Membership_save_msg_saved' : '_Membership_save_err_saved'), 3);
}
/**
* Retrieve current membership info.
*/
$aMembershipCurrent = getMemberMembershipInfo($this->iProfileID);
$sMembershipCurrent = $aMembershipCurrent['Name'];
if ($aMembershipCurrent['ID'] != MEMBERSHIP_ID_STANDARD) {
$sMembershipCurrent .= ', ' . (!isset($aMembershipCurrent['DateExpires']) ? _t('_MEMBERSHIP_EXPIRES_NEVER') : _t('_MEMBERSHIP_EXPIRES', defineTimeInterval($aMembershipCurrent['DateExpires'])));
}
$oForm->aInputs['MembershipInfo']['content'] = $sMembershipCurrent;
ob_start();
?>
<script type="text/javascript">
<!--
function checkStandard()
{
var iId = parseInt($("[name='MembershipID']").val());
if(iId == <?php
echo MEMBERSHIP_ID_STANDARD;
?>
) {
$("[name='MembershipDays']").attr('disabled', 'disabled');
$("[name='MembershipImmediately']").attr('disabled', 'disabled');
} else {
$("[name='MembershipDays']").removeAttr('disabled');
$("[name='MembershipImmediately']").removeAttr('disabled');
}
}
$(document).ready(function() {
checkStandard();
});
-->
</script>
<?php
$sContent .= ob_get_clean();
return array($sContent . $oForm->getCode(), array(), array(), false);
}
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:60,代码来源:pedit.php
示例14: PageSDatingCalendar
/**
* page show filer form function
* @return HTML presentation of data
*/
function PageSDatingCalendar()
{
global $dir;
global $site;
global $sdatingThumbWidth;
global $sdatingThumbHeight;
global $aPreValues;
global $oTemplConfig;
$iPicSize = $this->iIconSize + 15;
// collect information about current member
$aMember['ID'] = (int) $_COOKIE['memberID'];
$aMemberData = getProfileInfo($aMember['ID']);
$sMemberSex = $aMemberData['Sex'];
$aMembership = getMemberMembershipInfo($aMember['ID']);
// now year, month and day
list($iNowYear, $iNowMonth, $iNowDay) = explode('-', date('Y-m-d'));
// current year, month, month name, day, days in month
if (isset($_REQUEST['month'])) {
list($iCurMonth, $iCurYear) = explode('-', $_REQUEST['month']);
$iCurMonth = (int) $iCurMonth;
$iCurYear = (int) $iCurYear;
} else {
list($iCurMonth, $iCurYear) = explode('-', date('n-Y'));
}
list($sCurMonthName, $iCurDaysInMonth) = explode('-', date('F-t', mktime(0, 0, 0, $iCurMonth, $iNowDay, $iCurYear)));
// previous month year, month
$iPrevYear = $iCurYear;
$iPrevMonth = $iCurMonth - 1;
if ($iPrevMonth <= 0) {
$iPrevMonth = 12;
$iPrevYear--;
}
// next month year, month
$iNextYear = $iCurYear;
$iNextMonth = $iCurMonth + 1;
if ($iNextMonth > 12) {
$iNextMonth = 1;
$iNextYear++;
}
// days in previous month
$iPrevDaysInMonth = (int) date('t', mktime(0, 0, 0, $iPrevMonth, $iNowDay, $iPrevYear));
// days-of-week of first day in current month
$iFirstDayDow = (int) date('w', mktime(0, 0, 0, $iCurMonth,
|
请发表评论