コード例 #1
0
ファイル: admin.weibo.php プロジェクト: jaryvan/ThinkSAAS
 public function deleteweibo()
 {
     $weiboid = intval($_GET['weiboid']);
     $this->delete('weibo', array('weiboid' => $weiboid));
     $this->delete('weibo_comment', array('weiboid' => $weiboid));
     qiMsg('删除成功!');
 }
コード例 #2
0
 public function deleteweibo()
 {
     $weiboid = intval($_GET['weiboid']);
     $strWeibo = $this->find('weibo', array('weiboid' => $weiboid));
     unlink('uploadfile/weibo/' . $strWeibo['photo']);
     $this->delete('weibo', array('weiboid' => $weiboid));
     $this->delete('weibo_comment', array('weiboid' => $weiboid));
     qiMsg('删除成功!');
 }
コード例 #3
0
ファイル: mysqli.php プロジェクト: 994837457/BreakNgThinksaas
 /**
 * @param unknown $DB	数据库链接参数
 */
 function __construct($DB)
 {
     if (!function_exists('mysqli_connect')) {
         qiMsg('服务器PHP不支持MySQLi数据库');
     }
     $this->conn = mysqli_connect($DB['host'], $DB['user'], $DB['pwd'], $DB['name'], $DB['port']);
     if (mysqli_connect_errno()) {
         qiMsg('数据库链接错误/无法找到数据库 : ' . mysqli_connect_error());
     }
     $this->query("SET NAMES UTF8");
 }
コード例 #4
0
ファイル: tsApp.php プロジェクト: zhangzhengyu/ThinkSAAS
 /**
  * 替换数据,根据条件替换存在的记录,如记录不存在,则将条件与替换数据相加并新增一条记录。
  * 
  * @param table 数据表
  * @param conditions 数组形式,查找条件,请注意,仅能使用数组作为该条件!
  * @param row 数组形式,修改的数据
  */
 public function replace($table, $conditions, $row)
 {
     if ($this->find($table, $conditions)) {
         return $this->update($table, $conditions, $row);
     } else {
         if (!is_array($conditions)) {
             qiMsg('replace方法的条件务必是数组形式!');
         }
         return $this->create($table, $row);
     }
 }
コード例 #5
0
ファイル: mysql.php プロジェクト: 994837457/BreakNgThinksaas
 /**
 * @param unknown $DB	数据库链接参数
 */
 function __construct($DB)
 {
     if (!function_exists('mysql_connect')) {
         qiMsg('服务器PHP不支持MySql数据库');
     }
     if ($DB['host'] && $DB['user']) {
         if (!($this->conn = mysql_connect($DB['host'] . ':' . $DB['port'], $DB['user'], $DB['pwd']))) {
             qiMsg("连接数据库失败,可能是数据库用户名或密码错误");
         }
     }
     $this->query("SET NAMES 'utf8'");
     if ($DB['name']) {
         mysql_select_db($DB['name'], $this->conn) or qiMsg("未找到指定数据库");
     }
 }
コード例 #6
0
ファイル: cache.php プロジェクト: 994837457/BreakNgThinksaas
<?php

//更新统计活动分类缓存
$arrTypess = $db->fetch_all_assoc("select * from " . dbprefix . "event_type");
foreach ($arrTypess as $key => $item) {
    $event = $db->once_fetch_assoc("select count(eventid) from " . dbprefix . "event where typeid='" . $item['typeid'] . "'");
    $arrTypes['list'][] = array('typeid' => $item['typeid'], 'typename' => $item['typename'], 'count_event' => $event['count(eventid)']);
}
$eventNum = $db->once_fetch_assoc("select count(eventid) from " . dbprefix . "event");
$arrTypes['count'] = $eventNum['count(eventid)'];
//生成缓存文件
fileWrite('event_types.php', 'data', $arrTypes);
qiMsg("更新成功!");
コード例 #7
0
ファイル: album.php プロジェクト: zhangzhengyu/ThinkSAAS
     } else {
         tsNotice('非法操作!');
     }
     break;
 case "edit_do":
     if ($_POST['token'] != $_SESSION['token']) {
         tsNotice('非法操作!');
     }
     //用户是否登录
     $userid = aac('user')->isLogin();
     $albumid = intval($_POST['albumid']);
     $strAlbum = $new['photo']->find('photo_album', array('albumid' => $albumid));
     if ($strAlbum['userid'] == $userid || $TS_USER['isadmin'] == 1) {
         $albumname = trim($_POST['albumname']);
         if ($albumname == '') {
             qiMsg("相册名称不能为空!");
         }
         $albumdesc = trim($_POST['albumdesc']);
         if ($TS_USER['isadmin'] == 0) {
             //过滤内容开始
             aac('system')->antiWord($albumname);
             aac('system')->antiWord($albumdesc);
             //过滤内容结束
         }
         $new['photo']->update('photo_album', array('userid' => $strAlbum['userid'], 'albumid' => $strAlbum['albumid']), array('albumname' => $albumname, 'albumdesc' => $albumdesc));
         header("Location: " . tsUrl('photo', 'album', array('id' => $albumid)));
     } else {
         tsNotice('非法操作!');
     }
     break;
     //批量修改
