function fsetsession() { global $GETSQL, $ODBC, $onlineip, $uid, $config, $nowtime, $id; //$config['online'] $lastactivity = $nowtime - $config['online']; $GETSQL->fDelete("`cdb_sessions`", "`lastactivity`>'{$lastactivity}'", "100"); $sql_sessions = $GETSQL->fSql("sid", "`cdb_sessions`", "CONCAT_WS('.',ip1,ip2,ip3,ip4)='{$onlineip}'", "", "", "", "U_B"); $sql_member = $GETSQL->fSql("username", "`cdb_member`", "`uid`='{$uid}'", "", "", "", "U_B"); if ($sql_sessions['sid'] != '') { $GETSQL->fUpdate("`cdb_sessions`", "`ip1`='{$ips[0]}',`ip2`='{$ips[1]}',`ip3`='{$ips[2]}',`ip4`='{$ips[3]}',`lastactivity`='{$nowtime}'", "`uid`='{$id}'"); } else { $ips = explode('.', $onlineip); $cQuery = array("`sid`", "`ip1`", "`ip2`", "`ip3`", "`ip4`", "`uid`", "`username`", "`lastactivity`"); $cData = array($sid, $ips[0], $ips[1], $ips[2], $ips[3], $uid, $sql_members['username'], $nowtime); $GETSQL->fInsert("`cdb_sessions`", $cQuery, $cData); } if ($uid != $id && $uid > 0) { $sql_activity = $GETSQL->fSql("aid,toid", "`{$ODBC['tablepre']}activity`", "`uid`='{$uid}'", "ORDER BY `date` DESC,`aid` DESC"); $n = count($sql_activity); $activity = "no"; foreach ($sql_activity as $value) { if ($value['toid'] == $id) { $GETSQL->fUpdate("`{$ODBC['tablepre']}activity`", "`date`='" . fgetdate() . "'", "`uid`='{$id}' AND `toid`='{$id}'"); $activity = "yes"; } } if ($n < 20 && $activity == "no") { $cQuery = array("`aid`", "`uid`", "`toid`", "`date`"); $cData = array($nowtime, $uid, $id, fgetdate()); $GETSQL->fInsert("`{$ODBC['tablepre']}activity`", $cQuery, $cData); $GETSQL->fUpdate("`{$ODBC['tablepre']}member`", "`blogsee`=`blogsee`+1", "`uid`='{$id}'"); } elseif ($activity == "no") { $GETSQL->fUpdate("`{$ODBC['tablepre']}activity`", "`date`='" . fgetdate() . "'", "`uid`='{$id}' AND `aid`='{$sql_activity[0]['aid']}'"); } } }
$smarty->assign('sqltable', $_GET['table']); $smarty->assign('fpageup', $fpageup); $smarty->display("sqladmin.htm"); } if ($option == 'columns') { if ($_GET['del'] != '') { $GETSQL->fQuery("ALTER TABLE `{$_GET['table']}` DROP `{$_GET['del']}`"); die(gb2utf8("字段{$_GET['table']}.{$_GET['del']}删除")); } $sql_rs = $GETSQL->fArray("show columns from `{$_GET['table']}`"); $smarty->assign('table', $_GET['table']); $smarty->assign('sql_rs', $sql_rs); $smarty->display("sqladmin.htm"); } if ($option == 'sqlback') { $bak = "#\n# IOIme bakfile\n# Version:" . $ODBC['live'] . "\n# Time: " . fgetdate() . "\n# Type: \n# IOIme: http://www.ioime.com\n# --------------------------------------------------------\n\n\n"; $GETSQL->fQuery("SET SQL_QUOTE_SHOW_CREATE = 0"); $bakupdata = ""; $sizelimit = $_GET['sizelimit']; $coun = 0; $url = "admin.php?action={$action}&option={$option}"; if (@is_array($_POST['tablename'])) { foreach ($_POST['tablename'] as $key => $value) { if ($value != '') { fbakouttable($value, $bakupdata); } else { unset($_POST['tablename'][$key]); } $coun++; } $fHtmlcode = fHtmlcode();
function fstatistics($admin = 0) { global $GETSQL, $ODBC, $nowtime, $action, $option, $_SERVER, $onlineip, $uid, $uname; $cQuery = array("`st_id`", "`st_admin`", "`st_action`", "`st_option`", "`st_url`", "`st_ip`", "`st_uid`", "`st_username`", "`st_date`"); $cData = array($nowtime, $admin, $action, $option, $_SERVER['REQUEST_URI'], $onlineip, $uid, $uname, fgetdate()); $GETSQL->fInsert("`{$ODBC['tablepre']}statistics`", $cQuery, $cData); }
if ($IMG_upment['watermark'] == '1') { ImgWaterMark("{$config['attach']}/info/{$img}", $IMG_upment['waterpos'], $IMG_upment['waterimg'], $IMG_upment['watertext'], $IMG_upment['waterfont'], $IMG_upment['watercolor'], $IMG_upment['waterpct']); } $cQuery = array("`img_picid`", "`img_picsrc`", "`img_picsize`", "`img_uid`"); $cData = array($nowtime, $img, $_FILES['fileContent']['size'], $uid); $GETSQL->fInsert("`{$ODBC['tablepre']}images`", $cQuery, $cData); header("Location: update.php?action=img&fileKey={$_POST['fileKey']}&img={$img}"); exit; } if ($_POST['blog_title'] != '' && $_POST['blog_body'] != '') { if ($_POST['bid'] != '') { $GETSQL->fUpdate("`{$ODBC['tablepre']}info`", "`new_type`='{$_POST['blog_class']}',\n\t\t\t`new_subject`='{$_POST['blog_title']}',\n\t\t\t`new_quote`='{$_POST['blog_quote']}',\n\t\t\t`new_content`='{$_POST['blog_body']}',\n\t\t\t`new_date`='" . fgetdate() . "'", "`new_id`='{$_POST['bid']}'"); header("Location: update.php?action=edit&title=" . urlencode("{$_POST['blog_title']}修改成功")); } else { $cQuery = array("`new_id`", "`new_type`", "`new_subject`", "`new_quote`", "`new_content`", "`new_date`"); $cData = array($nowtime, $_POST['blog_class'], $_POST['blog_title'], $_POST['blog_quote'], $_POST['blog_body'], fgetdate()); $GETSQL->fInsert("`{$ODBC['tablepre']}info`", $cQuery, $cData); header("Location: update.php?action=add&title=" . urlencode("{$_POST['blog_title']}发表成功") . "&a={$action}&p={$option}&id={$nowtime}&u=admin"); } exit; } $sql_newsclass = $GETSQL->fSql("*", "`{$ODBC['tablepre']}class`", "", "ORDER BY `type_sp`,`type_id` DESC"); if ($id != '') { $sql_news = $GETSQL->fSql("*", "`{$ODBC['tablepre']}info`", "`new_id`='{$id}'", "", "", "", "U_B"); $soptions = flist_option($sql_newsclass, 0, '', 1); $showoption = preg_replace("/value='{$sql_news['new_type']}'/is", "value='{$sql_news['new_type']}' selected", $soptions); $ncontent = str_replace("\\", "\\\\", $sql_news['new_content']); $ncontent = str_replace("\n", "\\n", $ncontent); $ncontent = str_replace("\r", "\\r", $ncontent); $ncontent = str_replace("\"", "\\\"", $ncontent); $smarty->assign('sql_news', $sql_news);
$_POST['blog_tags'] = implode(",", $gametag); $sql_gametag = $GETSQL->fSql("tag_id,tag_subject", "`{$ODBC['tablepre']}travelyoutag`", "`tag_subject` IN ({$gametags})"); foreach ($sql_gametag as $value) { foreach ($gametag as $key => $ver) { if ($ver == $value['tag_subject']) { unset($gametag[$key]); } } } $GETSQL->fUpdate("`{$ODBC['tablepre']}travelyoutag`", "`tag_num`=`tag_num`+1", "`tag_subject` IN ({$gametags})"); foreach ($gametag as $value) { $cQuery = array("`tag_subject`"); $cData = array($value); $GETSQL->fInsert("`{$ODBC['tablepre']}travelyoutag`", $cQuery, $cData); } } $cQuery = array("`thr_id`", "`thr_hid`", "`thr_subject`", "`thr_tages`", "`thr_content`", "`thr_date`"); $cData = array($nowtime, $id, $_POST['blog_title'], $_POST['blog_tags'], $_POST['blog_body'], fgetdate()); $GETSQL->fInsert("`{$ODBC['tablepre']}travelyou`", $cQuery, $cData); if ($actionhtml = GetCache('travel')) { include_once $actionhtml; if ($cache_config['cache'] == '1') { P_unlink(R_P . "html/travel/travelyou_I_{$id}.htm"); ffile("{$boardurl}index.php?action=travel&option=travelyou&id={$id}", '', "r"); } } header("Location: update.php?action=add&title=" . urlencode("发表成功") . "&a=travel&p=travelyouthread&id={$id}&in={$nowtime}"); exit; } $smarty->display("travelyouedit.htm"); }
} die(gb2utf8("ÈÏÖ¤Âë³ö´í")); } die(gb2utf8("ÁôÑÔʧ°Ü")); } if ($option == 'travelword') { $sql_hotel = $GETSQL->fSql("sc_id", "`{$ODBC['tablepre']}travel`", "`sc_id`='{$_POST['hid']}'", "", "", "", "U_B"); if ($sql_hotel['sc_id'] == '') { die(gb2utf8("¾Æµê²»´æÔÚ²»ÄÜÁôÑÔ")); } if ($_POST['gdcode'] != '' && $_POST['message'] != '' && $_POST['hid'] != '') { $upauth = $_COOKIE['authnum'] ? $_COOKIE['authnum'] : $_SESSION['authnum']; Cookie("authnum", ''); if ($_POST['gdcode'] == $upauth) { fgetposttoupdatd($_POST, $ODBC['charset']); $cQuery = array("`word_id`", "`word_hid`", "`word_uid`", "`word_username`", "`word_content`", "`word_ip`", "`word_date`"); $cData = array($nowtime, $_POST['hid'], $uid, $_POST['nickname'], $_POST['message'], $onlineip, fgetdate()); $GETSQL->fInsert("`{$ODBC['tablepre']}travelword`", $cQuery, $cData); if ($actionhtml = GetCache('travel')) { include_once $actionhtml; if ($cache_config['cache'] == '1') { P_unlink(R_P . "html/travel/hotelword_I_{$_POST['hid']}.htm"); ffile("{$boardurl}index.php?action=travel&option=travelword&id={$_POST['hid']}", '', "r"); } } die(gb2utf8("ÁôÑԳɹ¦")); } die(gb2utf8("ÈÏÖ¤Âë³ö´í")); } die(gb2utf8("ÁôÑÔʧ°Ü")); }
$ncontent = str_replace("\"", "\\\"", $ncontent); $smarty->assign('ncontent', $ncontent); $smarty->assign('sql_hotelthread', $sql_hotelthread); } $smarty->assign('sql_hotel', $sql_hotel); $smarty->display("travelattredit.htm"); } } if ($option == 'travelphoto') { $sql_hotel = $GETSQL->fSql("sc_id,sc_uid,sc_info,sc_traffic", "`{$ODBC['tablepre']}travel`", "`sc_id`='{$id}'", "", "", "", "U_B"); if ($sql_hotel['sc_id'] != '' and $uid == $sql_hotel['sc_uid'] || in_array('travel', $authority) || $sql_pop['group_authority'] == 'all') { if ($_FILES['uploadphoto']['name'] != "" && $_POST['uploadsubject'] != '') { $img = "{$config['attach']}/travel/" . fUploadimg_process($_FILES['uploadphoto'], "{$config['attach']}/travel/", "simll/"); ImgWaterMark($img, $IMG_upment['waterpos'], $IMG_upment['waterimg'], $IMG_upment['watertext'], $IMG_upment['waterfont'], $IMG_upment['watercolor'], $IMG_upment['waterpct']); $cQuery = array("`hi_id`", "`hi_hid`", "`hi_src`", "`hi_subject`", "`hi_date`"); $cData = array($nowtime, $sql_hotel['sc_id'], $img, $_POST['uploadsubject'], fgetdate()); $GETSQL->fInsert("`{$ODBC['tablepre']}travelimage`", $cQuery, $cData); $cQuery = array("`img_picid`", "`img_did`", "`img_picsrc`", "`img_picsize`", "`img_uid`"); $cData = array($nowtime, $nowtime, $img, $_FILES['uploadphoto']['size'], $uid); $GETSQL->fInsert("`{$ODBC['tablepre']}images`", $cQuery, $cData); $GETSQL->fUpdate("`{$ODBC['tablepre']}travel`", "`sc_album`=`sc_album`+1", "`sc_id`='{$id}'"); if ($actionhtml = GetCache('travel')) { include_once $actionhtml; if ($cache_config['cache'] == '1') { P_unlink(R_P . "html/travel/travelphoto_I_{$id}.htm"); ffile("{$boardurl}index.php?action=travel&option=travelphoto&id={$id}", '', "r"); } } echo "<script type='text/javascript' language='javascript' src='lang/ajax.js'></script>\n\t\t\t\t<script type='text/javascript' language='javascript'>\n\t\t\t\tvar s = new parent.dialog();s.init();\n\t\t\t\ts.set('src', 2);\n\t\t\t\ts.set('title', '系统提示信息');\n\t\t\t\ts.event('图片上传成功','parent.window.location.reload();','','parent.window.location.reload();');\n\t\t\t\t</script>"; exit; die(gb2utf8("图片上传成功"));