Пример #1
0
    $content .= newsletter_posts_issue($issue);
} elseif (isset($_GET['action']) && $_GET['action'] == 'unsubscribe' && !isset($_GET['nonce'])) {
    $title = __('退订', 'tinection');
    $content = newsletter_unsubscribe_template();
} elseif (isset($_GET['action']) && $_GET['action'] == 'unsubscribe' && isset($_GET['email']) && isset($_GET['nonce'])) {
    $title = __('邮件订阅', 'tinection');
    $meta_key = 'unsubscribe_' . $_GET['email'];
    $nonce = get_tin_meta($meta_key) ? get_tin_meta($meta_key) : '';
    if ($nonce == $_GET['nonce']) {
        delete_tin_meta($meta_key);
        //删除用户邮箱
        $tin_dlusers = get_tin_meta('tin_dlusers');
        $tin_dlusers = tin_delete_string_specific_value(',', $tin_dlusers, $_GET['email']);
        update_tin_meta('tin_dlusers', $tin_dlusers);
        $tin_subscribers = get_tin_meta('tin_subscribers');
        $tin_subscribers = tin_delete_string_specific_value(',', $tin_subscribers, $_GET['email']);
        update_tin_meta('tin_subscribers', $tin_subscribers);
        $content = '<div style="min-height:300px;">' . __('退订成功!', 'tinection') . '</div>';
    } else {
        $content = '<div style="min-height:300px;">' . __('退订失败,你可能已经退订,或请重新再试!', 'tinection') . '</div>';
    }
} elseif (isset($_GET['action']) && $_GET['action'] == 'subscribe') {
    $title = __('邮件订阅', 'tinection');
    $content = newsletter_subscribe_template();
} else {
    $issue = $length;
    $title = __('邮件周刊(No.', 'tinection') . $issue . ')';
    $content = tin_past_issues_selection();
    $content .= newsletter_posts_issue($issue);
}
?>
Пример #2
0
function tin_collect()
{
    $pid = $_POST['pid'];
    $uid = $_POST['uid'];
    $action = $_POST['act'];
    if ($action != 'remove') {
        $collect = get_user_meta($uid, 'tin_collect', true);
        if (!empty($collect)) {
            $collect .= ',' . $pid;
            update_user_meta($uid, 'tin_collect', $collect);
        } else {
            $collect = $pid;
            update_user_meta($uid, 'tin_collect', $collect);
        }
        $collects = get_post_meta($pid, 'tin_post_collects', true);
        $collects++;
        update_post_meta($pid, 'tin_post_collects', $collects);
    } else {
        $collect = get_user_meta($uid, 'tin_collect', true);
        $collect = tin_delete_string_specific_value(',', $collect, $pid);
        update_user_meta($uid, 'tin_collect', $collect);
        $collects = get_post_meta($pid, 'tin_post_collects', true);
        $collects--;
        update_post_meta($pid, 'tin_post_collects', $collects);
    }
}
Пример #3
0
    $content .= newsletter_posts_issue($issue);
} elseif (isset($_GET['action']) && $_GET['action'] == 'unsubscribe' && !isset($_GET['nonce'])) {
    $title = __('退订', 'tinection');
    $content = newsletter_unsubscribe_template();
} elseif (isset($_GET['action']) && $_GET['action'] == 'unsubscribe' && isset($_GET['email']) && isset($_GET['nonce'])) {
    $title = __('邮件订阅', 'tinection');
    $meta_key = 'unsubscribe_' . htmlspecialchars($_GET['email']);
    $nonce = get_tin_meta($meta_key) ? get_tin_meta($meta_key) : '';
    if ($nonce == $_GET['nonce']) {
        delete_tin_meta($meta_key);
        //删除用户邮箱
        $tin_dlusers = get_tin_meta('tin_dlusers');
        $tin_dlusers = tin_delete_string_specific_value(',', $tin_dlusers, htmlspecialchars($_GET['email']));
        update_tin_meta('tin_dlusers', $tin_dlusers);
        $tin_subscribers = get_tin_meta('tin_subscribers');
        $tin_subscribers = tin_delete_string_specific_value(',', $tin_subscribers, htmlspecialchars($_GET['email']));
        update_tin_meta('tin_subscribers', $tin_subscribers);
        $content = '<div style="min-height:300px;">' . __('退订成功!', 'tinection') . '</div>';
    } else {
        $content = '<div style="min-height:300px;">' . __('退订失败,你可能已经退订,或请重新再试!', 'tinection') . '</div>';
    }
} elseif (isset($_GET['action']) && $_GET['action'] == 'subscribe') {
    $title = __('邮件订阅', 'tinection');
    $content = newsletter_subscribe_template();
} else {
    $issue = $length;
    $title = __('邮件周刊(No.', 'tinection') . $issue . ')';
    $content = tin_past_issues_selection();
    $content .= newsletter_posts_issue($issue);
}
?>