コード例 #8
0
ファイル: event.php プロジェクト: 994837457/BreakNgThinksaas
        }
        if ($strEvent['isaudit'] == 1) {
            $new['event']->update('event', array('eventid' => $eventid), array('isaudit' => 0));
        }
        qiMsg('操作成功');
        break;
        //推荐
    //推荐
    case "isrecommend":
        $eventid = intval($_GET['eventid']);
        $strEvent = $new['event']->find('event', array('eventid' => $eventid));
        if ($strEvent['isrecommend'] == 0) {
            $new['event']->update('event', array('eventid' => $eventid), array('isrecommend' => 1));
        }
        if ($strEvent['isrecommend'] == 1) {
            $new['event']->update('event', array('eventid' => $eventid), array('isrecommend' => 0));
        }
        qiMsg('操作成功');
        break;
    case "delete":
        $eventid = intval($_GET['eventid']);
        $strEvent = $new['event']->find('event', array('eventid' => $eventid));
        if ($strEvent['photo']) {
            unlink('uploadfile/event/' . $strEvent['photo']);
        }
        $new['event']->delete('event', array('eventid' => $eventid));
        $new['event']->delete('event_comment', array('eventid' => $eventid));
        $new['event']->delete('event_users', array('eventid' => $eventid));
        qiMsg('删除成功');
        break;
}
コード例 #9
0
ファイル: score.php プロジェクト: zhangzhengyu/ThinkSAAS
        $scoreid = intval($_POST['scoreid']);
        $score = intval($_POST['score']);
        $app = trim($_POST['app']);
        $action = trim($_POST['action']);
        $ts = trim($_POST['ts']);
        $status = intval($_POST['status']);
        $new['user']->update('user_score', array('scoreid' => $scoreid), array('score' => $score, 'app' => $app, 'action' => $action, 'ts' => $ts, 'status' => $status));
        header('Location: ' . SITE_URL . 'index.php?app=user&ac=admin&mg=score&ts=list');
        break;
        //加积分
    //加积分
    case "send":
        include template('admin/score_send');
        break;
    case "senddo":
        $userid = intval($_POST['userid']);
        $score = intval($_POST['score']);
        $scorename = trim($_POST['scorename']);
        if ($userid && $score && $scorename) {
            aac('user')->addScore($userid, $scorename, $score);
            qiMsg('操作成功!');
        } else {
            qiMsg('操作失败!');
        }
        break;
    case "delete":
        $scoreid = intval($_GET['scoreid']);
        $new['user']->delete('user_score', array('scoreid' => $scoreid));
        qiMsg('删除成功!');
        break;
}
コード例 #10
0
<?php

