$_POST['when_monthly'] = 28; } $follows['when'] = $_POST['when_monthly']; break; } switch ($_POST['notification_type']) { case 'email': $follows['post_url'] = ''; $follows['post_format'] = ''; break; case 'post': $follows['post_url'] = $_POST['post_url']; $follows['post_format'] = in_array($_POST['post_format'], array('json')) ? $_POST['post_format'] : 'json'; break; } $result = User::UpdateService('follows', $data['user'], $follows); if ($result === true) { $data['message'] = 'Changes saved <strong>successfully</strong>'; } else { $data['message'] = '<span style="color:red;">Save failed: ' . $result . '</span>'; } } } $data['follows'] = User::GetServices($data['user'], 'follows'); Layout('Follows', 'account'); if ($data['follows'] === false) { TPL('account/follows/install', $data); } else { TPL('account/follows/index', $data); } // echo '<pre>';
Redirect('/account/signin'); } $data = array('user' => User::Get(), 'message' => ' '); if (!empty($_POST['save'])) { $pattern = '/^([a-z0-9\\+])(([-a-z0-9\\+._])*([a-z0-9\\+]))*\\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+(\\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i'; if (!preg_match($pattern, $_POST['email'])) { $data['message'] = '<span style="color:red;">Save failed: Invalid email address; please try again.</span>'; } else { $replies = array(); $replies['status'] = trim($_POST['status']) == 'active' ? 'active' : 'inactive'; $replies['email'] = trim($_POST['email']); $replies['min_interval'] = intval($_POST['min_interval']) * 60; $replies['max_queued'] = intval($_POST['max_queued']); $replies['replies_only'] = empty($_POST['replies_only']) ? 0 : 1; $replies['ignore_self'] = empty($_POST['ignore_self']) ? 0 : 1; $result = User::UpdateService('replies', $data['user'], $replies); if ($result === true) { $data['message'] = 'Changes saved <strong>successfully</strong>'; } else { $data['message'] = '<span style="color:red;">Save failed: ' . $result . '</span>'; } } } $data['replies'] = User::GetServices($data['user'], 'replies'); Layout('Replies', 'account'); if ($data['replies'] === false) { TPL('account/replies/install', $data); } else { $data['replies']['min_interval'] = $data['replies']['min_interval'] / 60; TPL('account/replies/index', $data); }
<?php require dirname(__FILE__) . '/../../../fx.php'; header('Content-Type: text/plain'); $user = array('screen_name' => $_GET['u']); $result = User::UpdateService('follows', $user, array('status' => 'inactive')); if ($result === true) { $result = User::UpdateService('replies', $user, array('status' => 'inactive')); if ($result === true) { echo '1'; exit; } } echo '0';