$data['create_date'] = date('Y-m-d H:i:s', $_WGT['TIME']); $data['location_name'] = isset($_POST['location_name']) ? str_inmysql($_POST['location_name']) : ''; $data['location_intro'] = isset($_POST['location_intro']) ? str_inmysql($_POST['location_intro']) : ''; $data['location_desc'] = isset($_POST['location_desc']) ? str_inmysql($_POST['location_desc']) : ''; $data['location_pic'] = isset($_POST['location_pic']) ? str_inmysql($_POST['location_pic']) : ''; $data['state'] = isset($_POST['state']) ? str_inmysql($_POST['state']) : ''; $data['x_dian'] = isset($_POST['x_dian']) ? str_inmysql($_POST['x_dian']) : ''; $data['y_dian'] = isset($_POST['y_dian']) ? str_inmysql($_POST['y_dian']) : ''; if (!$data['location_name']) { ajax_feedback(0, '1310'); } if (!$data['x_dian']) { ajax_feedback(0, '1311'); } if (!$data['y_dian']) { ajax_feedback(0, '1312'); } //save-InfoLbs $info_id = Model_Table::get('InfoLbs')->upsert($data); //save-keywordlist $list = array('customer_id' => $customer_id, 'info_id' => $info_id, 'keyword' => $data['keyword'], 'info_type' => $info_type); Model_Table::get('KeywordList')->saveForKeywords($list); //return ajax_feedback(1); } //category $cateModel = new Model_InfoCate(); $cates = $cateModel->getCatesByType($info_type); $smarty->assign("cates", $cates); $smarty->assign("today", date("Y-m-d")); $smarty->setTpl('info/templates/lbs.html')->display();
<?php include_once "../includes/config.inc.php"; include_once "../includes/class-upload.php"; $customer_id = $_WGT['m_customer_id']; if (method_is('post')) { $upload = new class_upload(); $upload->upload_form_field = 'imgfile'; $upload->out_file_dir = '../data/image_c/' . $customer_id . '/' . date("Ymd"); $upload->max_file_size = 1024 * 1024 * 6; //6M $upload->make_script_safe = 1; $upload->allowed_file_ext = array('gif', 'jpg', 'jpeg', 'png'); $upload->upload_process(); if ($upload->error_no) { ajax_feedback(0, $upload->error_no); } //等比缩放 makethumb($upload->saved_upload_name, $upload->saved_upload_name, 800, 800, 1); $save_path = str_replace('../data/image_c/', '', $upload->saved_upload_name); ajax_feedback(1, array('path' => $save_path)); }
include_once "../../includes/config.inc.php"; include_once "../../includes/login_check.php"; //var $customer_id = (int) $_SESSION['customer_id']; $status = isset($_REQUEST['status']) ? (int) $_REQUEST['status'] : 1; $page = (int) $_REQUEST["p"] > 0 ? (int) $_REQUEST["p"] : 1; //submit-reply if (isXmlHttpRequest() && method_is('post')) { //TODO 验证身份合法性 $id = isset($_POST['id']) ? (int) $_POST['id'] : ''; $data = array(); $data['is_reply'] = 1; $data['reply_list'] = isset($_POST['reply_list']) ? str_inmysql($_POST['reply_list']) : ''; $sqlStatus = Model_Table::get('Message')->updateById($id, $data); ajax_feedback(1, array('is_reply_str' => Model_Table::get('Message')->is_reply(1))); } //sql $filter = array(); $now_time = time(); $n_time = $now_time - 48 * 3600; $filter['where'] = "customer_id = '{$customer_id}' and create_time > '{$n_time}' and fromuser !=''"; $filter['order'] = "id desc"; //$filter['order'] .= $status ? ',status asc' : ',status desc'; if ($_POST['search']) { $sea = str_inmysql($_POST['search']); $filter['where'] = "customer_id = '{$customer_id}' and msg_content like '%{$sea}%' and fromuser !=''"; //如果是ajax请求48小时外信息 } elseif (method_is('get') && $_GET['act'] == 'history') { $filter['where'] = "customer_id = '{$customer_id}' and create_time < '{$n_time}' and fromuser!=''"; //smarty
<?php use_helper('Language', 'Link', 'Forum', 'Flash', 'MyForm', 'Javascript', 'Ajax', 'General'); echo ajax_feedback(); foreach (array('notice', 'warning', 'error') as $key => $value) { echo display_flash_message($value); } ?> <div id="header"> <div id="banner_middle"> <div id="log"> <div id="mobile_home"> <?php echo link_to('<span> </span>', '@homepage', array('title' => 'Camptocamp.org')); ?> </div> <div class="log_elt"> <?php echo select_interface_language(), ' '; if ($sf_user->isConnected() && PunbbMsg::GetUnreadMsg($sf_user->getId())) { echo f_link_to(picto_tag('action_contact', __('mailbox')), 'message_list.php'); } ?> </div> <div class="log_elt" id="user_mngt"> <?php if ($sf_user->isConnected()) { ?> <strong><?php echo link_to($sf_user->getUsername(), '@document_by_id?module=users&id=' . $sf_user->getId(), array('id' => 'name_to_use', 'data-user-id' => $sf_user->getId(), 'class' => 'logged_as', 'title' => __('Your are connected as ')));
<?php include_once "../../includes/config.inc.php"; include_once "../../includes/login_check.php"; $customer_id = $_SESSION['customer_id']; //submit if (method_is('post')) { //save $infoHelper = new Helper_Info(); $result = $infoHelper->save('common'); //return ajax_feedback($result['success'], $result['content']); }