defined('IN_TS') or die('Access Denied.');
switch ($ts) {
    //基本配置
    case "":
        $arrOptions = $new['group']->findAll('group_options');
        foreach ($arrOptions as $item) {
            $strOption[$item['optionname']] = stripslashes($item['optionvalue']);
        }
        include template("admin/options");
        break;
    case "do":
        //先清空数据
        $db->query("TRUNCATE TABLE `" . dbprefix . "group_options`");
        foreach ($_POST['option'] as $key => $item) {
            $optionname = $key;
            $optionvalue = trim($item);
            $new['group']->create('group_options', array('optionname' => $optionname, 'optionvalue' => $optionvalue));
        }
        $arrOptions = $new['group']->findAll('group_options', null, null, 'optionname,optionvalue');
        foreach ($arrOptions as $item) {
            $arrOption[$item['optionname']] = $item['optionvalue'];
        }
        fileWrite('group_options.php', 'data', $arrOption);
        $tsMySqlCache->set('group_options', $arrOption);
        qiMsg('修改成功!');
        break;
}
コード例 #11
0
ファイル: edit.php プロジェクト: zhangzhengyu/ThinkSAAS
 $articleid = intval($_POST['articleid']);
 $strArticle = $new['article']->find('article', array('articleid' => $articleid));
 if ($strArticle['userid'] != $userid && $TS_USER['isadmin'] == 0) {
     tsNotice('非法操作!');
 }
 $cateid = intval($_POST['cateid']);
 $title = trim($_POST['title']);
 $content = tsClean($_POST['content']);
 if ($TS_USER['isadmin'] == 0) {
     // 过滤内容开始
     aac('system')->antiWord($title);
     aac('system')->antiWord($content);
     // 过滤内容结束
 }
 if ($title == '' || $content == '') {
     qiMsg("标题和内容都不能为空!");
 }
 $new['article']->update('article', array('articleid' => $articleid), array('cateid' => $cateid, 'title' => $title, 'content' => $content));
 // 处理标签
 $tag = trim($_POST['tag']);
 if ($tag) {
     aac('tag')->delIndextag('article', 'articleid', $articleid);
     aac('tag')->addTag('article', 'articleid', $articleid, $tag);
 }
 // 上传帖子图片开始
 $arrUpload = tsUpload($_FILES['photo'], $articleid, 'article', array('jpg', 'gif', 'png', 'jpeg'));
 if ($arrUpload) {
     $new['article']->update('article', array('articleid' => $articleid), array('path' => $arrUpload['path'], 'photo' => $arrUpload['url']));
     tsDimg($arrUpload['url'], 'article', '180', '140', $arrUpload['path']);
 }
 // 上传帖子图片结束
コード例 #12
0
ファイル: ajax.php プロジェクト: 994837457/BreakNgThinksaas
        $albumname = t($_POST['albumname']);
        if ($albumname == '') {
            qiMsg("圖名称不能为空!");
        }
        $albumdesc = h($_POST['albumdesc']);
        $addtime = time();
        $uptime = time();
        $albumid = $new['photo']->create('photo_album', array('userid' => $userid, 'albumname' => $albumname, 'albumdesc' => $albumdesc, 'addtime' => time(), 'uptime' => time()));
        header("Location: " . SITE_URL . "index.php?app=photo&ac=ajax&ts=flash&albumid=" . $albumid);
        break;
        //
    //
    case "info":
        $albumid = intval($_GET['albumid']);
        $addtime = intval($_GET['addtime']);
        $strAlbum = $new['photo']->find('photo_album', array('albumid' => $albumid));
        if ($strAlbum['userid'] != $userid) {
            qiMsg("非法操作!");
        }
        //统计
        $count_photo = $new['photo']->findCount('photo', array('albumid' => $albumid));
        $new['photo']->update('photo_album', array('albumid' => $albumid), array('count_photo' => $count_photo));
        //添加圖封面
        if ($strAlbum['albumface'] == '') {
            $strPhoto = $new['photo']->find('photo', "`albumid`='{$albumid}' and `userid`='{$userid}' and `addtime`>'{$addtime}'");
            $new['photo']->update('photo_album', array('albumid' => $albumid), array('albumface' => $strPhoto['photourl']));
        }
        $arrPhoto = $new['photo']->findAll('photo', "`albumid`='{$albumid}' and  `userid`='{$userid}' and `addtime`>'{$addtime}'");
        include template("ajax/info");
        break;
}
コード例 #13
0
ファイル: do.php プロジェクト: zhangzhengyu/ThinkSAAS
<?php

