include_once '../frame.php'; $db = get_db(); if ($_POST['type'] == 'comment') { if (is_numeric($_POST['news_id']) === false) { die; } $comment = new table_class('fb_comment'); $comment->resource_type = "news"; $comment->resource_id = intval($_POST['news_id']); $comment->comment = htmlspecialchars($_POST['content']); $comment->created_at = now(); $comment->nick_name = $_POST['nick_name']; $comment->ip = $_SERVER['REMOTE_ADDR']; if (!empty($_COOKIE['cache_name'])) { $comment->user_id = intval(front_user_id()); } $comment->save(); echo $comment->id; } else { if ($_POST['type'] == 'up') { if (is_numeric($_POST['id']) === false) { die; } $db->execute("insert into fb_comment_dig (comment_id,up) values ({$_POST['id']},1) ON DUPLICATE KEY update up=up+1"); } else { if ($_POST['type'] == 'down') { if (is_numeric($_POST['id']) === false) { die; } $db->execute("insert into fb_comment_dig (comment_id,down) values ({$_POST['id']},1) ON DUPLICATE KEY update down=down+1");
<?php session_start(); include_once dirname(__FILE__) . '/../frame.php'; require_login(); $db = get_db(); $uid = front_user_id(); $yh_xx = $db->query("select id from fb_yh_xx where yh_id={$uid}"); $user = new table_class('fb_yh_xx'); $user->find($yh_xx[0]->id); if (isset($_COOKIE['name'])) { $uname = $_COOKIE['name']; } else { $uname = $_COOKIE['login_name']; } if (!isset($_SESSION['new_user_info'])) { $_SESSION['new_user_info'] = rand_str(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv=Content-Type content="text/html; charset=utf-8"> <meta http-equiv=Content-Language content=zh-cn> <title>用户中心_福布斯中文网</title> <?php use_jquery(); js_include_tag('public', 'jquery.colorbox-min.js', 'user/user2'); css_include_tag('complete_info', 'public', 'colorbox'); ?> </head>
function require_zzh() { $uid = front_user_id(); if (empty($uid)) { redirect('/event/zzh/vip.php'); die; } else { $db = get_db(); $user = $db->query("select * from zzh_member where user_id={$uid}"); if (!$user) { redirect('/event/zzh/vip.php'); die; } } }