function run_cron() { global $INI; if (option_yes('cronsubscribe')) { run_cron_subscribe(); } }
function current_frontend() { global $INI; $a = array('/index.php' => '首页', '/team/current_list.php' => '团购列表', '/team/index.php' => '往期团购'); if (option_yes('navseconds')) { $a['/team/seconds.php'] = '秒杀抢团'; } if (option_yes('navgoods')) { $a['/team/goods.php'] = '热销商品'; } if (option_yes('navpartner')) { $a['/partner/index.php'] = '品牌商户'; } $a['/help/tour.php'] = '团购达人'; $a['/play/puzzle.php'] = '拼图游戏'; if (option_yes('navforum')) { $a['/forum/index.php'] = '讨论区'; } $r = $_SERVER['REQUEST_URI']; if (preg_match('#/team#', $r)) { $l = '/team/index.php'; } elseif (preg_match('#/help#', $r)) { $l = '/help/tour.php'; } elseif (preg_match('#/subscribe#', $r)) { $l = '/subscribe.php'; } else { $l = '/index.php'; } return current_link(null, $a); }
function rewrite_partner($c) { if (!option_yes('rewritepartner')) { return $c; } global $INI; $pre = strval($INI['webroot']); $p = "#\"{$pre}/partner\\.php\\?id=(\\d+)\"#i"; $r = "{$pre}/partner/\$1.html"; return preg_replace($p, $r, $c); }
function current_system_option($s = null) { global $city; if (option_yes('daysign')) { $filter = array('a' => '页面设置', 'b' => '地址重写', 'c' => '登录设置', 'd' => '每日签到设置'); } else { $filter = array('a' => '页面设置', 'b' => '地址重写', 'c' => '登录设置'); } $a['/manage/system/option.php'] = '基本选项'; foreach ($filter as $id => $name) { $a["/manage/system/option.php?s={$id}"] = $name; } $l = '/manage/system/option.php'; if ($s) { $l = "/manage/system/option.php?s={$s}"; } return current_link($l, $a, true); }
static public function BuyOne($order) { $order = Table::FetchForce('order', $order['id']); $order_id = abs(intval($order['id'])); $team_id = abs(intval($order['team_id'])); $team = Table::FetchForce('team', $order['team_id']); $plus = $team['conduser']=='Y' ? 1 : $order['quantity']; $team['now_number'] += $plus; /* close time */ if ( $team['max_number']>0 && $team['now_number'] >= $team['max_number'] ) { $team['close_time'] = time(); } /* reach time */ if ( $team['now_number']>=$team['min_number'] && $team['reach_time'] == 0 ) { $team['reach_time'] = time(); } Table::UpdateCache('team', $team['id'], array( 'close_time' => $team['close_time'], 'reach_time' => $team['reach_time'], 'now_number' => array( "`now_number` + {$plus}", ), )); //UPDATE buy_id $SQL = "UPDATE `order` o,(SELECT max(buy_id)+1 AS c FROM `order` WHERE state = 'pay' and team_id = '{$team_id}') AS c SET o.buy_id = c.c, o.luky_id = 100000 + floor(rand()*100000) WHERE o.id = '{$order_id}' AND buy_id = 0;"; DB::Query($SQL); /* send sms Immediately */ if(option_yes('buycouponsms')) sms_buy($order); /* cash flow */ ZFlow::CreateFromOrder($order); /* order : send coupon ? */ ZCoupon::CheckOrder($order); /* order : send voucher ? */ ZVoucher::CheckOrder($order); /* order : send express sms ? */ ZExpress::CheckOrder($order); /* order : invite buy */ ZInvite::CheckInvite($order); ZCredit::UpdateFromOrder($order); }
public static function CheckOrder($order) { $coupon_array = array('express'); $team = Table::FetchForce('team', $order['team_id']); if (!in_array($team['delivery'], $coupon_array) || !option_yes('expressbuysms')) { return; } if ($team['now_number'] >= $team['min_number']) { //init express sms; $last = $team['conduser'] == 'Y' ? 1 : $order['quantity']; if ($team['now_number'] - $team['min_number'] < $last) { $orders = DB::LimitQuery('order', array('condition' => array('team_id' => $order['team_id'], 'state' => 'pay'))); foreach ($orders as $order) { sms_express_buy($order); } } else { sms_express_buy($order); } } }
<option value='餐饮美食'>餐饮美食</option> <option value='休闲娱乐'>休闲娱乐</option> <option value='电影/5D'>电影/5D</option> <option value='美容保健'>美容保健</option> <option value='生活服务'>生活服务</option> <option value='旅行/酒店'>旅行/酒店</option> <option value='精品网购'>精品网购</option> </select> </div> <div class="field suggest"> <label for="feedback-suggest">合作内容</label> <textarea cols="30" rows="5" name="content" id="feedback-suggest" class="f-textarea" require="true" datatype="require" ></textarea> <span class="qtdl">请输入合作内容 </span> </div> <?php if(option_yes('verifyfeedback')){?> <?php include template("block_block_captcha");?> <?php }?> <div class="clear"></div> <div class="act"> <input type="submit" value="好了,提交" name="commit" id="feedback-submit" class="formbutton"/> </div> </form> </div> </div> </div> </div> <?php include template("footer");?>
$wwwlink = mail_zd($email); die(include template('account_verify')); } else { if (strpos($secret, '@')) { Session::Set('unemail', $secret); mail_sign_email($secret); redirect(WEB_ROOT . '/account/verify.php'); } } $user = Table::Fetch('user', $secret, 'secret'); if ($user['enable'] == 'Y') { Session::Set('error', '你的账户已经验通过,请直接登录!'); if (isset($_SESSION['user_id'])) { unset($_SESSION['user_id']); ZLogin::NoRemember(); ZUser::SynLogout(); } redirect(WEB_ROOT . '/account/login.php'); } if ($user) { if (option_yes('mobilecode')) { Table::UpdateCache('user', $user['id'], array('emailable' => 'Y')); die(include template('account_signmobile')); } else { Table::UpdateCache('user', $user['id'], array('emailable' => 'Y', 'enable' => 'Y')); Session::Set('notice', '恭喜!你的帐户已经通过Email验证'); ZLogin::Login($user['id']); redirect(get_loginpage(WEB_ROOT . '/index.php')); } } redirect(WEB_ROOT . '/index.php');
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; if ($_POST) { $login_user = ZUser::GetLogin($_POST['email'], $_POST['password']); if (!$login_user) { Session::Set('error', '登录失败'); redirect(WEB_ROOT . '/account/login.php'); } else { if (option_yes('mobilecode') && $login_user['emailable'] == 'Y' && $login_user['enable'] == 'N') { $user['id'] = $login_user['id']; Session::Set('error', '请验证手机号'); die(include template('account_signmobile')); } else { if (option_yes('emailverify') && $login_user['emailable'] == 'N' && $login_user['enable'] == 'N' && $login_user['secret']) { Session::Set('unemail', $_POST['email']); redirect(WEB_ROOT . '/account/verify.php'); } else { Session::Set('user_id', $login_user['id']); if (abs(intval($_POST['auto_login']))) { ZLogin::Remember($login_user); } ZUser::SynLogin($login_user['username'], $_POST['password']); ZCredit::Login($login_user['id']); redirect(get_loginpage(WEB_ROOT . '/index.php')); } } } } $currefer = strval($_GET['r']); if ($currefer) {
function current_help($selector='faqs') { global $INI; $a = array( '/help/wzmlt.php' => '玩转' . $INI['system']['abbreviation'], '/help/faqs.php' => '常见问题', '/help/zuitu.php' => $INI['system']['abbreviation'] . '是什么', '/help/widget.php' => '团购挂件', ); $b = array( '/help/wzmlt.php' => '玩转' . $INI['system']['abbreviation'], '/help/xfbz.php' => '青年优品承诺', '/help/faqs.php' => '常见问题', '/help/xszn.php' => '新手指南', '/help/rmjc.php' => '入门教程', '/help/zflc' => '付款流程演示 ', ); $a = option_yes('widget') ? $a : $b; $l = "/help/{$selector}.php"; return current_link($l, $a, true); }
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; need_login(); need_open(option_yes('navforum')); $publics = option_category('public'); $id = abs(intval($_GET['id'])); $condition = array('parent_id' => 0); if ($id && ($public = Table::Fetch('category', $id))) { $condition['public_id'] = $id; } else { if ($id) { redirect(WEB_ROOT . '/forum/public.php'); } else { $condition[] = 'public_id > 0'; } } $count = Table::Count('topic', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 20); $topics = DB::LimitQuery('topic', array('condition' => $condition, 'size' => $pagesize, 'offset' => $offset, 'order' => 'ORDER BY head DESC, last_time DESC')); $user_ids = Utility::GetColumn($topics, 'user_id'); $luser_ids = Utility::GetColumn($topics, 'last_user_id'); $user_ids = array_merge($user_ids, $luser_ids); $users = Table::Fetch('user', $user_ids); $public = Table::Fetch('category', $id); $pagetitle = $public ? "{$public['name']}讨论区" : '公共讨论区'; include template('forum_public');
<?php @header('Content-Type:text/html;charset=utf-8'); session_start(); include_once 'config.php'; include_once 'weibooauth.php'; $o = new WeiboOAuth(WB_AKEY, WB_SKEY, $_SESSION['keys']['oauth_token'], $_SESSION['keys']['oauth_token_secret']); $last_key = $o->getAccessToken($_REQUEST['oauth_verifier']); //获取ACCESSTOKEN $_SESSION['last_key'] = $last_key; if (!option_yes('firstsinalogin')) { Utility::Redirect(WEB_ROOT . '/thirdpart/sina/auth.php'); } Utility::Redirect(WEB_ROOT . '/account/sina_bind.php');
$team = Table::Fetch('team', $order['team_id']); team_state($team); if (is_post() && $_POST['paytype'] ) { $uarray = array( 'service' => pay_getservice($_POST['paytype']) ); Table::UpdateCache('order', $order_id, $uarray); $order = Table::Fetch('order', $order_id); $order['service'] = pay_getservice($_POST['paytype']); } if ( $_POST['paytype']!='credit' && $_POST['service']!='credit' && $team['team_type']=='seconds' && ($order['origin']>$login_user['money']) && option_yes('creditseconds') ) { $need_money = ceil($order['origin'] - $login_user['money']); Session::Set('error', "秒杀项目仅可以使用余额付款,您的余额不足,还需要充值{$need_money}元才可以完成秒杀"); redirect(WEB_ROOT . "/credit/charge.php?money={$need_money}"); } //peruser buy count if ($_POST && $team['per_number']>0) { $now_count = Table::Count('order', array( 'user_id' => $login_user_id, 'team_id' => $team['id'], 'state' => 'pay', ), 'quantity'); $leftnum = ($team['per_number'] - $now_count); if ($leftnum <= 0) {
if (empty($cp)) { echo json_encode($return); die; } $check_team = Table::Fetch('team', $cp['team_id']); if (strpos($check_team['store_ids'], '@' . $store_id . '@') === false) { echo json_encode($return); die; } $coupons = DB::LimitQuery('coupon', array('condition' => array('order_id' => $cp['order_id'], 'consume' => 'N'))); if (!empty($coupons)) { foreach ($coupons as $one) { $coupon = Table::FetchForce('coupon', $one['id']); $partner = Table::Fetch('partner', $coupon['partner_id']); $team = Table::Fetch('team', $coupon['team_id']); $check = option_yes('mycoupon') || $coupon['user_id'] == $login_user_id || $coupon['partner_id'] == abs($_SESSION['partner_id']); if (false == $check) { $return[$one['id']]['result'] = -1; } elseif ($coupon['consume'] == 'Y') { $return[$one['id']]['result'] = 2; } else { if ($coupon['expire_time'] < strtotime(date('Y-m-d'))) { $return[$one['id']]['result'] = -2; } else { ZCoupon::Consume($coupon, $store_id, $partner_id); $return[$one['id']]['result'] = 1; } } $return[$one['id']]['coupon'] = Table::FetchForce('coupon', $one['id']); } }
<?php if (option_yes('qzonelogin')) { ?> <p><a href="/thirdpart/qzone/index.php"><img src="/static/css/i/qq.gif" /></a></p> <?php } ?> <?php if (option_yes('qqlogin')) { ?> <p><a href="/thirdpart/qq/index.php"><img src="/static/css/i/qq.png" /></a></p> <?php } ?> <?php if (option_yes('sinalogin')) { ?> <p><a href="/thirdpart/sina/login.php"><img src="/static/css/i/sina_login.png" /></a></p> <?php } ?> <?php if ($INI['alipay']['alifast'] == 'Y') { ?> <p><a href="/alifast/auth_authorize.php"><img src="/static/css/i/btn_login_zfbkj.png" /></a></p> <?php } ?> </div> </div> <div class="sbox-bottom"></div>
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; $daytime = strtotime(date('Y-m-d')); $condition = array('team_type' => 'normal', 'city_id' => array(0, abs(intval($city['id']))), "begin_time <= '{$daytime}'", "audit" => 1); if (!option_yes('displayfailure')) { $condition['OR'] = array("now_number >= min_number", "end_time > '{$daytime}'"); } $group_id = abs(intval($_GET['gid'])); if ($group_id) { $condition['group_id'] = $group_id; } $count = Table::Count('team', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 10); $teams = DB::LimitQuery('team', array('condition' => $condition, 'order' => 'ORDER BY begin_time DESC, sort_order DESC, id DESC', 'size' => $pagesize, 'offset' => $offset)); foreach ($teams as $id => $one) { team_state($one); if (!$one['close_time']) { $one['picclass'] = 'isopen'; } if ($one['state'] == 'soldout') { $one['picclass'] = 'soldout'; } $partner = Table::Fetch('partner', $one['partner_id']); $one['authenticate'] = $partner['authenticate']; $teams[$id] = $one; } $category = Table::Fetch('category', $group_id); $pagetitle = '往期团购'; include template('team_index'); function current_teamcategory($gid = '0')
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; $daytime = time(); $condition = array('open' => 'Y'); $group_id = abs(intval($_GET['gid'])); if ($group_id) { $condition['group_id'] = $group_id; } if (option_yes('citypartner') && ($cid = abs(intval($city['id'])))) { $condition['city_id'] = $cid; } $count = Table::Count('partner', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 10); $partners = DB::LimitQuery('partner', array('condition' => $condition, 'order' => 'ORDER BY head DESC, id DESC', 'size' => $pagesize, 'offset' => $offset)); foreach ($partners as $id => $one) { team_state($one); if ($one['state'] == 'none') { $one['picclass'] = 'isopen'; } if ($one['state'] == 'soldout') { $one['picclass'] = 'soldout'; } $one['comment_num'] = $one['comment_good'] + $one['comment_bad'] + $one['comment_none']; $one['reputation'] = $one['comment_num'] > 0 ? moneyit(number_format(100 * ($one['comment_good'] / $one['comment_num']), 2)) : null; $partners[$id] = $one; } /* now_comments */ $now_cc = array('state' => 'pay', 'comment_display' => 'Y', 'comment_time > 0', 'partner_id > 0'); $now_comments = DB::LimitQuery('order', array('condition' => $now_cc, 'order' => 'ORDER BY comment_time DESC')); foreach ($now_comments as $k => $v) {
<?php require_once(dirname(dirname(__FILE__)) . '/app.php'); require_once(dirname(__FILE__) . '/inc.php'); $id = abs(intval($_GET['id'])); if (!$id || !$team = Table::Fetch('team', $id) ) { redirect( WEB_ROOT . '/team/index.php'); } team_state($team); $pagetitle = "{$INI['system']['abbreviation']}答疑 {$team['title']}"; $condition = array( 'length(comment)>0', 'type' => 'ask', ); if(option_yes('teamask')) { $condition[] = 'team_id > 0'; } else { $condition['team_id'] = $id; } /*pageit*/ $count = Table::Count('ask', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 10); $asks = DB::LimitQuery('ask', array( 'condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset, )); /*endpage*/ $user_ids = Utility::GetColumn($asks, 'user_id'); $users = Table::Fetch('user', $user_ids); include template('team_ask');
$u['email'] = strval($_POST['email']); $u['city_id'] = isset($_POST['city_id']) ? abs(intval($_POST['city_id'])) : abs(intval($city['id'])); $u['mobile'] = strval($_POST['mobile']); if ($_POST['subscribe']) { ZSubscribe::Create($u['email'], abs(intval($u['city_id']))); } if (!Utility::ValidEmail($u['email'], true)) { Session::Set('error', 'Email地址为无效地址'); redirect(WEB_ROOT . '/account/signup.php'); } if ($_POST['password2'] == $_POST['password'] && $_POST['password']) { if (option_yes('emailverify')) { $u['enable'] = 'N'; } if ($user_id = ZUser::Create($u)) { if (option_yes('emailverify')) { mail_sign_id($user_id); Session::Set('unemail', $_POST['email']); redirect(WEB_ROOT . '/account/signuped.php'); } else { ZLogin::Login($user_id); redirect(get_loginpage(WEB_ROOT . '/index.php')); } } else { $au = Table::Fetch('user', $_POST['email'], 'email'); if ($au) { Session::Set('error', '注册失败,Email已被使用'); } else { Session::Set('error', '注册失败,用户名已被使用'); } }
function current_account($selector = '/account/settings.php') { global $INI; $a = array('/coupon/index.php' => '我的' . $INI['system']['couponname'], '/order/index.php' => '我的订单', '/account/refer.php' => '我的邀请', '/account/settings.php' => '账户信息', '/credit/index.php' => '帐户余额', '/account/myask.php' => '我的问答'); if (option_yes('usercredit')) { $a['/credit/score.php'] = '我的积分'; } return current_link($selector, $a, true); }
<?php include_once( 'config.php' ); //QQ登录成功后的回调地址,主要保存access token qq_callback(); //获取用户标示id get_openid(); die($_SESSION["access_token"].'sss'.$_SESSION["openid"]); if(!option_yes('firstqzonelogin')){ Utility::Redirect( WEB_ROOT . '/thirdpart/qzone/auth.php' ); } Utility::Redirect(WEB_ROOT . '/account/qzone_bind.php' );
$order = DB::LimitQuery('order', array( 'condition' => $ex_con, 'one' => true, )); //buyonce if (strtoupper($team['buyonce'])=='Y') { $ex_con['state'] = 'pay'; if ( Table::Count('order', $ex_con) ) { Session::Set('error', '您已经成功购买了本单产品,请勿重复购买,快去关注一下其他产品吧!'); redirect( WEB_ROOT . "/team.php?id={$id}"); } } //bind mobile can buy if (option_yes('bindmobile')) { if(!$login_user_id){ Session::Set('error', '登录后绑定手机的用户才能参团,赶快登录吧!'); redirect( WEB_ROOT . "/team.php?id={$id}"); } $condition = array( 'enable' => 'Y', 'user_id' => $login_user_id, ); $havebind = DB::GetTableRow ('toolsbind', $condition); if ( !$havebind ) { Session::Set('error', '绑定手机的用户才能参团,赶快在账户信息里绑定手机吧!'); redirect( WEB_ROOT . "/team.php?id={$id}"); } }
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; need_login(); $condition = array(); if (!option_yes('usercredit')) { Session::Set('notice', "未开启积分模块!"); redirect(WEB_ROOT . '/order/index.php'); } $count = Table::Count('goods', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 20); $goods = DB::LimitQuery('goods', array('condition' => $condition, 'size' => $pagesize, 'offset' => $offset, 'order' => 'ORDER BY id DESC')); $pagetitle = '兑换商品'; include template('credit_goods');
<?php include_once( 'config.php' ); include_once( 'txwboauth.php' ); $o = new WeiboOAuth( WB_AKEY , WB_SKEY , $_SESSION['keys']['oauth_token'] , $_SESSION['keys']['oauth_token_secret'] ); $last_key = $o->getAccessToken( $_REQUEST['oauth_verifier'] ) ;//获取ACCESSTOKEN $_SESSION['last_key'] = $last_key; if(!option_yes('firstqqlogin')){ Utility::Redirect( WEB_ROOT . '/thirdpart/qq/auth.php' ); } Utility::Redirect( WEB_ROOT . '/account/qq_bind.php' );
/ajax/validator.php" vname="signupname" msg="|" /> <span class="hint">填写4-16个字符,一个汉字为两个字符</span> </div> <div class="field password"> <label for="signup-password">密码</label> <input type="password" size="30" name="password" id="signup-password" class="f-input" require="true" datatype="require" /> <span class="hint">为了您的帐号安全,建议密码最少设置为6个字符以上</span> </div> <div class="field password"> <label for="signup-password-confirm">确认密码</label> <input type="password" size="30" name="password2" id="signup-password-confirm" class="f-input" require="true" datatype="compare" compare="signup-password" /> </div> <div class="field"> <label for="signup-password-confirm">手机号码</label> <input type="text" size="30" name="mobile" id="signup-mobile" class="number" require="<?php echo option_yes('needmobile') ? 'true' : 'require'; ?> " datatype="mobile" /><span class="inputtip">手机号码是我们联系您的最重要方式,并用于<?php echo $INI['system']['couponname']; ?> 的短信通知</span> </div> <div class="field city"> <label id="enter-address-city-label" for="signup-city">所在城市</label> <select name="city_id" class="f-city"><?php echo Utility::Option(Utility::OptionArray($hotcities, 'id', 'name'), $city['id']); ?> <option value='0'>其他</option></select> </div> <div class="field subscribe">
function option_yesv($n, $default = 'N') { return option_yes($n, $default == 'Y') ? 'Y' : 'N'; }
<input type="submit" class="commit" value="订阅" /> </form> <?php if (option_yes('smssubscribe')) { ?> <span><a class="sms" onclick="X.miscajax('sms','subscribe');">» 短信订阅,免费!</a> <a class="sms" onclick="X.miscajax('sms','unsubscribe');">» 取消手机订阅</a></span> <?php } ?> </div> <ul class="nav cf"><?php echo current_frontend(); ?> </ul> <?php if (option_yes('trsimple')) { ?> <div class="vcoupon"> » <a href="/account/invite.php">邀请好友</a> » <a id="verify-coupon-id" href="javascript:;"><?php echo $INI['system']['couponname']; ?> 验证及消费登记</a> » <a href="javascript:;" onclick="return X.misc.locale();">简繁转换</a></div> <?php } else { ?> <div class="vcoupon">» <a href="/account/invite.php">邀请好友购买返利 <?php echo abs($INI['system']['invitecredit']); ?> 元</a> » <a id="verify-coupon-id" href="javascript:;"><?php echo $INI['system']['couponname']; ?>
$daytime = strtotime(date('Y-m-d')); //判断今天是否为1、3、5、7 $today = Utility::GetDate(); $weeks = array('星期一', '星期三', '星期五', '星期天'); if (in_array($today['week'], $weeks)) { json('今天不能签到', 'alert'); } $condition = array('user_id' => $user_id, 'create_time' => $daytime); $have = DB::GetTableRow('daysign', $condition); if ($have) { json(array(array('type' => 'eval', 'data' => 'jQuery("#sign_info").replaceWith(\'' . '<div class="signinfo">您已经签到过了</div>\');')), 'mix'); } $money = abs(strval($INI['system']['givemoney'])); $credit = abs(strval($INI['system']['givecredit'])); if (option_yes('givecredit')) { ZCredit::Create($credit, $user_id, 'daysign'); } if (option_yes('givemoney')) { ZFlow::CreateFromDaysign($user_id, $money); } if ($money == '0' && $credit == '0') { json('暂未设置签到赠送值', 'alert'); } $u = array('user_id' => $user_id, 'credit' => $credit, 'money' => $money, 'create_time' => $daytime); DB::Insert('daysign', $u); $today = Utility::GetDate(); $count = Table::Count('daysign', array('user_id' => $user_id)); $income_money = Table::Count('daysign', array('user_id' => $user_id), 'money'); $income_credit = Table::Count('daysign', array('user_id' => $user_id), 'credit'); json(array(array('type' => 'eval', 'data' => 'jQuery("#sign_info").replaceWith(\'' . '<div class="signinfo-tscg"><span>签到成功</span></div>' . '<div class="sign_info" id="sign_info_a"></div>\');'), array('type' => 'eval', 'data' => 'jQuery("#sign_info_a").replaceWith(\'<div class="sign_info" id="sign_info"></div>' . '<div class="signinfo-ljqd">累计签到' . $count . '次' . ' <a href="http://www.milituan.net/account/loginup.php" target="_blank">[查看]</a></div>\');' . 'jQuery("#nowsign").replaceWith(\'<div class="havesign" id="nowsign">' . '<div class="weekday">' . $today['week'] . '</div></div>\');' . 'jQuery("#showSignTips").replaceWith(\'<div class="signtip" id="showSignTips">今日已签到</div>\');')), 'mix'); }
<?php require_once dirname(__FILE__) . '/app.php'; $request_uri = 'index'; $group_id = abs(intval($_GET['gid'])); if (option_yes('indexmulti') && option_yes('indexpage')) { $city_id = abs(intval($city['id'])); $now = time(); $size = abs(intval($INI['system']['indexteam'])); if ($size <= 1) { return current_team($city_id); } $condition = array('team_type' => 'normal', "begin_time < '{$now}'", "end_time > '{$now}'"); if ($group_id) { $condition['group_id'] = $group_id; } $condition[] = "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))"; $count = Table::Count('team', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, $size); $teams = DB::LimitQuery('team', array('condition' => $condition, 'order' => 'ORDER BY `sort_order` DESC, `id` DESC', 'size' => $pagesize, 'offset' => $offset)); $disable_multi = true; /***********************加入的代码:开始*********************************/ $cates = DB::LimitQuery('category', array('condition' => array('zone' => 'group', 'fid' => '0', 'display' => 'Y'), 'order' => 'ORDER BY `sort_order` DESC, `id` DESC')); $alls = array(); $anow = time(); foreach ($cates as $key => $value) { $alls[$key]['name'] = $value[name]; $alls[$key]['ename'] = $value[ename]; $alls[$key]['gid'] = $value[id]; $alls[$key]['number'] = Table::Count('team', array('team_type' => 'normal', 'group_id' => $value[id], "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))", "begin_time < '{$anow}'", "end_time > '{$anow}'")); $alls[$key]['teams'] = DB::LimitQuery('team', array('condition' => array('team_type' => 'normal', 'group_id' => $value[id], "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))", "begin_time < '{$anow}'", "end_time > '{$anow}'"), 'order' => 'ORDER BY `sort_order` DESC, `id` DESC', 'size' => $value[show_number]));
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; require_once dirname(__FILE__) . '/inc.php'; $id = abs(intval($_GET['id'])); if (!$id || !($team = Table::Fetch('team', $id))) { redirect(WEB_ROOT . '/team/index.php'); } team_state($team); $pagetitle = "{$INI['system']['abbreviation']}答疑 {$team['title']}"; $condition = array('length(comment)>0', 'type' => 'ask'); if (option_yes('teamask')) { $condition[] = 'team_id > 0'; } else { $condition['team_id'] = $id; } /*pageit*/ $count = Table::Count('ask', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 10); $asks = DB::LimitQuery('ask', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset)); /*endpage*/ $user_ids = Utility::GetColumn($asks, 'user_id'); $users = Table::Fetch('user', $user_ids); include template('team_ask');