defined('IN_TS') or die('Access Denied.');
switch ($ts) {
    //APP配置选项
    case "options":
        $arrData = array('appname' => trim($_POST['appname']), 'appdesc' => trim($_POST['appdesc']), 'isenable' => trim($_POST['isenable']), 'mailhost' => trim($_POST['mailhost']), 'ssl' => intval($_POST['ssl']), 'mailport' => trim($_POST['mailport']), 'mailuser' => trim($_POST['mailuser']), 'mailpwd' => trim($_POST['mailpwd']));
        //先清空数据
        $db->query("TRUNCATE TABLE `" . dbprefix . "mail_options`");
        foreach ($arrData as $key => $item) {
            $optionname = $key;
            $optionvalue = $item;
            $new['mail']->create('mail_options', array('optionname' => $optionname, 'optionvalue' => $optionvalue));
        }
        //更新缓存
        $arrOptions = $new['mail']->findAll('mail_options', null, null, 'optionname,optionvalue');
        foreach ($arrOptions as $item) {
            $arrOption[$item['optionname']] = $item['optionvalue'];
        }
        fileWrite('mail_options.php', 'data', $arrOption);
        $tsMySqlCache->set('mail_options', $arrOption);
        qiMsg("邮件配置更新成功,并重置了缓存文件^_^");
        break;
}
コード例 #14
0
ファイル: do.php プロジェクト: zhangzhengyu/ThinkSAAS
        $new['tag']->delete('tag_topic_index', array('tagid' => $tagid));
        $new['tag']->delete('tag_user_index', array('tagid' => $tagid));
        header('Location: ' . SITE_URL . 'index.php?app=tag&ac=admin&mg=list&page=' . $page);
        break;
        //优化标签
    //优化标签
    case "opt":
        $tagid = intval($_GET['tagid']);
        $strTag = $new['tag']->getOneTag($tagid);
        $tagname = t($strTag['tagname']);
        $tagNum = $db->once_fetch_assoc("select count(*) from " . dbprefix . "tag where `tagname`='{$tagname}'");
        if ($tagNum['count(*)'] == 0) {
            $db->query("update " . dbprefix . "tag set `tagname`='{$tagname}' where `tagid`='{$tagid}'");
        } elseif ($tagNum['count(*)'] == 1) {
        } else {
            $arrTags = $db->fetch_all_assoc("select * from " . dbprefix . "tag where `tagname`='{$tagname}'");
            foreach ($arrTags as $item) {
                $tagids = $item['tagid'];
                //先更新索引
                $db->query("update " . dbpreifx . "tag_topic_index set `tagid`='{$tagid}' where `tagid`='{$tagids}'");
                $db->query("update " . dbpreifx . "tag_article_index set `tagid`='{$tagid}' where `tagid`='{$tagids}'");
                $db->query("update " . dbpreifx . "tag_user_index set `tagid`='{$tagid}' where `tagid`='{$tagids}'");
                //再进行删除
                $db->query("delete from " . dbprefix . "tag where `tagid`='{$tagids}'");
                //最后更新tag
                $db->query("update " . dbprefix . "tag set `tagname`='{$tagname}' where `tagid`='{$tagid}'");
            }
        }
        qiMsg("优化成功!");
        break;
}
コード例 #15
0
ファイル: topic.php プロジェクト: 994837457/BreakNgThinksaas
        $pageUrl = pagination($topicNum, 10, $page, $url);
        include template("admin/topic_delete");
        break;
        //编辑的帖子
    //编辑的帖子
    case "edittopic":
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
        $url = SITE_URL . 'index.php?app=group&ac=admin&mg=topic&ts=edittopic&page=';
        $lstart = $page * 10 - 10;
        $arrTopic = $new['group']->findAll('group_topic_edit', null, 'addtime desc', null, $lstart . ',10');
        $topicNum = $new['group']->findCount('group_topic_edit');
        $pageUrl = pagination($topicNum, 10, $page, $url);
        include template("admin/topic_edit");
        break;
        //执行更新帖子
    //执行更新帖子
    case "update":
        $topicid = intval($_GET['topicid']);
        $strTopic = $new['group']->find('group_topic_edit', array('topicid' => $topicid));
        $new['group']->update('group_topic', array('topicid' => $topicid), array('title' => $strTopic['title'], 'content' => $strTopic['content']));
        $new['group']->update('group_topic_edit', array('topicid' => $topicid), array('isupdate' => 1));
        qiMsg('更新成功!');
        break;
        //查看单独某个修改的帖子
    //查看单独某个修改的帖子
    case "editview":
        $topicid = intval($_GET['topicid']);
        $strTopic = $new['group']->find('group_topic_edit', array('topicid' => $topicid));
        include template('admin/topic_edit_view');
        break;
}
コード例 #16
0
ファイル: admin.feed.php プロジェクト: zhangzhengyu/ThinkSAAS
 public function deletefeed()
 {
     $feedid = intval($_GET['feedid']);
     $this->delete('feed', array('feedid' => $feedid));
     qiMsg('删除成功!');
 }
