예제 #1
0
<?php

require_once '/home/amp/public_html/include/load_amp_command_line.php';
$site_name = AMP_load_site_command_line();
require_once 'democracyinaction/api.php';
require_once 'AMP/System/User/Profile/Profile.php';
require_once 'win_config.php';
require_once 'WinMember.php';
$members = WinMember::getMembers();
$i = 0;
foreach ($members as $member) {
    if (!$member->get_email()) {
        continue;
    }
    if ($member->needs_reminder('-1 month')) {
        //print $member->get_email(). " is getting reminder -1 month\n";
        $member->send_reminder(ONE_MONTH_MEMBERSHIP_REMINDER_KEY);
    } elseif ($member->needs_reminder('-1 week')) {
        //print $member->get_email(). " is getting reminder -1 week\n";
        $member->send_reminder(ONE_WEEK_MEMBERSHIP_REMINDER_KEY);
    } elseif ($member->needs_reminder('-1 day')) {
        //print $member->get_email(). " is getting reminder -1 day\n";
        $member->send_reminder(ONE_DAY_MEMBERSHIP_REMINDER_KEY);
    } elseif ($member->needs_reminder('+2 week', true)) {
        //print $member->get_email(). " is getting reminder +2 weeks\n";
        $member->send_reminder(TWO_WEEK_MEMBERSHIP_EMAIL_KEY);
    } elseif ($member->needs_reminder('+6 month', true)) {
        //print $member->get_email(). " is getting reminder +6 months\n";
        $member->send_reminder(TWO_MONTH_MEMBERSHIP_EMAIL_KEY);
    } elseif ($member->needs_reminder('+2 week')) {
        //print $member->get_email(). " is getting reminder after expiration\n";
예제 #2
0
<?php

require_once '/home/amp/public_html/include/load_amp_command_line.php';
$site_name = AMP_load_site_command_line();
require_once 'democracyinaction/api.php';
require_once 'AMP/System/User/Profile/Profile.php';
require_once 'win_config.php';
require_once 'WinMember.php';
$members = WinMember::getMembers(array('modin' => 20));
foreach ($members as $member) {
    //trigger_error($member->get_email());
    if ($member->get_dia_supporter_key() && $member->get_email()) {
        //trigger_error($member->get_dia_supporter_key());
        print $member->data->getData(WIN_MEMBERSHIP_STATUS) . "\n";
        /*
            $member->connect_to_dia();
            $member->dia->save('supporter', array(
              'key' => $member->get_dia_supporter_key(),
              'membership_status' => $member->data->getData(WIN_MEMBERSHIP_STATUS),
              'expire_date' => $member->data->getData(WIN_MEMBERSHIP_EXPIRATION)
            ));
        */
    }
}
예제 #3
0
{
    foreach ($members as $member) {
        $member->set_google_group_status($status);
    }
}
if (AMP_params('email')) {
    $emails = split(',', AMP_params('email'));
    $action_members = array_map('find_member_by_email', $emails);
}
if (AMP_params('action') == 'add') {
    if (!empty($action_members)) {
        set_google_group_statuses($action_members, 1);
    }
    $members = WinMember::getMembers(array('publish' => 1, 'modin' => 20, 'is' => array(WIN_GOOGLE_GROUP_MEMBER, 'NULL OR ' . WIN_GOOGLE_GROUP_MEMBER . '=0')));
}
//removing
if (AMP_params('action') == 'remove') {
    if (!empty($action_members)) {
        set_google_group_statuses($action_members, 0);
    }
    $members = WinMember::getMembers(array('publish' => 0, 'modin' => '20', WIN_GOOGLE_GROUP_MEMBER => 1));
}
if ($members === null) {
    die('you need to specicy a valid action like "add" or "remove"');
}
$list = array();
foreach ($members as $member) {
    $list[] = $member->get_email();
    $users = array('users' => $list);
}
print $_GET['callback'] . "(" . json_encode($users) . ")";