<?php require_once dirname(__FILE__) . '/include/application.php'; /* magic_quota_gpc */ $_GET = magic_gpc($_GET); $_POST = magic_gpc($_POST); $_COOKIE = magic_gpc($_COOKIE); /* process currefer*/ $currefer = uencode(strval($_SERVER['REQUEST_URI'])); /* session,cache,configure,webroot register */ Session::Init(); $INI = ZSystem::GetINI(); /* end */ /* date_zone */ if (function_exists('date_default_timezone_set')) { date_default_timezone_set($INI['system']['timezone']); } /* end date_zone */ /* biz logic */ $currency = $INI['system']['currency']; $login_user_id = ZLogin::GetLoginId(); $login_user = Table::Fetch('user', $login_user_id); $hotcities = option_hotcategory('city', false, true); $allcities = option_category('city', false, true); $city = cookie_city(null); if (!isset($_COOKIE['referer'])) { setcookie('referer', $_SERVER['HTTP_REFERER']); } /* not allow access app.php */ if ($_SERVER['SCRIPT_FILENAME'] == __FILE__) { 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; }
<?php if($team['id']){?> <?php if ($login_user_id ){ $user = Table::Fetch('user',$login_user_id); $mail = uencode($user['email']); } ; ?> <style type="text/css"> #deal-share { position: absolute; top: 10px; left: 540px; _left: 525px; } #deal-share a { padding-left: 24px; padding-right: 3px; line-height: 16px; background-position: 4px 5px; } </style> <div id="deal-share"> <!-- Baidu Button BEGIN --> <div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare" data="{'url':'<?php echo $INI['system']['wwwprefix']; ?>/team.php?id=<?php echo $team['id']; ?>&r=<?php echo $mail; ?>'}"> <script language="javascript"> var clipBoardContent=document.location; clipBoardContent+='\r\n'; function copy_clip(meintext)
function share_mail($team) { global $login_user_id; global $INI; $user = Table::Fetch('user', $login_user_id); $mail = uencode($user['email']); if (!$team) { $team = array('title' => $INI['system']['sitename'] . '(' . $INI['system']['wwwprefix'] . ')'); } $pre[] = "发现一好网站--{$INI['system']['sitename']},他们每天组织一次团购,超值!"; if ($team['id']) { $pre[] = "今天的团购是:{$team['title']}"; $pre[] = "我想你会感兴趣的:"; $pre[] = $INI['system']['wwwprefix'] . "/team.php?id={$team['id']}&r={$mail}"; $pre = mb_convert_encoding(join("\n\n", $pre), 'GBK', 'UTF-8'); $sub = "有兴趣吗:{$team['title']}"; } else { $sub = $pre[] = $team['title']; } $sub = mb_convert_encoding($sub, 'GBK', 'UTF-8'); $query = array('subject' => $sub, 'body' => $pre); $query = http_build_query($query); return 'mailto:?' . $query; }