@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
//管理入口
|
||||
|
||||
if(is_file('app/'.$app.'/action/admin/'.$mg.'.php')){
|
||||
include_once 'app/'.$app.'/action/admin/'.$mg.'.php';
|
||||
}else{
|
||||
qiMsg('sorry:no index!');
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
switch($ts){
|
||||
case "list":
|
||||
|
||||
$arrLocation = $new['location']->findAll('location',null,'orderid asc');
|
||||
include template('admin/location_list');
|
||||
break;
|
||||
|
||||
case "add":
|
||||
|
||||
|
||||
include template('admin/location_add');
|
||||
break;
|
||||
|
||||
case "adddo":
|
||||
|
||||
$title = t($_POST['title']);
|
||||
$content = trim($_POST['content']);
|
||||
|
||||
$orderid = intval($_POST['orderid']);
|
||||
|
||||
$locationid = $new['location']->create('location',array(
|
||||
'title'=>$title,
|
||||
'content'=>$content,
|
||||
'orderid'=>$orderid,
|
||||
));
|
||||
|
||||
$arrUpload = tsUpload ( $_FILES ['photo'], $locationid, 'location', array ('jpg','gif','png','jpeg' ) );
|
||||
if ($arrUpload) {
|
||||
$new ['location']->update ( 'location', array (
|
||||
'locationid' => $locationid
|
||||
), array (
|
||||
'path' => $arrUpload ['path'],
|
||||
'photo' => $arrUpload ['url']
|
||||
) );
|
||||
}
|
||||
|
||||
header('Location: '.SITE_URL.'index.php?app=location&ac=admin&mg=location&ts=list');
|
||||
|
||||
break;
|
||||
|
||||
case "edit":
|
||||
|
||||
$locationid = intval($_GET['locationid']);
|
||||
|
||||
$strLocation = $new['location']->find('location',array(
|
||||
'locationid'=>$locationid,
|
||||
));
|
||||
|
||||
include template('admin/location_edit');
|
||||
break;
|
||||
|
||||
case "editdo":
|
||||
$locationid = intval($_POST['locationid']);
|
||||
$title = t($_POST['title']);
|
||||
$content = trim($_POST['content']);
|
||||
|
||||
$orderid = intval($_POST['orderid']);
|
||||
|
||||
$new['location']->update('location',array(
|
||||
'locationid'=>$locationid,
|
||||
),array(
|
||||
'title'=>$title,
|
||||
'content'=>$content,
|
||||
'orderid'=>$orderid,
|
||||
));
|
||||
|
||||
$arrUpload = tsUpload ( $_FILES ['photo'], $locationid, 'location', array ('jpg','gif','png','jpeg' ) );
|
||||
if ($arrUpload) {
|
||||
$new ['location']->update ( 'location', array (
|
||||
'locationid' => $locationid
|
||||
), array (
|
||||
'path' => $arrUpload ['path'],
|
||||
'photo' => $arrUpload ['url']
|
||||
) );
|
||||
}
|
||||
|
||||
header('Location: '.SITE_URL.'index.php?app=location&ac=admin&mg=location&ts=list');
|
||||
|
||||
break;
|
||||
|
||||
case "delete":
|
||||
|
||||
$locationid = intval($_GET['locationid']);
|
||||
$strLocation = $new['location']->find('location',array(
|
||||
'locationid'=>$locationid,
|
||||
));
|
||||
|
||||
unlink('uploadfile/location/'.$strLocation['photo']);
|
||||
|
||||
$new['location']->delete('location',array(
|
||||
'locationid'=>$locationid,
|
||||
));
|
||||
|
||||
$new['location']->update('article',array(
|
||||
'locationid'=>$locationid,
|
||||
),array(
|
||||
'locationid'=>0,
|
||||
));
|
||||
|
||||
$new['location']->update('attach',array(
|
||||
'locationid'=>$locationid,
|
||||
),array(
|
||||
'locationid'=>0,
|
||||
));
|
||||
|
||||
$new['location']->update('group_topic',array(
|
||||
'locationid'=>$locationid,
|
||||
),array(
|
||||
'locationid'=>0,
|
||||
));
|
||||
|
||||
$new['location']->update('photo',array(
|
||||
'locationid'=>$locationid,
|
||||
),array(
|
||||
'locationid'=>0,
|
||||
));
|
||||
|
||||
$new['location']->update('user_info',array(
|
||||
'locationid'=>$locationid,
|
||||
),array(
|
||||
'locationid'=>0,
|
||||
));
|
||||
|
||||
$new['location']->update('weibo',array(
|
||||
'locationid'=>$locationid,
|
||||
),array(
|
||||
'locationid'=>0,
|
||||
));
|
||||
|
||||
qiMsg('操作成功!');
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
include template("admin/options");
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
switch($ts){
|
||||
case "join":
|
||||
|
||||
|
||||
$userid = intval($TS_USER['userid']);
|
||||
|
||||
$locationid = intval($_POST['locationid']);
|
||||
|
||||
if($userid==0){
|
||||
getJson('请登录后再加入!');
|
||||
}
|
||||
|
||||
//更新ts_article、ts_attach、ts_group_topic、ts_photo、ts_user_info、ts_weibo
|
||||
$new['location']->update('article',array(
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'locationid'=>$locationid,
|
||||
));
|
||||
|
||||
$new['location']->update('attach',array(
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'locationid'=>$locationid,
|
||||
));
|
||||
|
||||
$new['location']->update('group_topic',array(
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'locationid'=>$locationid,
|
||||
));
|
||||
|
||||
$new['location']->update('photo',array(
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'locationid'=>$locationid,
|
||||
));
|
||||
|
||||
$new['location']->update('user_info',array(
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'locationid'=>$locationid,
|
||||
));
|
||||
|
||||
$new['location']->update('weibo',array(
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'locationid'=>$locationid,
|
||||
));
|
||||
|
||||
getJson('加入成功!',1,2,tsUrl('location','show',array('id'=>$locationid)));
|
||||
|
||||
break;
|
||||
|
||||
case "exit":
|
||||
|
||||
$userid = intval($TS_USER['userid']);
|
||||
|
||||
$locationid = intval($_POST['locationid']);
|
||||
|
||||
if($userid==0 || $locationid == 0){
|
||||
getJson('非法操作!');
|
||||
}
|
||||
|
||||
//更新ts_article、ts_attach、ts_group_topic、ts_photo、ts_user_info、ts_weibo
|
||||
$new['location']->update('article',array(
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'locationid'=>0,
|
||||
));
|
||||
|
||||
$new['location']->update('attach',array(
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'locationid'=>0,
|
||||
));
|
||||
|
||||
$new['location']->update('group_topic',array(
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'locationid'=>0,
|
||||
));
|
||||
|
||||
$new['location']->update('photo',array(
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'locationid'=>0,
|
||||
));
|
||||
|
||||
$new['location']->update('user_info',array(
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'locationid'=>0,
|
||||
));
|
||||
|
||||
$new['location']->update('weibo',array(
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'locationid'=>0,
|
||||
));
|
||||
|
||||
getJson('退出成功!',1,2,tsUrl('location'));
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$arrLocation = $new['location']->findAll('location');
|
||||
|
||||
$title = '全部同城';
|
||||
include template('all');
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
$strUser = aac('user')->getSimpleUser($userid);
|
||||
|
||||
if($strUser['locationid']==0){
|
||||
$arrLocation = $new['location']->findAll('location');
|
||||
if($arrLocation==''){
|
||||
tsNotice('同城未做配置,暂时还不能加入!');
|
||||
}
|
||||
|
||||
$title = '选择加入同城';
|
||||
include template('index');
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
header('Location: '.tsUrl('location','show',array('id'=>$strUser['locationid'])));
|
||||
exit;
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
|
||||
|
||||
// 管理入口
|
||||
if (is_file ( 'app/' . $TS_URL['app'] . '/action/my/' . $TS_URL['my'] . '.php' )) {
|
||||
include_once 'app/' . $TS_URL['app'] . '/action/my/common.php';
|
||||
include_once 'app/' . $TS_URL['app'] . '/action/my/' . $TS_URL['my'] . '.php';
|
||||
} else {
|
||||
qiMsg ( 'sorry:no index!' );
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
$strUser = aac('user')->getOneUser($userid);
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
|
||||
|
||||
|
||||
if($strUser['locationid']){
|
||||
|
||||
$strLocation = $new['location']->find('location',array(
|
||||
'locationid'=>$strUser['locationid'],
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
$title = '我的同城';
|
||||
include template('my/index');
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$locationid = intval($_GET['id']);
|
||||
|
||||
$strLocation = $new['location']->find('location',array(
|
||||
'locationid'=>$locationid,
|
||||
));
|
||||
|
||||
$strLocation['title'] = tsTitle($strLocation['title']);
|
||||
$strLocation['content'] = tsTitle($strLocation['content']);
|
||||
|
||||
//文章
|
||||
$arrArticle = $new['location']->findAll('article',array(
|
||||
'locationid'=>$locationid,
|
||||
),'addtime desc',null,10);
|
||||
//资料
|
||||
/*
|
||||
$arrAttach = $new['location']->findAll('attach',array(
|
||||
'locationid'=>$locationid,
|
||||
),'addtime desc',null,10);
|
||||
*/
|
||||
//帖子
|
||||
$arrTopic = $new['location']->findAll('group_topic',array(
|
||||
'locationid'=>$locationid,
|
||||
),'addtime desc',null,10);
|
||||
foreach($arrTopic as $key=>$item){
|
||||
$arrTopic[$key]['title'] = tsTitle($item['title']);
|
||||
$arrTopic[$key]['user'] = aac('user')->getSimpleUser($item['userid']);
|
||||
$arrTopic[$key]['group'] = $new['location']->find('group',array(
|
||||
'groupid'=>$item['groupid'],
|
||||
));
|
||||
}
|
||||
|
||||
//图片
|
||||
$arrPhoto = $new['location']->findAll('photo',array(
|
||||
'locationid'=>$locationid,
|
||||
),'addtime desc',null,10);
|
||||
//用户
|
||||
$arrUser = $new['location']->findAll('user_info',array(
|
||||
'locationid'=>$locationid,
|
||||
),'uptime desc',null,16);
|
||||
//唠叨
|
||||
$arrWeibo = $new['location']->findAll('weibo',array(
|
||||
'locationid'=>$locationid,
|
||||
),'addtime desc',null,10);
|
||||
foreach($arrWeibo as $key=>$item){
|
||||
$arrWeibo[$key]['content'] = tsTitle($item['content']);
|
||||
$arrWeibo[$key]['user'] = aac('user')->getSimpleUser($item['userid']);
|
||||
}
|
||||
|
||||
//是否是同城用户
|
||||
$isLocationId = 0;
|
||||
if($TS_USER['userid']){
|
||||
$strUser=$new['location']->find('user_info',array(
|
||||
'userid'=>$TS_USER['userid'],
|
||||
));
|
||||
$isLocationId = $strUser['locationid'];
|
||||
}
|
||||
|
||||
$sitekey = $strLocation['title'];
|
||||
$sitedesc = cututf8(t($strLocation['content']),0,100);
|
||||
$title = $strLocation['title'];
|
||||
include template('show');
|
||||
Reference in New Issue
Block a user