コード例 #17
0
ファイル: cache.php プロジェクト: zhangzhengyu/ThinkSAAS
        rmrf('cache/template');
        rmrf('cache/user');
        rmrf('cache/group');
        rmrf('cache/lang');
        qiMsg('缓存清除完毕!');
        break;
        //删除temp
    //删除temp
    case "deltemp":
        rmrf('cache/template');
        qiMsg('缓存清除完毕!');
        break;
        //删除group
    //删除group
    case "delgroup":
        rmrf('cache/group');
        qiMsg('缓存清除完毕!');
        break;
        //删除user
    //删除user
    case "deluser":
        rmrf('cache/user');
        qiMsg('缓存清除完毕!');
        break;
        //删除语言包
    //删除语言包
    case "dellang":
        rmrf('cache/lang');
        qiMsg('缓存清除完毕!');
        break;
}
コード例 #18
0
ファイル: album.php プロジェクト: 994837457/BreakNgThinksaas
     } else {
         tsNotice('非法操作!');
     }
     break;
 case "edit_do":
     if ($_POST['token'] != $_SESSION['token']) {
         tsNotice('非法操作!');
     }
     //用户是否登录
     $userid = aac('user')->isLogin();
     $albumid = intval($_POST['albumid']);
     $strAlbum = $new['photo']->find('photo_album', array('albumid' => $albumid));
     if ($strAlbum['userid'] == $userid || $TS_USER['isadmin'] == 1) {
         $albumname = tsClean($_POST['albumname']);
         if ($albumname == '') {
             qiMsg("圖名称不能为空!");
         }
         $albumdesc = tsClean($_POST['albumdesc']);
         if ($TS_USER['isadmin'] == 0) {
             //过滤内容开始
             aac('system')->antiWord($albumname);
             aac('system')->antiWord($albumdesc);
             //过滤内容结束
         }
         $new['photo']->update('photo_album', array('userid' => $strAlbum['userid'], 'albumid' => $strAlbum['albumid']), array('albumname' => $albumname, 'albumdesc' => $albumdesc));
         header("Location: " . tsUrl('photo', 'album', array('id' => $albumid)));
     } else {
         tsNotice('非法操作!');
     }
     break;
     //批量修改
コード例 #19
0
ファイル: role.php プロジェクト: zhangzhengyu/ThinkSAAS
defined('IN_TS') or die('Access Denied.');
switch ($ts) {
    //角色列表
    case "list":
        $arrRole = $new['user']->findAll('user_role');
        include template('admin/role_list');
        break;
        //角色修改
    //角色修改
    case "do":
        $arrRoleName = $_POST['rolename'];
        $arrScoreStart = $_POST['score_start'];
        $arrScoreEnd = $_POST['score_end'];
        //先清空
        $db->query("TRUNCATE TABLE `" . dbprefix . "user_role`");
        //后添加
        foreach ($arrRoleName as $key => $item) {
            $rolename = trim($item);
            $score_start = trim($arrScoreStart[$key]);
            $score_end = trim($arrScoreEnd[$key]);
            if ($rolename) {
                $new['user']->create('user_role', array('rolename' => $rolename, 'score_start' => $score_start, 'score_end' => $score_end));
            }
        }
        //再生成缓存文件
        $arrRole = $new['user']->findAll('user_role', null, null, 'rolename,score_start,score_end');
        fileWrite('user_role.php', 'data', $arrRole);
        $tsMySqlCache->set('user_role', $arrRole);
        qiMsg("修改成功!");
        break;
}
コード例 #20
0
<?php

$sql = file_get_contents('app/event/install/install.sql');
$sql = str_replace('ts_', $TS_DB['pre'], $sql);
$array_sql = preg_split("/;[\r\n]/", $sql);
foreach ($array_sql as $sql) {
    $sql = trim($sql);
    if ($sql) {
        if (strstr($sql, 'CREATE TABLE')) {
            preg_match('/CREATE TABLE ([^ ]*)/', $sql, $matches);
            $ret = $db->query($sql);
        } else {
            $ret = $db->query($sql);
        }
    }
}
$fp = fopen('app/event/install/event_install.rice', 'w');
$fw = fwrite($fp, $config);
qiMsg("安装成功!");
コード例 #21
0
ファイル: upuser.php プロジェクト: zhangzhengyu/ThinkSAAS
<?php

