service_register(); exit; //活动专区 //活动专区 case 'activity': $channel_count = array(); $count = $_MooClass['MooMySQL']->getAll('SELECT count(id) AS count,`channel` FROM `web_ahtv_reguser` WHERE `uid`!=0 group by `channel` '); foreach ($count as $value) { $channel_count[$value['channel']] = $value['count']; } require MooTemplate('public/service_activity', 'module'); exit; //湖北卫视 //湖北卫视 case 'hbtv': put_activity_click(3); $click_num = get_activity_click(3); $activity_register_count = get_activity_register(3); $male_num = $activity_register_count[0]; $female_num = $activity_register_count[1]; //报名数 $num = $male_num + $female_num; $sql = "select username,operationtime,remark from web_ahtv_remark where channel=3 and ispass=1 order by operationtime desc"; $result = $_MooClass['MooMySQL']->getAll($sql); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $seccode1 = strtolower(MooGetGPC('seccode', 'string', 'P')); $seccode2 = MooGetGPC('seccode', 'string', 'C'); $session_seccode = $memcached->get($seccode2); if ($seccode1 != $session_seccode) { MooMessage("验证码填写不正确,请确认。", "index.php?n=service&h=hbtv", '', '1', 1); }
function TV_activity($h, $channel) { global $user_arr; global $memcached; $db = $GLOBALS['db']; put_activity_click($channel); $click_num = get_activity_click($channel); $activity_register_count = get_activity_register($channel); $male_num = $activity_register_count[0]; $female_num = $activity_register_count[1]; //报名数 $num = $male_num + $female_num; $sql = "select username,operationtime,remark from web_ahtv_remark where channel='" . $channel . "' and ispass=1 order by operationtime desc"; $result = $db->getAll($sql); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $seccode1 = strtolower(MooGetGPC('seccode', 'string', 'P')); $seccode2 = MooGetGPC('seccode', 'string', 'C'); $session_seccode = $memcached->get($seccode2); if ($seccode1 != $session_seccode) { MooMessage("验证码填写不正确,请确认。", 'index.php?n=activity&h=' . $h . '', '', '1', 1); } $content = $_POST['content']; $date = date('Y-m-d H:i:s'); $nickname = $user_arr['nickname']; $userid = $user_arr['uid']; $query = $db->query("insert into web_ahtv_remark(uid,username,remark,operationtime,channel) values('{$userid}','{$nickname}','{$content}','{$date}','{$channel}')"); if ($query) { MooMessage("评论成功。", 'index.php?n=activity&h=' . $h . '', '', '3', 3); } } else { $seccode = md5(uniqid(rand(), true)); MooSetCookie('seccode', $seccode, 3600, ''); $session_seccode = $memcached->set($seccode, '', 0, 300); } require MooTemplate('public/service_' . $h . '', 'module'); exit; }