function getComment($type, $id) { global $dbTablePre, $user_arr; $page_per = 15; $page_now = MooGetGPC('page', 'integer', 'G'); $page_url = preg_replace('/&page=[^&]*/', '', $_SERVER['REQUEST_URI']); $uid = empty($user_arr['uid']) ? 0 : $user_arr['uid']; $from_where = "FROM {prefix}comment WHERE type = '{$type}' AND id= '{$id}' AND ( ischeck = 1 OR uid = '{$uid}' ) "; return readTable($page_now, $page_per, $page_url, $from_where, $order_by = 'ORDER BY cid DESC', $fd_list = '*'); }
function about_clinic_list() { include "./module/{$GLOBALS['name']}/function.php"; $type_id = MooGetGPC('type', 'integer', 'G'); if (!in_array($type_id, array(1, 2, 3, 4))) { header("location:index.php?n=about&h=clinic"); exit; } $page_now = MooGetGPC('page', 'integer', 'G'); $page_per = 15; $page_url = 'index.php?n=about&h=clinic_list&type=' . $type_id; $title_n = 6; // 设置每种类型的问题显示多少个标题 $from_where = "FROM {prefix}love_clinic WHERE type = '{$type_id}' and sid>'0' "; $data = readTable($page_now, $page_per, $page_url, $from_where, 'ORDER BY sort', 'id,title,sort'); $type_name = $GLOBALS['arr_clinic_type'][$type_id]; $left_menu = 'clinic'; require MooTemplate('public/about_clinic_list', 'module'); }
function diamond_redating() { $link = ''; include_once 'include/function_dating.php'; $uid = MooGetGPC('uid', 'integer', 'G'); $page_now = max(1, MooGetGPC('page', 'integer')); $page_per = 10; $where = ''; if (!empty($uid)) { $where .= " and uid='{$uid}'"; $link .= "&uid=" . $uid; } if (isset($_GET['agree'])) { $agree = MooGetGPC('agree', 'integer', 'G'); $where .= " and agree='{$agree}'"; $link .= "&agree={$agree}"; } if (isset($_GET['flag'])) { $flag = MooGetGPC('flag', 'integer', 'G'); $where .= " and flag='{$flag}'"; $link .= "&flag={$flag}"; } if (!empty($where)) { $where = preg_replace("/^\\sand\\s/", '', $where); $where = 'WHERE ' . $where; } $page_url = 'index.php?action=site_diamond&h=redating' . $link; $from_where = "FROM {prefix}dating_respond {$where}"; $data = readTable($page_now, $page_per, $page_url, $from_where, 'ORDER BY rid DESC', '*'); $comm = $did_list = $user_list = ''; foreach ($data['list'] as $repond) { $did_list .= $comm . $repond['did']; $user_list .= $comm . $repond['uid']; $comm = ','; } if (!empty($did_list) && !empty($user_list)) { $sql = "select did,subject from {$dbTablePre}dating where did in ({$did_list})"; $dating_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); foreach ($dating_list as $subject) { $subject_arr[$subject['did']] = $subject['subject']; } $sql = "select uid,sid from {$GLOBALS['dbTablePre']}members_search where uid in({$user_list})"; $user_sid = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); foreach ($user_sid as $user) { $user_arr[$user['uid']] = $user['sid']; } } require adminTemplate("diamond_redating"); }