defined('IN_TS') or die('Access Denied.');
//将用户全部绑定到群组
$groupid = intval($_GET['groupid']);
$arrUser = $db->fetch_all_assoc("select userid from " . dbprefix . "user order by userid desc");
foreach ($arrUser as $item) {
    $groupusernum = $db->once_num_rows("select * from " . dbprefix . "group_user where  userid='" . $item['userid'] . "' and groupid='" . $groupid . "'");
    if ($groupusernum == '0') {
        $db->query("insert into " . dbprefix . "group_user (`userid`,`groupid`,`addtime`) values ('" . $item['userid'] . "','" . $groupid . "','" . time() . "')");
    }
}
$userNum = $db->once_num_rows("select * from " . dbprefix . "group_user where groupid='" . $groupid . "'");
$db->query("update " . dbprefix . "group set `count_user`='" . $userNum . "' where groupid='" . $groupid . "'");
qiMsg("会员投送成功!");
コード例 #22
0
ファイル: login.php プロジェクト: zhangzhengyu/ThinkSAAS
        if ($_POST['token'] != $_SESSION['token']) {
            tsNotice('非法操作!');
        }
        $email = trim($_POST['email']);
        $pwd = trim($_POST['pwd']);
        $cktime = $_POST['cktime'];
        if ($email == '' || $pwd == '') {
            qiMsg("所有输入项都不能为空^_^");
        }
        $countAdmin = $new['system']->findCount('user', array('email' => $email));
        if ($countAdmin == 0) {
            qiMsg('用户Email不存在!');
        }
        $strAdmin = $new['system']->find('user', array('email' => $email));
        if (md5($strAdmin['salt'] . $pwd) !== $strAdmin['pwd']) {
            tsNotice('用户密码错误!');
        }
        $strAdminInfo = $new['system']->find('user_info', array('email' => $email), 'userid,username,isadmin');
        if ($strAdminInfo['isadmin'] != 1) {
            qiMsg("你无权登录后台管理!");
        }
        $_SESSION['tsadmin'] = $strAdminInfo;
        header("Location: " . SITE_URL . "index.php?app=system");
        break;
        //退出
    //退出
    case "out":
        unset($_SESSION['tsadmin']);
        header("Location: " . SITE_URL . "index.php?app=system&ac=login");
        break;
}
コード例 #23
0
ファイル: result.php プロジェクト: zhangzhengyu/ThinkSAAS
    $db->query("insert into " . $pre . "user_info (`userid`,`username`,`email`,`isadmin`,`addtime`,`uptime`) values ('{$userid}','{$username}','{$email}','1','" . time() . "','" . time() . "')");
    // 更改网站信息
    $db->query("update " . $pre . "system_options set `optionvalue`='{$site_title}' where `optionname`='site_title'");
    $db->query("update " . $pre . "system_options set `optionvalue`='{$site_subtitle}' where `optionname`='site_subtitle'");
    $db->query("update " . $pre . "system_options set `optionvalue`='{$site_url}' where `optionname`='site_url'");
    $db->query("update " . $pre . "system_options set `optionvalue`='{$site_url}' where `optionname`='link_url'");
    $arrOptions = $db->fetch_all_assoc("select * from " . $pre . "system_options");
    foreach ($arrOptions as $item) {
        $arrOption[$item['optionname']] = $item['optionvalue'];
    }
    fileWrite('system_options.php', 'data', $arrOption);
    $tsMySqlCache->set('system_options', $arrOption);
    $tsMySqlCache->file();
    // 生成配置文件
    $fp = fopen(THINKDATA . '/config.inc.php', 'w');
    if (!is_writable(THINKDATA . '/config.inc.php')) {
        qiMsg("配置文件(data/config.inc.php)不可写。如果您使用的是Unix/Linux主机,请修改该文件的权限为777。如果您使用的是Windows主机,请联系管理员,将此文件设为everyone可写");
    }
    $config = "<?php\n" . "\t/*\n" . "\t *数据库配置\n" . "\t */\n" . "\t\n" . "\t\$TS_DB['sql']='" . $select_sql . "';\n" . "\t\$TS_DB['host']='" . $host . "';\n" . "\t\$TS_DB['port']='" . $port . "';\n" . "\t\$TS_DB['user']='******';\n" . "\t\$TS_DB['pwd']='" . $pwd . "';\n" . "\t\$TS_DB['name']='" . $name . "';\n" . "\t\$TS_DB['pre']='" . $pre . "';\n" . "\tdefine('dbprefix','" . $pre . "');\n";
    $fw = fwrite($fp, $config);
    $strUser['email'] = $email;
    $strUser['password'] = $password;
    // 清空SESSION
    unset($_SESSION['tsuser']);
    session_destroy();
    setcookie("ts_email", '', time() + 3600, '/');
    setcookie("ts_uptime", '', time() + 3600, '/');
    include 'install/html/result.html';
} else {
    include 'install/html/error.html';
}
コード例 #24
0
ファイル: options.php プロジェクト: zhangzhengyu/ThinkSAAS
<?php

