public static function NoRemember($user_id = 0) { cookieset(self::$cookie_name, null, -1); if ($user_id > 0) { Cache::Del(Cache::GetObjectKey('user', $user_id)); } }
public static function Create($ruser, $newuser) { if ($ruser['id'] == $newuser['id']) { return; } $invite = array('user_id' => $ruser['id'], 'user_ip' => $ruser['ip'], 'other_user_id' => $newuser['id'], 'other_user_ip' => $newuser['ip'], 'create_time' => time()); cookieset('_rid', null, -1); return DB::Insert('invite', $invite); }
public static function CreateFromId($user_id, $other_user_id) { if (!$user_id || !$other_user_id) { return; } if ($user_id == $other_user_id) { return; } $ruser = Table::Fetch('user', $user_id); $newuser = Table::Fetch('user', $other_user_id); if ($newuser['newbie'] == 'Y') { cookieset('_rid', null, -1); self::Create($ruser, $newuser); } }
getRecentGoods($id); // 查看是否已经收藏该团购 $had_collect = false; if ($login_user_id) { $collect = DB::GetTableRow("collect",array('user_id'=>$login_user_id,'team_id'=>$id)); if($collect){ $had_collect = true; } } /* refer */ if ($_rid = strval($_GET['r'])) { $_rid = udecode($_rid); $_user = Table::Fetch('user',$_rid,'email'); if($_user) cookieset('_rid', abs(intval($_user['id']))); redirect( WEB_ROOT . "/team.php?id={$id}"); } $teamcity = Table::Fetch('category', $team['city_id']); $city = $teamcity ? $teamcity : $city; $city = $city ? $city : array('id'=>0, 'name'=>'全部'); $pagetitle = $team['title']; $discount_price = $team['market_price'] - $team['team_price']; $discount_rate = team_discount($team); $left = array(); $now = time(); /**team review 设置开始**/
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; $action = strval($_GET['action']); $id = strval($_GET['id']); $sec = strval($_GET['secret']); if ($action == 'needlogin') { $html = render('ajax_dialog_needlogin'); json($html, 'dialog'); } else { if ($action == 'authorization') { need_auth('super'); $user = Table::Fetch('user', $id); $html = render('manage_ajax_dialog_authorization'); json($html, 'dialog'); } else { if ('locale' == $action) { $v = cookieget('locale', 'zh_cn'); cookieset('locale', $v == 'zh_cn' ? 'zh_tw' : 'zh_cn'); json(null, 'refresh'); } } }
function cookie_city($city) { global $INI; if ($city) { cookieset('city', $city['id']); return $city; } $city_id = cookieget('city'); if (!$city_id) { $city = get_city(); if (!$city) { $city = Table::Fetch('category', $INI['hotcity'][0]); } if ($city) { cookie_city($city); } return $city; } else { if (in_array($city_id, $INI['hotcity'])) { return Table::Fetch('category', $city_id); } $INI['hotcity'] = array_diff($INI['hotcity'], array(0, NULL)); $city = Table::Fetch('category', $INI['hotcity'][0]); } return $city; }
public static function NoRemember() { cookieset(self::$cookie_name, null, -1); }
<?php require_once dirname(__FILE__) . '/app.php'; $id = abs(intval($_GET['id'])); if (!$id || !($team = Table::FetchForce('team', $id))) { Utility::Redirect(WEB_ROOT . '/team/index.php'); } /* refer */ if ($_rid = abs(intval($_GET['r']))) { if ($_rid) { cookieset('_rid', abs(intval($_GET['r']))); } Utility::Redirect(WEB_ROOT . "/team.php?id={$id}"); } $teamcity = Table::Fetch('category', $team['city_id']); $city = $teamcity ? $teamcity : $city; $city = $city ? $city : array('id' => 0, 'name' => '全部'); $pagetitle = $team['title']; $discount_price = $team['market_price'] - $team['team_price']; $discount_rate = team_discount($team); $left = array(); $now = time(); if ($team['end_time'] < $team['begin_time']) { $team['end_time'] = $team['begin_time']; } $diff_time = $left_time = $team['end_time'] - $now; if ($team['team_type'] == 'seconds' && $team['begin_time'] >= $now) { $diff_time = $left_time = $team['begin_time'] - $now; } $left_day = floor($diff_time / 86400); $left_time = $left_time % 86400;
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; cookieset('newbie', 'N'); Output::Json(0);
function cookie_city($city) { global $hotcities; if ($city) { cookieset('city', $city['id']); return $city; } $city_id = cookieget('city'); $city = Table::Fetch('category', $city_id); if (!$city) { $city = get_city(); } if (!$city) { $city = array_shift($hotcities); } if ($city) { return cookie_city($city); } return $city; }
<?php require_once dirname(__FILE__) . '/app.php'; $id = abs(intval($_GET['r'])); if ($id) { if ($login_user_id) { ZInvite::CreateFromId($id, $login_user_id); } else { $longtime = 86400 * 3; //3 days cookieset('_rid', $id, $longtime); } } Utility::Redirect(WEB_ROOT . '/index.php');
function cookie_city($city) { if ($city) { $city_v = uencode("{$city['id']}|{$city['ename']}|{$city['name']}"); $expire = time() + 365 * 86400; cookieset('city', $city_v); } else { if (!cookieget('city')) { $city = get_city(); if (!$city) { return array(); } return cookie_city($city); } else { $v = explode('|', udecode(cookieget('city'))); return array('id' => $v[0], 'ename' => $v[1], 'name' => $v[2]); } } return $city; }
static public function NoRemeberBiz($bizer){ $zone = "{$bizer['id']}@"; cookieset(self::$cookie_bizname, base64_encode($zone), 30*86400); }
<?php require_once dirname(__FILE__) . '/app.php'; $id = abs(intval($_GET['r'])); if ($id) { cookieset('_rid', $id); } Utility::Redirect(WEB_ROOT . '/index.php');
echo json_encode(array('done' => false, 'error' => '很抱歉,该手机号已经存在。')); die; } $code = send_reg_code($mobile); $_SESSION['mobile_reg_code'] = $code; // 设置cookie cookieset('mobile_reg_code_mobile', $mobile, 60); cookieset('mobile_reg_code', time(), 60); $output['done'] = true; echo json_encode($output); } elseif ($action == 'sendLoginDynamicCode') { $mobile = $_GET['m']; if (empty($mobile)) { // not null echo json_encode(array('done' => false, 'error' => '手机号为空')); die; } $check = DB::GetTableRow("user", array('mobile' => $mobile)); if (empty($check)) { // $dynamic_user = array('username' => 'm' . $mobile, 'email' => $mobile . '@milituan.net', 'mobile' => $mobile, 'password' => '', 'sns' => 'dynamic'); ZUser::Create($dynamic_user, true); } $code = send_dynamic_code($mobile); // 设置cookie cookieset('send_dynamic_mobile', $mobile, 60); cookieset('send_dynamic', time(), 60); $_SESSION['mobile_dynamic_code'] = $code; $output['done'] = true; echo json_encode($output); }