defined('IN_TS') or die('Access Denied.');
switch ($ts) {
    //配置
    case "":
        $arrOptions = $new['user']->findAll('user_options');
        foreach ($arrOptions as $item) {
            $strOption[$item['optionname']] = $item['optionvalue'];
        }
        include template("admin/options");
        break;
        //配置执行
    //配置执行
    case "do":
        //先清空数据
        $db->query("TRUNCATE TABLE `" . dbprefix . "user_options`");
        foreach ($_POST['option'] as $key => $item) {
            $optionname = $key;
            $optionvalue = trim($item);
            $new['user']->create('user_options', array('optionname' => $optionname, 'optionvalue' => $optionvalue));
        }
        $arrOptions = $new['user']->findAll('user_options', null, null, 'optionname,optionvalue');
        foreach ($arrOptions as $item) {
            $arrOption[$item['optionname']] = $item['optionvalue'];
        }
        fileWrite('user_options.php', 'data', $arrOption);
        $tsMySqlCache->set('user_options', $arrOption);
        qiMsg("用户APP配置成功!");
        break;
}
コード例 #25
0
ファイル: photo.php プロジェクト: 994837457/BreakNgThinksaas
<?php

defined('IN_TS') or die('Access Denied.');
switch ($ts) {
    case "list":
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
        $lstart = $page * 10 - 10;
        $url = SITE_URL . 'index.php?app=photo&ac=admin&mg=photo&ts=list&page=';
        $arrPhoto = $db->fetch_all_assoc("select * from " . dbprefix . "photo order by addtime desc limit {$lstart},10");
        $photoNum = $db->once_fetch_assoc("select count(*) from " . dbprefix . "photo");
        $pageUrl = pagination($photoNum['count(*)'], 10, $page, $url);
        include template("admin/photo_list");
        break;
        //推荐图片
    //推荐图片
    case "isrecommend":
        $photoid = intval($_GET['photoid']);
        $strPhoto = $db->once_fetch_assoc("select isrecommend from " . dbprefix . "photo where `photoid`='{$photoid}'");
        if ($strPhoto['isrecommend'] == 0) {
            $db->query("update " . dbprefix . "photo set `isrecommend`='1' where `photoid`='{$photoid}'");
        } else {
            $db->query("update " . dbprefix . "photo set `isrecommend`='0' where `photoid`='{$photoid}'");
        }
        qiMsg("操作成功!");
        break;
}
コード例 #26
0
ファイル: plugin.php プロジェクト: 994837457/BreakNgThinksaas
<?php

//插件条件入口
defined('IN_TS') or die('Access Denied.');
if (is_file('plugins/' . $app . '/' . $plugin . '/' . $in . '.php')) {
    require_once 'plugins/' . $app . '/' . $plugin . '/' . $in . '.php';
} else {
    qiMsg('sorry:no plugin!');
}
//形如这样
//index.php?app=group&ac=plugin&plugin=qq&in=do
コード例 #27
0
ファイル: my.php プロジェクト: zhangzhengyu/ThinkSAAS
<?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!');
}
コード例 #28
0
ファイル: cate.php プロジェクト: 994837457/BreakNgThinksaas
     include template("admin/cate_add");
     break;
 case "add_do":
     $new['group']->create('group_cate', array('catename' => t($_POST['catename']), 'referid' => intval($_POST['referid'])));
     header("Location: " . SITE_URL . "index.php?app=group&ac=admin&mg=cate&ts=list");
     break;
     //分类删除
 //分类删除
 case "del":
     $cateid = intval($_GET['cateid']);
     $groupNum = $db->once_fetch_assoc("select count(*) from " . dbprefix . "group where `cateid`='{$cateid}'");
     if ($groupNum['count(*)'] > 0) {
         qiMsg("此分类有小组存在,不允许删除!");
     }
     $db->query("delete from " . dbprefix . "group_cate where cateid='{$cateid}'");
     qiMsg("分类删除成功!");
     break;
     //分类修改
 //分类修改
 case "edit":
     $cateid = intval($_GET['cateid']);
     $referid = intval($_GET['referid']);
     $strCate = $db->once_fetch_assoc("select * from " . dbprefix . "group_cate where cateid='{$cateid}'");
     //调出顶级分类
     if ($referid) {
         $arrOneCate = $new['group']->findAll('group_cate', array('referid' => 0));
     }
     include template("admin/cate_edit");
     break;
     //分类修改执行
 //分类修改执行
コード例 #29
0
ファイル: album.php プロジェクト: GithuberFan/ThinkSAAS
            $db->query("update " . dbprefix . "photo_album set `isrecommend`='0' where `albumid`='{$albumid}'");
        }
        qiMsg("操作成功!");
        break;
        //删除没有图片的相册
    //删除没有图片的相册
    case "nophoto":
        $arrAlbum = $new['photo']->findAll('photo_album', "`count_photo`=0");
        foreach ($arrAlbum as $key => $item) {
            $isPhoto = $new['photo']->findCount('photo', array('albumid' => $item['albumid']));
            if ($isPhoto == 0) {
                $new['photo']->delete('photo_album', array('albumid' => $item['albumid']));
            } else {
                $count_photo = $new['photo']->findCount('photo', array('albumid' => $item['albumid']));
                $new['photo']->update('photo_album', array('albumid' => $item['albumid']), array('count_photo' => $count_photo));
            }
        }
        qiMsg('操作成功!');
        break;
    case "isaudit":
        $albumid = intval($_GET['albumid']);
        $strAlbum = $new['attach']->find('photo_album', array('albumid' => $albumid));
        if ($strAlbum['isaudit'] == 1) {
            $new['attach']->update('photo_album', array('albumid' => $albumid), array('isaudit' => 0));
        }
        if ($strAlbum['isaudit'] == 0) {
            $new['attach']->update('photo_album', array('albumid' => $albumid), array('isaudit' => 1));
        }
        qiMsg('操作成功!');
        break;
}
コード例 #30
0
ファイル: options.php プロジェクト: zhangzhengyu/ThinkSAAS
        $strLogo = $new['system']->find('system_options', array('optionname' => 'logo'));
        //先清空数据
        $db->query("TRUNCATE TABLE `" . dbprefix . "system_options`");
        foreach ($_POST['option'] as $key => $item) {
            $optionname = $key;
            $optionvalue = trim($item);
            $new['system']->create('system_options', array('optionname' => $optionname, 'optionvalue' => $optionvalue));
        }
        $new['system']->create('system_options', array('optionname' => 'logo', 'optionvalue' => $strLogo['optionvalue']));
        $arrOptions = $new['system']->findAll('system_options', null, null, 'optionname,optionvalue');
        foreach ($arrOptions as $item) {
            $arrOption[$item['optionname']] = $item['optionvalue'];
        }
        fileWrite('system_options.php', 'data', $arrOption);
        $tsMySqlCache->set('system_options', $arrOption);
        //生成伪静态文件
        if ($_POST['option']['site_urltype'] == 3 || $_POST['option']['site_urltype'] == 4 || $_POST['option']['site_urltype'] == 5 || $_POST['option']['site_urltype'] == 6 || $_POST['option']['site_urltype'] == 7) {
            $scriptName = explode('index.php', $_SERVER['SCRIPT_NAME']);
            //生成.htaccess文件
            $fp = fopen(THINKROOT . '/.htaccess', 'w');
            if (!is_writable(THINKROOT . '/.htaccess')) {
                qiMsg("文件(.htaccess)不可写。如果您使用的是Unix/Linux主机,请修改该文件的权限为777。如果您使用的是Windows主机,请联系管理员,将此文件设为everyone可写");
            }
            $htaccess = "RewriteEngine On\n" . "RewriteBase " . $scriptName[0] . "\n" . "RewriteRule ^index\\.php\$ - [L]\n" . "RewriteCond %{REQUEST_FILENAME} !-f\n" . "RewriteCond %{REQUEST_FILENAME} !-d\n" . "RewriteRule . " . $scriptName[0] . "index.php [L]\n" . "RewriteCond %{REQUEST_METHOD} ^TRACE\n" . "RewriteRule .* - [F]";
            $fw = fwrite($fp, $htaccess);
        }
        //更新皮肤
        setcookie('tsTheme', $_POST['option']['site_theme']);
        qiMsg("系统选项更新成功,并重置了缓存文件^_^");
        break;
}