commit 963ec1b2ead2d2382a8199e13055a2f4efb97441 Author: kevin Date: Thu Jun 22 13:33:25 2023 +0800 begin of thinksaas 3.68 Signed-off-by: kevin diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0c9120f --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +/cache +/data +/tslogs +/uploadfile +.git +.idea +.history +.vscode +.htaccess +.DS_Store +upgrade.sql +upgrade.txt +auto_install.json \ No newline at end of file diff --git a/.user.ini b/.user.ini new file mode 100644 index 0000000..053b273 --- /dev/null +++ b/.user.ini @@ -0,0 +1 @@ +open_basedir=/www/wwwroot/beta.lmve.net/:/tmp/ \ No newline at end of file diff --git a/404.html b/404.html new file mode 100644 index 0000000..99ff94f --- /dev/null +++ b/404.html @@ -0,0 +1,26 @@ + + + + + + +404 + + + + +

404,您请求的文件不存在!

+ + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dfd7c40 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,48 @@ +FROM php:7.2-apache + +RUN apt-get update \ + # 相关依赖必须手动安装 + && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev \ + # memcached 的相关依赖 + && apt-get install -y libmemcached-dev zlib1g-dev \ + # 安装扩展 + && docker-php-ext-install -j$(nproc) iconv \ + # 如果安装的扩展需要自定义配置时 + && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ + && docker-php-ext-install -j$(nproc) gd \ + # pecl 安卓mcrypt php从7.2开始不再在源码里支持mcrypt扩展而转到pecl方式支持 + && pecl install mcrypt-1.0.1 \ + && docker-php-ext-enable mcrypt \ + # 其他扩展 + && docker-php-ext-install mysqli \ + && docker-php-ext-install pdo_mysql \ + # pecl安装php的memcached扩展 + && pecl install memcached \ + # 启用memcached 扩展 + && docker-php-ext-enable memcached \ + # pecl 安装php的redis扩展 + && pecl install redis \ + # 启用redis扩展 + && docker-php-ext-enable redis + +COPY . /var/www/html/ + +RUN chmod -R 755 /var/www/html/cache +RUN chmod -R 755 /var/www/html/data +RUN chmod -R 755 /var/www/html/tslogs +RUN chmod -R 755 /var/www/html/upgrade +RUN chmod -R 755 /var/www/html/uploadfile + +ENV APACHE_RUN_USER www-data +ENV APACHE_RUN_GROUP www-data +ENV APACHE_LOG_DIR /var/log/apache2 +ENV APACHE_PID_FILE /var/run/apache2.pid +ENV APACHE_RUN_DIR /var/run/apache2 +ENV APACHE_LOCK_DIR /var/lock/apache2 +ENV APACHE_SERVERADMIN admin@localhost +ENV APACHE_SERVERNAME localhost +ENV APACHE_SERVERALIAS docker.localhost +ENV APACHE_DOCUMENTROOT /var/www + +WORKDIR /var/www/html +ENTRYPOINT apache2 -D FOREGROUND \ No newline at end of file diff --git a/INSTALL.TXT b/INSTALL.TXT new file mode 100644 index 0000000..ec41237 --- /dev/null +++ b/INSTALL.TXT @@ -0,0 +1,22 @@ +++++ThinkSAAS安装说明 + +【推荐运行环境】 +PHP7.0及以上版本(建议使用php7.2),MySQL5.5及以上版本(建议使用mysql5.6),不支持MySQL8 +推荐使用Linux + Apache或者Linux + Nginx环境的主机 +【安装说明】 +1、上传目录下所有文件到你的网站根目录下 +(Linux系统必须使用FTP二进制上传) +2、直接输入你的网址进行安装 +(不要带install) +3、根据安装提示输入数据库连接信息、网站信息和管理员信息 +(安装前请为ThinkSAAS手动新建一个空数据库) +4、安装成功。 + +【注意】 + +请保证以下目录和目录下所有文件的可写权限(777) +cache +data +tslogs +upgrade +uploadfile \ No newline at end of file diff --git a/LICENSE.TXT b/LICENSE.TXT new file mode 100644 index 0000000..4f0df43 --- /dev/null +++ b/LICENSE.TXT @@ -0,0 +1,18 @@ +【用户条款】 +本协议适用ThinkSAAS发布的所有程序版本和代码,所有版本都将按照最新发布的【用户条款】执行。 +1、ThinkSAAS官方指:ThinkSAAS社区、thinksaas.cn和ThinkSAAS社区系统开发者邱君。 +2、ThinkSAAS禁止用户在使用中触犯中国法律范围内的任何法律条文。 +3、ThinkSAAS、及其创始人邱君拥有对ThinkSAAS的所有权,任何个人,公司和组织不得以任何形式和目的侵犯ThinkSAAS的版权和著作权。 +4、ThinkSAAS官方拥有对ThinkSAAS社区软件绝对的版权和著作权。 +5、ThinkSAAS程序代码完全开源,不做任何加密处理。ThinkSAAS允许【自身运营】用户对程序代码进行二次开发,但必须遵循本条款第6、7、8和9条规定执行。 +6、所有使用ThinkSAAS的用户在保留底部Powered by ThinkSAAS 文字链接或者标识的情况下,可以免费使用ThinkSAAS。 +7、用户在购买ThinkSAAS商业授权后才可以去除底部Powered by ThinkSAAS 文字链接或者标识。 +8、ThinkSAAS不会监控用户网站信息,但有权通过邮件或者其他联系方式获悉用户使用情况,有权拿用户网站用作案例展示。 +9、在未经ThinkSAAS官方书面允许的情况下,除【自身运营】外,任何个人、公司和组织不能单方面发布和出售以ThinkSAAS为基础开发的任何互联网软件或者产品,否则将视为侵权行为,将依照中华人民共和国法律追究其法律责任。 +10、公司企业等组织机构使用ThinkSAAS软件必须购买ThinkSAAS商业授权协议。 +11、ThinkSAAS官方拥有对此协议的修改和不断完善。 + +【自身运营】解释:即用户在使用ThinkSAAS中,不通过出售任何以ThinkSAAS为基础开发的产品,仅用作自身学习和自身商业运营的网站。 +【用户条款】网址:https://www.thinksaas.cn/home/info/3/ +【官方网站】网址:https://www.thinksaas.cn/ +【演示网站】网址:https://demo.thinksaas.cn/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..0a6b2e1 --- /dev/null +++ b/README.md @@ -0,0 +1,78 @@ +## ThinkSAAS简介 + +ThinkSAAS是一个轻量级的开源社区系统,是一个可以用来搭建垂直网络的社区系统。 +ThinkSAAS是一个简单,高扩展的社区开发系统。 +ThinkSAAS可以帮你快速开发和搭建与众不同的交流社区。 + +## 开发环境 + +php >= 7.0 (支持php7+、php8+) +MySQL >= 5.5 (支持mysql5+,mysql8) +MariaDB >= 5.5(支持mariadb10) +Apache / Nginx +Windows / Linux +建议采用lnmp或者lamp环境 + +## 系统特点 + +开发简单,php新手也可以开发强大功能 +单一入口 +扩展强大,支持应用扩展和插件扩展,支持http api接口扩展 +APP可单独配置独立数据库 +多端自适应,集成bootstrap +底层加载速度快,抗压和并发能力强 +支持composer方式安装php第三方扩展库 +系统稳定、功能模块化、二次开发简单,持续升级 +适合个人和团队协作开发 + +## 系统基础功能 + +用户中心模块(user) +系统管理模块(system) +小组模块(group) +话题模块(topic) +文章模块(article) +相册模块(photo) +标签模块(tag) +邮件模块(mail) +消息模块(message) +唠叨模块(weibo) +搜索模块(search) +我的社区(my) +支持Email注册登录 +支持手机号注册 +支持短信验证码登录 +支持阿里云对象存储OSS +支持发布内容人机验证 +支持敏感词过滤 +支持用户行为日志记录 +支持微信公众号网页授权登录 +支持用户积分 +更多特点和功能期待您的发现! + +## 用户协议 + +本协议适用ThinkSAAS发布的所有程序版本和代码,所有版本都将按照最新发布的【用户条款】执行。 +1、ThinkSAAS官方指:ThinkSAAS社区、thinksaas.cn和ThinkSAAS社区系统开发者邱君。 +2、ThinkSAAS禁止用户在使用中触犯中国法律范围内的任何法律条文。 +3、任何个人,公司和组织不得以任何形式和目的侵犯ThinkSAAS的版权和著作权。 +4、ThinkSAAS官方拥有对ThinkSAAS社区软件绝对的版权和著作权。 +5、ThinkSAAS程序代码完全开源,不做任何加密处理。ThinkSAAS允许【自身运营】用户对程序代码进行二次开发,但必须遵循本条款第6、7、8和9条规定执行。 +6、所有使用ThinkSAAS的用户在保留底部Powered by ThinkSAAS 文字链接或者标识的情况下,可以免费使用ThinkSAAS。 +7、用户在购买ThinkSAAS商业授权后才可以去除底部Powered by ThinkSAAS 文字链接或者标识。 +8、ThinkSAAS不会监控用户网站信息,但有权通过邮件或者其他联系方式获悉用户使用情况,有权拿用户网站用作案例展示。 +9、在未经ThinkSAAS官方书面允许的情况下,除【自身运营】外,任何个人、公司和组织不能单方面发布和出售以ThinkSAAS为基础开发的任何互联网软件或者产品,否则将视为侵权行为,将依照中华人民共和国法律追究其法律责任。 +10、公司企业等组织机构使用ThinkSAAS软件必须购买ThinkSAAS商业授权协议。 +11、ThinkSAAS官方拥有对此协议的修改和不断完善。 + +【自身运营】解释:即用户在使用ThinkSAAS中,不通过出售任何以ThinkSAAS为基础开发的产品,仅用作自身学习和自身商业运营的网站。 +【用户条款】网址:https://www.thinksaas.cn/home/info/3/ +【官方网站】网址:https://www.thinksaas.cn/ +【演示网站】网址:https://demo.qiniao.com/ + +## 安装说明 + +1、上传目录下所有文件到你的网站根目录下(Linux系统必须使用FTP二进制上传) +2、直接输入你的网址进行安装(不要带install) +3、根据安装提示输入数据库连接信息、网站信息和管理员信息(安装前请为ThinkSAAS手动新建一个空数据库) +4、安装成功。 diff --git a/app/.ecoder_permissions_check.txt b/app/.ecoder_permissions_check.txt new file mode 100644 index 0000000..ea29cee --- /dev/null +++ b/app/.ecoder_permissions_check.txt @@ -0,0 +1 @@ +this file was created on Wed. 26th June 2019 at 13:38:22, after ecoder checked the permissions of the folder /www/wwwroot/lmve.net/app/. \ No newline at end of file diff --git a/app/article/.ecoder_permissions_check.txt b/app/article/.ecoder_permissions_check.txt new file mode 100644 index 0000000..81c508d --- /dev/null +++ b/app/article/.ecoder_permissions_check.txt @@ -0,0 +1 @@ +this file was created on Wed. 26th June 2019 at 13:38:28, after ecoder checked the permissions of the folder /www/wwwroot/lmve.net/app/article/. \ No newline at end of file diff --git a/app/article/about.php b/app/article/about.php new file mode 100644 index 0000000..26b4fa1 --- /dev/null +++ b/app/article/about.php @@ -0,0 +1,17 @@ + '文章', + 'version' => '1.2', + 'desc' => '文章', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '1', + 'ismy'=>'1' +); \ No newline at end of file diff --git a/app/article/action/add.php b/app/article/action/add.php new file mode 100644 index 0000000..4a44435 --- /dev/null +++ b/app/article/action/add.php @@ -0,0 +1,213 @@ + isLogin(); + +//判断用户是否存在 +if(aac('user')->isUser($userid)==false) tsNotice('不好意思,用户不存在!'); + +//判断发布者状态 +if(aac('user')->isPublisher()==false) tsNotice('不好意思,你还没有权限发布内容!'); + +//发布时间限制 +if(aac('system')->pubTime()==false) tsNotice('不好意思,当前时间不允许发布内容!'); + +//发布时间间隔限制 +if($TS_SITE['timeblank']){ + $lastArticle = $new['article']->find('article',array( + 'userid'=>$userid, + ),'articleid,addtime','addtime desc'); + if($lastArticle){ + if((time()-strtotime($lastArticle['addtime']))<$TS_SITE['timeblank']){ + tsNotice('不好意思,您的内容发送频率过高!请等等再发布!'); + } + } +} + +//发布内容扣除积分限制 +$strScoreOption = $new['article']->find('user_score',array( + 'app'=>'article', + 'action'=>'add', + 'ts'=>'do', +)); +if($strScoreOption && $strScoreOption['status']==1){ + #用户积分数 + $strUserScore = $new['article']->find('user_info',array( + 'userid'=>$userid, + ),'count_score'); + if($strUserScore['count_score']<$strScoreOption['score']){ + tsNotice('不好意思,您的积分不足!'); + } +} + +switch ($ts) { + case "" : + if ($TS_APP['allowpost'] == 0 && $TS_USER['isadmin'] == 0) { + tsNotice('系统设置不允许会员发文章!'); + } + + $cateid = tsIntval($_GET['cateid']); + + + foreach ($arrCate as $key=>$item){ + $arrCate[$key]['two'] = $new['article']->findAll('article_cate',array( + 'referid'=>$item['cateid'], + )); + } + + + #加载草稿箱 + $strDraft = $new['article']->find('draft',array( + 'userid'=>$userid, + 'types'=>'article', + )); + + + $title = '发布文章'; + include template('add'); + break; + + case "do" : + + #验证码验证 + $authcode = strtolower($_POST ['authcode']); + if ($TS_SITE['isauthcode']){ + if ($authcode != $_SESSION['verify']){ + tsNotice("验证码输入有误,请重新输入!" ); + } + } + + #人机验证 + $vaptcha_token = tsTrim($_POST['vaptcha_token']); + $vaptcha_server = tsTrim($_POST['vaptcha_server']); + if ($TS_SITE['is_vaptcha']){ + $strVt = vaptcha($vaptcha_token,0,$vaptcha_server); + if($strVt['success']==0){ + tsNotice('人机验证未通过!'); + } + } + + + $cateid = tsIntval($_POST['cateid']); + $cateid2 = tsIntval($_POST['cateid2']); + + if($cateid2) $cateid = $cateid2; + + $title = tsTrim($_POST['title']); + $content = tsClean($_POST['content']); + $content2 = emptyText($_POST['content']); + $gaiyao = tsTrim($_POST['gaiyao']); + $tag = tsClean($_POST['tag']); + $addtime = date('Y-m-d H:i:s'); + + $score = tsIntval($_POST ['score']);#积分 + + + //匿名用户 + $isniming = tsIntval($_POST['isniming']); + if($TS_SITE['isniming']==1 && $isniming==1) $userid = aac('user')->getNimingId(); + + + + if (tsIntval($TS_USER['isadmin']) == 0) { + // 过滤内容开始 + $title = antiWord($title); + $content = antiWord($content); + $tag = antiWord($tag); + // 过滤内容结束 + } + + if ($title == '' || $content2 == '' || $content=='') + tsNotice("标题和内容都不能为空!"); + + $isTitle = $new['article']->findCount('article',array( + 'title'=>$title, + )); + + if($isTitle){ + tsNotice("相同标题的文章已经存在!"); + } + + if($gaiyao){ + $gaiyao = cututf8($gaiyao,0,100); + }else{ + $gaiyao = cututf8(t(tsDecode($content)),0,100); + } + + if($score<0){ + tsNotice ( '积分填写有误!' ); + } + + //1审核后显示0不审核 + if ($TS_APP['isaudit'] == 1) { + $isaudit = 1; + } else { + $isaudit = 0; + } + + $articleid = $new['article'] -> create('article', array( + 'userid' => $userid, + 'cateid' => $cateid, + 'title' => $title, + #'content' => $content, + 'gaiyao' => $gaiyao, + 'score'=>$score, + 'isaudit' => $isaudit, + 'addtime' => date('Y-m-d H:i:s') + )); + + if($articleid){ + + $new['article'] -> create('article_content', array( + 'articleid' => $articleid, + 'content' => $content, + )); + + + #清空草稿箱 + $new['article']->delete('draft',array( + 'userid'=>$userid, + 'types'=>'article', + )); + + + // 上传图片开始 + $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'] + )); + + #生成不同尺寸的图片 + tsXimg($arrUpload['url'],'article',320,180,$arrUpload['path'],'1'); + //tsXimg($arrUpload['url'],'article',640,'',$arrUpload['path']); + + } + // 上传图片结束 + + // 处理标签 + aac('tag') -> addTag('article', 'articleid', $articleid, $tag); + + + // 对积分进行处理 + if($isaudit==0){ + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'],$TS_URL['ts']); + } + + #用户记录 + aac('pubs')->addLogs('article','articleid',$articleid,$userid,$title,$content,0); + + header("Location: " . tsUrl('article', 'show', array('id' => $articleid))); + + }else{ + + tsNotice ( '文章发布失败!' ); + + } + + break; +} diff --git a/app/article/action/admin.php b/app/article/action/admin.php new file mode 100644 index 0000000..3f99995 --- /dev/null +++ b/app/article/action/admin.php @@ -0,0 +1,9 @@ +findAll('article',null,'addtime desc',null,$lstart.',20'); + + $articleNum = $new['article']->findCount('article'); + $pageUrl = pagination($articleNum, 20, $page, $url); + + include template('admin/article_list'); + break; + + //审核通过 + case "isaudit0": + + $articleid = tsIntval($_GET['articleid']); + $strArticle = $new['article']->find('article',array( + 'articleid'=>$articleid, + )); + + $new['article']->update('article',array( + 'articleid'=>$articleid, + ),array( + 'isaudit'=>0, + )); + + #发送系统消息 + $msg_userid = '0'; + $msg_touserid = $strArticle['userid']; + $msg_content = '你发布的文章审核通过,快去看看吧^_^ '; + $msg_url = tsUrl('article','show',array('id'=>$articleid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_url); + + #处理积分 + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'],$TS_URL['ts'],$strArticle['userid']); + + qiMsg('操作成功!'); + break; + + #审核不通过 + case "isaudit1": + + $articleid = tsIntval($_GET['articleid']); + $strArticle = $new['article']->find('article',array( + 'articleid'=>$articleid, + )); + + $new['article']->update('article',array( + 'articleid'=>$articleid, + ),array( + 'isaudit'=>1, + )); + + #发送系统消息 + $msg_userid = '0'; + $msg_touserid = $strArticle['userid']; + $msg_content = '你发布的文章审核未通过,快去看看吧^_^ '; + $msg_url = tsUrl('article','show',array('id'=>$articleid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_url); + + #处理积分 + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'],$TS_URL['ts'],$strArticle['userid']); + + qiMsg('操作成功!'); + + break; + + //删除 + case "delete": + + $articleid = tsIntval($_GET['articleid']); + $strArticle = $new['article']->find('article',array( + 'articleid'=>$articleid, + )); + + $new['article']->deleteArticle($strArticle); + + #处理积分 + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'],$TS_URL['ts'],$strArticle['userid']); + + #用户记录 + aac('pubs')->addLogs('article','articleid',$articleid,$TS_USER['userid'],$strArticle['title'],$strArticle['content'],2); + + qiMsg('删除成功!'); + + break; + + //推荐 + case "isrecommend": + + $articleid = tsIntval($_GET['articleid']); + $strArticle = $new['article']->find('article',array( + 'articleid'=>$articleid, + )); + + if($strArticle['isrecommend']==0){ + $isrecommend = 1; + }else{ + $isrecommend = 0; + } + + $new['article']->update('article',array( + 'articleid'=>$articleid, + ),array( + 'isrecommend'=>$isrecommend, + )); + + #更新项目推荐 + aac('pubs')->upPtableRecommend('article','articleid',$articleid,$isrecommend); + + qiMsg('操作成功!'); + break; + + //置顶 + case "istop": + + $articleid = tsIntval($_GET['articleid']); + $strArticle = $new['article']->find('article',array( + 'articleid'=>$articleid, + )); + + if($strArticle['istop']==0){ + $istop = 1; + }else{ + $istop = 0; + } + + $new['article']->update('article',array( + 'articleid'=>$articleid, + ),array( + 'istop'=>$istop, + )); + + qiMsg('操作成功!'); + break; + +} \ No newline at end of file diff --git a/app/article/action/admin/cate.php b/app/article/action/admin/cate.php new file mode 100644 index 0000000..6e6c844 --- /dev/null +++ b/app/article/action/admin/cate.php @@ -0,0 +1,127 @@ +findAll('article_cate',array( + 'referid'=>0, + ),'orderid asc'); + + foreach($arrCate as $key=>$item){ + $arrCate[$key]['twocate'] = $new['article']->findAll('article_cate',array( + 'referid'=>$item['cateid'], + ),'orderid asc'); + } + + include template("admin/cate_list"); + + break; + + //分类添加 + case "add": + + $referid = tsIntval($_GET['referid']); + + include template("admin/cate_add"); + + break; + + case "add_do": + + + + $new['article']->create('article_cate',array( + 'referid'=>tsIntval($_POST['referid']), + 'catename'=>tsTrim($_POST['catename']), + 'cateinfo'=>tsTrim($_POST['cateinfo']), + 'orderid'=>tsIntval($_POST['orderid']), + + )); + + + header("Location: ".SITE_URL."index.php?app=article&ac=admin&mg=cate&ts=list"); + + break; + + //分类删除 + case "del": + + $cateid = tsIntval($_GET['cateid']); + + + $strCate = $new['article']->find('article_cate',array( + 'cateid'=>$cateid, + )); + + if($strCate['referid']==0){ + $arrCate = $new['article']->findAll('article_cate',array( + 'referid'=>$strCate['cateid'], + )); + + foreach($arrCate as $key=>$item){ + $new['article']->update('article',array( + 'cateid'=>$item['cateid'] + ),array( + 'cateid'=>0, + )); + } + + $new['article']->delete('article_cate',array( + 'referid'=>$strCate['cateid'], + )); + + } + + + $new['article']->update('article',array( + 'cateid'=>$cateid + ),array( + 'cateid'=>0, + )); + + + $new['article']->delete('article_cate',array( + 'cateid'=>$cateid, + )); + + + + + qiMsg("分类删除成功!"); + + break; + + //分类修改 + case "edit": + + $cateid = tsIntval($_GET['cateid']); + + $strCate = $new['article']->find('article_cate',array( + 'cateid'=>$cateid, + )); + + + include template("admin/cate_edit"); + + break; + + //分类修改执行 + case "edit_do": + $cateid = tsIntval($_POST['cateid']); + $catename = tsTrim($_POST['catename']); + $cateinfo = tsTrim($_POST['cateinfo']); + + $new['article']->update('article_cate',array( + 'cateid'=>$cateid, + ),array( + 'catename'=>$catename, + 'cateinfo'=>$cateinfo, + 'orderid'=>tsIntval($_POST['orderid']), + )); + + header("Location: ".SITE_URL."index.php?app=article&ac=admin&mg=cate&ts=list"); + + break; +} \ No newline at end of file diff --git a/app/article/action/admin/comment.php b/app/article/action/admin/comment.php new file mode 100644 index 0000000..7489b2c --- /dev/null +++ b/app/article/action/admin/comment.php @@ -0,0 +1,2 @@ +findAll('user_group',null,'ugid asc'); + + + + + include template('admin/permissions'); + + break; + + case "do": + + /** + * 权限参数说明,app,action必须,其他参数可选 + * app-action-ts + * app-action-mg-ts 当action=admin + * app-action-api-ts 当action=api + */ + + $ugid = tsIntval($_POST['ugid']); + + $arrOption = $_POST['option']; + + aac('pubs')->upAppPermissions($ugid,'article',$arrOption); + + qiMsg('操作成功!'); + + + break; + +} \ No newline at end of file diff --git a/app/article/action/admin/post.php b/app/article/action/admin/post.php new file mode 100644 index 0000000..e3a73cf --- /dev/null +++ b/app/article/action/admin/post.php @@ -0,0 +1,126 @@ +findAll('article',null,'addtime desc',null,$lstart.',20'); + + $articleNum = $new['article']->findCount('article'); + $pageUrl = pagination($articleNum, 20, $page, $url); + + include template('admin/post_list'); + break; + + //审核通过 + case "isaudit0": + + $articleid = intval($_GET['articleid']); + $strArticle = $new['article']->find('article',array( + 'articleid'=>$articleid, + )); + + $new['article']->update('article',array( + 'articleid'=>$articleid, + ),array( + 'isaudit'=>0, + )); + + #发送系统消息 + $msg_userid = '0'; + $msg_touserid = $strArticle['userid']; + $msg_content = '你发布的文章审核通过,快去看看吧^_^ '; + $msg_url = tsUrl('article','show',array('id'=>$articleid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_url); + + #处理积分 + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'], $TS_URL['ts'],$strArticle['userid'],$TS_URL['mg']); + + qiMsg('操作成功!'); + break; + + #审核不通过 + case "isaudit1": + + $articleid = intval($_GET['articleid']); + $strArticle = $new['article']->find('article',array( + 'articleid'=>$articleid, + )); + + $new['article']->update('article',array( + 'articleid'=>$articleid, + ),array( + 'isaudit'=>1, + )); + + #发送系统消息 + $msg_userid = '0'; + $msg_touserid = $strArticle['userid']; + $msg_content = '你发布的文章审核未通过,快去看看吧^_^ '; + $msg_url = tsUrl('article','show',array('id'=>$articleid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_url); + + #处理积分 + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'], $TS_URL['ts'],$strArticle['userid'],$TS_URL['mg']); + + qiMsg('操作成功!'); + + break; + + //删除 + case "delete": + + $articleid = intval($_GET['articleid']); + $strArticle = $new['article']->find('article',array( + 'articleid'=>$articleid, + )); + + if($strArticle['photo']){ + unlink('uploadfile/article/'.$strArticle['photo']); + } + + $new['article']->delete('article',array( + 'articleid'=>$articleid, + )); + + $new['article']->delete('tag_article_index',array( + 'articleid'=>$articleid, + )); + + #处理积分 + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'], $TS_URL['ts'],$strArticle['userid'],$TS_URL['mg']); + + qiMsg('删除成功!'); + + break; + + //推荐 + case "isrecommend": + + $articleid = intval($_GET['articleid']); + $strArticle = $new['article']->find('article',array( + 'articleid'=>$articleid, + )); + + if($strArticle['isrecommend']==0){ + $new['article']->update('article',array( + 'articleid'=>$articleid, + ),array( + 'isrecommend'=>1, + )); + }else{ + $new['article']->update('article',array( + 'articleid'=>$articleid, + ),array( + 'isrecommend'=>0, + )); + } + + qiMsg('操作成功!'); + break; + +} \ No newline at end of file diff --git a/app/article/action/admin/sitemap.php b/app/article/action/admin/sitemap.php new file mode 100644 index 0000000..959fb1d --- /dev/null +++ b/app/article/action/admin/sitemap.php @@ -0,0 +1,4 @@ +findAll(''); \ No newline at end of file diff --git a/app/article/action/ajax.php b/app/article/action/ajax.php new file mode 100644 index 0000000..2fecb5a --- /dev/null +++ b/app/article/action/ajax.php @@ -0,0 +1,26 @@ +findAll('article_cate',array( + 'referid'=>$referid, + )); + + echo ''; + + break; + +} \ No newline at end of file diff --git a/app/article/action/api.php b/app/article/action/api.php new file mode 100644 index 0000000..0608b65 --- /dev/null +++ b/app/article/action/api.php @@ -0,0 +1,9 @@ + +----------------------------------------------- +article http api list +URL:https://demo.thinksaas.cn +----------------------------------------------- +/** + * 文章列表【api接口示例】 + * index.php?app=article&ac=api&api=list + * get + * + * @cateid 分类ID + * @page + * @limit + * + */ +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +'; \ No newline at end of file diff --git a/app/article/action/api/list.php b/app/article/action/api/list.php new file mode 100644 index 0000000..d6f9129 --- /dev/null +++ b/app/article/action/api/list.php @@ -0,0 +1,80 @@ +findAll('article_cate',array( + 'referid'=>0, +)); +foreach($arrCate1 as $key=>$item){ + $arrCate[$item['cateid']] = $item['catename']; +} + +$cateid = tsIntval($_GET['cateid']); +$locationid = tsIntval($_GET['locationid']); + +$kw = tsTrim($_GET['kw']); + +$page = tsIntval($_GET['page'],1); +$limit = isset($_GET['limit']) ? $_GET['limit'] : '10'; + +$lstart = $limit*$page-$limit; + +$where = "`isaudit`='0'"; + +if($cateid){ + $where .= " and `cateid`='$cateid'"; +} + +$articleNum = $new['article']->findCount('article',$where); + +$arrArticle = $new['article']->findAll('article',$where,'addtime desc','articleid,cateid,title,gaiyao,photo,path,count_comment,count_view,count_love,addtime',$lstart.','.$limit); + +foreach($arrArticle as $key=>$item){ + + $arrArticle[$key]['title'] = tsTitle($item['title']); + $arrArticle[$key]['gaiyao'] = tsTitle($item['gaiyao']); + + if($item['photo']){ + $arrArticle[$key]['photourl'] = tsXimg($item['photo'],'article',320,180,$item['path'],'1'); + }else{ + $arrArticle[$key]['photourl'] = ''; + } + + if($item['cateid']){ + $arrArticle[$key]['catename'] = $arrCate[$item['cateid']]; + } + +} + +$jsonData = json_encode(array( + + 'status'=> 1, + 'msg'=> 'success', + 'data'=> array( + + 'previous'=>tsIntval($page-1), + 'page'=>tsIntval($page), + 'next'=>tsIntval($page+1), + 'total'=>tsIntval(ceil($articleNum/$limit)), + 'list'=>$arrArticle, + + ), + +)); + +if($_GET['callback']){ + echo $_GET['callback'].'('.$jsonData.')'; + exit; +}else{ + echo $jsonData; +} \ No newline at end of file diff --git a/app/article/action/cate.php b/app/article/action/cate.php new file mode 100644 index 0000000..df1f1e0 --- /dev/null +++ b/app/article/action/cate.php @@ -0,0 +1,99 @@ +find ( 'article_cate', array ( + 'cateid' => $cateid +)); + +if($strCate==''){ + ts404(); +} + +if($strCate['referid']==0){ + $arrTwoCate = $new['article']->findAll('article_cate',array( + 'referid'=>$strCate['cateid'], + ),'orderid asc'); + + if($arrTwoCate){ + + foreach($arrTwoCate as $key=>$item){ + $arrCateId[] = $item['cateid']; + } + + $cateids = $cateid.','.arr2str($arrCateId); + + $where = "`cateid` in ($cateids) and `isaudit`=0"; + + }else{ + + $where = array( + 'cateid'=>$cateid, + 'isaudit'=>0, + ); + + } + + + +}else{ + + $arrTwoCate = $new['article']->findAll('article_cate',array( + 'referid'=>$strCate['referid'], + ),'orderid asc'); + + $where = array( + 'cateid'=>$cateid, + 'isaudit'=>0, + ); +} + +// 列表 +$page = tsIntval($_GET['page'],1); +$url = tsUrl ( 'article', 'cate', array ('id' => $cateid, 'page' => '')); +$lstart = $page * 10 - 10; + +$arrArticle = $new ['article']->findAll ( 'article',$where, 'addtime desc', 'articleid,userid,cateid,title,gaiyao,score,path,photo,count_comment,count_love,count_view,addtime', $lstart . ',10' ); + +$articleNum = $new ['article']->findCount ( 'article',$where); + +$pageUrl = pagination ( $articleNum, 10, $page, $url ); + +foreach ( $arrArticle as $key => $item ) { + $arrArticle [$key]['title'] = tsTitle($item['title']); + $arrArticle [$key]['gaiyao'] = tsTitle($item['gaiyao']); + $arrArticle [$key] ['user'] = aac ( 'user' )->getSimpleUser ( $item ['userid'] ); + $arrArticle [$key] ['cate'] = array( + 'cateid'=>$strCate['cateid'], + 'catename'=>$strCate['catename'], + ); + + + #封面图 + if($item['photo']){ + $arrArticle[$key]['photo_url'] = $new['article']->getArticlePhoto($item); + } + +} + +// 推荐阅读 +$arrRecommend = $new ['article']->getRecommendArticle (); + +// 一周热门 +$arrHot7 = $new ['article']->getHotArticle ( 7); +// 一月热门 +$arrHot30 = $new ['article']->getHotArticle ( 30 ); + +$title = $strCate ['catename']; + +// SEO优化 +$sitekey = $strCate ['catename']; +$sitedesc = $strCate ['catename'] . ' - 文章'; + +include template ( 'index' ); \ No newline at end of file diff --git a/app/article/action/comment.php b/app/article/action/comment.php new file mode 100644 index 0000000..451f12f --- /dev/null +++ b/app/article/action/comment.php @@ -0,0 +1,73 @@ +isLogin (); + +switch ($ts) { + + case "do" : + + $articleid = intval ( $_POST ['articleid'] ); + $content = tsClean ( $_POST ['content'] ); + $content2 = emptyText( $_POST ['content'] ); + + if ($content2 == '') tsNotice ( "内容不能为空!" ); + + // 过滤内容开始 + aac ( 'system' )->antiWord ( $content ); + // 过滤内容结束 + + $new ['article']->create ( 'article_comment', array ( + 'articleid' => $articleid, + 'userid' => $userid, + 'content' => $content, + 'addtime' => time () + ) + ); + + // 统计 + $count_comment = $new ['article']->findCount ( 'article_comment', array ( + 'articleid' => $articleid + ) ); + + $new ['article']->update ( 'article', array ( + 'articleid' => $articleid + ), array ( + 'count_comment' => $count_comment + ) ); + + header ( "Location: " . tsUrl ( 'article', 'show', array ( + 'id' => $articleid + ) ) ); + + break; + + case "delete" : + + $commentid = intval ( $_GET ['commentid'] ); + + $strComment = $new ['article']->find ( 'article_comment', array ( + 'commentid' => $commentid + ) ); + + $strArticle = $new ['article']->find ( 'article', array ( + 'articleid' => $strComment ['articleid'] + ) ); + + if ($userid == $strArticle ['userid'] || $TS_USER ['isadmin'] == 1) { + + $new ['article']->delete ( 'article_comment', array ( + 'commentid' => $commentid + )); + + //处理积分 + aac('user')->doScore($GLOBALS['TS_URL']['app'], $GLOBALS['TS_URL']['ac'], $GLOBALS['TS_URL']['ts'],$strComment['userid']); + + tsNotice ( '删除成功' ); + } else { + + tsNotice ( '非法操作' ); + } + + break; +} \ No newline at end of file diff --git a/app/article/action/common.php b/app/article/action/common.php new file mode 100644 index 0000000..9873ccd --- /dev/null +++ b/app/article/action/common.php @@ -0,0 +1,7 @@ +findAll ( 'article_cate',array( + 'referid'=>0, +),'orderid asc'); \ No newline at end of file diff --git a/app/article/action/delete.php b/app/article/action/delete.php new file mode 100644 index 0000000..45416b8 --- /dev/null +++ b/app/article/action/delete.php @@ -0,0 +1,32 @@ +isLogin (); + +$articleid = tsIntval ( $_GET ['articleid'] ); + +$strArticle = $new ['article']->find ( 'article', array ( + 'articleid' => $articleid +) ); + +//普通用户不允许删除内容 +if($TS_SITE['isallowdelete'] && $TS_USER ['isadmin'] == 0) tsNotice('系统不允许用户删除内容,请联系管理员删除!'); + +if ($strArticle ['userid'] == $userid || $TS_USER ['isadmin'] == 1) { + + + #用户记录 + aac('pubs')->addLogs('article','articleid',$articleid,$userid,$strArticle['title'],$strArticle['content'],2); + + + #删除文章 + $new['article']->deleteArticle($strArticle); + + if($strArticle['isaudit']==0){ + #对积分进行处理 + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'],$TS_URL['ts'],$strArticle ['userid']); + } + +} + +tsNotice('删除成功','点击返回文章首页',tsUrl ( 'article' )); \ No newline at end of file diff --git a/app/article/action/edit.php b/app/article/action/edit.php new file mode 100644 index 0000000..6c58809 --- /dev/null +++ b/app/article/action/edit.php @@ -0,0 +1,174 @@ +isLogin (); + +//普通不用不允许编辑内容 +if($TS_SITE['isallowedit'] && $TS_USER ['isadmin'] == 0) tsNotice('系统不允许用户编辑内容,请联系管理员编辑!'); + +switch ($ts) { + + case "" : + + $articleid = tsIntval ( $_GET ['articleid'] ); + + $cateid = tsIntval ( $_GET ['cateid'] ); + + $strArticle = $new ['article']->find ( 'article', array ( + 'articleid' => $articleid + ) ); + + if ($strArticle ['userid'] == $userid || $TS_USER ['isadmin'] == 1) { + + $strArticle['title'] = tsTitle($strArticle['title']); + + $articleContent = $new['article']->find('article_content',array( + 'articleid'=>$articleid, + )); + + $strArticle['content'] = $articleContent['content']; + + //$strArticle['content'] = tsDecode($strArticle['content']); //为有效防止xss攻击,如果前端通过textarea标签加载的编辑器,请注释掉本行;如果编辑器有其他的加载方式,请视情况解除本行注释。 + $strArticle['gaiyao'] = tsTitle($strArticle['gaiyao']); + + #封面图 + $strArticle['photo_url'] = $new['article']->getArticlePhoto($strArticle); + + // 找出TAG + $arrTags = aac ( 'tag' )->getObjTagByObjid ( 'article', 'articleid', $articleid ); + foreach ( $arrTags as $key => $item ) { + $arrTag [] = $item ['tagname']; + } + $strArticle ['tag'] = arr2str ( $arrTag ); + + foreach ($arrCate as $key=>$item){ + $arrCate[$key]['two'] = $new['article']->findAll('article_cate',array( + 'referid'=>$item['cateid'], + )); + } + + + $title = '修改文章'; + include template ( 'edit' ); + } else { + + tsNotice ( '非法操作!' ); + } + + break; + + case "do" : + + $articleid = tsIntval ( $_POST ['articleid'] ); + + $strArticle = $new ['article']->find ( 'article', array ( + 'articleid' => $articleid + ) ); + + if($strArticle['userid']!=$userid && $TS_USER['isadmin']==0){ + tsNotice('非法操作!'); + } + + $cateid = tsIntval ( $_POST ['cateid'] ); + $cateid2 = tsIntval ( $_POST ['cateid2'] ); + + if($cateid2) $cateid = $cateid2; + + $title = trim ( $_POST ['title'] ); + $content = tsClean ( $_POST ['content'] ); + $content2 = emptyText ( $_POST ['content'] ); + $gaiyao = trim ( $_POST ['gaiyao'] ); + + $re_gaiyao = tsIntval ( $_POST ['re_gaiyao'] ); + + $score = tsIntval($_POST ['score']);#积分 + + if ($TS_USER ['isadmin'] == 0) { + // 过滤内容开始 + $title = antiWord ( $title ); + $content = antiWord ( $content ); + // 过滤内容结束 + } + + if ($title == '' || $content2 == '' || $content=='') + qiMsg ( "标题和内容都不能为空!" ); + + if($score<0){ + tsNotice ( '积分填写有误!' ); + } + + if($re_gaiyao==1){ + $gaiyao = cututf8(t(tsDecode($content)),0,100); + } + + $new ['article']->update ( 'article', array ( + 'articleid' => $articleid, + ), array ( + 'title' => $title, + 'gaiyao' => $gaiyao, + 'score'=>$score, + )); + + $new['article']->replace('article_content',array( + 'articleid'=>$articleid, + ),array( + 'articleid'=>$articleid, + 'content'=>$content, + )); + + #更新分类 + if($cateid){ + $new['article']->update('article',array( + 'articleid' => $articleid, + ),array( + 'cateid' => $cateid, + )); + } + + // 处理标签 + $tag = trim ( $_POST ['tag'] ); + if ($tag) { + aac ( 'tag' )->delIndextag ( 'article', 'articleid', $articleid ); + aac ( 'tag' )->addTag ( 'article', 'articleid', $articleid, $tag ); + } + + $pjson = ''; + if($strArticle['photo']){ + $pjson = json_encode(array( + tsXimg($strArticle['photo'],'article',320,180,$strArticle['path'],1) + )); + } + + // 上传封面图片 + $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'], + 'uptime'=>time(), + ) ); + + #生成不同尺寸的图片 + tsDimg ($arrUpload ['url'], 'article', '320', '180', $arrUpload ['path']); + + $pjson = json_encode(array( + tsXimg($arrUpload['url'],'article',320,180,$arrUpload['path'],1) + )); + + } + + #更新ptable + aac('pubs')->editPtable('article','articleid',$articleid,$pjson,$title,$gaiyao); + + + #用户记录 + aac('pubs')->addLogs('article','articleid',$articleid,$userid,$title,$content,1); + + + header ("Location: " . tsUrl ( 'article', 'show', array ('id' => $articleid))); + + break; +} \ No newline at end of file diff --git a/app/article/action/index.php b/app/article/action/index.php new file mode 100644 index 0000000..700eb46 --- /dev/null +++ b/app/article/action/index.php @@ -0,0 +1,50 @@ + '') ); +$lstart = $page * 10 - 10; + +$arrArticle = $new ['article']->findAll ( 'article', array ( + 'isaudit' => '0' +), 'istop desc,addtime desc', 'articleid,userid,cateid,title,gaiyao,score,path,photo,count_comment,count_love,count_view,istop,addtime,uptime', $lstart . ',10' ); + +$articleNum = $new ['article']->findCount ( 'article', array ( + 'isaudit' => '0' +) ); + +$pageUrl = pagination ( $articleNum, 10, $page, $url ); + +foreach ( $arrArticle as $key => $item ) { + $arrArticle [$key]['title'] = tsTitle($item['title']); + $arrArticle [$key]['gaiyao'] = tsTitle($item['gaiyao']); + $arrArticle [$key] ['user'] = aac ( 'user' )->getSimpleUser( $item ['userid'] ); + $arrArticle [$key] ['cate'] = $new ['article']->find( 'article_cate', array ( + 'cateid' => $item ['cateid'] + ) ); + + #封面图 + if($item['photo']){ + $arrArticle[$key]['photo_url'] = $new['article']->getArticlePhoto($item); + } + + +} + +// 推荐阅读 +$arrRecommend = $new ['article']->getRecommendArticle (); + +// 一周热门 +$arrHot7 = $new ['article']->getHotArticle ( 7 ); +// 一月热门 +$arrHot30 = $new ['article']->getHotArticle ( 30 ); + + +$sitekey = $TS_APP['appkey']; +$sitedesc = $TS_APP['appdesc']; +$title = '文章'; + +include template ( 'index' ); \ No newline at end of file diff --git a/app/article/action/my.php b/app/article/action/my.php new file mode 100644 index 0000000..0f8df1f --- /dev/null +++ b/app/article/action/my.php @@ -0,0 +1,11 @@ +isLogin(); + $strUser = aac('user')->getOneUser($userid); + include_once 'app/' . $TS_URL['app'] . '/action/my/' . $TS_URL['my'] . '.php'; +} else { + qiMsg ( 'sorry:no index!' ); +} \ No newline at end of file diff --git a/app/article/action/my/common.php b/app/article/action/my/common.php new file mode 100644 index 0000000..2fb16c1 --- /dev/null +++ b/app/article/action/my/common.php @@ -0,0 +1,6 @@ +isLogin(); + +$strUser = aac('user')->getOneUser($userid); \ No newline at end of file diff --git a/app/article/action/my/index.php b/app/article/action/my/index.php new file mode 100644 index 0000000..6cc3e88 --- /dev/null +++ b/app/article/action/my/index.php @@ -0,0 +1,22 @@ +'index','page' => '' ) ); +$lstart = $page * 20 - 20; + +$arrArticle = $new ['article']->findAll ( 'article', array ( + 'userid' => $strUser['userid'], +), 'addtime desc', null, $lstart . ',20' ); + +$articleNum = $new ['article']->findCount ( 'article', array ( + 'userid' => $strUser['userid'], +) ); + +$pageUrl = pagination ( $articleNum, 20, $page, $url ); + + + +$title = '我的文章'; +include template('my/index'); \ No newline at end of file diff --git a/app/article/action/recommend.php b/app/article/action/recommend.php new file mode 100644 index 0000000..0e60173 --- /dev/null +++ b/app/article/action/recommend.php @@ -0,0 +1,39 @@ +findCount ( 'article_recommend', array ( + 'articleid' => $articleid, + 'userid' => $userid +) ); + +if ($isRecommend > 0) { + echo 1; + exit (); +} + +$new ['article']->create ( 'article_recommend', array ( + 'articleid' => $articleid, + 'userid' => $userid +) ); + +$count_recommend = $new ['article']->findCount ( 'article_recommend', array ( + 'articleid' => $articleid +) ); + +$new ['article']->update ( 'article', array ( + 'articleid' => $articleid +), array ( + 'count_recommend' => $count_recommend +) ); + +echo 2; +exit (); \ No newline at end of file diff --git a/app/article/action/score.php b/app/article/action/score.php new file mode 100644 index 0000000..080be7b --- /dev/null +++ b/app/article/action/score.php @@ -0,0 +1,69 @@ +find('article',array( + 'articleid'=>$articleid, + ),'articleid,userid,score'); + + if($strArticle==''){ + getJson('文章不存在!',1,0); + } + + if($strArticle['userid']==$userid){ + getJson('自己无需支付阅读自己的文章!',1,0); + } + + $isArticleUser = $new['article']->findCount('article_user',array( + 'articleid'=>$articleid, + 'userid'=>$userid, + )); + + if($isArticleUser>0){ + getJson('你已经支付过,无需再次支付!',1,0); + } + + $strUserScore = $new['article']->find('user_info',array( + 'userid'=>$userid, + ),'userid,count_score'); + + if($strUserScore['count_score']<$strArticle['score']){ + getJson('积分不足!',1,0); + } + + aac('user')->addScore($strArticle['userid'],'文章收入'.$strArticle['articleid'],$strArticle['score'],1); + aac('user')->delScore($userid,'查看文章'.$strArticle['articleid'],$strArticle['score']); + + $new['article']->create('article_user',array( + 'articleid'=>$articleid, + 'userid'=>$userid, + 'addtime'=>time(), + )); + + + getJson('积分支付成功!',1,2,tsUrl('article','show',array('id'=>$articleid))); + + break; + +} \ No newline at end of file diff --git a/app/article/action/show.php b/app/article/action/show.php new file mode 100644 index 0000000..f60af49 --- /dev/null +++ b/app/article/action/show.php @@ -0,0 +1,112 @@ +find ( 'article', array ( + 'articleid' => $articleid +)); + +if ($strArticle == '') { + ts404(); +} + +// 是否审核 +if ($strArticle ['isaudit'] == 1 && $TS_USER['isadmin']==0 && $TS_USER['userid']!=$strArticle['userid']) { + tsNotice ( '内容审核中...' ); +} + +$cateid = $strArticle['cateid']; + +$strArticle['title'] = tsTitle($strArticle['title']); + +$articleContent = $new['article']->find('article_content',array( + 'articleid'=>$articleid, +)); + +$strArticle['content'] = tsDecode($articleContent['content']); + +$strArticle ['tags'] = aac ( 'tag' )->getObjTagByObjid ( 'article', 'articleid', $articleid ); +$strArticle ['user'] = aac ( 'user' )->getSimpleUser ( $strArticle ['userid'] ); +$strArticle ['cate'] = $new ['article']->find ( 'article_cate', array ( + 'cateid' => $strArticle ['cateid'] +) ); + + +// 上一篇 +$strUp = $new['article']->find('article', "`articleid`< '$articleid' and `isaudit`='0'", 'articleid,title','articleid desc'); +if($strUp) $strUp['title'] = tsTitle($strUp['title']); +// 下一篇 +$strNext = $new['article']->find('article', "`articleid`> '$articleid' and `isaudit`='0'", 'articleid,title','articleid asc'); +if($strNext) $strNext['title'] = tsTitle($strNext['title']); + + + +// 获取评论 +$page = tsIntval($_GET['page'],1); +$url = tsUrl ('article','show', array ('id' => $articleid,'page'=>'')); +$lstart = $page * 15 - 15; +$arrComment = aac('comment')->getCommentList('article','articleid',$strArticle['articleid'],$page,$lstart,$strArticle['userid']); +$commentNum = aac('comment')->getCommentNum('article','articleid',$strArticle['articleid']); +$pageUrl = pagination ( $commentNum, 15, $page, $url ); + +// 标签 +$strArticle ['tags'] = aac ( 'tag' )->getObjTagByObjid ( 'article', 'articleid', $strArticle ['articleid'] ); + +//最新文章 +$arrArticle = $new ['article']->findAll ( 'article', array( + 'isaudit'=>0, +), 'addtime desc', 'articleid,title', 10 ); + +// 推荐阅读 +$arrRecommend = $new ['article']->getRecommendArticle (); + +// 一周热门 +$arrHot7 = $new ['article']->getHotArticle ( 7); +// 一月热门 +$arrHot30 = $new ['article']->getHotArticle ( 30); + + + +//判断用户可阅读文章:0可读1不可读 +$isread = 0; +if($strArticle['score']>0) $isread = 1; +if($TS_USER['userid'] && $strArticle['userid']==$TS_USER['userid']) $isread=0; +if($TS_USER['userid'] && $strArticle['userid']!=$TS_USER['userid'] && $strArticle['score']>0){ + $isArticleUser = $new['article']->findCount('article_user',array( + 'articleid'=>$articleid, + 'userid'=>$TS_USER['userid'], + )); + if($isArticleUser>0) $isread=0; +} +if($TS_USER['isadmin']==1) $isread=0; + + + + +//把标签作为关键词 +if($strArticle['tags']){ + foreach($strArticle['tags'] as $key=>$item){ + $arrTag[] = $item['tagname']; + } + $sitekey = arr2str($arrTag); +}else{ + $sitekey = $strArticle['title']; +} + +$sitedesc = cututf8(t($strArticle['content']),0,100); + +$title = $strArticle ['title']; + +include template ( 'show' ); + +// 统计查看次数 +$count_view = $strArticle ['count_view'] + 1; +$new ['article']->update ('article', array( + 'articleid' => $strArticle ['articleid'] +), array ( + 'count_view' => $count_view, +)); + +#更新ptable +aac('pubs')->upPtableView('article','articleid',$articleid,$count_view); \ No newline at end of file diff --git a/app/article/action/tag.php b/app/article/action/tag.php new file mode 100644 index 0000000..7cc2c14 --- /dev/null +++ b/app/article/action/tag.php @@ -0,0 +1,64 @@ +getTagByName($name); + +$strTag ['tagname'] = htmlspecialchars ( $strTag ['tagname'] ); + +$page = tsIntval($_GET['page'],1); + +$url = tsUrl ( 'article', 'tag', array ( + 'id' => urlencode ( $name ), + 'page' => '' +) ); + +$lstart = $page * 30 - 30; + +$tagid = $strTag['tagid']; + +$arrTagId = $new ['article']->findAll ( 'tag_article_index', array ( + 'tagid' => $tagid +), null, null, $lstart . ',30' ); + +foreach ( $arrTagId as $item ) { + $strArticle = $new ['article']->find ( 'article', array ( + 'articleid' => $item ['articleid'] + ) ); + if ($strArticle == '') { + $new ['article']->delete ( 'tag_article_index', array ( + 'articleid' => $item ['articleid'], + 'tagid' => $item ['tagid'] + ) ); + } + + if ($strArticle && $strArticle['isaudit']==0) { + $arrArticle [] = $strArticle; + } +} + +aac ( 'tag' )->countObjTag ( 'article', $tagid ); + +$articleNum = $new ['article']->findCount ( 'tag_article_index', array ( + 'tagid' => $tagid +) ); + +$pageUrl = pagination ( $articleNum, 30, $page, $url ); + +foreach ( $arrArticle as $key => $item ) { + $arrArticle [$key] ['title'] = htmlspecialchars ( $item ['title'] ); + $arrArticle [$key] ['content'] = cututf8 ( t ( $item ['content'] ), 0, 150 ); + $arrArticle [$key] ['user'] = aac ( 'user' )->getSimpleUser ( $item ['userid'] ); + $arrArticle [$key] ['cate'] = $new ['article']->find ( 'article_cate', array ( + 'cateid' => $item ['cateid'] + ) ); +} + +// 热门tag +$arrTag = $new ['article']->findAll ( 'tag', "`count_article`>'0' and `isaudit`=0", 'count_article desc', null, 30 ); + +$sitekey = $strTag ['tagname']; +$title = $strTag ['tagname']; + +include template ( "tag" ); \ No newline at end of file diff --git a/app/article/action/tags.php b/app/article/action/tags.php new file mode 100644 index 0000000..15c5c53 --- /dev/null +++ b/app/article/action/tags.php @@ -0,0 +1,18 @@ + '' +) ); + +$lstart = $page * 200 - 200; + +$arrTag = $new ['article']->findAll ( 'tag', "`count_article`>'0' and `isaudit`=0", null, null, $lstart . ',200' ); + +$tagNum = $new ['article']->findCount ( 'tag', "`count_article`>'0' and `isaudit`=0" ); + +$pageUrl = pagination ( $tagNum, 200, $page, $url ); + +$title = '标签'; +include template ( 'tags' ); \ No newline at end of file diff --git a/app/article/class.article.php b/app/article/class.article.php new file mode 100644 index 0000000..106104d --- /dev/null +++ b/app/article/class.article.php @@ -0,0 +1,165 @@ +delete('article',array( + 'articleid' => $strArticle['articleid'], + )); + + #删除ts_article_content + $this->delete('article_content',array( + 'articleid' => $strArticle['articleid'], + )); + + #删除ts_article_user + $this->delete('article_user',array( + 'articleid' => $strArticle['articleid'], + )); + + #删除关联标签 + $this->delete('tag_article_index',array( + 'articleid'=>$strArticle['articleid'], + )); + + #删除评论ts_comment + aac('comment')->delComment('article','articleid',$strArticle['articleid']); + + #删除点赞ts_love + aac('pubs')->delLove('article','articleid',$strArticle['articleid']); + + #删除ptable + aac('pubs')->delPtable('article','articleid',$strArticle['articleid']); + + } + + + //热门文章,1天,7天,30天 + /** + * @param $day + * @param int $cateid + * @return mixed + */ + public function getHotArticle($day, $cateid = 0) { + $startTime = time() - ($day * 3600 * 24); + $startTime = date('Y-m-d', $startTime); + + $endTime = date('Y-m-d'); + + if ($day == 30) { + $endTime = date('Y-m-d', time() - (7 * 3600 * 24)); + } + + if ($cateid) { + $arr = "`cateid`='$cateid' and `count_view`>'0' and `addtime`>'$startTime' and `addtime`<'$endTime' and `isaudit`='0'"; + } else { + $arr = "`addtime`>'$startTime' and `count_view`>'0' and `addtime`<'$endTime' and `isaudit`='0'"; + } + + $arrArticle = $this->findAll('article', $arr, 'addtime desc', 'articleid,title', 10); + foreach ($arrArticle as $key => $item) { + $arrArticle[$key]['title'] = tsTitle($item['title']); + } + + return $arrArticle; + } + + //推荐文章 $cateid + /** + * @param int $cateid + * @return mixed + */ + public function getRecommendArticle($cateid = 0) { + + if ($cateid) { + $arr = array( + 'cateid' => $cateid, + 'isrecommend' => 1, + ); + } else { + $arr = array( + 'isrecommend' => 1, + ); + } + + $arrArticle = $this->findAll('article', $arr, 'addtime desc', 'articleid,title', 10); + foreach ($arrArticle as $key => $item) { + $arrArticle[$key]['title'] = tsTitle($item['title']); + } + + return $arrArticle; + } + + /* + * 是否文章作者 + */ + public function isArticleUser($articleid,$userid){ + $isUser = $this->findCount('article',array( + 'articleid'=>$articleid, + 'userid'=>$userid, + )); + + if($isUser){ + return true; + }else{ + return false; + } + + } + +} diff --git a/app/article/config.php b/app/article/config.php new file mode 100644 index 0000000..2cec18d --- /dev/null +++ b/app/article/config.php @@ -0,0 +1,19 @@ + + $(document).ready(function() { + + //选择一级区域 + $('#cateid').change(function(){ + $("#select2").html(''); + var cateid = $(this).children('option:selected').val(); //弹出select的值 + + if(cateid==0){ + $("#select2").html(''); + + }else{ + + $.ajax({ + type: "GET", + url: "{SITE_URL}index.php?app=article&ac=ajax&ts=twocate&referid="+cateid, + success: function(msg){ + $("#select2").html(msg); + } + }); + + } + + }); + + }); + + + + +
+ + + + +
+
+ + +
+
+
+ + +
+ +
+ + +
+{if $arrCate} +
+ + +
+
+ + + +
+
+ + + +
+
+ + +
+{/if} + +
+ +
+ +
+
+ + +
+ + +
+ +
+ + +
+ +
+ + + + +
+ + +
+ + + +
+ + +
+ + 积分 +
+ + + + {if $TS_SITE['isniming']==1} +
+ + 否 + (匿名发布后用户将无法对内容进行管理) +
+ {/if} + + + + + {if $TS_SITE['isauthcode']} +
+ + +
+ + 点击刷新验证码 + +
+ + +
+ {/if} + + + + {if $TS_SITE['is_vaptcha']} +
+ + +
+ +
+
+
+ + + + Vaptcha启动中... +
+
+
+ + + +
+ +
+ +
+ {/if} + + + + + + + 取消发布 + +
+ + +
+
+
+ + + +
+
+ + + + + +
+{php doAction('tseditor')} + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/article/html/admin/article_list.html b/app/article/html/admin/article_list.html new file mode 100644 index 0000000..1fb9a34 --- /dev/null +++ b/app/article/html/admin/article_list.html @@ -0,0 +1,76 @@ +{php include pubTemplate("header_admin")} + + +
+ +{php include template("admin/menu");} + +
{$pageUrl}
+ + + + + + + + + + + + + + + + + + + +{loop $arrArticle $key $item} + + + + + + + +{/loop} + +
ID用户ID标题统计操作
{$item['articleid']}{$item['userid']}{tsTitle($item['title'])}浏览:{$item['count_view']}
+ 评论:{$item['count_comment']} + +
+ + + + +{if $item['isaudit']==0} +取消审核 +{/if} + +{if $item['isaudit']==1} +审核 +{/if} + + + + + {if $item['istop']==1} + 取消置顶 + {else} + 置顶 + {/if} + + + +{if $item['isrecommend']==1} +取消推荐 +{else} +推荐 +{/if} + +删除 +
+ +
+ +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/article/html/admin/cate_add.html b/app/article/html/admin/cate_add.html new file mode 100644 index 0000000..30f6ee0 --- /dev/null +++ b/app/article/html/admin/cate_add.html @@ -0,0 +1,28 @@ +{php include pubTemplate("header_admin")} + +
+{php include template("admin/menu");} + +
+ + + + + + + + +
分类名称:
分类介绍: + + + +
排序ID:
+ + + +
+
+ +
+ +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/article/html/admin/cate_edit.html b/app/article/html/admin/cate_edit.html new file mode 100644 index 0000000..9e43dfc --- /dev/null +++ b/app/article/html/admin/cate_edit.html @@ -0,0 +1,27 @@ +{php include pubTemplate("header_admin")} + +
+{php include template("admin/menu");} + +
+ + + + + + + + +
分类名称:
分类介绍: + + + +
排序ID:
+ + + +
+
+ +
+{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/article/html/admin/cate_list.html b/app/article/html/admin/cate_list.html new file mode 100644 index 0000000..12cb279 --- /dev/null +++ b/app/article/html/admin/cate_list.html @@ -0,0 +1,64 @@ +{php include pubTemplate("header_admin")} + +
+ +{php include template("admin/menu");} + + + + + + + + + +{loop $arrCate $key $item} + + + + + + + + + + + +{loop $item['twocate'] $tkey $titem} + + + + + + + + + + + + + +{/loop} + + + +{/loop} + + + +
分类ID分类名字排序(排序数字越小越靠前)操作
{$item[cateid]}I、{$item[catename]}{$item[orderid]} + +添加二级分类 + +修改 + 删除 + +
{$titem[cateid]}II、{$titem[catename]}{$titem[orderid]} + +修改 +删除 + +
+ +
+{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/article/html/admin/menu.html b/app/article/html/admin/menu.html new file mode 100644 index 0000000..4630af3 --- /dev/null +++ b/app/article/html/admin/menu.html @@ -0,0 +1,17 @@ + +
+
文章管理
+ +
+
\ No newline at end of file diff --git a/app/article/html/admin/options.html b/app/article/html/admin/options.html new file mode 100644 index 0000000..dde731f --- /dev/null +++ b/app/article/html/admin/options.html @@ -0,0 +1,29 @@ +{php include pubTemplate("header_admin")} + +
+ +{php include template("admin/menu");} + +
+ + + + + + + + + + + + + + +
APP名称:
APP介绍:
APP关键词:
会员发布:不允许 允许
文章是否审核:不审核 审核
+ +
+
+ +
+ +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/article/html/admin/permissions.html b/app/article/html/admin/permissions.html new file mode 100644 index 0000000..d452f7a --- /dev/null +++ b/app/article/html/admin/permissions.html @@ -0,0 +1,148 @@ +{php include pubTemplate("header_admin")} + +
+ +{php include template("admin/menu");} + + + +
+ {loop $arrUg $key $item} + {$item['ugname']} + {/loop} +
+ + +
+ + +
前台权限
+ + + + + + + + + + {if $ugid==1 || $ugid==2 || $ugid==3} + + + + + + + + + + + + + + + {/if} + + + + +
查看文章: + +
发布文章: + +
修改文章: + +
删除文章: + +
+ + + + {if $ugid==1 || $ugid==2} +
后台权限
+ + + + + + + + + + + + + + + + + + + + +
文章配置: + +
权限配置: + +
添加分类: + +
修改分类: + +
+ {/if} + + + +
API权限
+ + + + + + + + + + + +
查看文章: + +
+ + + + + + +
+ +
+ +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/article/html/admin/post_list.html b/app/article/html/admin/post_list.html new file mode 100644 index 0000000..d7af5d8 --- /dev/null +++ b/app/article/html/admin/post_list.html @@ -0,0 +1,52 @@ +{php include pubTemplate("header_admin")} + + +
+ +{php include template("admin/menu");} + +
{$pageUrl}
+ + + + + + + + + + + + + + +{loop $arrArticle $key $item} + +{/loop} + +
ID用户ID标题 操作
{$item['articleid']}{$item['userid']}{tsTitle($item['title'])} + + + + +{if $item['isaudit']==0} +取消审核 +{/if} + +{if $item['isaudit']==1} +审核 +{/if} + + +{if $item['isrecommend']==1} +取消推荐 +{else} +推荐 +{/if} + +删除 +
+ +
+ +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/article/html/cate.html b/app/article/html/cate.html new file mode 100644 index 0000000..4172f3b --- /dev/null +++ b/app/article/html/cate.html @@ -0,0 +1,133 @@ +{php include pubTemplate("header")} + +
+ + + + + +
+ + + +
+ + +
+
{$strCate['catename']}
+
+ +
+
    +{loop $arrArticle $key $item} +
  • +{if $item['photo']} + + + +{/if} + + + +
    {$item[user][username]} 发表于 {$item[addtime]}
    + +
    {if $item['gaiyao']}{tsTitle($item['gaiyao'])}{else}暂无概要{/if} (查看全文)
    + +
    {$item['count_view']}阅读 | {$item['count_comment']}评论
    +
    +
  • +{/loop} +
+
+ +
{$pageUrl}
+
+
+ + +
+ + + +
+ + +
+ 写文章 +
+ +
+
分类
+
+ + + {loop $arrCate $key $item} + {$item['catename']} + {/loop} + + +
+ +
+ + +
+
推荐阅读
+
+
+ +
+
+
+ +
+
一周热门
+
+
+ +
+
+
+ +
+
一月热门
+
+
+ +
+
+
+ + + +{php doAction('gobad','300')} + + +
+ + + + + +
+
+ +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/article/html/edit.html b/app/article/html/edit.html new file mode 100644 index 0000000..d72be2e --- /dev/null +++ b/app/article/html/edit.html @@ -0,0 +1,163 @@ +{php include pubTemplate("header")} + + + +
+ + + + + +
+
+ + +
+
+
+ + +
+ +
+ + +
+{if $arrCate} +
+ + + + +
+
+ + + +
+
+ + + +
+
+ + + +
+{/if} + +
+ + +
+ +
+ + +
+ + +
+ + +
+ 重新生成内容概要 +
+
+ +
+ + +
+ +
+ + + {if $strArticle['photo']} +

+ +

+ {/if} + +
+ + +
+ + + +
+ + +
+ + 积分 +
+ + + + + + + 返回文章 + +
+ + +
+
+
+ + + +
+
+ + + + + +
+{php doAction('tseditor')} +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/article/html/index.html b/app/article/html/index.html new file mode 100644 index 0000000..78be781 --- /dev/null +++ b/app/article/html/index.html @@ -0,0 +1,237 @@ +{php include pubTemplate("header")} +
+ + + + + +
+ 全部 + {loop $arrCate $key $item} + {$item['catename']} + {/loop} +
+ + +
+ + + +
+ + +
+
+

+ {if $strCate} + {$strCate['catename']} + {else} + {$TS_APP['appname']} + {/if} +

+ + {if $strCate && $strCate['cateinfo']} +
+ {tsTitle($strCate['cateinfo'])} +
+ {/if} + + + {if $ac=='index'} +
+ {$TS_APP['appdesc']} +
+ {/if} + +
+
+ + + + +{loop $arrArticle $key $item} + +
+
+ + + {if $item['photo']} +
+ +
+ + + +
+
+ +
+ {$item['title']} + {if $item['istop']=='1'} + [置顶] + {/if} +
+ +
{$item['user']['username']} 发表于 {$item['addtime']}
+ +
{if $item['gaiyao']}{tsTitle($item['gaiyao'])}{else}暂无概要{/if} (查看全文)
+ + + + + +
+ + +
+ + {$item['count_view']} + + {$item['count_comment']} + + +
+ +
+ + + + + + + +
+ +
+ + + {else} + +
+ {$item['title']} + {if $item['istop']=='1'} + [置顶] + {/if} +
+ +
{$item['user']['username']} 发表于 {$item['addtime']}
+ + {if $item['score']==0} +
{if $item['gaiyao']}{$item['gaiyao']}{else}暂无概要{/if} (查看全文)
+ {/if} + + + + +
+ + +
+ + {$item['count_view']} + {$item['count_comment']} + +
+ +
+ + + + {/if} + +
+
+ +{/loop} + + +
{$pageUrl}
+ + + +
+ + + +
+ + + {if $arrTwoCate} +
+
二级分类
+
+ {loop $arrTwoCate $key $item} + {$item['catename']} + {/loop} +
+
+ {/if} + + + +
+
推荐阅读
+
+
+ +
+
+
+ +
+
一周热门
+
+
+ +
+
+
+ +
+
一月热门
+
+
+ +
+
+
+ + + +{php doAction('gobad','300')} + + +
+ + + + + +
+
+ +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/article/html/menu.html b/app/article/html/menu.html new file mode 100644 index 0000000..3500aa6 --- /dev/null +++ b/app/article/html/menu.html @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/app/article/html/my/index.html b/app/article/html/my/index.html new file mode 100644 index 0000000..ef3c52d --- /dev/null +++ b/app/article/html/my/index.html @@ -0,0 +1,73 @@ +{php include pubTemplate("header")} +
+ + + +
+ + +
+
+ + {php include pubTemplate("my")} + +
+
+ + + +
+ + +
+
我的文章
+
+ + +
+ + 已发布{$articleNum}篇文章 + + 发布文章 +
+ + + + + + + + + {loop $arrArticle $key $item} + + {/loop} + +
标题时间操作
+ + {tsTitle($item['title'])}{$item['addtime']} + + 修改 | + + 删除 + +
+ +
+
{$pageUrl}
+ + + +
+
+ +
+
+ + + + + +
+ + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/article/html/show.html b/app/article/html/show.html new file mode 100644 index 0000000..323c5a5 --- /dev/null +++ b/app/article/html/show.html @@ -0,0 +1,253 @@ +{php include pubTemplate("header")} +
+ + +
+ 全部 + {loop $arrCate $key $item} + {$item['catename']} + {/loop} +
+ +
+ +
+ +
+
+ +

{$strArticle[title]}

+ +
+ + {$strArticle['user']['username']} + + +
+ +
发表于 {$strArticle['addtime']}
+
+
+ + {if $strArticle['tags']} +
+ {loop $strArticle['tags'] $key $item} + {$item['tagname']} + {/loop} +
+
+ {/if} + + + {if $isread==1} +
查看文章需要支付 {$strArticle['score']}积分 支付
+ {else} + +
+ + {$strArticle[content]} + + {$tpUrl} + +
+ {/if} + + + +
{php doAction('article_show_footer')}
+ + +
{php doAction('gobad','468')}
+ + +
+ + +
+ + {$strArticle['count_view']} + + {$strArticle['count_comment']} + +
+ + {if $TS_USER[isadmin]==1 || $TS_USER['userid']==$strArticle['userid']} + + {/if} + + +
+ +
+ + {if $strUp} +
上一篇:{$strUp['title']}
+ {/if} + {if $strNext} + + {/if} + + + + +
+
+ + +
+
评论{if $strArticle['count_comment']} ({$strArticle['count_comment']}){/if}
+
+ + + + + + {php include pubTemplate("comment")} + + + + + +
+ + {if tsIntval($TS_USER[userid])==0} +
+ 登录 | 注册 +
+ {else} + +
+
+ +
+ +
+
+ {if $TS_SITE['isauthcode']} + + 点击刷新验证码 + {/if} +
+ +
是否公开:公开 不公开
+ + +
+ + + + {if $TS_SITE['isniming']==1} +
+ 匿名发布: + 否 + 是 +
+ {/if} + + +
+ + + + + +
+ +
+ {/if} + +
+ +
+
+ + + + + +
+
最新文章
+
+ +
+ +
+ +
+
+ + +
+ +
+ + +
+
推荐阅读
+
+
+ +
+
+
+ + +
+
一周热门
+
+
+ +
+
+ +
+ +
+
一月热门
+
+
+ +
+
+ +
+ + + {php doAction('gobad','300')} +
+ +
+
+{php doAction('tseditor','mini')} +{php include pubTemplate("footer")} diff --git a/app/article/html/tag.html b/app/article/html/tag.html new file mode 100644 index 0000000..80617c4 --- /dev/null +++ b/app/article/html/tag.html @@ -0,0 +1,155 @@ +{php include pubTemplate("header")} + +
+ + + + +
+ + +
+ + + + + + + + {loop $arrArticle $key $item} + + +
+
+ + + {if $item['photo']} +
+ +
+ + + +
+
+ + + +
{$item['user']['username']} 发表于 {$item['addtime']}
+ +
{if $item['gaiyao']}{tsTitle($item['gaiyao'])}{else}暂无概要{/if} (查看全文)
+ + + + + +
+ + +
+ + {$item['count_view']} + {$item['count_comment']} + + +
+ +
+ + + + + + + +
+ +
+ + + {else} + + + +
{$item['user']['username']} 发表于 {$item['addtime']}
+ +
{if $item['gaiyao']}{$item['gaiyao']}{else}暂无概要{/if} (查看全文)
+ + + + +
+ + +
+ + {$item['count_view']} + {$item['count_comment']} +
+ +
+ + + + {/if} + +
+
+ + + + + + + + + + {/loop} + + + + + + +
{$pageUrl}
+ +
+ + +
+ +
+
热门标签
+
+
+{loop $arrTag $key $item} +{$item['tagname']} +{/loop} + +
+
+
+ + +
+ + + + + + +
+
+ +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/article/html/tags.html b/app/article/html/tags.html new file mode 100644 index 0000000..f35fa4b --- /dev/null +++ b/app/article/html/tags.html @@ -0,0 +1,34 @@ +{php include pubTemplate("header")} + +
+ + + +
+
+ +
+{loop $arrTag $key $item} +{$item[tagname]} +{/loop} + +
+
+
+
{$pageUrl}
+ + + + +
+
+
+ + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/article/icon.png b/app/article/icon.png new file mode 100644 index 0000000..03dd356 Binary files /dev/null and b/app/article/icon.png differ diff --git a/app/article/js/admin.js b/app/article/js/admin.js new file mode 100644 index 0000000..e69de29 diff --git a/app/article/js/extend.func.js b/app/article/js/extend.func.js new file mode 100644 index 0000000..adbfc53 --- /dev/null +++ b/app/article/js/extend.func.js @@ -0,0 +1,16 @@ +function recommend(articleid){ + $.post(siteUrl+'index.php?app=article&ac=recommend',{'articleid':articleid},function(rs){ + if(rs==0){ + + tsNotice('请登陆后再推荐'); + + }else if(rs == 1){ + + tsNotice('你已经推荐过'); + + }else if(rs == 2){ + + window.location.reload() + } + }) +} \ No newline at end of file diff --git a/app/article/skin/style.css b/app/article/skin/style.css new file mode 100644 index 0000000..bee8a55 --- /dev/null +++ b/app/article/skin/style.css @@ -0,0 +1,23 @@ + +.catelist{} +.catelist ul{} +.catelist ul li{font-size:12px;height:30px;line-height:30px; width:140px;} +.catelist .on{background:#999999;padding:5px 10px;color:#FFFFFF;} + +.article_show_content{font-size:16px;line-height:30px;overflow: hidden;word-wrap: break-word;word-break: normal;} +.article_show_content img{max-width: 100%;} + +.article_show_content p{font-size:16px;} +.article_show_content a{color:#49a5de} + + +.article_video{ + background-color: #FFFFFF; + border:dashed 2px #66afe9; + padding:10px; +} + +.article_video iframe{width: 100%;height:450px;} +@media (max-width: 575.98px) { + .article_video iframe{width: 100%;height:230px;} +} \ No newline at end of file diff --git a/app/article/skins/default/style.css b/app/article/skins/default/style.css new file mode 100644 index 0000000..bee8a55 --- /dev/null +++ b/app/article/skins/default/style.css @@ -0,0 +1,23 @@ + +.catelist{} +.catelist ul{} +.catelist ul li{font-size:12px;height:30px;line-height:30px; width:140px;} +.catelist .on{background:#999999;padding:5px 10px;color:#FFFFFF;} + +.article_show_content{font-size:16px;line-height:30px;overflow: hidden;word-wrap: break-word;word-break: normal;} +.article_show_content img{max-width: 100%;} + +.article_show_content p{font-size:16px;} +.article_show_content a{color:#49a5de} + + +.article_video{ + background-color: #FFFFFF; + border:dashed 2px #66afe9; + padding:10px; +} + +.article_video iframe{width: 100%;height:450px;} +@media (max-width: 575.98px) { + .article_video iframe{width: 100%;height:230px;} +} \ No newline at end of file diff --git a/app/attach/about.php b/app/attach/about.php new file mode 100644 index 0000000..8ffc2fc --- /dev/null +++ b/app/attach/about.php @@ -0,0 +1,34 @@ + '附件', + + 'version' => '1.0', + + 'desc' => '附件', + + 'url' => 'https://lmve.net', + + 'email' => '1337087466@qq.com', + + 'author' => '无闻风', + + 'author_url' => 'https://lmve.net', + + 'isoption' => '1', + + 'isinstall' => '1', + + 'issql' => '0', + + 'issystem' => '1', + + 'isappnav' => '1', + + 'ismy'=>'1', + +); \ No newline at end of file diff --git a/app/attach/action/album.php b/app/attach/action/album.php new file mode 100644 index 0000000..a30e47f --- /dev/null +++ b/app/attach/action/album.php @@ -0,0 +1,192 @@ +find('attach_album',array( + 'albumid'=>$albumid, + )); + //404 + if($albumid!=0) + { + + if($strAlbum==''){ + header("HTTP/1.1 404 Not Found"); + header("Status: 404 Not Found"); + $title = '404'; + include pubTemplate("404"); + exit; + if($strAlbum['isaudit']==1){ + tsNotice('内容审核中...'); + } + } + } + + + + + $strAlbum['albumname'] = tsTitle($strAlbum['albumname']); + $strAlbum['albumdesc'] = tsTitle($strAlbum['albumdesc']); + + + $page = isset($_GET['page']) ? intval($_GET['page']) : '1'; + + $url = tsUrl('attach','album',array('id'=>$albumid,'page'=>'')); + + $lstart = $page*24-24; + + $strUser = aac('user')->getSimpleUser($strAlbum['userid']); + if($albumid!=0) + { + $arrattach = $new['attach']->findAll('attach',array( + 'albumid'=>$albumid, + ),'attachid desc',null,$lstart.',24'); + + $attachNum = $new['attach']->findCount('attach',array( + 'albumid'=>$albumid, + )); + + }else + { + $userid = aac('user')->isLogin(); + $arrattach = $new['attach']->findAll('attach',array( + 'userid'=>$userid, + 'albumid'=>0, + ),'attachid desc',null,$lstart.',24'); + + $attachNum = $new['attach']->findCount('attach',array( + 'userid'=>$userid, + )); + $strAlbum['albumname']="个人附件库"; + $strAlbum['userid']=$userid; + + } + + + foreach($arrattach as $key=>$item){ + $arrattach[$key]['attachdesc'] = tsTitle($item['attachdesc']); + } + + $pageUrl = pagination($attachNum, 24, $page, $url); + + + $title = $strAlbum['albumname']; + + + include template("album"); + + $new['attach']->update('attach_album',array( + 'albumid'=>$strAlbum['albumid'], + ),array( + 'count_view'=>$strAlbum['count_view']+1, + )); + + + break; + + + //修改attach + case "edit": + + //用户是否登录 + $userid = aac('user')->isLogin(); + + $albumid = intval($_GET['albumid']); + + $strAlbum = $new['attach']->find('attach_album',array( + 'albumid'=>$albumid, + )); + + if($strAlbum['userid'] == $userid || $TS_USER['isadmin']==1) { + + $strAlbum['albumname'] = tsTitle($strAlbum['albumname']); + $strAlbum['albumdesc'] = tsTitle($strAlbum['albumdesc']); + + $title = '修改attach属性-'.$strAlbum['albumname']; + include template("album_edit"); + + }else{ + + tsNotice('非法操作!'); + + } + + break; + + case "editdo": + + //用户是否登录 + $userid = aac('user')->isLogin(); + + $albumid = intval($_POST['albumid']); + + $strAlbum = $new['attach']->find('attach_album',array( + 'albumid'=>$albumid, + )); + + if($strAlbum['userid']==$userid || $TS_USER['isadmin']==1){ + + $albumname = trim($_POST['albumname']); + if($albumname == '') qiMsg("attach名称不能为空!"); + + $albumdesc = trim($_POST['albumdesc']); + + + if($TS_USER['isadmin']==0){ + //过滤内容开始 + aac('system')->antiWord($albumname); + aac('system')->antiWord($albumdesc); + //过滤内容结束 + } + + $new['attach']->update('attach_album',array( + 'userid'=>$strAlbum['userid'], + 'albumid'=>$strAlbum['albumid'], + ),array( + 'albumname'=>$albumname, + 'albumdesc'=>$albumdesc, + )); + + header("Location: ".tsUrl('attach','album',array('id'=>$albumid))); + }else{ + tsNotice('非法操作!'); + } + break; + + + + + + //删除attach + case "del": + + //用户是否登录 + $userid = aac('user')->isLogin(); + + $albumid = intval($_GET['albumid']); + + $strAlbum = $new['attach']->find('attach_album',array( + 'albumid'=>$albumid, + )); + + if($strAlbum['userid'] == $userid || $TS_USER['isadmin'] == 1) { + + $new['attach']->delete('attach_album',array( + 'albumid'=>$albumid, + )); + + $new['attach']->delete('attach',array( + 'albumid'=>$albumid, + )); + + + } + + + header("Location: ".tsUrl('attach')); + + break; +} \ No newline at end of file diff --git a/app/attach/action/comment.php b/app/attach/action/comment.php new file mode 100644 index 0000000..5ce3376 --- /dev/null +++ b/app/attach/action/comment.php @@ -0,0 +1,92 @@ +isLogin($js,$userkey); +switch($ts){ + + case "do": + + $authcode = strtolower($_POST['authcode']); + + if ($TS_SITE ['isauthcode']) { + if ($authcode != $_SESSION ['verify']) { + getJson ( "验证码输入有误,请重新输入!" ,$js,0); + } + } + + $attachid = intval($_POST['attachid']); + $content = tsClean($_POST['content'],$js); + $content2 = emptyText($_POST['content']);//测试空内容 + $ispublic = intval($_POST['ispublic']); + + //过滤内容开始 + if($TS_USER['isadmin']==0){ + aac('system')->antiWord($content,$js); + } + //过滤内容结束 + + if($content2==''){ + getJson('没有任何内容是不允许你通过滴^_^',$js); + }else{ + $commentid = $new['attach']->create('attach_comment',array( + 'attachid' => $attachid, + 'userid' => $userid, + 'content' => $content, + 'addtime'=> time(), + )); + + + + //发送系统消息(通知楼主有人回复他的帖子啦) + $strattach = $new['attach']->find('attach',array( + 'attachid'=>$attachid, + )); + + if($strattach['userid'] != $TS_USER['userid']){ + + $msg_userid = '0'; + $msg_touserid = $strattach['userid']; + $msg_content = '你的附件:《'.$strattach['attachname'].'》新增一条评论,快去看看给个回复吧^_^ '; + $msg_tourl = tsUrl('attach','show',array('id'=>$attachid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + + } + + header("Location: ".tsUrl('attach','show',array('id'=>$attachid))); + + } + + break; + + //删除评论 + case "delete": + + $commentid = intval($_GET['commentid']); + + $strComment = $new['attach']->find('attach_comment',array( + 'commentid'=>$commentid, + )); + + $strattach = $new['attach']->find('attach',array( + 'attachid'=>$strComment['attachid'], + )); + + + + if($strattach['userid']==$userid || $TS_USER['isadmin']==1 || $strComment['userid']==$userid){ + + $new['attach']->delete('attach_comment',array( + 'commentid'=>$commentid, + )); + + + + + + } + + //跳转回到帖子页 + header("Location: ".tsUrl('attach','show',array('id'=>$strComment['attachid']))); + + break; +} \ No newline at end of file diff --git a/app/attach/action/down.php b/app/attach/action/down.php new file mode 100644 index 0000000..05b0225 --- /dev/null +++ b/app/attach/action/down.php @@ -0,0 +1,103 @@ +isLogin(); + if(aac('user')->isPublisher()==false) {tsNotice('你可能被限制或没有验证邮箱,检查邮箱是否认证。','->点击认证<-',tsUrl('user','verify'));} + + $attachid=intval($_GET['id']); + + $the_file=$new['attach']->find('attach',array( + 'attachid'=>$attachid, + + )); + if($the_file) //检查数据表 + { + $file_dir = "uploadfile/attach/".$the_file['attachurl']; + if (!file_exists($file_dir)) { //检查文件是否存在 + echo "文件已删除"; + exit; + }else{ + if($the_file['userid']==$userid) + { + $new['attach']->update('attach',array( + 'attachid'=>$attachid, + ),array( + 'count_view'=>$the_file['count_view']+1, + )); + download($file_dir,$the_file['attachname']); + exit; + }else + { + if($the_file['pay']==0)//免费的 + { + $new['attach']->update('attach',array( + 'attachid'=>$attachid, + ),array( + 'count_view'=>$the_file['count_view']+1, + )); + download($file_dir,$the_file['attachname']); + exit; + + }else + { + if(aac('user')->delScore($userid,"download file:" . $the_file['attachname'],$the_file['pay'])) + { + $new['attach']->update('attach',array( + 'attachid'=>$attachid, + ),array( + 'count_view'=>$the_file['count_view']+1, + )); + download($file_dir,$the_file['attachname']); + aac('user')->addScore($the_file['userid'],$userme['username']."download:" . $the_file['attachname'],$the_file['pay'],1); + exit; + }else + { + tsNotice('下载文件需要支付'.$the_file['pay'].'积分,你似乎不够!'); + } + + } + } + + + + } + + }else + { + echo "文件已删除"; + exit; + + } + + \ No newline at end of file diff --git a/app/attach/action/edit.php b/app/attach/action/edit.php new file mode 100644 index 0000000..e6d70d7 --- /dev/null +++ b/app/attach/action/edit.php @@ -0,0 +1,24 @@ + + +isLogin(); + +$attachid = intval ( $_GET ['id'] ); + +$stredit = $new ['attach']->find ( 'attach', array ('attachid' => $attachid ) ); +$stredit['content'] = tsDecode($stredit['content']); +if($stredit=='') +{ + + tsNotice('NO!'); +} +if($userid!=$stredit['userid']) +{ + tsNotice('NO'); + +} +include template ( "edit" ); + +?> \ No newline at end of file diff --git a/app/attach/action/editdo.php b/app/attach/action/editdo.php new file mode 100644 index 0000000..0f70897 --- /dev/null +++ b/app/attach/action/editdo.php @@ -0,0 +1,31 @@ +isLogin(); + +$attachid = intval ( $_POST ['attachid'] ); + +$stredit = $new ['attach']->find ( 'attach', array ('attachid' => $attachid ) ); + +if($stredit=='') +{ + + tsNotice('NO!'); +} +if($userid!=$stredit['userid']) +{ + tsNotice('NO'); + +} + + +$attachname = trim($_POST['attachname']); + +$pay=intval($_POST['pay']); + +$new['attach'] -> update('attach', array('attachid' => $attachid), array( + 'attachname' => $attachname, + 'pay' => $pay, + )); +header("Location: " . tsUrl('attach', 'show', array('id' => $attachid))); +?> \ No newline at end of file diff --git a/app/attach/action/editor.php b/app/attach/action/editor.php new file mode 100644 index 0000000..cd88e5e --- /dev/null +++ b/app/attach/action/editor.php @@ -0,0 +1,36 @@ +isLogin(); + +switch($ts){ + case "list": + + $kw=urldecode(tsFilter($_GET['kw'])); + + $page = isset($_GET['page']) ? intval($_GET['page']) : '1'; + + $url = tsUrl('attach','editor',array('ts'=>'list','page'=>'')); + + $lstart = $page*10-10; + + if($kw=='') + { + $attachlist = $new['attach']->findAll('attach',array('userid'=>$userid),'addtime desc',null,$lstart.',10'); + $albumNum = $new['attach']->findCount('attach'); + }else + { + $kw = t($kw); + $attachlist = $db->fetch_all_assoc("select * from ".dbprefix."attach WHERE `userid` = '$userid' AND `attachname` like '%$kw%' order by addtime desc limit $lstart,10"); + $albumNum = $db->once_num_rows("select * from ".dbprefix."attach WHERE `userid` = '$userid' AND attachname like '%$kw%'"); + } + + $pageUrl = pagination($albumNum, 10, $page, $url); + + include template("editor"); + break; + case "upload": + $albumid=0; + include template("upload"); + break; +} \ No newline at end of file diff --git a/app/attach/action/index.php b/app/attach/action/index.php new file mode 100644 index 0000000..f2bc6ed --- /dev/null +++ b/app/attach/action/index.php @@ -0,0 +1,25 @@ +'')); + +$lstart = $page*30-30; + +$arrAlbum = $new['attach']->findAll('attach_album',"`isaudit`=0",'albumid desc',null,$lstart.',30'); + +foreach($arrAlbum as $key=>$item){ + $arrAlbum[$key]['albumname'] = tstitle($item['albumname']); + $arrAlbum[$key]['albumdesc'] = tstitle($item['albumdesc']); +} + +$albumNum = $new['attach']->findCount('attach_album'); + +$pageUrl = pagination($albumNum, 30, $page, $url); + +$title = '最新专辑'; + +$sitekey = $TS_APP['appkey']; +$sitedesc = $TS_APP['appdesc']; +include template("index"); \ No newline at end of file diff --git a/app/attach/action/new.php b/app/attach/action/new.php new file mode 100644 index 0000000..93682cd --- /dev/null +++ b/app/attach/action/new.php @@ -0,0 +1,65 @@ +isLogin(); + +//判断发布者状态 +if(aac('user')->isPublisher()==false) tsNotice('不好意思,你还没有权限发布内容!'); + +//发布时间限制 +if(aac('system')->pubTime()==false) tsNotice('不好意思,当前时间不允许发布内容!'); + + +switch($ts){ + + + case "": + + $title = '新建库'; + include template("create"); + + break; + + case "do": + + + $albumname = trim($_POST['albumname']); + $albumdesc = trim($_POST['albumdesc']); + + if($albumname == '') { + tsNotice("库名称不能为空!"); + } + + //1审核后显示0不审核 + if ($TS_APP['isaudit']==1) { + $isaudit = 1; + } else { + $isaudit = 0; + } + + if($TS_USER['isadmin']==0){ + //过滤内容开始 + aac('system')->antiWord($albumname); + aac('system')->antiWord($albumdesc); + //过滤内容结束 + } + + $albumid = $new['attach']->create('attach_album',array( + + 'userid'=>$userid, + 'albumname'=>$albumname, + 'albumdesc'=>$albumdesc, + 'isaudit'=>$isaudit, + 'addtime'=>date('Y-m-d H:i:s'), + 'uptime'=>date('Y-m-d H:i:s'), + + )); + + header("Location: ".tsUrl('attach','album',array('id'=>$albumid))); + + + break; + + +} \ No newline at end of file diff --git a/app/attach/action/show.php b/app/attach/action/show.php new file mode 100644 index 0000000..1e7e91b --- /dev/null +++ b/app/attach/action/show.php @@ -0,0 +1,76 @@ +find('attach',array( + 'attachid'=>$attachid, + )); + +if ($strattach == '') { + header ( "HTTP/1.1 404 Not Found" ); + header ( "Status: 404 Not Found" ); + $title = '404'; + include pubTemplate ( "404" ); + exit (); +} + +$arrattachuser = aac ( 'user' )->getSimpleUser ( $strattach ['userid'] ); + + +//是否关注 +if($TS_USER['userid'] != '' && $TS_USER['userid'] != $arrattachuser['userid']){ + $userid=$arrattachuser['userid']; + $followNum = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='".$TS_USER['userid']."' and userid_follow='$userid'"); + if($followNum > '0'){ + $arrattachuser['isfollow'] = true; + }else{ + $arrattachuser['isfollow'] = false; + } +}else{ + $arrattachuser['isfollow'] = false; +} + +// 是否审核 +if ($strattach ['isaudit'] == 1 && $TS_USER['isadmin']==0 && $TS_USER['userid']!=$strattach['userid']) { + tsNotice ( '内容审核中...' ); +} + +$file_dir = "uploadfile/attach/".$strattach['attachurl']; +$filemd5=md5_file($file_dir); +if($filemd5) +{ + +}else +{ + $filemd5="File_Erro!"; + +} + +// 获取评论 +$page = isset ( $_GET ['page'] ) ? intval ( $_GET ['page'] ) : 1; +$url = tsUrl ( 'attach', 'show', array ( + 'id' => $attachid, + 'page' => '' +) ); +$lstart = $page * 10 - 10; + +$arrComments = $new ['attach']->findAll ( 'attach_comment', array ( + 'attachid' => $attachid +), 'addtime desc', null, $lstart . ',10' ); + +foreach ( $arrComments as $key => $item ) { + $arrComment [] = $item; + $arrComment[$key]['content'] = tsDecode($item['content']); + $arrComment [$key] ['user'] = aac ( 'user' )->getSimpleUser ( $item ['userid'] ); +} + +$commentNum = $new ['attach']->findCount ( 'attach_comment', array ( + 'attachid' => $attachid +) ); + +$pageUrl = pagination ( $commentNum, 10, $page, $url ); + +// 标签 +//$strattach ['tags'] = aac ( 'tag' )->getObjTagByObjid ( 'attach', 'attachid', $strattach ['attachid'] ); +$title = $strattach['attachname']; +include template ( "show" ); diff --git a/app/attach/action/upload.php b/app/attach/action/upload.php new file mode 100644 index 0000000..9daf537 --- /dev/null +++ b/app/attach/action/upload.php @@ -0,0 +1,69 @@ +isLogin(); + +switch($ts){ + case "": + $albumid=intval($_GET['albumid']); + include template("upload"); + break; + case "add": + $albumid=intval($_GET['albumid']); + include template("add"); + break; + case "do": + $albumid = intval($_POST['albumid']); + + + $strAlbum = $new['attach']->find('attach_album',array( + 'albumid'=>$albumid, + )); + + if($strAlbum!=''){ + if($strAlbum['userid']!=$userid){ + getJson('非法操作3!'); + + } + } + + + + if($_FILES['file']==''){ts404();} + //上传 + $attachid = $new['attach']->create('attach',array( + 'userid'=>$userid, + 'albumid'=>$albumid, + 'locationid'=>aac('user')->getLocationId($userid), + 'addtime' => date('Y-m-d H:i:s',time()), + )); + //上传 + $arrUpload = tsUpload($_FILES['file'],$attachid,'attach',array('zip','rar','doc','txt','ppt','pdf','docx','mp4')); + + if($arrUpload && $arrUpload['path'] && $arrUpload['url']){ + $new['attach']->update('attach',array( + 'attachid'=>$attachid, + ),array( + 'attachname'=>$arrUpload['name'], + 'attachtype'=>$arrUpload['type'], + 'path'=>$arrUpload['path'], + 'attachurl'=>$arrUpload['url'], + 'attachsize'=>$arrUpload['size'], + )); + } + + + $count_attach = $new['attach']->findCount('attach',array( + 'albumid'=>$albumid, + )); + + $new['attach']->update('attach_album',array( + 'albumid'=>$albumid, + ),array( + 'count_attach'=>$count_attach + )); + + + break; + +} \ No newline at end of file diff --git a/app/attach/class.attach.php b/app/attach/class.attach.php new file mode 100644 index 0000000..745b084 --- /dev/null +++ b/app/attach/class.attach.php @@ -0,0 +1,6 @@ + + + + + + +
+ +
+
+ + +
上传文件只支持:zip,rar,doc,txt,ppt,pdf,docx格式 (上传格式请在后台配置)
+ + + +
+ +
+ + + + + +
+ + +
+ + 取消上传 + +
+ + +
+
+ + + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/attach/html/album.html b/app/attach/html/album.html new file mode 100644 index 0000000..14fa07d --- /dev/null +++ b/app/attach/html/album.html @@ -0,0 +1,114 @@ +{php include pubTemplate("header")} + +
+ + + + + +
+
+ + +

{$title}

+ +
+ +
+ + {$strAlbum[count_view]} 人浏览 + + {$strAlbum[count_attach]} 文件 +  {$strAlbum[addtime]} 创建 + + +
+ + + +
+ + +{if $arrattach} +
{$pageUrl}
+ + + + + + + + + + + + +{loop $arrattach $key $item} + + + + + + + + + + + + +{/loop} + +
file id名称Size积分下载量操作
{$item[attachid]}{$item[attachname]}{$item[attachsize]}{if $item[pay]==0}Free{else}{$item[pay]}{/if}{$item[count_view]} + 下载 + 修改 +
+{else} +
+
这个附件库现在还没有文件 +{if $strAlbum[userid] == $TS_USER[userid]}, 你可以添加文件{/if} +
+
+{/if} +
+ + +
{$pageUrl}
+ +
{$strAlbum[albumdesc]}
+ + +
+ +
+ + {if $strAlbum[userid] == $TS_USER[userid] || $TS_USER[isadmin]==1}   + {if $albumid!=0} + > 修改附件库 + {/if} +  > 添加文件 + {/if} + + + {if $strAlbum[userid] == $TS_USER[userid] || $TS_USER[isadmin]==1} + {if $albumid!=0} +  > 删除附件库 + {/if} + {/if} + + {if $albumid!=0} +  > {$strUser['username']}的附件库 + {/if} +
+ + +
+
+
+ +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/attach/html/album_edit.html b/app/attach/html/album_edit.html new file mode 100644 index 0000000..e1d8c68 --- /dev/null +++ b/app/attach/html/album_edit.html @@ -0,0 +1,68 @@ +{php include pubTemplate("header")} + +
+ + + + + + +
+
+ + + + + + + +
+ +
+
+ +
+
+ + +
+ +
+ + +
+ + + + + + + 返回附件 +
+ + +
+
+ +
+ + + + + + +
+ +
+ +
+
+ +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/attach/html/create.html b/app/attach/html/create.html new file mode 100644 index 0000000..544d761 --- /dev/null +++ b/app/attach/html/create.html @@ -0,0 +1,65 @@ +{php include pubTemplate("header")} + +
+ + + + + + +
+
+ +{template menu} + + + + + +
+
+
+ +
+
+ + +
+ +
+ + +
+ + + + + 返回我的库 +
+ +

+ +

+
+
+
+ + + + + + + +
+
+ + +
+ +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/attach/html/edit.html b/app/attach/html/edit.html new file mode 100644 index 0000000..06d315b --- /dev/null +++ b/app/attach/html/edit.html @@ -0,0 +1,61 @@ +{php include pubTemplate("header")} + +
+ + +
+
+ + +
+
+
+ + + +
+ +
+ + +
+ + +
+ + +
+ + + + + + + +

+ +
+ + + + +
+
+
+ + + +
+
+ +
+ + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/attach/html/editor.html b/app/attach/html/editor.html new file mode 100644 index 0000000..92aac31 --- /dev/null +++ b/app/attach/html/editor.html @@ -0,0 +1,96 @@ + + + + + Title + + + + + + + + + + + +
+
+
+ +
+ + + +
+ +
+ +
+
+
+ +
+ +
+
+ +
+ + 上传新附件 + +
+
+ + +
{$pageUrl}
+ + + + + + + + + + + + + {loop $attachlist $key $item} + + + + + + + {/loop} + + +
名称Size积分操作
{$item[attachname]}{$item[attachsize]}{if $item[pay]==0}Free{else}{$item[pay]}{/if} + 插入 +
+ + + +
+
+ + +
+ + + + + + \ No newline at end of file diff --git a/app/attach/html/index.html b/app/attach/html/index.html new file mode 100644 index 0000000..b4f46e8 --- /dev/null +++ b/app/attach/html/index.html @@ -0,0 +1,49 @@ +{php include pubTemplate("header")} + +
+ + + + +
+
+ +{template menu} + + +
+{loop $arrAlbum $key $item} +
+ + {$item[albumname]} + + +
+
{$item[albumname]}
+
{$item[count_attach]}个附件
+
{php echo date('Y-m-d',strtotime($item['addtime']))} 创建
+
+ +
+{/loop} +
+ + + +
+
{$pageUrl}
+ +
+
+
+ +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/attach/html/show.html b/app/attach/html/show.html new file mode 100644 index 0000000..d8c5d60 --- /dev/null +++ b/app/attach/html/show.html @@ -0,0 +1,172 @@ +{php include pubTemplate("header")} +
+ + + +
+
+
+
+ {if $strattach['tags']} +
+ {loop $strattach[tags] $key $strattach} + {$strattach[tagname]} + {/loop} +
+
+ {/if} +
+

{$strattach[attachname]}

+ + + + + + + + + + + + + + + + + + + +
file idMD5值Size下载需要积分下载量
{$strattach[attachid]}{$filemd5}{$strattach[attachsize]}{if $strattach[pay]==0}Free{else}{$strattach[pay]}{/if}{$strattach[count_view]}
+ 下载{if $strattach[pay]>0}-{$strattach[pay]}积分{/if} +
+
+
{php doAction('group_topic_footer')}
+
+ + + + + + +
+
+
up主
+
+
+
+ {$arrattachuser[username]} +
+
+ {$arrattachuser[username]} + +
+
+
    +
    + {if $arrattachuser[userid] != $TS_USER[userid]} + {if $arrattachuser[isfollow]} + 取消关注 + {else} + 关注 + {/if} + + {/if} +
    +
+
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    评论
    +
    + + {if $arrComment} +
    +
      + {loop $arrComment $key $strattach} +
    • +
      + {$strattach[user][username]} +
      +
      +

      + + {$strattach[user][username]} +

      +

      {$strattach[content]}

      +

      {php echo date('Y-m-d H:i:s',$strattach[addtime])}

      + {if $TS_USER[userid] == $strattach[userid] || + $TS_USER['isadmin']==1} +
      + 删除 +
      + {/if} +
      +
    • {/loop} +
    +
    +
    {$pageUrl}
    + {/if} + + +
    + {if intval($TS_USER[userid])==0} +
    + 登录 | 注册 +
    + {else} +
    + + +
    + +
    + + + +
    + + +
    + {if $TS_SITE['isauthcode']} + 验证码: + 点击刷新验证码 + {/if} + +
    + + +
    + + + + +
    + +
    + +
    + {/if} +
    + + +
    +
    +
    + +{php doAction('tseditor','mini')} +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/attach/html/upload.html b/app/attach/html/upload.html new file mode 100644 index 0000000..5cea83e --- /dev/null +++ b/app/attach/html/upload.html @@ -0,0 +1,63 @@ + + + + + + Title + + + + + + + + + + + + + + + + + +
    + + +
    上传文件只支持:zip,rar,doc,txt,ppt,pdf,docx格式 (上传格式请在后台配置)
    + +
    + +
    + + + + + +
    + + + + + \ No newline at end of file diff --git a/app/attach/js/extend.func.js b/app/attach/js/extend.func.js new file mode 100644 index 0000000..139597f --- /dev/null +++ b/app/attach/js/extend.func.js @@ -0,0 +1,2 @@ + + diff --git a/app/attach/skins/default/attach_album.png b/app/attach/skins/default/attach_album.png new file mode 100644 index 0000000..a7d1f74 Binary files /dev/null and b/app/attach/skins/default/attach_album.png differ diff --git a/app/attach/skins/default/style.css b/app/attach/skins/default/style.css new file mode 100644 index 0000000..e69de29 diff --git a/app/comment/about.php b/app/comment/about.php new file mode 100644 index 0000000..c7285d9 --- /dev/null +++ b/app/comment/about.php @@ -0,0 +1,17 @@ + '评论', + 'version' => '1.2', + 'desc' => '评论管理', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '0', + 'ismy'=>'1' +); \ No newline at end of file diff --git a/app/comment/action/add.php b/app/comment/action/add.php new file mode 100644 index 0000000..583bb6c --- /dev/null +++ b/app/comment/action/add.php @@ -0,0 +1,145 @@ +isLogin($js,$userkey); + +$authcode = strtolower((string) $_POST['authcode']); + +if ($TS_SITE ['isauthcode'] && $authcode) { + if ($authcode != $_SESSION ['verify']) { + getJson ( "验证码输入有误,请重新输入!" ,$js,0); + } +} + +$ptable = tsTrim($_POST['ptable']); +if(!preg_match("/^[a-z_]*$/i", $ptable)){ + getJson('非法操作!',$js); +} + +$pkey = tsTrim($_POST['pkey']); +if(!preg_match("/^[a-z_]*$/i", $pkey)){ + getJson('非法操作!',$js); +} + +$pid = tsIntval($_POST['pid']); + + +$referid = tsIntval($_POST['referid']); +$touserid = tsIntval($_POST['touserid']); + + +$content = tsClean($_POST['content'],$js); +$content2 = emptyText($_POST['content']);//测试空内容 +$ispublic = tsIntval($_POST['ispublic']); + + +//匿名用户 +$isniming = tsIntval($_POST['isniming']); +if($TS_SITE['isniming']==1 && $isniming==1) $userid = aac('user')->getNimingId(); + + +//过滤内容开始 +if($TS_USER['isadmin']==0){ + $content = antiWord($content); +} +//过滤内容结束 + +if($ptable=='' || $pkey=='' || $pid=='' || $content2=='' || $content==''){ + getJson('没有任何内容是不允许你通过滴^_^',$js); +}else{ + + + $isaudit = 0; + if($TS_APP['comment_isaudit']==1 && $TS_USER['isadmin']==0) $isaudit=1; + + $commentid = $new['comment']->create('comment',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + + 'referid'=>$referid, + 'userid'=>$userid, + 'touserid'=>$touserid, + + 'content' => $content, + 'ispublic'=>$ispublic, + 'isaudit'=>$isaudit, + 'addtime'=> time(), + )); + + //统计评论数 + $count_comment = $new['comment']->findCount('comment',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + )); + + //更新项目最后回应时间和评论数 + $new['comment']->update($ptable,array( + $pkey=>$pid, + ),array( + 'count_comment'=>$count_comment, + 'uptime'=>time(), + )); + + #更新ptable评论数 + aac('pubs')->upPtableComment($ptable,$pkey,$pid,$count_comment); + + //发送系统消息(通知楼主有人回复他的帖子啦) + $strProject = $new['comment']->find($ptable,array( + $pkey=>$pid, + )); + + if($referid){ + + $strComment = $new['comment']->find('comment',array( + 'commentid'=>$referid, + )); + + //创建消息 + if($strComment['userid'] != $userid){ + $msg_userid = $userid; + $msg_touserid = $strComment['userid']; + $msg_content = '回复了你:'.t($content); + $msg_tourl = getProjectUrl($ptable,$pid); + $msg_extend = json_encode(array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + )); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl,$msg_extend); + } + + #上级评论用户加分 + aac ( 'user' )->doScore ( $TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'], $TS_URL['ts'],$strComment['userid']); + + + }else{ + + //创建消息 + if($strProject['userid'] != $userid){ + $msg_userid = $userid; + $msg_touserid = $strProject['userid']; + $msg_content = '评论了你发布的:《'.$strProject['title'].'》'; + $msg_tourl = getProjectUrl($ptable,$pid); + $msg_extend = json_encode(array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + )); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl,$msg_extend); + } + + } + + $daytime = strtotime(date('Y-m-d 00:00:01')); + $count_comment = $new['comment']->findCount('comment',"`userid`='$userid' and `addtime`>'$daytime'"); + + #每日前1条给积分 + if($count_comment<2){ + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'], $TS_URL['ts']); + } + + getJson('评论成功',$js,2,getProjectUrl($ptable,$pid)); + +} \ No newline at end of file diff --git a/app/comment/action/admin.php b/app/comment/action/admin.php new file mode 100644 index 0000000..3f99995 --- /dev/null +++ b/app/comment/action/admin.php @@ -0,0 +1,9 @@ +findAll('comment',$where,'addtime desc',null,$lstart.',10'); + + $commentNum = $new['comment']->findCount('comment',$where); + + $pageUrl = pagination($commentNum, 10, $page, $url); + + include template("admin/comment_list"); + + break; + + + case "delete": + + $commentid = tsIntval($_GET['commentid']); + + $strComment = $new['comment']->find('comment',array( + 'commentid'=>$commentid, + )); + + $ptable = $strComment['ptable']; + $pkey = $strComment['pkey']; + $pid = $strComment['pid']; + + $new['comment']->delete('comment',array( + 'commentid'=>$commentid, + )); + + $new['comment']->delComment($ptable,$pkey,$pid,$commentid); + + #处理积分 + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'], $TS_URL['ts'],$strComment['userid']); + + qiMsg('删除成功'); + + break; + + case "isaudit": + + $commentid = tsIntval($_GET['commentid']); + + $strComment = $new['comment']->find('comment',array( + 'commentid'=>$commentid, + )); + + if($strComment['isaudit']==1){ + $isaudit = 0; + }else{ + $isaudit = 1; + } + + $new['comment']->update('comment',array( + 'commentid'=>$commentid, + ),array( + 'isaudit'=>$isaudit, + )); + + qiMsg('操作成功!'); + + break; + + +} \ No newline at end of file diff --git a/app/comment/action/admin/options.php b/app/comment/action/admin/options.php new file mode 100644 index 0000000..189d53e --- /dev/null +++ b/app/comment/action/admin/options.php @@ -0,0 +1,26 @@ +isLogin($js,$userkey); + +$commentid = tsIntval($_GET['commentid']); + +$strComment = $new['comment']->find('comment',array( + 'commentid'=>$commentid, +)); + +$ptable = $strComment['ptable']; +$pkey = $strComment['pkey']; +$pid = $strComment['pid']; + +if($TS_USER['isadmin']==1 || $strComment['userid']==$userid){ + + $new['comment']->delComment($ptable,$pkey,$pid,$commentid); + + //处理积分 + aac('user')->doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'], $TS_URL['ts'],$strComment['userid']); + +} + +//跳转回到详情页 +header("Location: ".getProjectUrl($ptable,$pid)); \ No newline at end of file diff --git a/app/comment/action/my.php b/app/comment/action/my.php new file mode 100644 index 0000000..0f8df1f --- /dev/null +++ b/app/comment/action/my.php @@ -0,0 +1,11 @@ +isLogin(); + $strUser = aac('user')->getOneUser($userid); + include_once 'app/' . $TS_URL['app'] . '/action/my/' . $TS_URL['my'] . '.php'; +} else { + qiMsg ( 'sorry:no index!' ); +} \ No newline at end of file diff --git a/app/comment/action/my/index.php b/app/comment/action/my/index.php new file mode 100644 index 0000000..9965fb1 --- /dev/null +++ b/app/comment/action/my/index.php @@ -0,0 +1,22 @@ +'index','page' => '' ) ); +$lstart = $page * 20 - 20; + +$arrComment = $new ['comment']->findAll ( 'comment', array ( + 'userid' => $strUser['userid'], +), 'addtime desc', null, $lstart . ',20' ); + +$commentNum = $new ['comment']->findCount ( 'comment', array ( + 'userid' => $strUser['userid'], +) ); + +$pageUrl = pagination ( $commentNum, 20, $page, $url ); + + + +$title = '我的评论'; +include template('my/index'); \ No newline at end of file diff --git a/app/comment/action/recomment.php b/app/comment/action/recomment.php new file mode 100644 index 0000000..e3b4a48 --- /dev/null +++ b/app/comment/action/recomment.php @@ -0,0 +1,9 @@ +recomment($referid,$userid); + +include template('recomment'); \ No newline at end of file diff --git a/app/comment/class.comment.php b/app/comment/class.comment.php new file mode 100644 index 0000000..7f01c85 --- /dev/null +++ b/app/comment/class.comment.php @@ -0,0 +1,207 @@ +findAll('comment',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + 'referid'=>0, + ),'addtime desc',null,$lstart.',15'); + + foreach($arrComment as $key => $item){ + $arrComment[$key]['l'] = (($page-1) * 15) + $key + 1; + //$arrComment[$key]['l'] = (($page-1) * 15) - $key + $commentNum;//盖楼 + $arrComment[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + $arrComment[$key]['content'] = tsDecode($item['content']); + if($ismb){ + $arrComment[$key]['content'] = mobileHtml($arrComment[$key]['content']); + } + $arrComment[$key]['recomment'] = $this->recomment($item['commentid'],$puid,3,$uid,$ismb); + $arrComment[$key]['recomment_num'] = $this->recommentNum($item['commentid']); + + $arrComment[$key]['zzuid'] = $puid;//作者ID + + $arrComment[$key]['iszz'] = 0;#作者1是0否 + if($item['userid']==$puid){ + $arrComment[$key]['iszz'] = 1;#作者1是0否 + } + + $arrComment[$key]['isdelete'] = 0;#删除权限1有0无 + if($uid && $uid==$item['userid']){ + $arrComment[$key]['isdelete'] = 1;#删除权限1有0无 + } + + $arrComment[$key]['iscomment'] = 0;#回复权限1有0无 + if($uid && $uid!=$item['userid']){ + $arrComment[$key]['iscomment'] = 1;#回复权限1有0无 + } + + + $arrComment[$key]['datetime'] = date('m-d H:i',$item['addtime']); + + } + + return $arrComment; + } + + /** + * 获取评论数 + * + * @param [type] $ptable + * @param [type] $pkey + * @param [type] $pid + * @return void + */ + public function getCommentNum($ptable,$pkey,$pid){ + $commentNum = $this->findCount('comment',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + 'referid'=>0, + )); + return $commentNum; + } + + + /** + * 获取评论下的回复列表 + * + * @param [type] $referid 上级评论ID + * @param [type] $puid 当前项目用户ID + * @param integer $num 调用条数 + * @param integer $uid 当前登录的用户ID + * @param integer $ismb 是否手机浏览 + * @return void + */ + function recomment($referid,$puid,$num=0,$uid=0,$ismb=0){ + + if($num){ + $limit = $num; + }else{ + $limit = null; + } + + $arrComment = $this->findAll('comment',array( + 'referid'=>$referid, + ),'addtime desc',null,$limit); + + foreach($arrComment as $key=>$item){ + $html = tsDecode($item['content']); + if($ismb==1){ + $html = mobileHtml($html); + } + + $arrComment[$key]['content'] = $html; + + $arrComment[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + $arrComment[$key]['datetime'] = date('m-d H:i',$item['addtime']); + + if($item['touserid']){ + $arrComment[$key]['touser'] = aac('user')->getSimpleUser($item['touserid']); + } + + $arrComment[$key]['iszz'] = 0;#作者1是0否 + if($item['userid']==$puid){ + $arrComment[$key]['iszz'] = 1;#作者1是0否 + } + + $arrComment[$key]['isdelete'] = 0;#删除权限1有0无 + if($uid && $uid==$item['userid']){ + $arrComment[$key]['isdelete'] = 1;#删除权限1有0无 + } + + $arrComment[$key]['iscomment'] = 0;#回复权限1有0无 + if($uid && $uid!=$item['userid']){ + $arrComment[$key]['iscomment'] = 1;#回复权限1有0无 + } + + + } + + return $arrComment; + } + + function recommentNum($referid){ + $num = $this->findCount('comment',array( + 'referid'=>$referid, + )); + + return $num; + } + + + /** + * 删除评论 + * + * @param [type] $ptable + * @param [type] $pkey + * @param [type] $pid + * @param integer $commentid + * @return void + */ + public function delComment($ptable,$pkey,$pid,$commentid=0){ + + if($commentid){ + $this->delete('comment',array( + 'commentid'=>$commentid, + )); + #删除回复 + $this->delete('comment',array( + 'referid'=>$commentid, + )); + }else{ + $this->delete('comment',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + )); + } + + #统计评论数 + $count_comment = $this->findCount('comment',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + )); + + //更新评论数 + $this->update($ptable,array( + $pkey=>$pid, + ),array( + 'count_comment'=>$count_comment, + )); + + return true; + } + + +} \ No newline at end of file diff --git a/app/comment/config.php b/app/comment/config.php new file mode 100644 index 0000000..cacce7b --- /dev/null +++ b/app/comment/config.php @@ -0,0 +1,4 @@ + +
    + + {php include template("admin/menu");} + +
    {$pageUrl}
    + + +
    + + +
    + + + + + + + + + + + + + + + 全部 + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + {loop $arrComment $key $item} + + + + + + + + + + + + + + + {/loop} + + + +
    IDUserIDPID内容时间操作
    {$item['commentid']}{$item['userid']}{$item['pid']} [查看内容] + +
    {php echo tsDecode($item['content'])}
    + +
    {php echo date('Y-m-d H:i:s',$item['addtime'])} + + + + + + {if $item['isaudit']==1} + 审核 + {else} + 取消审核 + {/if} + + + + + 删除 + +
    + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/comment/html/admin/menu.html b/app/comment/html/admin/menu.html new file mode 100644 index 0000000..57d65a2 --- /dev/null +++ b/app/comment/html/admin/menu.html @@ -0,0 +1,11 @@ + +
    +
    评论管理
    + +
    +
    \ No newline at end of file diff --git a/app/comment/html/admin/options.html b/app/comment/html/admin/options.html new file mode 100644 index 0000000..3ae8864 --- /dev/null +++ b/app/comment/html/admin/options.html @@ -0,0 +1,38 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + +
    + + + + + + + + + + + + + + + + + + +
    APP名称:
    APP介绍:
    APP关键词:
    评论是否审核后显示: + + 不审核 + 审核 + +
    + +
    +
    + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/comment/html/my/index.html b/app/comment/html/my/index.html new file mode 100644 index 0000000..19ef477 --- /dev/null +++ b/app/comment/html/my/index.html @@ -0,0 +1,72 @@ +{php include pubTemplate("header")} +
    + + + +
    + + +
    +
    + + {php include pubTemplate("my")} + +
    +
    + + + +
    + + +
    +
    我的评论
    +
    + + + + + + + + + {loop $arrComment $key $item} + + + + + + + + + {/loop} + +
    评论内容时间操作
    + + {php echo tsDecode($item['content'])}{php echo date('Y-m-d H:i:s',$item['addtime'])} + + + + 删除 + +
    + +
    +
    {$pageUrl}
    + + + +
    +
    + +
    +
    + + + + + +
    + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/comment/html/recomment.html b/app/comment/html/recomment.html new file mode 100644 index 0000000..033ea3c --- /dev/null +++ b/app/comment/html/recomment.html @@ -0,0 +1,55 @@ +{loop $arrRecomment $rkey $ritem} +
    + +
    + + {$ritem[user][username]} + + {if $ritem['iszz']} + 作者 + {/if} + + {$ritem['datetime']} + + + + {if $TS_USER['userid'] && $ritem['userid']!=$TS_USER['userid']} + 回复 + {/if} + + {if $TS_USER['userid'] && $ritem['userid']==$TS_USER['userid']} + 删除 + {/if} + + + + + +
    + +
    + + {if $ritem['touserid']} + 回复 @{$ritem['touser']['username']} + {/if} + {$ritem[content]} + +
    + + + + + + + + + +
    +{/loop} \ No newline at end of file diff --git a/app/friendlinks/about.php b/app/friendlinks/about.php new file mode 100644 index 0000000..0c616ce --- /dev/null +++ b/app/friendlinks/about.php @@ -0,0 +1 @@ + '友链', 'version' => '1.0', 'desc' => '友情链接', 'url' => 'https://lmve.net', 'email' => '1337087466@qq.com', 'author' => '无闻风', 'author_url' => 'https://lmve.net', 'isoption' => '1', 'isinstall' => '1', 'issql' => '0', 'issystem' => '0', 'isappnav' => '0', 'ismy'=>'0', ); \ No newline at end of file diff --git a/app/friendlinks/action/admin.php b/app/friendlinks/action/admin.php new file mode 100644 index 0000000..e6922c0 --- /dev/null +++ b/app/friendlinks/action/admin.php @@ -0,0 +1,9 @@ +'.$path.'
    '.$name.'
    '.$face.'
    '.$about.'
    '.getIp(); /* $ispath = $new['friendlinks']->findCount('friendlinks',array( 'path'=>$path, )); if($ispath > 0){ getJson('你以提交过了',$js); }else */ $id = $new ['friendlinks']->create ( 'friendlinks',array( 'name'=>$name, 'email'=>$email, 'path'=>$path, 'face'=>$face, 'about'=>$about, 'ip'=>getIp(), 'addtime'=>time(), )); getJson('提交成功!!感谢!',$js); break; +} \ No newline at end of file diff --git a/app/friendlinks/action/index.php b/app/friendlinks/action/index.php new file mode 100644 index 0000000..9fcc9f3 --- /dev/null +++ b/app/friendlinks/action/index.php @@ -0,0 +1,3 @@ +findAll('friendlinks',array('isenable'=>0,),'addtime asc','id,name,face,path,addtime',$num); + +return $friends; } + + + + +} \ No newline at end of file diff --git a/app/friendlinks/config.php b/app/friendlinks/config.php new file mode 100644 index 0000000..16cfbdc --- /dev/null +++ b/app/friendlinks/config.php @@ -0,0 +1,19 @@ +小组管理 +
    + +
    \ No newline at end of file diff --git a/app/friendlinks/html/admin/options.html b/app/friendlinks/html/admin/options.html new file mode 100644 index 0000000..00eda69 --- /dev/null +++ b/app/friendlinks/html/admin/options.html @@ -0,0 +1,23 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + +
    + + + + + + + + + + + +
    APP名称:
    APP介绍:
    APP关键词:
    +
    +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/friendlinks/html/admin/topic_list.html b/app/friendlinks/html/admin/topic_list.html new file mode 100644 index 0000000..664b386 --- /dev/null +++ b/app/friendlinks/html/admin/topic_list.html @@ -0,0 +1,51 @@ +{php include pubTemplate("header_admin")} + + +
    + +{php include template("admin/menu");} + +
    {$pageUrl}
    + + + + + + + + + + + +{loop $arrTopic $key $item} + +{/loop} + + + +
    IDUserID标题时间操作
    {$item['topicid']}{$item['userid']}{tsTitle($item['title'])}{php echo date('Y-m-d H:i:s',$item['addtime'])} + + + + + + +{if $item['isaudit']==0} +已审核 +{else} +未审核 +{/if} + + + | + + + + + +删除 + +
    + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/friendlinks/html/create.html b/app/friendlinks/html/create.html new file mode 100644 index 0000000..a2986eb --- /dev/null +++ b/app/friendlinks/html/create.html @@ -0,0 +1,48 @@ +{php include pubTemplate("header")} + +
    + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    + + +
    +
    +
    + + +
    点击刷新验证码
    + + +
    +
    +
    +
    + + +
    +
    + + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/friendlinks/html/index.html b/app/friendlinks/html/index.html new file mode 100644 index 0000000..62a2fe3 --- /dev/null +++ b/app/friendlinks/html/index.html @@ -0,0 +1,17 @@ +{php include pubTemplate("header")} +
    + + + + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/friendlinks/js/admin.js b/app/friendlinks/js/admin.js new file mode 100644 index 0000000..e69de29 diff --git a/app/friendlinks/js/extend.func.js b/app/friendlinks/js/extend.func.js new file mode 100644 index 0000000..25fae19 --- /dev/null +++ b/app/friendlinks/js/extend.func.js @@ -0,0 +1,166 @@ +/*显示隐藏回复*/ +function commentOpen(id,gid) +{ + $('#rcomment_'+id).toggle('fast'); +} + +//收藏帖子(1.8改为喜欢) +function loveTopic(tid){ + + var url = siteUrl+'index.php?app=group&ac=do&ts=topic_collect'; + $.post(url,{topicid:tid},function(rs){ + if(rs == 0){ + + tsNotice('请登录后再喜欢'); + + }else if(rs == 1){ + + tsNotice('自己不能喜欢自己的帖子哦') + + }else if(rs == 2){ + + tsNotice('你已经喜欢过本帖啦,请不要再次喜欢'); + + }else{ + window.location.reload(); + } + }); +} + +//淘帖子,加专辑 +function taoalbum(topicid){ + $.post(siteUrl+'index.php?app=group&ac=album&ts=topic',{'topicid':topicid},function(rs){ + if(rs==0){ + + tsNotice('请登陆后再进行淘帖'); + + }else if(rs == 1){ + + tsNotice('请创建专辑后再进行淘贴'); + + }else { + + + tsNotice(rs); + + + } + }) +} + +//Ctrl+Enter 回复评论 + +function keyRecomment(rid,tid,event) +{ + if(event.ctrlKey == true) + { + if(event.keyCode == 13) + recomment(rid,tid); + return false; + } +} + +//回复评论 +function recomment(rid,tid,token){ + + c = $('#recontent_'+rid).val(); + if(c==''){alert('回复内容不能为空');return false;} + var url = siteUrl+'index.php?app=group&ac=comment&ts=recomment'; + $('#recomm_btn_'+rid).hide(); + $.post(url,{referid:rid,topicid:tid,content:c,'token':token} ,function(rs){ + if(rs == 0) + { + //alert('回复成功'); + window.location.reload(); + }else{ + $('#recomm_btn_'+rid).show(); + } + }) +} + + + +//向下加载更多帖子 +function loadTopic(userid,page){ + var num = parseInt(page)+1; + $("#viewmore").html(''); + $.get(siteUrl+'index.php?app=group&ac=ajax&ts=topic',{'userid':userid,'page':page},function(rs){ + if(rs==''){ + $("#viewmore").html('没有可以加载的内容啦...'); + }else{ + $("#before").before(rs); + $("#viewmore").html('查看更多内容......'); + } + }) +} + +//帖子审核 +function topicAudit(topicid,token){ + $.post(siteUrl+'index.php?app=group&ac=ajax&ts=topicaudit',{'topicid':topicid,'token':token},function(rs){ + if(rs==0){ + + window.location.reload(); + return false; + }else if(rs==1){ + + window.location.reload(); + return false; + + }else if(rs==2){ + + tsNotice('非法操作!'); + + } + }) +} + +//踢出小组 +function kickedGroup(groupid,userid){ + $.post(siteUrl+'index.php?app=group&ac=kicked',{'groupid':groupid,'userid':userid},function(rs){ + if(rs=='0'){ + + tsNotice('非法操作!') + + }else if(rs=='1'){ + + tsNotice('非法操作!') + + }else{ + window.location.reload(); + } + }) + +} + +//加入小组 +function joinGroup(groupid){ + tsPost('index.php?app=group&ac=ajax&ts=joingroup',{'groupid':groupid}); +} +function exitGroup(groupid){ + tsPost('index.php?app=group&ac=ajax&ts=exitgroup',{'groupid':groupid}); +} + + +//续期 +function openXuqi(userid) { + $("#xuqi_userid").val(userid); + var html = $("#xuqi_html").html(); + tsNotice(html); +} + + +//标注 +function toBook(topicid){ + var book = $('#book-text').val(); + if(topicid && book){ + $.post(siteUrl+'index.php?app=group&ac=ajax&ts=book',{'topicid':topicid,'book':book},function (rs) { + if(rs==1){ + window.location.reload() + }else{ + $('#book-alert').html('标注不能为空'); + } + }) + }else{ + $('#book-alert').html('标注不能为空'); + } +} \ No newline at end of file diff --git a/app/friendlinks/js/share.min.js b/app/friendlinks/js/share.min.js new file mode 100644 index 0000000..0f9bb42 --- /dev/null +++ b/app/friendlinks/js/share.min.js @@ -0,0 +1 @@ +!function(r){"use strict";function t(t,e,n,o){function i(r,t){return r-=o,t-=o,0>r||r>=u||0>t||t>=u?!1:a.isDark(r,t)}var a=r(n,e);a.addData(t),a.make(),o=o||0;var u=a.getModuleCount(),f=a.getModuleCount()+2*o,c=function(r,t,e,n){var o=this.isDark,i=1/f;this.isDark=function(a,u){var f=u*i,c=a*i,s=f+i,l=c+i;return o(a,u)&&(r>s||f>e||t>l||c>n)}};this.text=t,this.level=e,this.version=n,this.moduleCount=f,this.isDark=i,this.addBlank=c}function e(r,e,n,o,i){n=Math.max(1,n||1),o=Math.min(40,o||40);for(var a=n;o>=a;a+=1)try{return new t(r,e,a,i)}catch(u){}}function n(r,t,e){var n=e.size,o="bold "+e.mSize*n+"px "+e.fontname,i=w("")[0].getContext("2d");i.font=o;var a=i.measureText(e.label).width,u=e.mSize,f=a/n,c=(1-f)*e.mPosX,s=(1-u)*e.mPosY,l=c+f,d=s+u,h=.01;1===e.mode?r.addBlank(0,s-h,n,d+h):r.addBlank(c-h,s-h,l+h,d+h),t.fillStyle=e.fontcolor,t.font=o,t.fillText(e.label,c*n,s*n+.75*e.mSize*n)}function o(r,t,e){var n=e.size,o=e.image.naturalWidth||1,i=e.image.naturalHeight||1,a=e.mSize,u=a*o/i,f=(1-u)*e.mPosX,c=(1-a)*e.mPosY,s=f+u,l=c+a,d=.01;3===e.mode?r.addBlank(0,c-d,n,l+d):r.addBlank(f-d,c-d,s+d,l+d),t.drawImage(e.image,f*n,c*n,u*n,a*n)}function i(r,t,e){w(e.background).is("img")?t.drawImage(e.background,0,0,e.size,e.size):e.background&&(t.fillStyle=e.background,t.fillRect(e.left,e.top,e.size,e.size));var i=e.mode;1===i||2===i?n(r,t,e):(3===i||4===i)&&o(r,t,e)}function a(r,t,e,n,o,i,a,u){r.isDark(a,u)&&t.rect(n,o,i,i)}function u(r,t,e,n,o,i,a,u,f,c){a?r.moveTo(t+i,e):r.moveTo(t,e),u?(r.lineTo(n-i,e),r.arcTo(n,e,n,o,i)):r.lineTo(n,e),f?(r.lineTo(n,o-i),r.arcTo(n,o,t,o,i)):r.lineTo(n,o),c?(r.lineTo(t+i,o),r.arcTo(t,o,t,e,i)):r.lineTo(t,o),a?(r.lineTo(t,e+i),r.arcTo(t,e,n,e,i)):r.lineTo(t,e)}function f(r,t,e,n,o,i,a,u,f,c){a&&(r.moveTo(t+i,e),r.lineTo(t,e),r.lineTo(t,e+i),r.arcTo(t,e,t+i,e,i)),u&&(r.moveTo(n-i,e),r.lineTo(n,e),r.lineTo(n,e+i),r.arcTo(n,e,n-i,e,i)),f&&(r.moveTo(n-i,o),r.lineTo(n,o),r.lineTo(n,o-i),r.arcTo(n,o,n-i,o,i)),c&&(r.moveTo(t+i,o),r.lineTo(t,o),r.lineTo(t,o-i),r.arcTo(t,o,t+i,o,i))}function c(r,t,e,n,o,i,a,c){var s=r.isDark,l=n+i,d=o+i,h=e.radius*i,g=a-1,v=a+1,w=c-1,p=c+1,m=s(a,c),T=s(g,w),y=s(g,c),E=s(g,p),A=s(a,p),B=s(v,p),k=s(v,c),C=s(v,w),b=s(a,w);m?u(t,n,o,l,d,h,!y&&!b,!y&&!A,!k&&!A,!k&&!b):f(t,n,o,l,d,h,y&&b&&T,y&&A&&E,k&&A&&B,k&&b&&C)}function s(r,t,e){var n,o,i=r.moduleCount,u=e.size/i,f=a;for(m&&e.radius>0&&e.radius<=.5&&(f=c),t.beginPath(),n=0;i>n;n+=1)for(o=0;i>o;o+=1){var s=e.left+o*u,l=e.top+n*u,d=u;f(r,t,e,s,l,d,n,o)}if(w(e.fill).is("img")){t.strokeStyle="rgba(0,0,0,0.5)",t.lineWidth=2,t.stroke();var h=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",t.fill(),t.globalCompositeOperation=h,t.clip(),t.drawImage(e.fill,0,0,e.size,e.size),t.restore()}else t.fillStyle=e.fill,t.fill()}function l(r,t){var n=e(t.text,t.ecLevel,t.minVersion,t.maxVersion,t.quiet);if(!n)return null;var o=w(r).data("qrcode",n),a=o[0].getContext("2d");return i(n,a,t),s(n,a,t),o}function d(r){var t=w("").attr("width",r.size).attr("height",r.size);return l(t,r)}function h(r){return w("").attr("src",d(r)[0].toDataURL("image/png"))}function g(r){var t=e(r.text,r.ecLevel,r.minVersion,r.maxVersion,r.quiet);if(!t)return null;var n,o,i=r.size,a=r.background,u=Math.floor,f=t.moduleCount,c=u(i/f),s=u(.5*(i-c*f)),l={position:"relative",left:0,top:0,padding:0,margin:0,width:i,height:i},d={position:"absolute",padding:0,margin:0,width:c,height:c,"background-color":r.fill},h=w("
    ").data("qrcode",t).css(l);for(a&&h.css("background-color",a),n=0;f>n;n+=1)for(o=0;f>o;o+=1)t.isDark(n,o)&&w("
    ").css(d).css({left:s+o*c,top:s+n*c}).appendTo(h);return h}function v(r){return p&&"canvas"===r.render?d(r):p&&"image"===r.render?h(r):g(r)}var w=jQuery,p=function(){var r=document.createElement("canvas");return Boolean(r.getContext&&r.getContext("2d"))}(),m="[object Opera]"!==Object.prototype.toString.call(window.opera),T={render:"canvas",minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:0,quiet:0,mode:0,mSize:.1,mPosX:.5,mPosY:.5,label:"no label",fontname:"sans",fontcolor:"#000",image:null};w.fn.qrcode=function(r){var t=w.extend({},T,r);return this.each(function(){"canvas"===this.nodeName.toLowerCase()?l(this,t):w(this).append(v(t))})}}(function(){var r=function(){function r(t,e){if("undefined"==typeof t.length)throw new Error(t.length+"/"+e);var n=function(){for(var r=0;re;e+=1){t[e]=new Array(r);for(var n=0;r>n;n+=1)t[e][n]=null}return t}(h),T(0,0),T(h-7,0),T(0,h-7),A(),E(),k(r,t),s>=7&&B(r),null==v&&(v=M(s,l,w)),C(v,t)},T=function(r,t){for(var e=-1;7>=e;e+=1)if(!(-1>=r+e||r+e>=h))for(var n=-1;7>=n;n+=1)-1>=t+n||t+n>=h||(e>=0&&6>=e&&(0==n||6==n)||n>=0&&6>=n&&(0==e||6==e)||e>=2&&4>=e&&n>=2&&4>=n?d[r+e][t+n]=!0:d[r+e][t+n]=!1)},y=function(){for(var r=0,t=0,e=0;8>e;e+=1){m(!0,e);var n=i.getLostPoint(p);(0==e||r>n)&&(r=n,t=e)}return t},E=function(){for(var r=8;h-8>r;r+=1)null==d[r][6]&&(d[r][6]=r%2==0);for(var t=8;h-8>t;t+=1)null==d[6][t]&&(d[6][t]=t%2==0)},A=function(){for(var r=i.getPatternPosition(s),t=0;t=a;a+=1)for(var u=-2;2>=u;u+=1)-2==a||2==a||-2==u||2==u||0==a&&0==u?d[n+a][o+u]=!0:d[n+a][o+u]=!1}},B=function(r){for(var t=i.getBCHTypeNumber(s),e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);d[Math.floor(e/3)][e%3+h-8-3]=n}for(var e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);d[e%3+h-8-3][Math.floor(e/3)]=n}},k=function(r,t){for(var e=l<<3|t,n=i.getBCHTypeInfo(e),o=0;15>o;o+=1){var a=!r&&1==(n>>o&1);6>o?d[o][8]=a:8>o?d[o+1][8]=a:d[h-15+o][8]=a}for(var o=0;15>o;o+=1){var a=!r&&1==(n>>o&1);8>o?d[8][h-o-1]=a:9>o?d[8][15-o-1+1]=a:d[8][15-o-1]=a}d[h-8][8]=!r},C=function(r,t){for(var e=-1,n=h-1,o=7,a=0,u=i.getMaskFunction(t),f=h-1;f>0;f-=2)for(6==f&&(f-=1);;){for(var c=0;2>c;c+=1)if(null==d[n][f-c]){var s=!1;a>>o&1));var l=u(n,f-c);l&&(s=!s),d[n][f-c]=s,o-=1,-1==o&&(a+=1,o=7)}if(n+=e,0>n||n>=h){n-=e,e=-e;break}}},b=function(t,e){for(var n=0,o=0,a=0,u=new Array(e.length),f=new Array(e.length),c=0;c=0?v.getAt(w):0}}for(var p=0,d=0;dd;d+=1)for(var c=0;cd;d+=1)for(var c=0;c8*d)throw new Error("code length overflow. ("+c.getLengthInBits()+">"+8*d+")");for(c.getLengthInBits()+4<=8*d&&c.put(0,4);c.getLengthInBits()%8!=0;)c.putBit(!1);for(;!(c.getLengthInBits()>=8*d)&&(c.put(o,8),!(c.getLengthInBits()>=8*d));)c.put(a,8);return b(c,n)};return p.addData=function(r){var t=c(r);w.push(t),v=null},p.isDark=function(r,t){if(0>r||r>=h||0>t||t>=h)throw new Error(r+","+t);return d[r][t]},p.getModuleCount=function(){return h},p.make=function(){m(!1,y())},p.createTableTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e="";e+='";for(var o=0;o';e+=""}return e+="",e+="
    "},p.createImgTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e=p.getModuleCount()*r+2*t,n=t,o=e-t;return g(e,e,function(t,e){if(t>=n&&o>t&&e>=n&&o>e){var i=Math.floor((t-n)/r),a=Math.floor((e-n)/r);return p.isDark(a,i)?0:1}return 1})},p};t.stringToBytes=function(r){for(var t=new Array,e=0;ei)t.push(i);else{var a=e[r.charAt(o)];"number"==typeof a?(255&a)==a?t.push(a):(t.push(a>>>8),t.push(255&a)):t.push(n)}}return t}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},i=function(){var t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,i=7973,u=21522,f={},c=function(r){for(var t=0;0!=r;)t+=1,r>>>=1;return t};return f.getBCHTypeInfo=function(r){for(var t=r<<10;c(t)-c(n)>=0;)t^=n<=0;)t^=i<n;n+=1)e=e.multiply(r([1,a.gexp(n)],0));return e},f.getLengthInBits=function(r,t){if(t>=1&&10>t)switch(r){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+r)}else if(27>t)switch(r){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+r)}else{if(!(41>t))throw new Error("type:"+t);switch(r){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+r)}}},f.getLostPoint=function(r){for(var t=r.getModuleCount(),e=0,n=0;t>n;n+=1)for(var o=0;t>o;o+=1){for(var i=0,a=r.isDark(n,o),u=-1;1>=u;u+=1)if(!(0>n+u||n+u>=t))for(var f=-1;1>=f;f+=1)0>o+f||o+f>=t||(0!=u||0!=f)&&a==r.isDark(n+u,o+f)&&(i+=1);i>5&&(e+=3+i-5)}for(var n=0;t-1>n;n+=1)for(var o=0;t-1>o;o+=1){var c=0;r.isDark(n,o)&&(c+=1),r.isDark(n+1,o)&&(c+=1),r.isDark(n,o+1)&&(c+=1),r.isDark(n+1,o+1)&&(c+=1),(0==c||4==c)&&(e+=3)}for(var n=0;t>n;n+=1)for(var o=0;t-6>o;o+=1)r.isDark(n,o)&&!r.isDark(n,o+1)&&r.isDark(n,o+2)&&r.isDark(n,o+3)&&r.isDark(n,o+4)&&!r.isDark(n,o+5)&&r.isDark(n,o+6)&&(e+=40);for(var o=0;t>o;o+=1)for(var n=0;t-6>n;n+=1)r.isDark(n,o)&&!r.isDark(n+1,o)&&r.isDark(n+2,o)&&r.isDark(n+3,o)&&r.isDark(n+4,o)&&!r.isDark(n+5,o)&&r.isDark(n+6,o)&&(e+=40);for(var s=0,o=0;t>o;o+=1)for(var n=0;t>n;n+=1)r.isDark(n,o)&&(s+=1);var l=Math.abs(100*s/t/t-50)/5;return e+=10*l},f}(),a=function(){for(var r=new Array(256),t=new Array(256),e=0;8>e;e+=1)r[e]=1<e;e+=1)r[e]=r[e-4]^r[e-5]^r[e-6]^r[e-8];for(var e=0;255>e;e+=1)t[r[e]]=e;var n={};return n.glog=function(r){if(1>r)throw new Error("glog("+r+")");return t[r]},n.gexp=function(t){for(;0>t;)t+=255;for(;t>=256;)t-=255;return r[t]},n}(),u=function(){var r=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(r,t){var e={};return e.totalCount=r,e.dataCount=t,e},e={},o=function(t,e){switch(e){case n.L:return r[4*(t-1)+0];case n.M:return r[4*(t-1)+1];case n.Q:return r[4*(t-1)+2];case n.H:return r[4*(t-1)+3];default:return}};return e.getRSBlocks=function(r,e){var n=o(r,e);if("undefined"==typeof n)throw new Error("bad rs block @ typeNumber:"+r+"/errorCorrectLevel:"+e);for(var i=n.length/3,a=new Array,u=0;i>u;u+=1)for(var f=n[3*u+0],c=n[3*u+1],s=n[3*u+2],l=0;f>l;l+=1)a.push(t(c,s));return a},e}(),f=function(){var r=new Array,t=0,e={};return e.getBuffer=function(){return r},e.getAt=function(t){var e=Math.floor(t/8);return 1==(r[e]>>>7-t%8&1)},e.put=function(r,t){for(var n=0;t>n;n+=1)e.putBit(1==(r>>>t-n-1&1))},e.getLengthInBits=function(){return t},e.putBit=function(e){var n=Math.floor(t/8);r.length<=n&&r.push(0),e&&(r[n]|=128>>>t%8),t+=1},e},c=function(r){var n=e.MODE_8BIT_BYTE,o=t.stringToBytes(r),i={};return i.getMode=function(){return n},i.getLength=function(r){return o.length},i.write=function(r){for(var t=0;t>>8)},t.writeBytes=function(r,e,n){e=e||0,n=n||r.length;for(var o=0;n>o;o+=1)t.writeByte(r[o+e])},t.writeString=function(r){for(var e=0;e0&&(t+=","),t+=r[e];return t+="]"},t},l=function(){var r=0,t=0,e=0,n="",o={},i=function(r){n+=String.fromCharCode(a(63&r))},a=function(r){if(0>r);else{if(26>r)return 65+r;if(52>r)return 97+(r-26);if(62>r)return 48+(r-52);if(62==r)return 43;if(63==r)return 47}throw new Error("n:"+r)};return o.writeByte=function(n){for(r=r<<8|255&n,t+=8,e+=1;t>=6;)i(r>>>t-6),t-=6},o.flush=function(){if(t>0&&(i(r<<6-t),r=0,t=0),e%3!=0)for(var o=3-e%3,a=0;o>a;a+=1)n+="="},o.toString=function(){return n},o},d=function(r){var t=r,e=0,n=0,o=0,i={};i.read=function(){for(;8>o;){if(e>=t.length){if(0==o)return-1;throw new Error("unexpected end of file./"+o)}var r=t.charAt(e);if(e+=1,"="==r)return o=0,-1;r.match(/^\s$/)||(n=n<<6|a(r.charCodeAt(0)),o+=6)}var i=n>>>o-8&255;return o-=8,i};var a=function(r){if(r>=65&&90>=r)return r-65;if(r>=97&&122>=r)return r-97+26;if(r>=48&&57>=r)return r-48+52;if(43==r)return 62;if(47==r)return 63;throw new Error("c:"+r)};return i},h=function(r,t){var e=r,n=t,o=new Array(r*t),i={};i.setPixel=function(r,t,n){o[t*e+r]=n},i.write=function(r){r.writeString("GIF87a"),r.writeShort(e),r.writeShort(n),r.writeByte(128),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(255),r.writeByte(255),r.writeByte(255),r.writeString(","),r.writeShort(0),r.writeShort(0),r.writeShort(e),r.writeShort(n),r.writeByte(0);var t=2,o=u(t);r.writeByte(t);for(var i=0;o.length-i>255;)r.writeByte(255),r.writeBytes(o,i,255),i+=255;r.writeByte(o.length-i),r.writeBytes(o,i,o.length-i),r.writeByte(0),r.writeString(";")};var a=function(r){var t=r,e=0,n=0,o={};return o.write=function(r,o){if(r>>>o!=0)throw new Error("length over");for(;e+o>=8;)t.writeByte(255&(r<>>=8-e,n=0,e=0;n=r<0&&t.writeByte(n)},o},u=function(r){for(var t=1<u;u+=1)i.add(String.fromCharCode(u));i.add(String.fromCharCode(t)),i.add(String.fromCharCode(e));var c=s(),l=a(c);l.write(t,n);var d=0,h=String.fromCharCode(o[d]);for(d+=1;di;i+=1)for(var a=0;r>a;a+=1)o.setPixel(a,i,e(a,i));var u=s();o.write(u);for(var f=l(),c=u.toByteArray(),d=0;dn?t.push(n):2048>n?t.push(192|n>>6,128|63&n):55296>n||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(e++,n=65536+((1023&n)<<10|1023&r.charCodeAt(e)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}return t(r)}}(r),r}()),function(r){r.fn.share=function(t){function e(t,e){var n=o(e);for(var a in"prepend"==e.mode?n.reverse():n){var u=n[a],f=i(u,e),c=e.initialized?t.find(".icon-"+u):r('');c.length&&(c.attr("href",f),e.initialized||("prepend"==e.mode?t.prepend(c):t.append(c)))}}function n(r,t){var e=r.find("a.icon-wechat");e.append('

    '+t.wechatQrcodeTitle+'

    '+t.wechatQrcodeHelper+"
    "),e.find(".qrcode").qrcode({render:"image",size:100,text:t.url})}function o(r){r.mobileSites.length<1&&(r.mobileSites=r.sites);var t=u()?r.mobileSites:r.sites,e=r.disabled;return"string"==typeof t&&(t=t.split(",")),"string"==typeof e&&(e=e.split(",")),a()&&e.push("wechat"),t.filter(function(r){return!(e.indexOf(r)>-1)})}function i(r,t){var e=l[r];t.summary=t.description;for(var n in t){var o=r+n.replace(/^[a-z]/,function(r){return r.toUpperCase()}),i=encodeURIComponent(t[o]||t[n]);e=e.replace(new RegExp("{{"+n.toUpperCase()+"}}","g"),i)}return e}function a(){var r=navigator.userAgent.toLowerCase();return"micromessenger"==r.match(/MicroMessenger/i)}function u(){return r(window).width()<=768}var f=r(document).find("img:first").prop("src"),c={url:window.location.href,site_url:window.location.origin,source:r(document.head).find('[name="site"]').attr("content")||r(document.head).find('[name="Site"]').attr("content")||document.title,title:r(document.head).find('[name="title"]').attr("content")||r(document.head).find('[name="Title"]').attr("content")||document.title,description:r(document.head).find('[name="description"]').attr("content")||r(document.head).find('[name="Description"]').attr("content"),image:f?f:"",wechatQrcodeTitle:"微信扫一扫:分享",wechatQrcodeHelper:"

    微信里点“发现”,扫一下

    二维码便可将本文分享至朋友圈。

    ",mobileSites:[],sites:["weibo","qq","wechat","tencent","douban","qzone","linkedin","diandian","facebook","twitter","google"],disabled:[],initialized:!1},s=r.extend(!0,c,t),l={qzone:"http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={{URL}}&title={{TITLE}}&desc={{DESCRIPTION}}&summary={{SUMMARY}}&site={{SOURCE}}",qq:"http://connect.qq.com/widget/shareqq/index.html?url={{URL}}&title={{TITLE}}&source={{SOURCE}}&desc={{DESCRIPTION}}",tencent:"http://share.v.t.qq.com/index.php?c=share&a=index&title={{TITLE}}&url={{URL}}&pic={{IMAGE}}",weibo:"http://service.weibo.com/share/share.php?url={{URL}}&title={{TITLE}}&pic={{IMAGE}}",wechat:"javascript:;",douban:"http://shuo.douban.com/!service/share?href={{URL}}&name={{TITLE}}&text={{DESCRIPTION}}&image={{IMAGE}}&starid=0&aid=0&style=11",diandian:"http://www.diandian.com/share?lo={{URL}}&ti={{TITLE}}&type=link",linkedin:"http://www.linkedin.com/shareArticle?mini=true&ro=true&title={{TITLE}}&url={{URL}}&summary={{SUMMARY}}&source={{SOURCE}}&armin=armin",facebook:"https://www.facebook.com/sharer/sharer.php?u={{URL}}",twitter:"https://twitter.com/intent/tweet?text={{TITLE}}&url={{URL}}&via={{SITE_URL}}",google:"https://plus.google.com/share?url={{URL}}"};this.each(function(){var t=r.extend({},s,r(this).data()||{}),o=r(this).addClass("share-component").addClass("social-share");e(o,t),n(o,t)})},r(function(){r(".share-component,.social-share").share()})}(jQuery); \ No newline at end of file diff --git a/app/friendlinks/skins/default/group.jpg b/app/friendlinks/skins/default/group.jpg new file mode 100644 index 0000000..a4cdf15 Binary files /dev/null and b/app/friendlinks/skins/default/group.jpg differ diff --git a/app/friendlinks/skins/default/share.min.css b/app/friendlinks/skins/default/share.min.css new file mode 100644 index 0000000..0caf045 --- /dev/null +++ b/app/friendlinks/skins/default/share.min.css @@ -0,0 +1 @@ +@font-face{font-family:"socialshare";src:url("../fonts/iconfont.eot");src:url("../fonts/iconfont.eot?#iefix") format("embedded-opentype"),url("../fonts/iconfont.woff") format("woff"),url("../fonts/iconfont.ttf") format("truetype"),url("../fonts/iconfont.svg#iconfont") format("svg")}.social-share{font-family:"socialshare" !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-webkit-text-stroke-width:0.2px;-moz-osx-font-smoothing:grayscale}.social-share .icon-tencent:before{content:"\f07a"}.social-share .icon-qq:before{content:"\f11a"}.social-share .icon-weibo:before{content:"\f12a"}.social-share .icon-wechat:before{content:"\f09a"}.social-share .icon-douban:before{content:"\f10a"}.social-share .icon-heart:before{content:"\f20a"}.social-share .icon-like:before{content:"\f00a"}.social-share .icon-qzone:before{content:"\f08a"}.social-share .icon-linkedin:before{content:"\f01a"}.social-share .icon-diandian:before{content:"\f05a"}.social-share .icon-facebook:before{content:"\f03a"}.social-share .icon-google:before{content:"\f04a"}.social-share .icon-twitter:before{content:"\f06a"}.social-share a{position:relative;text-decoration:none;margin:4px;display:inline-block;outline:none}.social-share .social-share-icon{position:relative;display:inline-block;width:32px;height:32px;font-size:20px;border-radius:50%;line-height:32px;border:1px solid #666;color:#666;text-align:center;vertical-align:middle;transition:background 0.6s ease-out 0s}.social-share .social-share-icon:hover{background:#666;color:#fff}.social-share .icon-weibo{color:#ff763b;border-color:#ff763b}.social-share .icon-weibo:hover{background:#ff763b}.social-share .icon-tencent{color:#56b6e7;border-color:#56b6e7}.social-share .icon-tencent:hover{background:#56b6e7}.social-share .icon-qq{color:#56b6e7;border-color:#56b6e7}.social-share .icon-qq:hover{background:#56b6e7}.social-share .icon-qzone{color:#FDBE3D;border-color:#FDBE3D}.social-share .icon-qzone:hover{background:#FDBE3D}.social-share .icon-douban{color:#33b045;border-color:#33b045}.social-share .icon-douban:hover{background:#33b045}.social-share .icon-linkedin{color:#0077B5;border-color:#0077B5}.social-share .icon-linkedin:hover{background:#0077B5}.social-share .icon-facebook{color:#44619D;border-color:#44619D}.social-share .icon-facebook:hover{background:#44619D}.social-share .icon-google{color:#db4437;border-color:#db4437}.social-share .icon-google:hover{background:#db4437}.social-share .icon-twitter{color:#55acee;border-color:#55acee}.social-share .icon-twitter:hover{background:#55acee}.social-share .icon-diandian{color:#307DCA;border-color:#307DCA}.social-share .icon-diandian:hover{background:#307DCA}.social-share .icon-wechat{position:relative;color:#7bc549;border-color:#7bc549}.social-share .icon-wechat:hover{background:#7bc549}.social-share .icon-wechat .wechat-qrcode{opacity:0;filter:alpha(opacity=0);visibility:hidden;position:absolute;z-index:9;top:-205px;left:-84px;width:200px;height:192px;color:#666;font-size:12px;text-align:center;background-color:#fff;box-shadow:0 2px 10px #aaa;transition:all 200ms;-webkit-tansition:all 350ms;-moz-transition:all 350ms}.social-share .icon-wechat .wechat-qrcode h4{font-weight:normal;height:26px;line-height:26px;font-size:12px;background-color:#f3f3f3;margin:0;padding:0;color:#777}.social-share .icon-wechat .wechat-qrcode .qrcode{width:105px;margin:10px auto}.social-share .icon-wechat .wechat-qrcode .help p{font-weight:normal;line-height:16px;padding:0;margin:0}.social-share .icon-wechat .wechat-qrcode:after{content:'';position:absolute;left:50%;margin-left:-6px;bottom:-13px;width:0;height:0;border-width:8px 6px 6px 6px;border-style:solid;border-color:#fff transparent transparent transparent}.social-share .icon-wechat:hover .wechat-qrcode{opacity:1;filter:alpha(opacity=100);visibility:visible} diff --git a/app/friendlinks/skins/default/style.css b/app/friendlinks/skins/default/style.css new file mode 100644 index 0000000..6b1dbcd --- /dev/null +++ b/app/friendlinks/skins/default/style.css @@ -0,0 +1,298 @@ +/*最新CSS*/ +.group_show{overflow:hidden;padding: 50px 20px 20px 20px;border-bottom: solid 1px #dddddd;background-color:#bbb;background-image:url('group.jpg');background-repeat: no-repeat;background-size: 100% 100%;} +.group_show .face{float:left;} +.group_show .face img{} +.group_show .title{float:left;margin-left:20px;} +.group_show .title p{color:#999;margin: 0;margin-top: 6px;} +.group_show .join{float:right;margin-left:20px;color:#fff;} +/*最新CSS*/ + + +.mbtl { + float: left; + margin: 8px 7px 0 0; + padding: 0; + width: 55px; +} +.mbtr { + border-bottom: 1px solid #EEEEEE; + margin: 0px 0 20px 0; + min-height: 55px; + overflow: hidden; + padding: 10px;; + background:#f8f8f8; +} +.mbtr .author{} +.mbtr .author a{color:#8f8f8f;} +.mbtr .title{margin-top:10px;} +.mbtr .title a{color: #444444;font-size:22px;} +.mbtr .content{line-height:30px;font-size:14px;} + + + +/*右侧会员列表*/ + +.pl { + color: #666666; + font: 12px/150% Arial; + padding:10px 0; +} + +.pl2 { + color: #666666; + font: 14px/150% Arial; +} + + + +.pil { + height: 48px; + width: 48px; +} + + + +.plr { + color: #666666; + float: right; + font: 12px/150% Arial; +} + + +.mr5 { + margin-right: 5px; +} + + + + +/*内容页*/ +.topic-content{width: 100%;overflow:hidden;} + +.topic-content .user-face{float: left;height: 48px;overflow: hidden;width: 48px;} + +.topic-content .topic-doc { + margin-bottom: 30px; + overflow: hidden; + margin-left:60px; +} +.topic-content .topic-doc .author { + height: auto; + margin: 0; + margin-bottom: 1px; + color: #666666; + background:#f4f4ec; + padding:5px; + font-size:12px; +} + +.topic-content img{max-width:100%;} +.topic-content .topic-view{font-size:16px;line-height:30px;overflow: hidden;word-wrap: break-word;word-break: normal;} + +.topic-content .topic-view a{color:#49a5de} + +.topic-content .topic-view p{font-size:16px;} + +.topic-content .topic-view table{border:#CCCCCC 1px solid;} +.topic-content .topic-view table td{ border:1px #CCCCCC solid; border-right:none; border-top:none;} + + + +.pl20 { + padding-left: 20px; +} + +.topic-content .topic-opt { + padding: 15px 0 0; +} +.rec-sec { + color: #999999; + text-align: right; +} +.rec-num { + margin: 0 4px; +} +.clearfix { + display: block; +} + + + + + + +/*ob*/ +.ob { + float: left; + margin: 0 0 10px; + text-align: center; + width: 70px; +} +.ob dt { + height: 50px; + margin: 0; + overflow: hidden; + text-align: center; +} +.ob dd { + height: 55px; + margin: 0; + overflow: hidden; + text-align: center; +} +.ob span { + white-space: nowrap; +} + + + + + +/*帖子类型列表*/ +.topictype{} +.topictype td{border-bottom:dashed 1px #DDDDDD;padding:5px;} + + +/*帖子列表*/ +.topic_list{overflow:hidden;} +.topic_list ul, .topic_list ul li{list-style: none;margin:0;padding:0;} +.topic_list ul{overflow:hidden;} +.topic_list ul li{overflow:hidden;padding:15px 0;display: block;border-bottom: 1px dashed #ccc;} + +.topic_list .userimg{float:left;width:38px;overflow:hidden;} + +.topic_list .topic_title{margin-left:40px;overflow:hidden;} + +.topic_list .topic_title .title a{color:#343434;font-size:14px;} + +.topic_list .topic_info{overflow: hidden;font-size:12px;color:#999999;} + +.rank { + background: none repeat scroll 0 0 #BBBBBB; + height: 15px; + line-height: 15px; + margin: 0 0 0 5px; + padding: 0 3px; + border-radius:5px 5px 5px 5px; +} + +/*小组列表*/ +.sub-item{ + border-bottom: 1px dashed #AAAAAA; + height: 72px; + margin: 0 2px 15px 0; + overflow: hidden; + width: 100%; + padding-bottom: 15px; +} +.sub-item .pic { + float: left; + width: 48px; +} +.sub-item .info { + vertical-align: top; + word-wrap: break-word; + margin-left:60px; +} + +.sub-item .info .content{ line-height:20px;font-size: 12px;color:#999999} + +.sub-item .pic img { + height: 48px; + margin-bottom: -3px; + width: 48px; +} +.sub-item p { + margin: 0; +} + + +/*热门帖子列表*/ +.group_index_right_hottopic{} +.group_index_right_hottopic ul { + word-wrap: break-word; + list-style: none; + margin: 0; + padding: 0; +} +.group_index_right_hottopic ul li { + border-bottom: 1px dashed #CCCCCC; + color: #999999; + overflow: hidden; + padding: 10px 0; + list-style: none; + margin: 0; +} +.group_index_right_hottopic ul li h3 {margin: 0;padding:0;white-space: nowrap; overflow: hidden;} +.group_index_right_hottopic ul li .info{overflow: hidden;margin-top: 10px;font-size: 12px;} +.group_index_right_hottopic ul li .info .left{float: left} +.group_index_right_hottopic ul li .info .right{float: right} + + +/*小组分类*/ +.catelist{ margin-bottom: 20px;overflow: hidden;} +.catelist ul{} +.catelist ul li{float:left;width:150px;font-size:14px;} + +/*分类下小组*/ +.categroup{} +.categroup ul{} +.categroup ul li{padding:10px;border-bottom: 1px dashed #CCCCCC;overflow:hidden;} +.categroup ul li img{float:left;padding:0 10px 0 0;} + +/*帖子页*/ + +.newtopic{} +.newtopic ul, .newtopic ul li{list-style: none;margin:0;padding:0;} +.newtopic ul{} +.newtopic ul li{border-top: 1px dashed #CCCCCC;padding: 5px 0;} + +.title2{float:right;border: 1px solid #DDDDDD;border-bottom:none;margin-top:10px;} +.title2 li{width:150px;border-bottom: 1px solid #DDDDDD;font-size:12px;padding:5px;line-height: 15px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} + +.btool{ + border-top: 1px solid #EEEEEE; + font-size: 12px; + padding: 10px 10px 0 10px; + text-align: right;} +.btool a{margin-left:10px;padding:0px;color:#999999} + + +.bltool a{margin-right:10px;padding:0px;} +.after-view{font-size:14px;} + +/*专辑*/ +.album{} +.album li{float:left;width:225px;margin: 0 5px 10px;height: 80px;} +.album li .al{float:left;width:50px;height:50px;text-align:center;} +.album li .al .num{background:#F0F0F0;padding:10px 0} +.album li .al .tz{background:#CCCCCC;} +.album li .ar{margin-left:60px;} +.album li .ar h3{margin:0px;font-weight:bold;} +.album li .ar .info{} +.album li .ar .time{color:#999999;} + + + +/** +帖子附件 + */ +.topic_attach{ + background-color: #FFEAAA; + border:dashed 2px #EDCEBA; + padding:10px; +} +.topic_attach ul{list-style: none;margin:0;padding: 0;} +.topic_attach ul li{list-style: none;margin: 0;padding: 0;} + +/**帖子视频**/ +.topic_video{ + background-color: #FFFFFF; + border:dashed 2px #66afe9; + padding:10px; +} + +.topic_video iframe{width: 100%;height:450px;} +@media (max-width: 575.98px) { + .topic_video iframe{width: 100%;height:230px;} +} \ No newline at end of file diff --git a/app/friendlinks/skins/fonts/iconfont.ttf b/app/friendlinks/skins/fonts/iconfont.ttf new file mode 100644 index 0000000..515b493 Binary files /dev/null and b/app/friendlinks/skins/fonts/iconfont.ttf differ diff --git a/app/friendlinks/skins/fonts/iconfont.woff b/app/friendlinks/skins/fonts/iconfont.woff new file mode 100644 index 0000000..ed12916 Binary files /dev/null and b/app/friendlinks/skins/fonts/iconfont.woff differ diff --git a/app/group/about.php b/app/group/about.php new file mode 100644 index 0000000..78aa59d --- /dev/null +++ b/app/group/about.php @@ -0,0 +1,17 @@ + '小组', + 'version' => '1.2', + 'desc' => '小组,群组,BBS,社区讨论,创建小组,发表帖子', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '1', + 'ismy'=>'1', +); \ No newline at end of file diff --git a/app/group/action/add.php b/app/group/action/add.php new file mode 100644 index 0000000..ce823d0 --- /dev/null +++ b/app/group/action/add.php @@ -0,0 +1,290 @@ +isLogin (); + +//判断用户是否存在 +if(aac('user')->isUser($userid)==false) tsNotice('不好意思,用户不存在!'); + +//判断发布者状态 +if(aac('user')->isPublisher()==false) tsNotice('你还不能发布内容,检查邮箱是否认证。','->点击认证<-',tsUrl('user','verify')); + +//发布时间限制 +if(aac('system')->pubTime()==false) tsNotice('不好意思,当前时间不允许发布内容!'); + + +switch ($ts) { + // 发布帖子 + case "" : + + $groupid = intval ( $_GET ['id'] ); + // 小组数目 + $groupNum = $new ['group']->findCount ( 'group', array ( + 'groupid' => $groupid + ) ); + + if ($groupNum == 0) { + header ( "Location: " . SITE_URL ); + exit (); + } + + // 小组会员 + $isGroupUser = $new ['group']->findCount ( 'group_user', array ( + 'userid' => $userid, + 'groupid' => $groupid + ) ); + + + + //小组信息 + $strGroup = $new ['group']->find ( 'group', array ( + 'groupid' => $groupid + )); + $strGroup ['groupname'] = tsTitle( $strGroup ['groupname'] ); + $strGroup ['groupdesc'] = tsTitle( $strGroup ['groupdesc'] ); + + + + if ($strGroup ['isaudit'] == 1) { + tsNotice ( '小组还未审核通过,不允许发帖!' ); + } + + // 允许小组成员发帖 + if ($strGroup ['ispost'] == 0 && $isGroupUser == 0 && $userid != $strGroup ['userid']) { + tsNotice ( "本小组只允许小组成员发贴,请加入小组后再发帖!" ); + } + // 不允许小组成员发帖 + if ($strGroup ['ispost'] == 1 && $userid != $strGroup ['userid']) { + tsNotice ( "本小组只允许小组组长发帖!" ); + } + // 帖子类型 + $arrGroupType = $new ['group']->findAll ( 'group_topic_type', array ( + 'groupid' => $strGroup ['groupid'] + ) ); + + + + #加载草稿箱 + $strDraft = $new['group']->find('draft',array( + 'userid'=>$userid, + 'types'=>'topic', + )); + + + + $title = '发布帖子'; + // 包含模版 + include template ( "add" ); + + break; + + // 执行发布帖子 + case "do" : + + + $authcode = strtolower ( $_POST ['authcode'] ); + + if ($TS_SITE['isauthcode']) { + if ($authcode != $_SESSION ['verify']) { + tsNotice ( "验证码输入有误,请重新输入!" ); + } + } + + $groupid = intval ( $_POST ['groupid'] ); + $title = trim( $_POST ['title'] ); + + $content = tsClean( $_POST ['content'] ); + $content2 = emptyText( $_POST ['content'] ); + + $typeid = intval ( $_POST ['typeid'] ); + $tag = $_POST ['tag']; + + // 判断一下Title是否重复 + $isTitle = $new ['group']->findCount ( 'group_topic', array ( + 'title' => $title + ) ); + + if ($isTitle > 0) { + tsNotice ( '有重复标题出现哦^_^' ); + } + + // 小组 + $strGroup = $new ['group']->find ( 'group', array ( + 'groupid' => $groupid + ) ); + + if ($strGroup ['isaudit'] == 1) { + tsNotice ( '小组还未审核通过,不允许发帖!' ); + } + + if ($TS_USER ['isadmin'] == 0) { + aac ( 'system' )->antiWord ( $title ); + aac ( 'system' )->antiWord ( $content ); + aac ( 'system' )->antiWord ( $tag ); + } + + $iscomment = intval ( $_POST ['iscomment'] ); + $iscommentshow = intval ( $_POST ['iscommentshow'] ); + + // 帖子是否需要审核 + if ($strGroup ['ispostaudit'] == 1) { + $isaudit = 1; + } else { + $isaudit = 0; + } + + if ($title == '' || $content2 == '') { + tsNotice ( '???' ); + } + + /** + * ****************** + */ + // 防止用户发布重复内容,调出用户上一次发表的内容 + $strPreTopic = $new ['group']->find ( 'group_topic', array ( + 'userid' => $userid + ), 'topicid,title,addtime', 'addtime desc' ); + + // print_r($strPreTopic);exit; + + + // 发帖间隔时间 + /* + $IntervalTime = time () - $strPreTopic ['addtime']; + // if($strPreTopic && $IntervalTime<3600){ + if ($strPreTopic) { + similar_text ( $strPreTopic ['title'], $title, $percent ); + if ($percent >= 90) { + $new ['group']->update ( 'group_topic', array ( + 'topicid' => $strPreTopic ['topicid'] + ), array ( + 'isaudit' => 1 + ) ); + $isaudit = 1; + } + } + */ + + + + /** + * ***************** + */ + + $gaiyao = cututf8(t(tsDecode($content)),0,100); + + + $topicid = $new ['group']->create ( 'group_topic', array ( + 'groupid' => $groupid, + 'typeid' => $typeid, + 'userid' => $userid, + 'locationid'=>aac('user')->getLocationId($userid), + 'title' => $title, + 'content' => $content, + 'gaiyao'=>$gaiyao, + 'iscomment' => $iscomment, + 'iscommentshow' => $iscommentshow, + 'isaudit' => $isaudit, + 'addtime' => time (), + 'uptime' => time () + ) ); + + + #清空草稿箱 + $new['group']->delete('draft',array( + 'userid'=>$userid, + 'types'=>'topic', + )); + + + // 统计用户发帖数 + $countUserTopic = $new ['group']->findCount ( 'group_topic', array ( + 'userid' => $userid + ) ); + + $new ['group']->update ( 'user_info', array ( + 'userid' => $userid + ), array ( + 'count_topic' => $countUserTopic + ) ); + + // 处理@用户名 + /* + if (preg_match_all ( '/@/', $content, $at )) { + preg_match_all ( "/@(.+?)([\s|:]|$)/is", $content, $matches ); + + $unames = $matches [1]; + + $ns = "'" . implode ( "','", $unames ) . "'"; + + $csql = "username IN($ns)"; + + if ($unames) { + + $query = $db->fetch_all_assoc ( "select userid,username from " . dbprefix . "user_info where $csql" ); + + foreach ( $query as $v ) { + $content = str_replace ( '@' . $v ['username'] . '', '[@' . $v ['username'] . ':' . $v ['userid'] . ']', $content ); + $msg_content = '我在帖子中提到了你
    去看看:' . tsUrl ( 'group', 'topic', array ( + 'id' => $topicid + ) ); + aac ( 'message' )->sendmsg ( $userid, $v ['userid'], $msg_content ); + } + $new ['group']->update ( 'group_topic', array ( + 'topicid' => $topicid + ), array ( + 'content' => $content + ) ); + } + } + */ + + // 统计帖子类型 + if ($typeid) { + $topicTypeNum = $new ['group']->findCount ( 'group_topic', array ( + 'typeid' => $typeid + ) ); + + $new ['group']->update ( 'group_topic_type', array ( + 'typeid' => $typeid + ), array ( + 'count_topic' => $topicTypeNum + ) ); + } + // 处理标签 + aac ( 'tag' )->addTag ( 'topic', 'topicid', $topicid, $tag ); + + // 统计需要审核的帖子 + $count_topic_audit = $new ['group']->findCount ( 'group_topic', array ( + 'groupid' => $groupid, + 'isaudit' => '1' + ) ); + + // 统计小组下帖子数并更新 + $count_topic = $new ['group']->findCount ( 'group_topic', array ( + 'groupid' => $groupid + ) ); + + // 统计今天发布帖子数 + $today_start = strtotime ( date ( 'Y-m-d 00:00:00' ) ); + $today_end = strtotime ( date ( 'Y-m-d 23:59:59' ) ); + + $count_topic_today = $new ['group']->findCount ( 'group_topic', "`groupid`='$groupid' and `addtime`>'$today_start' and `addtime`<'$today_end'" ); + + $new ['group']->update ( 'group', array ( + 'groupid' => $groupid + ), array ( + 'count_topic' => $count_topic, + 'count_topic_audit' => $count_topic_audit, + 'count_topic_today' => $count_topic_today, + 'uptime' => time () + ) ); + + // 对积分进行处理 + aac ( 'user' )->doScore ( $TS_URL['app'], $TS_URL['ac'], $TS_URL['ts'] ); + + + header ( "Location: " . tsUrl('group', 'topic', array ('id' => $topicid))); + break; +} diff --git a/app/group/action/admin.php b/app/group/action/admin.php new file mode 100644 index 0000000..e6922c0 --- /dev/null +++ b/app/group/action/admin.php @@ -0,0 +1,9 @@ +findAll('group_album',null,'addtime desc',null,$lstart.',10'); + + $albumNum = $new['group']->findCount('group_album'); + + $pageUrl = pagination($albumNum, 10, $page, $url); + + include template("admin/album_list"); + + break; + + //分类删除 + case "delete": + + $albumid = intval($_GET['albumid']); + + $new['group']->delete('group_album',array( + 'albumid'=>$albumid, + )); + + $new['group']->delete('group_album_topic',array( + 'albumid'=>$albumid, + )); + + qiMsg('删除成功!'); + + break; + +} \ No newline at end of file diff --git a/app/group/action/admin/cate.php b/app/group/action/admin/cate.php new file mode 100644 index 0000000..6b0bb86 --- /dev/null +++ b/app/group/action/admin/cate.php @@ -0,0 +1,118 @@ +findAll('group_cate',array( + 'referid'=>'0', + )); + + foreach($arrCate as $key=>$item){ + + $arrCates[] = $item; + $arrCates[$key]['two'] = $new['group']->findAll('group_cate',array( + 'referid'=>$item['cateid'], + )); + + } + + foreach($arrCates as $key=>$item){ + + $arrCatess[] = $item; + foreach($item['two'] as $tkey=>$titem){ + + $arrCatess[$key]['two'][$tkey]['three'] = $new['group']->findAll('group_cate',array( + 'referid'=>$titem['cateid'], + )); + + } + + } + + //print_r($arrCatess); + + include template("admin/cate_list"); + + break; + + //分类添加 + case "add": + + $referid = tsIntval($_GET['referid']); + + include template("admin/cate_add"); + + break; + + case "add_do": + + $new['group']->create('group_cate',array( + + 'catename'=>t($_POST['catename']), + 'referid'=>tsIntval($_POST['referid']), + + )); + + + header("Location: ".SITE_URL."index.php?app=group&ac=admin&mg=cate&ts=list"); + + break; + + //分类删除 + case "del": + + $cateid = tsIntval($_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 = tsIntval($_GET['cateid']); + + $referid = tsIntval($_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; + + //分类修改执行 + case "edit_do": + $cateid = tsIntval($_POST['cateid']); + $catename = t($_POST['catename']); + + $referid = tsIntval($_POST['referid']); + + $refer = ''; + if($referid){ + $refer = ", `referid`='$referid'"; + } + + $db->query("update ".dbprefix."group_cate set `catename`='".$catename."'".$refer." where cateid='$cateid'"); + + header("Location: ".SITE_URL."index.php?app=group&ac=admin&mg=cate&ts=list"); + + break; +} \ No newline at end of file diff --git a/app/group/action/admin/group.php b/app/group/action/admin/group.php new file mode 100644 index 0000000..26ae19a --- /dev/null +++ b/app/group/action/admin/group.php @@ -0,0 +1,156 @@ +fetch_all_assoc("select * from ".dbprefix."group order by addtime desc limit $lstart,10"); + $groupNum = $db->once_num_rows("select * from ".dbprefix."group"); + if(is_array($arrGroup)){ + foreach($arrGroup as $key=>$item){ + $arrAllGroup[] = $item; + $arrAllGroup[$key]['groupdesc'] = cututf8($item['groupdesc'],0,40); + } + } + $pageUrl = pagination($groupNum, 10, $page, $url); + + include template("admin/group_list"); + + break; + + + //推荐的小组 + case "recommend": + + $arrGroup = $new['group']->findAll('group',array( + 'isrecommend'=>1, + ),'orderid asc','groupid,orderid,groupname,isrecommend'); + + + include template("admin/group_recommend"); + + break; + + + case "orderid": + + $arrGroupid = $_POST['groupid']; + $arrOrderid = $_POST['orderid']; + + foreach($arrGroupid as $key=>$item){ + $new['group']->update('group',array( + 'groupid'=>tsIntval($item) + ),array( + 'orderid'=>tsIntval($arrOrderid[$key]) + )); + } + + qiMsg('修改成功!'); + + break; + + + //小组编辑 + case "edit": + $groupid = tsIntval($_GET['groupid']); + $arrGroup = $db->once_fetch_assoc("select * from ".dbprefix."group where groupid='$groupid'"); + include template("admin/group_edit"); + break; + + //小组编辑执行 + case "editdo": + $groupid = tsIntval($_POST['groupid']); + + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'userid' => tsIntval($_POST['userid']), + )); + + qiMsg("小组信息修改成功!"); + break; + + //小组删除 + case "del": + $groupid = tsIntval($_GET['groupid']); + + if($groupid == 1){ + qiMsg("默认小组不能删除!"); + } + + $topicNum = $db->once_fetch_assoc("select count(*) from ".dbprefix."topic where `groupid`='$groupid'"); + + if($topicNum['count(*)'] > 0){ + qiMsg("本小组还有帖子,不允许删除。"); + } + + $strGroup = $new['group']->find('group',array( + 'groupid'=>$groupid, + )); + + $new['group']->deleteGroup($strGroup); + + qiMsg("小组删除成功!"); + + break; + + //审核小组 + case "isaudit": + + $groupid = tsIntval($_GET['groupid']); + + $strGroup = $db->once_fetch_assoc("select groupid,userid,groupname,isaudit from ".dbprefix."group where groupid='$groupid'"); + + if($strGroup['isaudit']){ + + $db->query("update ".dbprefix."group set `isaudit`='0' where groupid='$groupid'"); + + //发送系统消息(审核通过) + $msg_userid = '0'; + $msg_touserid = $strGroup['userid']; + $msg_content = '恭喜你,你申请的小组《'.$strGroup['groupname'].'》审核通过!快去看看吧'; + $msg_tourl = tsUrl('group','show',array('id'=>$groupid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + + }else{ + + $db->query("update ".dbprefix."group set `isaudit`='1' where groupid='$groupid'"); + + } + + + + qiMsg("操作成功!"); + + break; + + //推荐小组 + case "isrecommend": + $groupid = tsIntval($_GET['groupid']); + + $strGroup = $db->once_fetch_assoc("select groupid,userid,groupname,isrecommend from ".dbprefix."group where groupid='$groupid'"); + + if($strGroup['isrecommend'] == 0){ + $db->query("update ".dbprefix."group set `isrecommend`='1' where groupid='$groupid'"); + + //发送系统消息(审核通过) + $msg_userid = '0'; + $msg_touserid = $strGroup['userid']; + $msg_content = '恭喜你,你的小组《'.$strGroup['groupname'].'》被推荐啦!快去看看吧'; + $msg_tourl = tsUrl('group','show',array('id'=>$groupid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + + }else{ + + $db->query("update ".dbprefix."group set `isrecommend`='0' where groupid='$groupid'"); + + } + + qiMsg("操作成功!"); + + break; +} \ No newline at end of file diff --git a/app/group/action/admin/options.php b/app/group/action/admin/options.php new file mode 100644 index 0000000..9b6718a --- /dev/null +++ b/app/group/action/admin/options.php @@ -0,0 +1,27 @@ +findAll('user_group',null,'ugid asc'); + + + + + include template('admin/permissions'); + + break; + + case "do": + + /** + * 权限参数说明,app,action必须,其他参数可选 + * app-action-ts + * app-action-mg-ts 当action=admin + * app-action-api-ts 当action=api + */ + + $ugid = tsIntval($_POST['ugid']); + + $arrOption = $_POST['option']; + + aac('pubs')->upAppPermissions($ugid,'group',$arrOption); + + qiMsg('操作成功!'); + + + break; + +} \ No newline at end of file diff --git a/app/group/action/admin/topic.php b/app/group/action/admin/topic.php new file mode 100644 index 0000000..b60e9ed --- /dev/null +++ b/app/group/action/admin/topic.php @@ -0,0 +1,133 @@ +findAll('group_topic',null,'addtime desc',null,$lstart.',10'); + + $topicNum = $new['group']->findCount('group_topic'); + + $pageUrl = pagination($topicNum, 10, $page, $url); + + include template("admin/topic_list"); + + break; + + case "delete": + $topicid = intval($_GET['topicid']); + $groupid = intval($_GET['groupid']); + + $new['group']->delTopic($topicid,$groupid); + + qiMsg('删除成功'); + break; + + //帖子审核 + case "isaudit": + + $topicid = intval($_GET['topicid']); + + $strTopic = $new['group']->find('group_topic',array( + 'topicid'=>$topicid, + )); + + if($strTopic['isaudit']==0){ + $new['group']->update('group_topic',array( + 'topicid'=>$topicid, + ),array( + 'isaudit'=>1, + )); + } + + if($strTopic['isaudit']==1){ + $new['group']->update('group_topic',array( + 'topicid'=>$topicid, + ),array( + 'isaudit'=>0, + )); + } + + qiMsg('操作成功!'); + + break; + + //删除的帖子 + case "deletetopic": + + $page = isset($_GET['page']) ? intval($_GET['page']) : 1; + $url = SITE_URL.'index.php?app=group&ac=admin&mg=topic&ts=deletetopic&page='; + $lstart = $page*10-10; + + $arrTopic = $new['group']->findAll('group_topic',array('isdelete'=>'1'),'addtime desc',null,$lstart.',10'); + + $topicNum = $new['group']->findCount('group_topic',array( + 'isdelete'=>'1', + )); + + $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; + +} \ No newline at end of file diff --git a/app/group/action/admin/upuser.php b/app/group/action/admin/upuser.php new file mode 100644 index 0000000..5292bf2 --- /dev/null +++ b/app/group/action/admin/upuser.php @@ -0,0 +1,24 @@ +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("会员投送成功!"); \ No newline at end of file diff --git a/app/group/action/ajax.php b/app/group/action/ajax.php new file mode 100644 index 0000000..024930c --- /dev/null +++ b/app/group/action/ajax.php @@ -0,0 +1,147 @@ +find('group',array( + 'groupid'=>$groupid + )); + + if($userid==0 || $groupid==0 || $strGroup==''){ + getJson('请登录后再加入小组',1,2,tsUrl('user','login')); + } + + //管理员可以加入任何小组 + if($TS_USER['isadmin'] != 1){ + + //除管理员外其他用户都要经过这一关审核 + if($strGroup['joinway'] == 1) getJson('本小组禁止加入!'); + + //处理申请加入,成员审核 + if($strGroup['joinway'] == 2){ + $new['group']->replace('group_user_isaudit',array( + 'userid'=>$userid, + 'groupid'=>$strGroup['groupid'], + ),array( + 'userid'=>$userid, + 'groupid'=>$strGroup['groupid'], + )); + + getJson('加入小组申请提交成功,请等待管理员审核后加入。'); + + } + + + //先统计用户有多少个小组了,50个封顶 + $userGroupNum = $new['group']->findCount('group_user',array('userid'=>$userid)); + + if($userGroupNum >= $TS_APP['joinnum']) getJson('你加入的小组总数已经到达'.$TS_APP['joinnum'].'个,不能再加入小组!'); + + $groupUserNum = $new['group']->findCount('group_user',array( + 'userid'=>$userid, + 'groupid'=>$groupid, + )); + + if($groupUserNum > 0) getJson('你已经加入小组!'); + + + + #付费加入小组 + if($TS_APP['ispayjoin']==1 && $strGroup['joinway']==3){ + //启动支付帐号 + $strUserPay = aac('pay')->getUserPay($userid); + if($strUserPay['over']<$strGroup['price']){ + getJson('支付帐号资金不足,请充值后再加入小组!'); + } + //用户加入付款消费 + aac('pay')->updatePay($userid,$strGroup['price'],1,'加入收费小组'.$strGroup['groupid']); + + #组长获取加入收费收入 + aac('pay')->updatePay($strGroup['userid'],$strGroup['price'],0,'收费小组获取'.$strGroup['groupid']); + } + + + + } + + $new['group']->create('group_user',array( + 'userid'=>$userid, + 'groupid'=>$groupid, + 'addtime'=>time(), + )); + + //更新 + $count_group = $new['group']->findCount('group_user',array( + 'userid'=>$userid, + )); + $new['group']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'count_group'=>$count_group, + )); + + //计算小组会员数 + $count_user = $new['group']->findCount('group_user',array( + 'groupid'=>$groupid, + )); + + //更新小组成员统计 + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'count_user'=>$count_user, + )); + + getJson('加入成功!',1,1,tsUrl('group','show',array('id'=>$groupid))); + + break; + + //退出小组 + case "exitgroup": + + $userid = tsIntval($TS_USER['userid']); + + $groupid = tsIntval($_POST['groupid']); + + //判断是否是组长,是组长不能退出小组 + $strGroup = $new['group']->find('group',array( + 'groupid'=>$groupid + )); + + if($userid==0 || $groupid==0 || $strGroup==''){ + getJson('非法操作'); + } + + if($strGroup['userid'] == $userid) getJson('组长任务艰巨,请坚持到底!'); + + $new['group']->delete('group_user',array( + 'userid'=>$userid, + 'groupid'=>$groupid, + )); + + //计算小组会员数 + $count_user = $new['group']->findCount('group_user',array( + 'groupid'=>$groupid, + )); + + //更新小组成员统计 + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'count_user'=>$count_user, + )); + + getJson('加入成功!',1,1,tsUrl('group','show',array('id'=>$groupid))); + + break; + + + +} \ No newline at end of file diff --git a/app/group/action/all.php b/app/group/action/all.php new file mode 100644 index 0000000..c1b91a9 --- /dev/null +++ b/app/group/action/all.php @@ -0,0 +1,30 @@ +'')); +$lstart = $page*20-20; +$arrGroups = $db->fetch_all_assoc("select groupid from ".dbprefix."group order by isrecommend desc limit $lstart,20"); +foreach($arrGroups as $key=>$item){ + $arrData[] = $new['group']->getOneGroup($item['groupid']); +} +foreach($arrData as $key=>$item){ + $arrGroup[] = $item; + $arrGroup[$key]['groupdesc'] = cututf8(t($item['groupdesc']),0,35); +} +$groupNum = $db->once_fetch_assoc("select count(groupid) from ".dbprefix."group"); +$pageUrl = pagination($groupNum['count(groupid)'], 20, $page, $url); +if($page > 1){ + $title = '全部小组 - 第'.$page.'页'; +}else{ + $title = '全部小组'; +} + + +//热门帖子 +$arrTopic = $db->fetch_all_assoc("select topicid,title,count_comment from ".dbprefix."group_topic order by count_comment desc limit 10"); + +//最新10个小组 +$arrNewGroup = $new['group']->getNewGroup('10'); + +include template('all'); \ No newline at end of file diff --git a/app/group/action/api.php b/app/group/action/api.php new file mode 100644 index 0000000..0608b65 --- /dev/null +++ b/app/group/action/api.php @@ -0,0 +1,9 @@ + +----------------------------------------------- +Group Http Api List +URL:https://demo.thinksaas.cn +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +'; \ No newline at end of file diff --git a/app/group/action/audit.php b/app/group/action/audit.php new file mode 100644 index 0000000..5a26018 --- /dev/null +++ b/app/group/action/audit.php @@ -0,0 +1,99 @@ +isLogin(); + +$groupid = tsIntval($_GET['groupid']); + +$strGroup = $new['group']->find('group',array( + 'groupid'=>$groupid, +)); + +if($strGroup['userid']==$userid || $TS_USER['isadmin']==1){ + + switch($ts){ + + case "": + + $arrTopic = $new['group']->findAll('topic',array( + 'groupid'=>$groupid, + 'isaudit'=>1, + )); + + $title = '审核帖子'; + include template('audit'); + + break; + + //执行审核 + case "do": + + $topicid = tsIntval($_GET['topicid']); + + $new['group']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'isaudit'=>'0', + )); + + //统计需要审核的帖子 + $count_topic_audit = $new['group']->findCount('topic',array( + 'groupid'=>$groupid, + 'isaudit'=>'1', + )); + + // 统计小组下帖子数并更新 + $count_topic = $new['group']->findCount('topic',array( + 'groupid'=>$groupid, + )); + + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'count_topic'=>$count_topic, + 'count_topic_audit'=>$count_topic_audit, + )); + + tsNotice('审核成功!'); + + break; + + //删除审核 + case "delete": + + $topicid = tsIntval($_GET['topicid']); + + $strTopic = aac('topic')->getOneTopic($topicid); + + if($strGroup['groupid']!=$groupid){ + tsNotice('非法操作!'); + } + + aac('topic')->deleteTopic($strTopic); + + //统计需要审核的帖子 + $count_topic_audit = $new['group']->findCount('topic',array( + 'groupid'=>$groupid, + 'isaudit'=>'1', + )); + + // 统计小组下帖子数并更新 + $count_topic = $new['group']->findCount('topic',array( + 'groupid'=>$groupid, + )); + + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'count_topic'=>$count_topic, + 'count_topic_audit'=>$count_topic_audit, + )); + + tsNotice('删除成功!'); + + break; + + } +}else{ + tsNotice('非法操作!'); +} \ No newline at end of file diff --git a/app/group/action/cate.php b/app/group/action/cate.php new file mode 100644 index 0000000..e7fc45b --- /dev/null +++ b/app/group/action/cate.php @@ -0,0 +1,223 @@ +findAll('group_cate',array( + 'referid'=>0, + )); + + + //分类下小组 + $page = tsIntval($_GET['page'],1); + $url = tsUrl('group','cate',array('page'=>'')); + $lstart = $page*20-20; + $arrGroup = $new['group']->findAll('group',null,'isrecommend desc,count_topic desc',null,$lstart.',20'); + $groupNum = $new['group']->findCount('group'); + $pageUrl = pagination($groupNum, 20, $page, $url); + + + + $title = '分类'; + + include template('cate'); + + break; + + //二级分类 + case "2": + $cateid = tsIntval($_GET['cateid']); + $strCate = $new['group']->find('group_cate',array( + 'cateid'=>$cateid, + )); + + + $arrCate = $new['group']->findAll('group_cate',array( + 'referid'=>$cateid, + )); + + + //分类下小组 + $page = tsIntval($_GET['page'],1); + $url = tsUrl('group','cate',array('ts'=>'2','page'=>'')); + $lstart = $page*20-20; + $arrGroup = $new['group']->findAll('group',array( + 'cateid'=>$cateid, + ),null,null,$lstart.',20'); + $groupNum = $new['group']->findCount('group',array( + 'cateid'=>$cateid, + )); + $pageUrl = pagination($groupNum, 20, $page, $url); + + + + + $title = $strCate['catename']; + include template('cate2'); + + break; + + //三级分类 + case "3": + + $cateid = tsIntval($_GET['cateid']); + + $strCate = $new['group']->find('group_cate',array( + 'cateid'=>$cateid, + )); + + //上级分类 + $oneCate = $new['group']->find('group_cate',array( + 'cateid'=>$strCate['referid'], + )); + + //下级分类 + $arrCate = $new['group']->findAll('group_cate',array( + 'referid'=>$cateid, + )); + + + //分类下小组 + $page = tsIntval($_GET['page'],1); + $url = tsUrl('group','cate',array('ts'=>'3','page'=>'')); + $lstart = $page*20-20; + $arrGroup = $new['group']->findAll('group',array( + 'cateid2'=>$cateid, + ),null,null,$lstart.',20'); + + $groupNum = $new['group']->findCount('group',array( + 'cateid'=>$cateid, + )); + $pageUrl = pagination($groupNum, 20, $page, $url); + + $title = $strCate['catename']; + include template('cate3'); + break; + + //展示小组 + case "group": + + $cateid = tsIntval($_GET['cateid']); + + $strCate = $new['group']->find('group_cate',array( + 'cateid'=>$cateid, + )); + + $twoCate = $new['group']->find('group_cate',array( + 'cateid'=>$strCate['referid'], + )); + + $oneCate = $new['group']->find('group_cate',array( + 'cateid'=>$twoCate['referid'], + )); + + + //分类下小组 + $arrGroup = $new['group']->findAll('group',array( + + 'cateid3'=>$cateid, + + )); + + + $title = $strCate['catename']; + + include template('cate_group'); + + break; + + //绑定分类 + case "do": + + $groupid = tsIntval($_POST['groupid']); + $cateid = tsIntval($_POST['cateid']); + $cateid2 = tsIntval($_POST['cateid2']); + $cateid3 = tsIntval($_POST['cateid3']); + + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'cateid'=>$cateid, + 'cateid2'=>$cateid2, + 'cateid3'=>$cateid3, + )); + + //更新分类统计 + //更新一级 + if($cateid){ + $count_group = $new['group']->findCount('group',array( + 'cateid'=>$cateid, + )); + $new['group']->update('group_cate',array( + 'cateid'=>$cateid, + ),array( + 'count_group'=>$count_group, + )); + } + //更新二级 + if($cateid2){ + + $count_group = $new['group']->findCount('group',array( + 'cateid2'=>$cateid2, + )); + + $new['group']->update('group_cate',array( + 'cateid'=>$cateid2, + ),array( + 'count_group'=>$count_group, + )); + } + //更新三级 + if($cateid3){ + $count_group = $new['group']->findCount('group',array( + 'cateid3'=>$cateid3, + )); + $new['group']->update('group_cate',array( + 'cateid'=>$cateid3, + ),array( + 'count_group'=>$count_group, + )); + } + + tsNotice('分类修改成功!'); + + break; + + + //二级分类 + case "two": + $cateid = tsIntval($_GET['cateid']); + $arrCate = $db->fetch_all_assoc("select * from ".dbprefix."group_cate where referid='$cateid'"); + + if($arrCate){ + echo '"; + }else{ + echo ''; + } + break; + + //三级分类 + case "three": + $cateid2 = tsIntval($_GET['cateid2']); + $arrCate = $db->fetch_all_assoc("select * from ".dbprefix."group_cate where referid='$cateid2'"); + + if($arrCate){ + echo '"; + }else{ + echo ''; + } + break; + +} \ No newline at end of file diff --git a/app/group/action/comment.php b/app/group/action/comment.php new file mode 100644 index 0000000..71a1e8d --- /dev/null +++ b/app/group/action/comment.php @@ -0,0 +1,192 @@ +isLogin($js,$userkey); +switch($ts){ + + /** + * 添加帖子评论 + * index.php?app=group&ac=comment&ts=do&js=1 + * post + * @userkey + * @topicid + * @content + * @ispublic + */ + case "do": + + $authcode = strtolower($_POST['authcode']); + + if ($TS_SITE ['isauthcode']) { + if ($authcode != $_SESSION ['verify']) { + getJson ( "验证码输入有误,请重新输入!" ,$js,0); + } + } + + $topicid = intval($_POST['topicid']); + $content = tsClean($_POST['content'],$js); + $content2 = emptyText($_POST['content']);//测试空内容 + $ispublic = intval($_POST['ispublic']); + + //过滤内容开始 + if($TS_USER['isadmin']==0){ + aac('system')->antiWord($content,$js); + } + //过滤内容结束 + + if($content2==''){ + getJson('没有任何内容是不允许你通过滴^_^',$js); + }else{ + $commentid = $new['group']->create('group_topic_comment',array( + 'topicid' => $topicid, + 'userid' => $userid, + 'content' => $content, + 'ispublic'=>$ispublic, + 'addtime'=> time(), + )); + + //统计评论数 + $count_comment = $new['group']->findCount('group_topic_comment',array( + 'topicid'=>$topicid, + )); + + //更新帖子最后回应时间和评论数 + $new['group']->update('group_topic',array( + 'topicid'=>$topicid, + ),array( + 'count_comment'=>$count_comment, + 'uptime'=>time(), + )); + + //对积分进行处理 + aac('user')->doScore($GLOBALS['TS_URL']['app'], $GLOBALS['TS_URL']['ac'], $GLOBALS['TS_URL']['ts']); + + //发送系统消息(通知楼主有人回复他的帖子啦) + $strTopic = $new['group']->find('group_topic',array( + 'topicid'=>$topicid, + )); + + if($strTopic['userid'] != $TS_USER['userid']){ + + $msg_userid = '0'; + $msg_touserid = $strTopic['userid']; + $msg_content = '你的帖子:《'.$strTopic['title'].'》新增一条评论,快去看看给个回复吧^_^ '; + $msg_tourl = tsUrl('group','topic',array('id'=>$topicid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + + } + + getJson('评论成功',$js,1,tsUrl('group','topic',array('id'=>$topicid))); + + } + + break; + + + + //回复评论 + case "recomment": + + + + $referid = intval($_POST['referid']); + $topicid = intval($_POST['topicid']); + $content = tsClean($_POST['content']); + + $new['group']->create('group_topic_comment',array( + 'referid'=>$referid, + 'topicid'=>$topicid, + 'userid'=>$userid, + 'content'=>$content, + 'addtime'=>time(), + )); + + + //统计评论数 + $count_comment = $new['group']->findCount('group_topic_comment',array( + 'topicid'=>$topicid, + )); + + //更新帖子最后回应时间和评论数 + $new['group']->update('group_topic',array( + 'topicid'=>$topicid, + ),array( + 'count_comment'=>$count_comment, + 'uptime'=>time(), + )); + + $strTopic = $new['group']->find('group_topic',array( + 'topicid'=>$topicid, + )); + + $strComment = $new['group']->find('group_topic_comment',array( + 'commentid'=>$referid, + )); + + if($topicid && $strTopic['userid'] != $TS_USER['userid']){ + $msg_userid = '0'; + $msg_touserid = $strTopic['userid']; + $msg_content = '你的帖子:《'.$strTopic['title'].'》新增一条评论,快去看看给个回复吧^_^ '; + $msg_tourl = tsUrl('group','topic',array('id'=>$topicid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + } + + if($referid && $strComment['userid'] != $TS_USER['userid']){ + $msg_userid = '0'; + $msg_touserid = $strComment['userid']; + $msg_content = '有人评论了你在帖子:《'.$strTopic['title'].'》中的回复,快去看看给个回复吧^_^ '; + $msg_tourl = tsUrl('group','topic',array('id'=>$topicid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + } + + echo 0;exit; + + break; + + + + //删除评论 + case "delete": + + $commentid = intval($_GET['commentid']); + + $strComment = $new['group']->find('group_topic_comment',array( + 'commentid'=>$commentid, + )); + + $strTopic = $new['group']->find('group_topic',array( + 'topicid'=>$strComment['topicid'], + )); + + $strGroup = $new['group']->find('group',array( + 'groupid'=>$strTopic['groupid'], + )); + + if($strTopic['userid']==$userid || $strGroup['userid']==$userid || $TS_USER['isadmin']==1 || $strComment['userid']==$userid){ + + $new['group']->delComment($commentid); + + //统计评论数 + $count_comment = $new['group']->findCount('group_topic_comment',array( + 'topicid'=>$strTopic['topicid'], + )); + + //更新帖子最后回应时间和评论数 + $new['group']->update('group_topic',array( + 'topicid'=>$strTopic['topicid'], + ),array( + 'count_comment'=>$count_comment, + )); + + //处理积分 + aac('user')->doScore($GLOBALS['TS_URL']['app'], $GLOBALS['TS_URL']['ac'], $GLOBALS['TS_URL']['ts'],$strComment['userid']); + + + + } + + //跳转回到帖子页 + header("Location: ".tsUrl('group','topic',array('id'=>$strComment['topicid']))); + + break; +} \ No newline at end of file diff --git a/app/group/action/create.php b/app/group/action/create.php new file mode 100644 index 0000000..bc0d42d --- /dev/null +++ b/app/group/action/create.php @@ -0,0 +1,169 @@ +isLogin(); + +//判断用户是否存在 +if(aac('user')->isUser($userid)==false) tsNotice('不好意思,用户不存在!'); + +//判断发布者状态 +if(aac('user')->isPublisher()==false) tsNotice('不好意思,你还没有权限发布内容!'); + +//发布时间限制 +if(aac('system')->pubTime()==false) tsNotice('不好意思,当前时间不允许发布内容!'); + + +switch($ts){ + + case "": + + //先判断加入多少个小组啦 + $userGroupNum = $new['group']->findCount('group_user',array( + 'userid'=>$userid + )); + + if($userGroupNum >= $TS_APP['joinnum'] && $TS_USER['isadmin']==0){ + tsNotice('你加入的小组总数已经到达'.$TS_APP['joinnum'].'个,不能再创建小组!'); + } + + if($TS_APP['iscreate'] == 0 || $TS_USER['isadmin']==1){ + + //小组分类 + $arrCate = $new['group']->findAll('group_cate',array( + + 'referid'=>0, + + )); + + $title = '创建小组'; + + include template("create"); + + }else{ + + tsNotice('系统不允许会员创建小组!'); + + } + break; + + //执行创建小组 + case "do": + + //先判断加入多少个小组啦 + $userGroupNum = $new['group']->findCount('group_user',array( + 'userid'=>$userid + )); + + if($userGroupNum >= $TS_APP['joinnum'] && $TS_USER['isadmin']==0){ + tsNotice('你加入的小组总数已经到达'.$TS_APP['joinnum'].'个,不能再创建小组!'); + } + + if($TS_APP['iscreate'] == 0 || $TS_USER['isadmin']==1){ + + $groupname = tsTrim($_POST['groupname']); + $groupdesc = tsTrim($_POST['groupdesc']); + + if($groupname=='' || $groupdesc=='') { + tsNotice('小组名称和介绍不能为空!'); + } + + //过滤内容开始 + if($TS_USER['isadmin']!=1){ + $groupname = antiWord($groupname); + $groupdesc = antiWord($groupdesc); + } + //过滤内容结束 + + //配置文件是否需要审核 + $isaudit = tsIntval($TS_APP['isaudit']); + if($TS_USER['isadmin']==1){ + $isaudit = 0; + } + + $isGroup = $new['group']->findCount('group',array( + 'groupname'=>$groupname, + )); + + if($isGroup > 0) { + tsNotice("小组名称已经存在,请更换其他小组名称!"); + } + + $groupid = $new['group']->create('group',array( + 'userid' => $userid, + 'groupname' => $groupname, + 'groupdesc' => $groupdesc, + 'isaudit' => $isaudit, + 'addtime' => time(), + )); + + //上传 + $arrUpload = tsUpload($_FILES['photo'],$groupid,'group',array('jpg','gif','png','jpeg')); + + if($arrUpload){ + + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'path'=>$arrUpload['path'], + 'photo'=>$arrUpload['url'], + )); + } + + //绑定成员 + $new['group']->create('group_user',array( + 'userid'=>$userid, + 'groupid'=>$groupid, + 'addtime'=>time(), + )); + + //更新 + $count_group = $new['group']->findCount('group_user',array( + 'userid'=>$userid, + )); + $new['group']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'count_group'=>$count_group, + )); + + //更新小组人数 + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'count_user'=>1, + )); + + //更新分类统计 + $cateid = tsIntval($_POST['cateid']); + if($cateid > 0){ + $count_group = $new['group']->findCount('group',array( + 'cateid'=>$cateid, + )); + + $new['group']->update('group_cate',array( + 'cateid'=>$cateid, + ),array( + 'count_group'=>$count_group, + )); + + } + + // 处理标签 + aac ( 'tag' )->addTag ( 'group', 'groupid', $groupid, $_POST['tag'] ); + + + // 对积分进行处理 + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'],$TS_URL['ts']); + + + #用户记录 + aac('pubs')->addLogs('group','groupid',$groupid,$userid,$groupname,$groupdesc,0); + + + header("Location: ".tsUrl('group','show',array('id'=>$groupid))); + } + break; + +} \ No newline at end of file diff --git a/app/group/action/delete.php b/app/group/action/delete.php new file mode 100644 index 0000000..f9ecaf8 --- /dev/null +++ b/app/group/action/delete.php @@ -0,0 +1,3 @@ +isLogin(); + +switch ($ts) { + + //删除帖子 + case "deltopic": + + //普通用户不允许删除内容 + if($TS_SITE['isallowdelete'] && $TS_USER ['isadmin'] == 0) tsNotice('系统不允许用户删除内容,请联系管理员删除!'); + + $topicid = intval($_GET['topicid']); + + $strTopic = $new['group']->find('group_topic',array('topicid'=>$topicid)); + + $groupid = $strTopic['groupid']; + + $strGroup = $new['group']->find('group',array('groupid'=>$groupid)); + + $strGroupUser = $new['group']->find('group_user',array( + 'userid'=>$userid, + 'groupid'=>$groupid, + )); + + //系统管理员删除 + if($TS_USER['isadmin'] == '1'){ + $new['group']->delTopic($topicid,$groupid); + + header('Location: '.tsUrl('group')); + exit; + + } + /* + //其他人员删除 + if($userid == $strTopic['userid'] || $userid == $strGroup['userid'] || $strGroupUser['isadmin']=='1'){ + + $new['group']->update('group_topic',array( + 'topicid'=>$topicid, + ),array( + 'isdelete'=>1, + )); + + + + //处理积分 + aac('user')->doScore($GLOBALS['TS_URL']['app'],$GLOBALS['TS_URL']['ac'],$GLOBALS['TS_URL']['ts'],$strTopic['userid']); + + + tsNotice('你的删除帖子申请已经提交!'); + + } + */ + //其他人员删除 + if($userid == $strTopic['userid'] || $userid == $strGroup['userid'] || $strGroupUser['isadmin']=='1') + { + //处理积分 + aac('user')->doScore($GLOBALS['TS_URL']['app'],$GLOBALS['TS_URL']['ac'],$GLOBALS['TS_URL']['ts'],$strTopic['userid']); + $new['group']->delTopic($topicid,$groupid); + header('Location: '.tsUrl('group')); + exit; + } + break; + + //收藏帖子 + case "topic_collect": + + $topicid = intval($_POST['topicid']); + + $strTopic = $db->once_fetch_assoc("select * from ".dbprefix."group_topic where topicid='".$topicid."'"); + + $collectNum = $db->once_num_rows("select * from ".dbprefix."group_topic_collect where userid='$userid' and topicid='$topicid'"); + + if($userid == '0'){ + echo 0; + }elseif($userid == $strTopic['userid']){ + echo 1; + }elseif($collectNum > 0){ + echo 2; + }else{ + + $new['group']->create('group_topic_collect',array( + 'userid'=>$userid, + 'topicid'=>$topicid, + 'addtime'=>time(), + )); + + $new['group']->update('group_topic',array( + 'topicid'=>$topicid, + ),array( + 'count_love'=>$strTopic['count_love']+1, + )); + + echo 3; + } + + break; + + //置顶帖子 + case "topic_istop": + + $topicid = intval($_GET['topicid']); + + $strTopic = $new['group']->find('group_topic',array( + 'topicid'=>$topicid, + )); + + $istop = $strTopic['istop']; + + $istop == 0 ? $istop = 1 : $istop = 0; + + $strGroup = $new['group']->find('group',array( + 'groupid'=>$strTopic['groupid'], + )); + + if($userid==$strGroup['userid'] || $TS_USER['isadmin']==1){ + $new['group']->update('group_topic',array( + 'topicid'=>$topicid, + ),array( + 'istop'=>$istop, + )); + + + tsNotice("帖子置顶成功!"); + + + }else{ + tsNotice("非法操作!"); + } + break; + + //帖子标签 + case "topic_tag_ajax"; + + $topicid = intval($_GET['topicid']); + include template("topic_tag_ajax"); + break; + + //添加帖子标签 + case "topic_tag_do": + + $topicid = intval($_POST['topicid']); + + if($topicid == 0) tsNotice("非法操作!"); + + $tagname = t($_POST['tagname']); + $uptime = time(); + + if($tagname != ''){ + + if(strlen($tagname) > '32') tsNotice("TAG长度大于32个字节(不能超过16个汉字)"); + + $tagcount = $db->once_num_rows("select * from ".dbprefix."tag where tagname='".$tagname."'"); + + if($tagcount == '0'){ + $db->query("INSERT INTO ".dbprefix."tag (`tagname`,`uptime`) VALUES ('".$tagname."','".$uptime."')"); + $tagid = $db->insert_id(); + + $tagIndexCount = $db->once_num_rows("select * from ".dbprefix."tag_topic_index where topicid='".$topicid."' and tagid='".$tagid."'"); + if($tagIndexCount == '0'){ + $db->query("INSERT INTO ".dbprefix."tag_topic_index (`topicid`,`tagid`) VALUES ('".$topicid."','".$tagid."')"); + } + + $tagIdCount = $db->once_num_rows("select * from ".dbprefix."tag_topic_index where tagid='".$tagid."'"); + + $db->query("update ".dbprefix."tag set `count_topic`='".$tagIdCount."',`uptime`='".$uptime."' where tagid='".$tagid."'"); + + }else{ + + $tagData = $db->once_fetch_assoc("select * from ".dbprefix."tag where tagname='".$tagname."'"); + + $tagIndexCount = $db->once_num_rows("select * from ".dbprefix."tag_topic_index where topicid='".$topicid."' and tagid='".$tagData['tagid']."'"); + if($tagIndexCount == '0'){ + $db->query("INSERT INTO ".dbprefix."tag_topic_index (`topicid`,`tagid`) VALUES ('".$topicid."','".$tagData['tagid']."')"); + } + + $tagIdCount = $db->once_num_rows("select * from ".dbprefix."tag_topic_index where tagid='".$tagData['tagid']."'"); + + $db->query("update ".dbprefix."tag set `count_topic`='".$tagIdCount."',`uptime`='".$uptime."' where tagid='".$tagData['tagid']."'"); + + } + + echo ""; + + } + + break; + + + + + + + + case 'parseurl': + function formPost($url,$post_data){ + $o=''; + foreach ($post_data as $k=>$v){ + $o.= "$k=".urlencode($v)."&"; + } + $post_data=substr($o,0,-1); + $ch = curl_init(); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_URL,$url); + curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); + $result = curl_exec($ch); + return $result; + } + + $url = $_POST['parseurl']; + $urlArr = parse_url($url); + $domainArr = explode('.',$urlArr['host']); + $data['type'] = $domainArr[count($domainArr)-2]; + $str = formPost('http://share.pengyou.com/index.php?mod=usershare&act=geturlinfo',array('url'=>$url)); + echo $str; + + break; + + //置顶帖子 + case "isposts": + + $topicid = intval($_GET['topicid']); + + if($userid == 0 || $topicid == 0) tsNotice("非法操作"); + + $strTopic = $db->once_fetch_assoc("select userid,groupid,title,isposts from ".dbprefix."group_topic where topicid='$topicid'"); + + $strGroup = $db->once_fetch_assoc("select userid from ".dbprefix."group where groupid='".$strTopic['groupid']."'"); + + if($userid == $strGroup['userid'] || intval($TS_USER['isadmin']) == 1){ + if($strTopic['isposts']==0){ + $db->query("update ".dbprefix."group_topic set `isposts`='1' where `topicid`='$topicid'"); + + //msg start + $msg_userid = '0'; + $msg_touserid = $strTopic['userid']; + $msg_content = '恭喜,你的帖子:《'.$strTopic['title'].'》被评为精华帖啦^_^ '; + $msg_tourl = tsUrl('group','topic',array('id'=>$topicid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + //msg end + + }else{ + $db->query("update ".dbprefix."group_topic set `isposts`='0' where `topicid`='$topicid'"); + } + + tsNotice("操作成功!"); + }else{ + tsNotice("非法操作!"); + } + + break; + + //小组邀请用户 + case "invite": + + $iuserid = intval($_POST['userid']); + $groupid = intval($_POST['groupid']); + + if(aac('user')->isUser($iuserid) && $new['group']->isGroup($groupid)){ + + //先统计用户有多少个小组了,20个封顶 + $userGroupNum = $new['group']->findCount('group_user',array('userid'=>$iuserid)); + + if($userGroupNum >= $TS_APP['joinnum']) tsNotice('邀请用户加入的小组总数已经到达'.$TS_APP['joinnum'].'个,不能再加入小组!'); + + $groupUserNum = $new['group']->findCount('group_user',array( + 'userid'=>$iuserid, + 'groupid'=>$groupid, + )); + + if($groupUserNum > 0) tsNotice('用户已经加入小组!'); + + $new['group']->create('group_user',array( + 'userid'=>$iuserid, + 'groupid'=>$groupid, + 'addtime'=>time(), + )); + + //计算小组会员数 + $count_user = $new['group']->findCount('group_user',array( + 'groupid'=>$groupid, + )); + + //更新小组成员统计 + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'count_user'=>$count_user, + )); + + //发送系统消息开始 + $msg_userid = '0'; + $msg_touserid = $iuserid; + $msg_content = '你被邀请加入一个小组,快去看看吧'; + $msg_tourl = tsUrl('group','show',array('id'=>$groupid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + //发送系统消息end + + header('Location: '.tsUrl('group','show',array('id'=>$groupid))); + + }else{ + tsNotice('倒霉了吧?'); + } + + break; + + //usertips + case "usertips": + + $data = fileRead('data/user_tips.php'); + + if($data == ''){ + $query = $db->fetch_all_assoc("select * from " . dbprefix . "user_info"); + foreach($query as $user) { + $usertip[]=array('user'=>$user['username'],'name'=>$user['userid']); + } + fileWrite('user_tips.php','data',json_encode($usertip)); + $data = fileRead('data/user_tips.php'); + } + + echo $data; + + break; +} diff --git a/app/group/action/edit.php b/app/group/action/edit.php new file mode 100644 index 0000000..877fac2 --- /dev/null +++ b/app/group/action/edit.php @@ -0,0 +1,602 @@ +isLogin(); + +$groupid = tsIntval($_GET['groupid']); + +$strGroup = $new['group']->find('group',array( + 'groupid'=>$groupid, +)); + +if($strGroup['userid']!=$userid && $TS_USER['isadmin']==0){ + tsNotice('非法操作!'); +} + +$strGroup['groupname'] = tsDecode($strGroup['groupname']); +$strGroup['groupdesc'] = tsDecode($strGroup['groupdesc']); +$strGroup['photo'] = $new['group']->getGroupPhoto($strGroup); +$strGroup['bgphoto'] = $new['group']->getGroupBgPhoto($strGroup); + + + +switch($ts){ + + //编辑小组基本信息 + case "base": + + + //小组标签 + $arrTags = aac ( 'tag' )->getObjTagByObjid ( 'group', 'groupid', $groupid ); + foreach ( $arrTags as $key => $item ) { + $arrTag [] = $item ['tagname']; + } + $strGroup ['tag'] = arr2str ( $arrTag ); + + $title = '编辑小组基本信息'; + include template("edit_base"); + + break; + + //编辑小组基本信息 + case "basedo": + + $groupname = tsTrim($_POST['groupname']); + $groupdesc = tsTrim($_POST['groupdesc']); + + if($groupname=='' || $groupdesc=='') tsNotice("小组名称和介绍都不能为空!"); + + //过滤内容开始 + if($TS_USER['isadmin']!=1){ + $groupname = antiWord($groupname); + $groupdesc = antiWord($groupdesc); + } + + //过滤内容结束 + + $isgroupname = $new['group']->findCount('group',array( + 'groupname'=>$groupname, + )); + + if($isgroupname > 0 && $strGroup['groupname']!=$groupname) tsNotice('小组名称已经存在!'); + + + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'groupname' => $groupname, + 'groupdesc' => $groupdesc, + 'joinway' => tsIntval($_POST['joinway']), + 'price' => tsIntval($_POST['price']), + 'ispost' => tsIntval($_POST['ispost']), + 'isopen' => tsIntval($_POST['isopen']), + 'ispostaudit' => tsIntval($_POST['ispostaudit']), + )); + + // 处理标签 + if ($_POST ['tag']) { + aac ( 'tag' )->delIndextag ( 'group', 'groupid', $groupid ); + aac ( 'tag' )->addTag ( 'group', 'groupid', $groupid, $_POST ['tag'] ); + } + + + #用户记录 + aac('pubs')->addLogs('group','groupid',$groupid,$userid,$groupname,$groupdesc,1); + + tsNotice('基本信息修改成功!'); + + + + break; + + + //编辑小组头像 + case "icon": + + $title = '修改小组头像'; + include template("edit_icon"); + + break; + + //上传小组头像 + + case "icondo": + + //上传图标 + $arrUpload = tsUpload($_FILES['photo'],$groupid,'group',array('jpg','gif','png','jpeg')); + + if($arrUpload){ + + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'path'=>$arrUpload['path'], + 'photo'=>$arrUpload['url'], + 'uptime'=>time(), + )); + + tsDimg($arrUpload['url'],'group','200','200',$arrUpload['path']); + tsXimg($arrUpload['url'],'group','200','200',$arrUpload['path'],1); + + + } + + + //上传背景 + $arrBgUpload = tsUpload($_FILES['bgphoto'],$groupid,'group/bgphoto',array('jpg','gif','png','jpeg')); + + if($arrBgUpload){ + + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'path'=>$arrBgUpload['path'], + 'bgphoto'=>$arrBgUpload['url'], + 'uptime'=>time(), + )); + + } + + + tsNotice('修改成功!'); + + break; + + + //修改访问权限 + case "privacy": + + $title = '编辑小组权限'; + include template("edit_privacy"); + + break; + + + + + //帖子分类 + case "type": + //调出类型 + $arrGroupType = $new['group']->findAll('topic_type',array( + 'groupid'=>$strGroup['groupid'], + )); + + $title = '编辑帖子分类'; + include template("edit_type"); + + break; + + + //添加帖子分类 + case "typeadd": + + $typename = tsTrim($_POST['typename']); + if($typename){ + $new['group']->create('topic_type',array( + 'groupid'=>$groupid, + 'typename'=>$typename, + )); + } + + header("Location: ".tsUrl('group','edit',array('ts'=>'type','groupid'=>$groupid))); + break; + + //修改帖子分类 + case "typeedit": + $typeid = tsIntval($_POST['typeid']); + $typename = tsTrim($_POST['typename']); + if($typeid && $typename){ + $new['group']->update('topic_type',array( + 'typeid'=>$typeid, + 'groupid'=>$groupid, + ),array( + 'typename'=>$typename, + )); + } + header("Location: ".tsUrl('group','edit',array('ts'=>'type','groupid'=>$groupid))); + break; + + + //删除帖子分类 + case "typedelete": + + $typeid = tsIntval($_GET['typeid']); + + $new['group']->delete('topic_type',array( + 'typeid'=>$typeid, + 'groupid'=>$groupid, + )); + + $new['group']->update('topic',array( + 'groupid'=>$groupid, + 'typeid'=>$typeid, + ),array( + 'typeid'=>0, + )); + + header("Location: ".tsUrl('group','edit',array('ts'=>'type','groupid'=>$groupid))); + break; + + + + + + + //小组分类 + case "cate": + + $arrCate = $new['group']->findAll('group_cate',array( + + 'referid'=>0, + + )); + + //一级分类 + $strCate = $new['group']->find('group_cate',array( + 'cateid'=>$strGroup['cateid'], + )); + //二级分类 + $strCate2 = $new['group']->find('group_cate',array( + 'cateid'=>$strGroup['cateid2'], + )); + //三级分类 + $strCate3 = $new['group']->find('group_cate',array( + 'cateid'=>$strGroup['cateid3'], + )); + + $title = '编辑小组分类'; + include template("edit_cate"); + + break; + + + //成员审核 + case "useraudit": + + $arrUserId = $new['group']->findAll('group_user_isaudit',array( + 'groupid'=>$groupid, + )); + foreach($arrUserId as $key=>$item){ + $arrUser[] = aac('user')->getSimpleUser($item['userid']); + } + + $title = '成员申请加入审核'; + include template('edit_useraudit'); + break; + + //成员审核执行 + case "userauditdo": + + $userid = tsIntval($_GET['userid']); + $status = tsIntval($_GET['status']); + + + //0加入1删除 + if($status==0 && $userid){ + + $new['group']->create('group_user',array( + 'userid'=>$userid, + 'groupid'=>$groupid, + 'addtime'=>time(), + )); + + //更新 + $count_group = $new['group']->findCount('group_user',array( + 'userid'=>$userid, + )); + $new['group']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'count_group'=>$count_group, + )); + + //计算小组会员数 + $count_user = $new['group']->findCount('group_user',array( + 'groupid'=>$groupid, + )); + + //更新小组成员统计 + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'count_user'=>$count_user, + )); + + } + + $new['group']->delete('group_user_isaudit',array( + 'userid'=>$userid, + 'groupid'=>$groupid, + )); + + header('Location: '.tsUrl('group','edit',array('groupid'=>$groupid,'ts'=>'useraudit'))); + + break; + + + //小组转让 + case "transfer": + + + $title = '小组转让'; + include template('edit_transfer'); + break; + + case "transferdo": + + + $touserid = tsIntval($_POST['touserid']); + + $strTouser = $new['group']->find('group_user',array( + 'userid'=>$touserid, + 'groupid'=>$groupid, + )); + + if($strTouser==''){ + tsNotice('用户还没有加入本小组,只能转让给本小组成员'); + } + + $new['group']->update('group',array( + 'groupid'=>$groupid, + ),array( + 'userid'=>$touserid, + )); + + tsNotice('小组转让成功!'); + + break; + + #添加用户 + case "adduser": + + $js = tsIntval($_GET['js']); + + + $userid = tsIntval($_POST['userid']); + + if($userid==0){ + getJson('用户ID输入有误!',$js); + } + + $isGroupUser = $new['group']->findCount('group_user',array( + 'groupid'=>$groupid, + 'userid'=>$userid, + )); + + if($isGroupUser>0){ + getJson('用户已经加入小组!',$js); + } + + $new['group']->create('group_user',array( + 'groupid'=>$groupid, + 'userid'=>$userid, + 'addtime'=>time(), + )); + + + //发送系统消息 + $msg_userid = '0'; + $msg_touserid = $userid; + $msg_content = '恭喜你,你成为了小组《'.$strGroup['groupname'].'》的成员!快去看看吧'; + $msg_tourl = tsUrl('group','show',array('id'=>$groupid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + + + getJson('操作成功!',$js,1); + + break; + + + #小组管理员 + case "isadmin": + + $arrAdmin = $new['group']->findAll('group_user',array( + 'groupid'=>$groupid, + 'isadmin'=>1, + )); + + $arrAdminUser = array(); + if($arrAdmin){ + foreach($arrAdmin as $key=>$item){ + $arrUserId[] = $item['userid']; + } + $userids = arr2str($arrUserId); + + $arrAdminUser = $new['group']->findAll('user_info',"`userid` in ($userids)",'addtime desc','userid,username'); + + } + + + $title = '小组管理员'; + include template('edit_isadmin'); + + break; + + case "isadmindo": + + $js = tsIntval($_GET['js']); + + + $userid = tsIntval($_POST['userid']); + + if($userid==0){ + getJson('用户ID输入有误!',$js); + } + + if($userid==$strGroup['userid']){ + getJson('用户ID不可以是组长ID!',$js); + } + + $isGroupUser = $new['group']->findCount('group_user',array( + 'groupid'=>$groupid, + 'userid'=>$userid, + )); + + if($isGroupUser==0){ + getJson('输入用户ID不属于该小组用户!',$js); + } + + $new['group']->update('group_user',array( + 'groupid'=>$groupid, + 'userid'=>$userid, + ),array( + 'isadmin'=>1, + )); + + + //发送系统消息 + $msg_userid = '0'; + $msg_touserid = $userid; + $msg_content = '恭喜你,你成为了小组《'.$strGroup['groupname'].'》的管理员!快去看看吧'; + $msg_tourl = tsUrl('group','show',array('id'=>$groupid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + + + getJson('操作成功!',$js,1); + + break; + + #取消管理员 + case "isadmindel": + + $js = tsIntval($_GET['js']); + + + $userid = tsIntval($_POST['userid']); + + if($userid==0){ + getJson('用户ID输入有误!',$js); + } + + if($userid==$strGroup['userid']){ + getJson('用户ID不可以是组长ID!',$js); + } + + $isGroupUser = $new['group']->findCount('group_user',array( + 'groupid'=>$groupid, + 'userid'=>$userid, + )); + + if($isGroupUser==0){ + getJson('输入用户ID不属于该小组用户!',$js); + } + + $new['group']->update('group_user',array( + 'groupid'=>$groupid, + 'userid'=>$userid, + ),array( + 'isadmin'=>0, + )); + + + //发送系统消息 + $msg_userid = '0'; + $msg_touserid = $userid; + $msg_content = '不好意思,你在小组《'.$strGroup['groupname'].'》的管理员身份被撤销了!快去看看吧'; + $msg_tourl = tsUrl('group','show',array('id'=>$groupid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + + + getJson('操作成功!',$js,1); + + break; + + + case "user": + + + $guserid = tsIntval($_GET['guserid']); + + + $page = tsIntval($_GET['page'],1); + + $url = tsUrl('group','edit',array('ts'=>'user','groupid'=>$groupid,'page'=>'')); + + + $lstart = $page*40-40; + + $arr = array( + 'groupid'=>$groupid, + 'isadmin'=>0, + 'isfounder'=>0, + ); + + if($guserid){ + + $arr = array( + 'userid'=>$guserid, + 'groupid'=>$groupid, + 'isadmin'=>0, + 'isfounder'=>0, + ); + + } + + //普通用户 + $groupUserNum = $new['group']->findCount('group_user',$arr); + + $groupUser = $new['group']->findAll('group_user',$arr,'userid desc',null,$lstart.',40'); + + if(is_array($groupUser)){ + foreach($groupUser as $key=>$item){ + $arrGroupUser[$key] = aac('user')->getSimpleUser($item['userid']); + $arrGroupUser[$key]['endtime'] = $item['endtime']; + $arrGroupUser[$key]['price'] = $item['price']; + } + } + + $pageUrl = pagination($groupUserNum, 40, $page, $url); + + $title = '用户管理'; + include template('edit_user'); + break; + + case "xuqi": + + $js = tsIntval($_GET['js']); + + + $userid = tsIntval($_POST['userid']); + $endtime = tsTrim($_POST['endtime']); + + if($userid==0){ + getJson('用户ID输入有误!',$js); + } + + + if($endtime==''){ + getJson('续期时间不能为空!',$js); + } + + if($endtimefindCount('group_user',array( + 'groupid'=>$groupid, + 'userid'=>$userid, + )); + + if($isGroupUser==0){ + getJson('续期用户不属于该小组用户!',$js); + } + + $new['group']->update('group_user',array( + 'groupid'=>$groupid, + 'userid'=>$userid, + ),array( + 'endtime'=>$endtime, + )); + + getJson('操作成功!',$js,1); + + break; + + + + + +} diff --git a/app/group/action/index.php b/app/group/action/index.php new file mode 100644 index 0000000..7102954 --- /dev/null +++ b/app/group/action/index.php @@ -0,0 +1,65 @@ +findAll('group_cate',array( + 'referid'=>0, +)); + + +// 所有小组 +$page = tsIntval($_GET['page'],1); +$lstart = $page * 32 - 32; +$url = tsUrl ( 'group', 'index', array ('page' => '') ); +$arr = array( + 'isaudit'=>0 +); + +if($cateid){ + $strCate = $new['group']->find('group_cate',array( + 'cateid'=>$cateid, + )); + $url = tsUrl ( 'group', 'index', array ('cateid'=>$cateid,'page' => '') ); + $arr = array( + 'cateid'=>$cateid, + 'isaudit'=>0, + ); + +} + +$arrGroup = $new ['group']->findAll ( 'group', $arr, 'isrecommend desc,addtime asc', null, $lstart . ',32' ); + +foreach ( $arrGroup as $key => $item ) { + $arrGroup[$key]['groupname'] = tsTitle ( $item['groupname'] ); + $arrGroup[$key]['groupdesc'] = cututf8 (tsTitle($item ['groupdesc']), 0, 35 ); + $arrGroup[$key]['photo_url'] = $new['group']->getGroupPhoto($item); +} + +$groupNum = $new ['group']->findCount ( 'group',$arr); + +$pageUrl = pagination ( $groupNum, 32, $page, $url ); + +// 我加入的小组 +$myGroup = array (); +if ($TS_USER ['userid']) { + $myGroups = $new ['group']->findAll ( 'group_user', array ( + 'userid' => $TS_USER ['userid'] + ), null, 'groupid' ); + foreach ( $myGroups as $item ) { + $myGroup [] = $item ['groupid']; + } +} + +// 最新10个小组 +$arrNewGroup = $new ['group']->getNewGroup ( '10' ); + +$title = '小组'; +if($strCate){ + $title = $strCate['catename']; +} + +$sitekey = $TS_APP['appkey']; +$sitedesc = $TS_APP['appdesc']; +include template ( "index" ); \ No newline at end of file diff --git a/app/group/action/kicked.php b/app/group/action/kicked.php new file mode 100644 index 0000000..3aefb4c --- /dev/null +++ b/app/group/action/kicked.php @@ -0,0 +1,34 @@ +find('group',array( + 'groupid'=>$groupid, +)); + +if($strGroup['userid']!=$groupuserid){ + + echo 1;exit; + +} + +$new['group']->delete('group_user',array( + 'userid'=>$userid, + 'groupid'=>$groupid, +)); + +$new['group']->update('group',array( + 'groupid'=>$groupid, +),array( + 'count_user'=>$strGroup['count_user']-1, +)); + +echo 2;exit; \ No newline at end of file diff --git a/app/group/action/my.php b/app/group/action/my.php new file mode 100644 index 0000000..0f8df1f --- /dev/null +++ b/app/group/action/my.php @@ -0,0 +1,11 @@ +isLogin(); + $strUser = aac('user')->getOneUser($userid); + include_once 'app/' . $TS_URL['app'] . '/action/my/' . $TS_URL['my'] . '.php'; +} else { + qiMsg ( 'sorry:no index!' ); +} \ No newline at end of file diff --git a/app/group/action/my/common.php b/app/group/action/my/common.php new file mode 100644 index 0000000..59b5488 --- /dev/null +++ b/app/group/action/my/common.php @@ -0,0 +1,6 @@ +isLogin(); + +$strUser = aac('user')->getOneUser($userid); \ No newline at end of file diff --git a/app/group/action/my/index.php b/app/group/action/my/index.php new file mode 100644 index 0000000..9dd4844 --- /dev/null +++ b/app/group/action/my/index.php @@ -0,0 +1,30 @@ +findAll('group_user',array( + 'userid'=>$strUser['userid'], +),null,'groupid'); + + +foreach($arrGroupsList as $key=>$item){ + $arrGroup[] = aac('group')->getOneGroup($item['groupid']); +} + +//创建的小组 +$arrCreateGroup = $new['group']->findAll('group',array( + 'userid'=>$strUser['userid'], +)); + +foreach($arrCreateGroup as $key=>$item){ + $arrCreateGroup[$key]['groupname'] = tsTitle($item['groupname']); + if($item['photo']){ + $arrCreateGroup[$key]['photo'] = tsXimg($item['photo'],'group',120,120,$item['path'],1); + }else{ + $arrCreateGroup[$key]['photo'] = SITE_URL.'public/images/group.jpg'; + } +} + + +$title = '我加入的小组'; +include template('my/index'); \ No newline at end of file diff --git a/app/group/action/my/topic.php b/app/group/action/my/topic.php new file mode 100644 index 0000000..4d75faf --- /dev/null +++ b/app/group/action/my/topic.php @@ -0,0 +1,20 @@ +'topic','page' => '' ) ); +$lstart = $page * 20 - 20; + +$arrTopic = $new['group']->findAll('group_topic',array( + 'userid'=>$strUser['userid'], +),'addtime desc',null,$lstart.',20'); + +$topicNum = $new ['group']->findCount ( 'group_topic', array ( + 'userid' => $strUser['userid'], +) ); + +$pageUrl = pagination ( $topicNum, 20, $page, $url ); + +$title = '我的帖子'; +include template('my/topic'); \ No newline at end of file diff --git a/app/group/action/plugin.php b/app/group/action/plugin.php new file mode 100644 index 0000000..7cc6698 --- /dev/null +++ b/app/group/action/plugin.php @@ -0,0 +1,12 @@ +getOneGroup($groupid); + +if($strGroup['groupid'] == '') { + header("HTTP/1.1 404 Not Found"); + header("Status: 404 Not Found"); + $title = '404'; + include pubTemplate("404"); + exit; +} + +if($strGroup['isaudit'] == 1) { + tsNotice('小组审核中...'); +} + +$title = $strGroup['groupname']; + +//小组帖子分类 +$arrTopicTypes = $new['group']->findAll('topic_type',array( + 'groupid'=>$groupid, +)); + +if(is_array($arrTopicTypes)){ + foreach($arrTopicTypes as $item){ + $arrTopicType[$item['typeid']] = $item; + } +} + +//组长信息 +$strLeader = aac('user')->getSimpleUser($strGroup['userid']); + +//判断会员是否加入该小组 +$isGroupUser = ''; +if(tsIntval($TS_USER['userid'])){ + $strUser = aac('user')->getSimpleUser(tsIntval($TS_USER['userid'])); + $isGroupUser = $new['group']->find('group_user',array( + 'userid'=>tsIntval($TS_USER['userid']), + 'groupid'=>$groupid, + )); +} + +//小组是否需要审核 +if($strGroup['isaudit']=='1'){ + //推荐小组 + $arrRecommendGroup = $new['group']->getRecommendGroup('7'); + include template("group_isaudit"); + +}else{ + + $page = tsIntval($_GET['page'],1); + + $lstart = $page*30-30; + + if($typeid > 0){ + $andType = " and `typeid`='$typeid'"; + $url = tsUrl('group','show',array('id'=>$groupid,'typeid'=>$typeid,'page'=>'')); + }else{ + $andType = ''; + $url = tsUrl('group','show',array('id'=>$groupid,'page'=>'')); + } + + $arrTopics = $new['group']->findAll('topic',"`groupid`='$groupid' ".$andType." and `isaudit`='0'",'istop desc,uptime desc',null,$lstart.',30'); + + if( is_array($arrTopics)){ + foreach($arrTopics as $key=>$item){ + $arrTopic[] = $item; + $arrTopic[$key]['title'] = tsTitle($item['title']); + $arrTopic[$key]['gaiyao'] = tsTitle($item['gaiyao']); + $arrTopic[$key]['typename'] = $arrTopicType[$item['typeid']]['typename']; + $arrTopic[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + $arrTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']); + } + } + + $topicNum = $new['group']->findCount('topic',"`groupid`='$groupid' ".$andType); + + $pageUrl = pagination($topicNum, 30, $page, $url); + + + //是否小组会员 + $groupUser = $new['group']->findAll('group_user',array( + 'groupid'=>$groupid, + ),'addtime desc',null,8); + + if(is_array($groupUser)){ + foreach($groupUser as $item){ + $strUser = aac('user')->getSimpleUser($item['userid']); + if($strUser){ + $arrGroupUser[] = $strUser; + }else{ + $new['group']->delete('group_user',array( + 'userid'=>$item['userid'], + 'groupid'=>$groupid, + )); + } + } + } + + //小组管理员 + $arrGroupAdmin = $new['group']->findAll('group_user',array( + 'groupid'=>$groupid, + 'isadmin'=>1, + )); + $arrGroupAdminUser = array(); + if($arrGroupAdmin){ + foreach($arrGroupAdmin as $key=>$item){ + $arrGroupUserId[] = $item['userid']; + } + $groupUserIds = arr2str($arrGroupUserId); + $arrGroupAdminUser = $new['group']->findAll('user_info',"`userid` in ($groupUserIds)",'addtime desc','userid,username'); + } + + //标签 + $strGroup ['tags'] = aac ( 'tag' )->getObjTagByObjid ( 'group', 'groupid', $strGroup ['groupid'] ); + + + + if($page > 1){ + $title = $strGroup['groupname'].' - 第'.$page.'页'; + } + + //把标签作为关键词 + if($strGroup['tags']){ + foreach($strGroup['tags'] as $key=>$item){ + $arrTag[] = $item['tagname']; + } + $sitekey = $strGroup['groupname'].','.arr2str($arrTag); + }else{ + $sitekey = $strGroup['groupname']; + } + + + $sitedesc = tsCutContent($strGroup['groupdesc'],50); + include template("show"); + +} \ No newline at end of file diff --git a/app/group/action/tag.php b/app/group/action/tag.php new file mode 100644 index 0000000..be3e902 --- /dev/null +++ b/app/group/action/tag.php @@ -0,0 +1,30 @@ +getTagByName(t($name)); + +$strTag['tagname'] = htmlspecialchars($strTag['tagname']); + +$tagid = $strTag['tagid']; + +//小组 +$arrGroupTagId = $new['group']->findAll('tag_group_index',array( + 'tagid'=>$tagid, +)); +if($arrGroupTagId){ + foreach($arrGroupTagId as $key=>$item){ + $arrGroup[] = $new['group']->getOneGroup($item['groupid']); + } +} + +//热门tag +$arrTag = $new['group']->findAll('tag',"`count_group`>0 and `isaudit`=0",'uptime desc',null,30); + +$sitekey = $strTag['tagname']; +$title = $strTag['tagname']; + +include template("tag"); \ No newline at end of file diff --git a/app/group/action/tags.php b/app/group/action/tags.php new file mode 100644 index 0000000..88f1932 --- /dev/null +++ b/app/group/action/tags.php @@ -0,0 +1,17 @@ +'')); + +$lstart = $page*200-200; + +$arrTag = $new['group']->findAll('tag',"`count_group`>'0' and `isaudit`=0",'uptime desc',null,$lstart.',200'); + +$tagNum = $new['group']->findCount('tag',"`count_group`>'0' and `isaudit`=0"); + +$pageUrl = pagination($tagNum, 200, $page, $url); + +$title = '标签'; +include template('tags'); \ No newline at end of file diff --git a/app/group/action/topic.php b/app/group/action/topic.php new file mode 100644 index 0000000..ab35efb --- /dev/null +++ b/app/group/action/topic.php @@ -0,0 +1,5 @@ +$topicid))); \ No newline at end of file diff --git a/app/group/action/topiccollect.php b/app/group/action/topiccollect.php new file mode 100644 index 0000000..e339517 --- /dev/null +++ b/app/group/action/topiccollect.php @@ -0,0 +1,28 @@ +fetch_all_assoc("select * from ".dbprefix."group_topic_collect where topicid='$topicid'"); + + if(is_array($arrCollectUser)){ + foreach($arrCollectUser as $item){ + $strUser = aac('user')->getSimpleUser($item['userid']); + $arrUser[] = $strUser; + } + } + + if($arrUser == ''){ + echo '
    还没有人喜欢,赶快来做第一个喜欢者吧^_^
    '; + }else{ + include template("topic_collect"); + } + + break; +} \ No newline at end of file diff --git a/app/group/action/topicedit.php b/app/group/action/topicedit.php new file mode 100644 index 0000000..5f3cb8e --- /dev/null +++ b/app/group/action/topicedit.php @@ -0,0 +1,152 @@ +isLogin(); + +//普通不用不允许编辑内容 +if($TS_SITE['isallowedit'] && $TS_USER ['isadmin'] == 0) tsNotice('系统不允许用户编辑内容,请联系管理员编辑!'); + +switch($ts){ + + //编辑帖子 + case "": + $topicid = intval($_GET['topicid']); + + if($topicid == 0){ + header("Location: ".SITE_URL); + exit; + } + + $topicNum = $new['group']->findCount('group_topic',array( + 'topicid'=>$topicid, + )); + + if($topicNum==0){ + header("Location: ".SITE_URL); + exit; + } + + $strTopic = $new['group']->find('group_topic',array( + 'topicid'=>$topicid, + )); + + $strTopic['title'] = tsTitle($strTopic['title']); + $strTopic['content'] = tsDecode($strTopic['content']); + + $strGroup = $new['group']->find('group',array( + 'groupid'=>$strTopic['groupid'], + )); + + $strGroupUser = $new['group']->find('group_user',array( + 'userid'=>$userid, + 'groupid'=>$strTopic['groupid'], + )); + + //print_r($strGroupUser);exit; + + if($strTopic['userid'] == $userid || $strGroup['userid']==$userid || $TS_USER['isadmin']==1 || $strGroupUser['isadmin']==1){ + $arrGroupType = $new['group']->findAll('group_topic_type',array( + 'groupid'=>$strGroup['groupid'], + )); + + //找出TAG + $arrTags = aac('tag')->getObjTagByObjid('topic', 'topicid', $topicid); + foreach($arrTags as $key=>$item){ + $arrTag[] = $item['tagname']; + } + $strTopic['tag'] = arr2str($arrTag); + + $title = '编辑帖子'; + include template("topic_edit"); + + }else{ + + header("Location: ".SITE_URL); + exit; + + } + break; + + //编辑帖子执行 + case "do": + + + $authcode = strtolower ( $_POST ['authcode'] ); + + if ($TS_SITE['isauthcode']) { + if ($authcode != $_SESSION ['verify']) { + tsNotice ( "验证码输入有误,请重新输入!" ); + } + } + + $topicid = intval($_POST['topicid']); + $typeid = intval($_POST['typeid']); + + $title = trim($_POST['title']); + + //echo br2nl($_POST['content']);exit; + + $content = tsClean($_POST['content']); + $content2 = emptyText($_POST['content']); + + $iscomment = intval($_POST['iscomment']); + $iscommentshow = intval($_POST['iscommentshow']); + + if($topicid == '' || $title=='' || $content2=='') tsNotice("都不能为空的哦!"); + + + if($TS_USER['isadmin']==0){ + + //过滤内容开始 + aac('system')->antiWord($title); + aac('system')->antiWord($content); + //过滤内容结束 + + } + + $strTopic = $new['group']->find('group_topic',array( + 'topicid'=>$topicid, + )); + + $strGroup = $new['group']->find('group',array( + 'groupid'=>$strTopic['groupid'], + )); + + $strGroupUser = $new['group']->find('group_user',array( + 'userid'=>$userid, + 'groupid'=>$strTopic['groupid'], + )); + + if($strTopic['userid']==$userid || $strGroup['userid']==$userid || $TS_USER['isadmin']==1 || $strGroupUser['isadmin']==1){ + $gaiyao = cututf8(t(tsDecode($content)),0,100); + $new['group']->update('group_topic',array( + 'topicid'=>$topicid, + ),array( + 'typeid' => $typeid, + 'title'=>$title, + 'content'=>$content, + 'gaiyao'=>$gaiyao, + 'iscomment' => $iscomment, + 'iscommentshow' => $iscommentshow, + 'uptime' => time (), + )); + + + + //处理标签 + $tag = trim($_POST['tag']); + if($tag){ + aac('tag')->delIndextag('topic','topicid',$topicid); + aac('tag') -> addTag('topic', 'topicid', $topicid, $tag); + } + + header("Location: ".tsUrl('group','topic',array('id'=>$topicid))); + + }else{ + header("Location: ".SITE_URL); + exit; + } + break; + +} diff --git a/app/group/action/topicmove.php b/app/group/action/topicmove.php new file mode 100644 index 0000000..e2e5aa9 --- /dev/null +++ b/app/group/action/topicmove.php @@ -0,0 +1,87 @@ +isLogin(); + +switch($ts){ + + //移动帖子 + case "": + + $topicid = intval($_GET['topicid']); + + if($topicid == 0) tsNotice("非法操作!"); + + $strTopic = $new['group']->find('group_topic',array( + 'topicid'=>$topicid, + )); + + if($strTopic){ + + $strGroup = $new['group']->find('group',array( + 'groupid'=>$strTopic['groupid'], + )); + + if($strTopic['userid']==$userid || $strGroup['userid']==$userid || $TS_USER['isadmin']==1){ + + $arrGroups = $new['group']->findAll('group_user',array( + 'userid'=>$strTopic['userid'], + )); + foreach($arrGroups as $item){ + if($item['groupid'] != $strGroup['groupid']){ + + $arrGroup[] = $new['group']->find('group',array( + 'groupid'=>$item['groupid'], + )); + + } + + } + + $title = '移动帖子'; + include template("topic_move"); + + }else{ + + tsNotice('非法操作!'); + + } + + + }else{ + + tsNotice('非法操作!'); + + } + + break; + + //执行移动 + case "do": + + $groupid = intval($_POST['groupid']); + $topicid = intval($_POST['topicid']); + + $strTopic = $new['group']->find('group_topic',array( + 'topicid'=>$topicid, + )); + + if($strTopicid['userid']==$userid || $TS_USER['isadmin']==1){ + + $new['group']->update('group_topic',array( + 'topicid'=>$topicid, + ),array( + 'groupid'=>$groupid, + 'typeid'=>'0', + )); + + + header("Location: ".tsUrl('group','topic',array('id'=>$topicid))); + }else{ + tsNotice('非法操作!'); + } + + break; + +} \ No newline at end of file diff --git a/app/group/action/user.php b/app/group/action/user.php new file mode 100644 index 0000000..3b76ebf --- /dev/null +++ b/app/group/action/user.php @@ -0,0 +1,89 @@ +getOneGroup($groupid); + if($strGroup == '') { + header("HTTP/1.1 404 Not Found"); + header("Status: 404 Not Found"); + $title = '404'; + include pubTemplate("404"); + exit; + } + + //小组组长信息 + $leaderId = $strGroup['userid']; + + $strLeader = aac('user')->getSimpleUser($leaderId); + + //管理员信息 + + $strAdmin = $new['group']->findAll('group_user',array( + 'groupid'=>$strGroup['groupid'], + 'isadmin'=>'1', + 'isfounder'=>'0', + )); + + + if(is_array($strAdmin)){ + foreach($strAdmin as $key=>$item){ + $arrAdmin[] = aac('user')->getSimpleUser($item['userid']); + $arrAdmin[$key]['isadmin'] = $item['isadmin']; + } + } + + //小组会员分页 + + $page = tsIntval($_GET['page'],1); + + $url = tsUrl('group','user',array('id'=>$groupid,'page'=>'')); + + + $lstart = $page*40-40; + + //普通用户 + $groupUserNum = $new['group']->findCount('group_user',array( + + 'groupid'=>$groupid, + 'isadmin'=>0, + 'isfounder'=>0, + + )); + + $groupUser = $new['group']->findAll('group_user',array( + 'groupid'=>$strGroup['groupid'], + 'isadmin'=>'0', + 'isfounder'=>'0', + ),'userid desc',null,$lstart.',40'); + //print_r($groupUser); + + if(is_array($groupUser)){ + foreach($groupUser as $key=>$item){ + $arrGroupUser[] = aac('user')->getSimpleUser($item['userid']); + $arrGroupUser[$key]['isadmin'] = $item['isadmin']; + } + } + + $pageUrl = pagination($groupUserNum, 40, $page, $url); + + if($page > '1'){ + $titlepage = " - 第".$page."页"; + }else{ + $titlepage=''; + } + + $title = $strGroup['groupname'].'成员'.$titlepage; + + include template("user"); + + break; + +} \ No newline at end of file diff --git a/app/group/class.group.php b/app/group/class.group.php new file mode 100644 index 0000000..5943caa --- /dev/null +++ b/app/group/class.group.php @@ -0,0 +1,212 @@ +find('group',array( + 'groupid'=>$groupid, + )); + if($strGroup){ + $strGroup['groupname'] = tsTitle($strGroup['groupname']); + $strGroup['groupdesc'] = tsTitle($strGroup['groupdesc']); + $strGroup['photo'] = $this->getGroupPhoto($strGroup); + $strGroup['bgphoto'] = $this->getGroupBgPhoto($strGroup); + } + return $strGroup; + } + + /** + * 获取小组头像 + * + * @param [type] $strGroup + * @return void + */ + function getGroupPhoto($strGroup){ + if($strGroup['photo']){ + $strFace = tsXimg($strGroup['photo'],'group',200,200,$strGroup['path'],1); + + if($GLOBALS['TS_SITE']['file_upload_type']==1){ + $strFace .= '&v='.$strGroup['uptime']; + }else{ + $strFace .= '?v='.$strGroup['uptime']; + } + + }else{ + $strFace = SITE_URL.'public/images/group.jpg'; + } + return $strFace; + } + + /** + * 小组背景图 + * + * @param [type] $strGroup + * @return void + */ + function getGroupBgPhoto($strGroup){ + if($strGroup['bgphoto']){ + + if($GLOBALS['TS_SITE']['file_upload_type']==1){ + $strPhoto = $GLOBALS['TS_SITE']['alioss_bucket_url'].'/uploadfile/group/bgphoto/'.$strGroup['bgphoto'].'?v='.$strGroup['uptime']; + }else{ + $strPhoto = SITE_URL.'uploadfile/group/bgphoto/'.$strGroup['bgphoto'].'?v='.$strGroup['uptime']; + } + + }else{ + $strPhoto = SITE_URL.'app/group/skin/group.jpg'; + } + return $strPhoto; + } + + /** + * 删除小组 + * + * @param [type] $strGroup + * @return void + */ + public function deleteGroup($strGroup){ + if($strGroup['photo']){ + if($GLOBALS['TS_SITE']['file_upload_type']==1){ + deleteAliOssFile('uploadfile/group/'.$strGroup['photo']); + }else{ + unlink('uploadfile/group/'.$strGroup['photo']); + tsDimg($strGroup['photo'],'group','120','120',$strGroup['path']); + } + } + + $this->delete('group',array( + 'groupid'=>$strGroup['groupid'], + )); + + $this->delete('group_user',array( + 'groupid'=>$strGroup['groupid'], + )); + + return true; + + } + + /** + * 获取推荐的小组 + * + * @param integer $num + * @return void + */ + function getRecommendGroup($num=10){ + $arrGroup = $this->findAll('group',array( + 'isrecommend'=>1, + ),'orderid asc','groupid,groupname,groupdesc,path,photo,count_user',$num); + foreach($arrGroup as $key=>$item){ + $arrGroup[$key]['groupname'] = tsTitle($item['groupname']); + $arrGroup[$key]['groupdesc'] = tsTitle($item['groupdesc']); + $arrGroup[$key]['photo'] = $this->getGroupPhoto($item); + } + return $arrGroup; + } + + /** + * 获取最新创建的小组 + * + * @param integer $num + * @return void + */ + function getNewGroup($num=10){ + $arrGroup = $this->findAll('group',array( + 'isaudit'=>0, + ),'addtime desc',null,$num); + foreach($arrGroup as $key=>$item){ + $arrGroup[$key]['groupname'] = tsTitle($item['groupname']); + $arrGroup[$key]['groupdesc'] = tsTitle($item['groupdesc']); + $arrGroup[$key]['photo'] = $this->getGroupPhoto($item); + } + return $arrGroup; + } + + + + //判断是否存在小组 + function isGroup($groupid){ + $isGroup = $this->findCount('group',array( + 'groupid'=>$groupid, + )); + if($isGroup > 0){ + return true; + }else{ + return false; + } + } + + /* + * 是否小组组长 + */ + public function isGroupCreater($groupid,$userid){ + $isCreater = $this->findCount('group',array( + 'groupid'=>$groupid, + 'userid'=>$userid, + )); + + if($isCreater){ + return true; + }else{ + return false; + } + } + + /* + * 是否小组管理员,仅次于小组组长 + */ + public function isGroupAdmin($groupid,$userid){ + $isAdmin = $this->findCount('group_user',array( + 'userid'=>$userid, + 'groupid'=>$groupid, + 'isadmin'=>1, + )); + if($isAdmin){ + return true; + }else{ + return false; + } + } + + /* + * 是否小组成员,被统治阶级 + */ + public function isGroupUser($groupid,$userid){ + $countGroupUser = $this->findCount('group_user',array( + 'groupid'=>$groupid, + 'userid'=>$userid, + )); + if($countGroupUser){ + return true; + }else{ + return false; + } + } + + + + + //析构函数 + public function __destruct(){ + + } + +} \ No newline at end of file diff --git a/app/group/config.php b/app/group/config.php new file mode 100644 index 0000000..7f991c7 --- /dev/null +++ b/app/group/config.php @@ -0,0 +1,6 @@ + + + + +
    +
    + + +
    +
    +
    + + {if $isGroupUser == '0'} + + {else} + +
    + +
    + + +
    + + {if $arrGroupType} +
    + + + + +
    + {/if} + + +
    + +
    {if $strDraft['content']}{php echo tsDecode($strDraft['content'])}{/if}
    +
    + +
    +
    + +
    + + +
    + +
    + + + 允许 不允许 + +
    + + +
    + + + 不需要 需要 + +
    + + + {if $TS_SITE['isauthcode']} +
    + + +
    + + 点击刷新验证码 + +
    + + +
    + {/if} + + + + + + + + + 返回小组 + +

    + +
    + + + {/if} + +
    +
    +
    + + + +
    +
    + + + + + + + +
    +{php doAction('tseditor')} + + +{php include pubTemplate("footer")} diff --git a/app/group/html/admin/album_list.html b/app/group/html/admin/album_list.html new file mode 100644 index 0000000..eda1615 --- /dev/null +++ b/app/group/html/admin/album_list.html @@ -0,0 +1,27 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + +
    {$pageUrl}
    + + + + + + + + + + +{loop $arrAlbum $key $item} + +{/loop} + + + +
    专辑ID名字介绍话题数操作
    {$item['albumid']}{$item['albumname']}{$item['albumdesc']}{$item['count_topic']}删除
    + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/group/html/admin/cate_add.html b/app/group/html/admin/cate_add.html new file mode 100644 index 0000000..8326c8a --- /dev/null +++ b/app/group/html/admin/cate_add.html @@ -0,0 +1,21 @@ +{php include pubTemplate("header_admin")} + +
    +{php include template("admin/menu");} + +
    + + + + +
    分类名称:
    + + + + +
    +
    + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/group/html/admin/cate_edit.html b/app/group/html/admin/cate_edit.html new file mode 100644 index 0000000..cd52267 --- /dev/null +++ b/app/group/html/admin/cate_edit.html @@ -0,0 +1,32 @@ +{php include pubTemplate("header_admin")} + +
    +{php include template("admin/menu");} + +
    + + + + +{if $referid} + + + +{/if} + + +
    分类名称:
    上级分类: + +
    + + + +
    +
    + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/group/html/admin/cate_list.html b/app/group/html/admin/cate_list.html new file mode 100644 index 0000000..74ac783 --- /dev/null +++ b/app/group/html/admin/cate_list.html @@ -0,0 +1,58 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + + + + + + + + + + + +{loop $arrCatess $key $item} + + + + + + +{loop $item['two'] $tkey $titem} + + + + + +{loop $titem['three'] $ttkey $ttitem} + + + +{/loop} + +{/loop} + + +{/loop} + + + +
    分类ID分类名字操作
    {$item[cateid]}I、{$item[catename]} + +[添加二级分类] + +[修改] [删除]
    {$titem[cateid]}        II、{$titem[catename]} + +[添加三级分类] + +[修改] [删除]
    {$ttitem[cateid]}                III、{$ttitem[catename]} + + + +[修改] [删除]
    + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/group/html/admin/group_list.html b/app/group/html/admin/group_list.html new file mode 100644 index 0000000..6a120c7 --- /dev/null +++ b/app/group/html/admin/group_list.html @@ -0,0 +1,62 @@ +{php include pubTemplate("header_admin")} + + +
    + +{php include template("admin/menu");} + +
    {$pageUrl}
    + + + + + + + + + + + + + + + + + +{loop $arrAllGroup $key $item} + + + + + + + + + +{/loop} + + + +
    ID小组名字小组介绍统计创建时间操作
    {$item[groupid]}[{tsTitle($item['groupname'])}]{php echo cututf8(t($item[groupdesc]),0,20)}帖子数:{$item['count_topic']} +
    + 成员数:{$item['count_user']} +
    {php echo date('Y-m-d H:i:s',$item[addtime])} + + + + {if $item[isaudit]} + 审核 + {else} + 取消审核 + {/if} + + + | {if $item[isrecommend]=='0'}[推荐]{else}[取消推荐]{/if} + + + + | [修改] + | [删除]
    + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/group/html/admin/group_recommend.html b/app/group/html/admin/group_recommend.html new file mode 100644 index 0000000..cea4c72 --- /dev/null +++ b/app/group/html/admin/group_recommend.html @@ -0,0 +1,74 @@ +{php include pubTemplate("header_admin")} + + +
    + +{php include template("admin/menu");} + +
    {$pageUrl}
    + + +
    + + + + + + + + + + + + + + + + + + + +{loop $arrGroup $key $item} + + + + + + + + + +{/loop} + + + +
    ID小组名字排序ID(从小到大)操作
    {$item[groupid]}[{tsTitle($item['groupname'])}] + + + + + + + + + {if $item[isrecommend]=='0'}[推荐]{else}[取消推荐]{/if} + + +
    + + + +
    + +
    + + + +
    + + +
    + + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/group/html/admin/menu.html b/app/group/html/admin/menu.html new file mode 100644 index 0000000..a35518d --- /dev/null +++ b/app/group/html/admin/menu.html @@ -0,0 +1,18 @@ +
    +
    小组管理
    + +
    +
    \ No newline at end of file diff --git a/app/group/html/admin/options.html b/app/group/html/admin/options.html new file mode 100644 index 0000000..b4c3596 --- /dev/null +++ b/app/group/html/admin/options.html @@ -0,0 +1,46 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    APP名称:
    APP介绍:
    APP关键词:
    是否允许用户创建小组 :允许 不允许(只有管理员可以创建小组)
    创建小组是否需要审核 :审核 不审核
    每个会员加入小组数 : (创建和加入的总和)
    是否开启加入小组付费功能 : + + 不开启 + 开启 (开启需要安装支付模块) + +
    + +
    +
    +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/group/html/admin/permissions.html b/app/group/html/admin/permissions.html new file mode 100644 index 0000000..e20a5fa --- /dev/null +++ b/app/group/html/admin/permissions.html @@ -0,0 +1,148 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + + + +
    + {loop $arrUg $key $item} + {$item['ugname']} + {/loop} +
    + + +
    + + +
    前台权限
    + + + + + + + + + + {if $ugid==1 || $ugid==2 || $ugid==3} + + + + + + + + + + + + + + + {/if} + + + + +
    查看小组: + +
    创建小组: + +
    修改小组: + +
    删除小组: + +
    + + + + {if $ugid==1 || $ugid==2} +
    后台权限
    + + + + + + + + + + + + + + + + + + + + +
    小组配置: + +
    权限配置: + +
    添加分类: + +
    修改分类: + +
    + {/if} + + + +
    API权限
    + + + + + + + + + + + +
    查看小组: + +
    + + + + + + +
    + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/group/html/admin/topic_delete.html b/app/group/html/admin/topic_delete.html new file mode 100644 index 0000000..79483ff --- /dev/null +++ b/app/group/html/admin/topic_delete.html @@ -0,0 +1,37 @@ +{php include pubTemplate("header_admin")} + + +
    + +{php include template("admin/menu");} + +
    {$pageUrl}
    + + + + + + + + + + +{loop $arrTopic $key $item} + + + + + + +{/loop} + +
    IDUserID标题时间操作
    {$item['topicid']}{$item['userid']} + + {$item['title']}{php echo date('Y-m-d H:i:s',$item['addtime'])} + +删除 + +
    + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/group/html/admin/topic_edit.html b/app/group/html/admin/topic_edit.html new file mode 100644 index 0000000..8e92f8a --- /dev/null +++ b/app/group/html/admin/topic_edit.html @@ -0,0 +1,45 @@ +{php include pubTemplate("header_admin")} + + +
    + +{php include template("admin/menu");} + +
    {$pageUrl}
    + + + + + + + + + + + + + + + + + + + + + {loop $arrTopic $key $item} + + + {/loop} + + + + + + + +
    ID标题时间状态操作
    {$item['topicid']}{$item['title']}{$item['addtime']}{if $item['isupdate']==1}已更新{else}未更新{/if} + 更新 +
    + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/group/html/admin/topic_edit_view.html b/app/group/html/admin/topic_edit_view.html new file mode 100644 index 0000000..902232b --- /dev/null +++ b/app/group/html/admin/topic_edit_view.html @@ -0,0 +1,18 @@ +{php include pubTemplate("header_admin")} + + +
    + +{php include template("admin/menu");} + + + +
    +

    {$strTopic['title']}

    +
    {$strTopic['content']}
    +
    +
    {$strTopic['addtime']}
    +
    + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/group/html/admin/topic_list.html b/app/group/html/admin/topic_list.html new file mode 100644 index 0000000..b30dba7 --- /dev/null +++ b/app/group/html/admin/topic_list.html @@ -0,0 +1,42 @@ +{php include pubTemplate("header_admin")} + + +
    + +{php include template("admin/menu");} + +
    {$pageUrl}
    + + + + + + + + + + + + +{loop $arrTopic $key $item} + +{/loop} + + + +
    IDUserID标题时间操作
    {$item['topicid']}{$item['userid']}{tsTitle($item['title'])}{php echo date('Y-m-d H:i:s',$item['addtime'])} + + +{if $item['isaudit']==0} +已审核 +{else} +未审核 +{/if} + + +删除 + +
    + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/group/html/ajax_topic.html b/app/group/html/ajax_topic.html new file mode 100644 index 0000000..621e0d6 --- /dev/null +++ b/app/group/html/ajax_topic.html @@ -0,0 +1,45 @@ +{loop $arrTopic $key $item} +
  • +
    +{$item[user]['username']} +
    + +
    +
    +{if $item['appkey'] != 'group' && $item['appkey']!=''} +[{$item['appname']}] +{$item[title]} +{else} +{$item[title]} +{/if} + +{if $item[istop]=='1'} +[置顶] +{/if} +{if $item[isposts] == '1'} +[精华] +{/if} +{if $item['postby']==1} +通过Iphone手机端发布 + +{/if} + +
    + +
    + +{$item[group][groupname]} + + + +{php echo getTime($item[uptime],time())} + +{$item[user][username]} + +{if $item[count_comment]>0}{$item[count_comment]}{/if} + +
    +
    +
    +
  • +{/loop} \ No newline at end of file diff --git a/app/group/html/audit.html b/app/group/html/audit.html new file mode 100644 index 0000000..e7ccda3 --- /dev/null +++ b/app/group/html/audit.html @@ -0,0 +1,84 @@ +{php include pubTemplate("header")} + +
    + + + + + + +
    +
    + +
    + +
    审核帖子
    + +
    + + + + + + + + + + + + + + + + + + + +{loop $arrTopic $key $item} + + + + + + + + + +{/loop} + + +
    帖子标题用户ID时间操作
    {$item['title']}{$item['userid']}{php echo date('Y-m-d H:i:s',$item['addtime'])} + +审核 | +删除 + + +
    + +
    +
    + +
    + + + +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/create.html b/app/group/html/create.html new file mode 100644 index 0000000..78b32ea --- /dev/null +++ b/app/group/html/create.html @@ -0,0 +1,59 @@ +{php include pubTemplate("header")} + +
    + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    + + +
    + +
    + + +
    + +
    + +
    +
    + +
    + + +
    + + + +
    +
    +
    +
    + + +
    +
    + + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/edit_base.html b/app/group/html/edit_base.html new file mode 100644 index 0000000..e446839 --- /dev/null +++ b/app/group/html/edit_base.html @@ -0,0 +1,115 @@ +{php include pubTemplate("header")} +
    + + + + + +
    +
    + +{template edit_xbar} + + + + + +
    + + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + (多个请用英文,号分割) +
    +
    + + +
    + +
    + 自由加入(开放小组) +
    禁止加入(私密小组) +
    申请加入(需要审核) + + {if $TS_APP['ispayjoin']==1} +
    付费加入 需要 金币 + {/if} + +
    +
    + +
    + +
    + 仅允许成员发帖 + 不允许成员和非成员发帖 + 允许成员和非成员发帖 +
    +
    + + +
    + +
    + 完全开放 仅组员 +
    +
    + +
    + +
    +审核 不审核 +
    +
    + + + +
    +
    + +
    + + + + + + + 返回小组 +
    +
    +
    + + + + + + + +
    +
    + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/edit_cate.html b/app/group/html/edit_cate.html new file mode 100644 index 0000000..6fe52f6 --- /dev/null +++ b/app/group/html/edit_cate.html @@ -0,0 +1,127 @@ +{php include pubTemplate("header")} + + + +
    + + + +
    +
    +{template edit_xbar} + + + +
    +
    + + +
    + + + + + + +
    + + + + + 返回小组 +
    + + +
    +{if $strCate} +一级:{$strCate['catename']} + +{/if} +{if $strCate2} +二级:{$strCate2['catename']} + +{/if} +{if $strCate3} +三级:{$strCate3['catename']} + +{/if} +
    + + +
    +
    +
    + + + + + + + + +
    +
    + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/edit_icon.html b/app/group/html/edit_icon.html new file mode 100644 index 0000000..73a0495 --- /dev/null +++ b/app/group/html/edit_icon.html @@ -0,0 +1,87 @@ +{php include pubTemplate("header")} + +
    + + + +
    +
    + +{template edit_xbar} + + +
    +
    + + +
    + + + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + + + +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    +
    + + + 返回小组 +
    +
    + + +
    + + +
    +
    +
    + + + + +
    +
    + + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/edit_isadmin.html b/app/group/html/edit_isadmin.html new file mode 100644 index 0000000..daa4679 --- /dev/null +++ b/app/group/html/edit_isadmin.html @@ -0,0 +1,66 @@ +{php include pubTemplate("header")} + +
    + + + + + +
    +
    + + + {template edit_xbar} + + +
    +
    +
    +
    + +
    + +
    + + + +
    + + + + + + + + + + + {loop $arrAdminUser $key $item} + + + + + + {/loop} + + +
    ID用户名操作
    {$item['userid']}{$item['username']}取消
    + + +
    +
    +
    + + +
    +
    + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/edit_transfer.html b/app/group/html/edit_transfer.html new file mode 100644 index 0000000..e3b7107 --- /dev/null +++ b/app/group/html/edit_transfer.html @@ -0,0 +1,48 @@ +{php include pubTemplate("header")} + +
    + + + + + +
    +
    + + + {template edit_xbar} + + +
    + +
    + +
    + +
    +
    + + +
    +
    + +
    +
    + +
    + + + + +
    +
    + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/edit_type.html b/app/group/html/edit_type.html new file mode 100644 index 0000000..040ce2b --- /dev/null +++ b/app/group/html/edit_type.html @@ -0,0 +1,81 @@ +{php include pubTemplate("header")} + +
    + + + +
    +
    +{template edit_xbar} + + +
    +
    + + + +
    + + + + + + + + + 返回小组 + +
    + + + + + + + + + + + +{loop $arrGroupType $key $item} + + + + + + +{/loop} + +
    类型操作
    + + + + + + + + + + + + 删除
    + + +
    +
    +
    + + + +
    +
    + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/edit_user.html b/app/group/html/edit_user.html new file mode 100644 index 0000000..3797834 --- /dev/null +++ b/app/group/html/edit_user.html @@ -0,0 +1,91 @@ +{php include pubTemplate("header")} + +
    + + + + + +
    +
    + + + {template edit_xbar} + + +
    +
    +
    + + +
    + + + + + + +
    + +
    + + + +
    + + +
    + * 有效期等于0000-00-00 或者 1970-01-01 即为永久 +
    + + + + + + + + + {loop $arrGroupUser $key $item} + + {/loop} + + +
    用户ID用户名有效期操作
    {$item['userid']}{$item['username']}{$item['endtime']} + + {if $TS_APP['ispayjoin']==1 && $strGroup['joinway']==3}续期 | {/if} + 清退 + +
    + + +
    {$pageUrl}
    + + +
    +
    +
    + + +
    +
    + +
    + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/edit_useraudit.html b/app/group/html/edit_useraudit.html new file mode 100644 index 0000000..29e83f2 --- /dev/null +++ b/app/group/html/edit_useraudit.html @@ -0,0 +1,46 @@ +{php include pubTemplate("header")} + + +
    + + + + + + + +
    +
    + +{template edit_xbar} + + + + + + + + + + + {loop $arrUser $key $item} + + {/loop} + + + +
    申请用户操作
    {$item['username']}通过 | 删除
    + +
    +
    + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/edit_xbar.html b/app/group/html/edit_xbar.html new file mode 100644 index 0000000..7b942ce --- /dev/null +++ b/app/group/html/edit_xbar.html @@ -0,0 +1,20 @@ + +
    + 基本信息 + 图标/背景 + 帖子分类 + 小组分类 + 小组转让 + + + {if $strGroup['joinway']==2} + 成员审核 + {/if} + + 管理员 + 成员 + +
    + + +
    \ No newline at end of file diff --git a/app/group/html/group_ajax.html b/app/group/html/group_ajax.html new file mode 100644 index 0000000..061b0b1 --- /dev/null +++ b/app/group/html/group_ajax.html @@ -0,0 +1,49 @@ +
    + + +
    + +
    +
    + +{$item[groupname]} + +
    + +{if in_array($item['groupid'],$myGroup)} +已加入 +{else} ++加入 +{/if} + +
    +
    +
    +{$item[groupname]} {$item[count_user]}人加入 +

    {$item[groupdesc]}

    +
    +
    + +
    +
    + +
    + + +
    该分类下没有小组
    +
    点击查看更多>>
    + + \ No newline at end of file diff --git a/app/group/html/group_ajax_more.html b/app/group/html/group_ajax_more.html new file mode 100644 index 0000000..6da99f7 --- /dev/null +++ b/app/group/html/group_ajax_more.html @@ -0,0 +1,26 @@ + +
    +
    + +{$item[groupname]} + +
    + +{if in_array($item['groupid'],$myGroup)} +已加入 +{else} ++加入 +{/if} + +
    +
    +
    +{$item[groupname]} {$item[count_user]}人加入 +

    {$item[groupdesc]}

    +
    +
    + + \ No newline at end of file diff --git a/app/group/html/group_isopen.html b/app/group/html/group_isopen.html new file mode 100644 index 0000000..7c6321d --- /dev/null +++ b/app/group/html/group_isopen.html @@ -0,0 +1,37 @@ +{php include pubTemplate("header")} +
    + + + + + + + +
    +
    + + + +
    + +

    本小组只有小组成员才可以浏览^_^

    + + 加入小组 + +
    + + + +
    +
    + + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/index.html b/app/group/html/index.html new file mode 100644 index 0000000..b8c94e2 --- /dev/null +++ b/app/group/html/index.html @@ -0,0 +1,101 @@ +{php include pubTemplate("header")} +
    + + + + + + + + +
    + +
    + + + +
    +
    + + +
    + 全部 + {loop $arrGroupCate $key $item} + {$item['catename']} + {/loop} + +
    + + +
    + + +
    + {loop $arrGroup $key $item} +
    + +
    +
    + + {$item[groupname]} + + +
    +
    + {$item[groupname]} + {$item[count_user]}人加入 +

    {$item[groupdesc]}

    +
    +
    + +
    + {/loop} +
    + + + + +
    {$pageUrl}
    + + + + +
    +
    +
    + +
    + + + +
    +
    最新创建小组
    +
    +
    +
      + {loop $arrNewGroup $key $item} +
    • + {$item[groupname]} ({$item[count_user]}成员) +
    • + {/loop} +
    +
    + +
    +
    + + +{php doAction('gobad','300')} + +
    +
    +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/my/index.html b/app/group/html/my/index.html new file mode 100644 index 0000000..aca942f --- /dev/null +++ b/app/group/html/my/index.html @@ -0,0 +1,89 @@ +{php include pubTemplate("header")} +
    + + + +
    + + +
    + +
    + + {php include pubTemplate("my")} + +
    + +
    +
    + + + +
    +
    创建的小组
    +
    + + + + +
    + + {loop $arrCreateGroup $key $item} +
    +
    + +
    +
    {$item['groupname']}
    +
    +
    +
    + {/loop} + + +
    + + + + + +
    +
    + + + +
    +
    加入的小组
    +
    +
    + + + + + {loop $arrGroup $key $item} +
    +
    + {$item['groupname']} +
    +
    {php echo cututf8($item['groupname'],0,6,false)}
    +
    +
    +
    + {/loop} + +
    +
    +
    + + + + + + +
    +
    + + + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/my/topic.html b/app/group/html/my/topic.html new file mode 100644 index 0000000..3213ce0 --- /dev/null +++ b/app/group/html/my/topic.html @@ -0,0 +1,60 @@ +{php include pubTemplate("header")} +
    + + + +
    + + +
    + +
    + + {php include pubTemplate("my")} + +
    + +
    +
    + + + +
    +
    我发布的帖子
    +
    + + + + + + + + + + + {loop $arrTopic $key $item} + + {/loop} + +
    发布时间标题浏览/评论操作
    {php echo date('Y-m-d',$item['addtime'])}{php echo tsTitle($item['title'])}{$item['count_view']}/{$item['count_comment']}修改
    + + + + +
    +
    + + + + + + + +
    +
    + + + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/show.html b/app/group/html/show.html new file mode 100644 index 0000000..14fddcb --- /dev/null +++ b/app/group/html/show.html @@ -0,0 +1,285 @@ +{php include pubTemplate("header")} +
    + + + + + + + + + + +
    + + + +
    + + + +
    + +
    + + + +
    + {$strGroup['groupname']} +
    +

    {$strGroup['groupname']}

    +
    + + {$strGroup['count_topic']} 帖子 + {$strGroup['count_user']} 成员 + +
    + +
    + + 创建于 {php echo date('Y-m-d',$strGroup[addtime])} + + 组长:{$strLeader['username']} + {if $arrGroupAdminUser} + 管理员: + {loop $arrGroupAdminUser $key $item} + {$item['username']} + {/loop} + {/if} +
    + +
    +
    + + + +
    +
    + + + +
    + {if $isGroupUser > 0 && $TS_USER['userid'] != $strGroup['userid']} + 我是这个小组的{$strGroup['role_user']} 退出小组 + {elseif $isGroupUser > 0 && $TS_USER['userid'] == $strGroup['userid']} + 我是这个小组的{$strGroup['role_leader']} + {elseif $strGroup['joinway'] == '0'} + 加入小组 + {elseif $strGroup['joinway'] == '2'} + 申请加入小组 + + {elseif $strGroup['joinway']==3} + + 需要支付{$strGroup['price']}金币加入小组 + + {else} + 本小组禁止加入 + {/if} +
    + + + +
    + +
    + + +
    + + + + +
    + +
    {php echo nl2br($strGroup['groupdesc'])}
    + + {if $strGroup ['tags']} +
    + {loop $strGroup['tags'] $key $item} + {$item['tagname']} + {/loop} +
    + {/if} + +
    +
    + + + + + + +
    + +
    + + + + + {if $strGroup['isopen']==1 && $isGroupUser==''} + +
    你需要加入小组后才可以访问帖子内容
    + + {elseif $strGroup['isopen']==1 && $isGroupUser && $TS_APP['ispayjoin']==1 && $isGroupUser['endtime']!='0000-00-00' && $isGroupUser['endtime']!='1970-01-01' && $isGroupUser['endtime']你的组费已经到期,请联系组长续期!续期后才可以访问帖子内容。
    + {else} + +
    +
    + + + + + +
    + 全部 + {loop $arrTopicType $key $item} + {$item['typename']} + {/loop} +
    + + +
    + + + + + + +
    +
      + +{loop $arrTopic $key $item} +
    • +
      + + {$item['user']['username']} + +
      + +
      +
      + +{if $item['label']}{tsTitle($item['label'])}{/if} + +{if $item['typeid'] != 0}[{$item['typename']}]{/if} + + +{$item['title']} + + +{if $item['istop']=='1'} +[置顶] +{/if} + +{if $item['isposts'] == '1'} +[精华] +{/if} + + +
      + + + {if $item['group']['isopen']==0 && $item['score']==0 && $item['iscommentshow']==0} +
      + {$item['gaiyao']} +
      + {if $item['photos']} +
      + {loop $item['photos'] $pkey $pitem} + + {/loop} +
      + {/if} + {/if} + + +
      +
      + {$item['user']['username']} + 发表于 + {php echo getTime($item['uptime'],time())} +
      +
      +
      {$item['count_comment']}
      +
      {$item['count_view']}
      +
      +
      + + + +
      +
      +
    • +{/loop} + +
    +
    + + +
    {$pageUrl}
    + + +
    + + +
    + + {/if} + + + +
    + + +
    + + +
    +
    成员 更多
    +
    + + + +
    + {loop $arrGroupUser $key $item} + + {/loop} +
    + + +
    +
    + + + + + {if $TS_USER['userid'] == $strGroup['userid'] || $TS_USER['isadmin']=='1'} + + {/if} + +
    + +{php doAction('gobad','300')} + + +
    +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/tag.html b/app/group/html/tag.html new file mode 100644 index 0000000..78c6bce --- /dev/null +++ b/app/group/html/tag.html @@ -0,0 +1,67 @@ +{php include pubTemplate("header")} + +
    + + + + + +
    + +
    +
    +
    +

    {$strTag[tagname]}

    +
    +
    + + +
    +
    {$strTag[tagname]}相关的小组
    +
    + +
    + +
    +
    +
    + + + + +
    + +
    + +
    +
    热门标签
    +
    + {loop $arrTag $key $item} + {$item[tagname]} + {/loop} + 更多... +
    +
    + +
    + + {php doAction('gobad','300')} + +
    +
    +
    + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/tags.html b/app/group/html/tags.html new file mode 100644 index 0000000..9a47ebf --- /dev/null +++ b/app/group/html/tags.html @@ -0,0 +1,36 @@ +{php include pubTemplate("header")} + +
    + + + + + + +
    +
    全部标签
    +
    + +
    + {loop $arrTag $key $item} + {$item[tagname]} + {/loop} + +
    + +
    {$pageUrl}
    +
    +
    + + + +
    + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/topic.html b/app/group/html/topic.html new file mode 100644 index 0000000..78abf71 --- /dev/null +++ b/app/group/html/topic.html @@ -0,0 +1,505 @@ +{php include pubTemplate("header")} + + + +
    {php doAction('group_topic_top')}
    + + +
    + + + + +
    + +
    + + + +
    +
    + + +

    {if $strTopic['label']}{tsTitle($strTopic['label'])}{/if}{if $strTopic[typeid] !='0'}[{$strTopic[type][typename]}]{/if}{$strTopic[title]}

    + + +
    + + {$strTopic[user][username]} +
    + +
    发表于 {php echo date('Y-m-d H:i:s',$strTopic[addtime])}
    +
    +
    {$strTopic['count_comment']}
    +
    {$strTopic['count_view']}
    +
    + {if $TS_USER[userid] == $strTopic[userid] || $TS_USER[userid]==$strGroup[userid] ||$strGroupUser[isadmin]=="1" || $TS_USER[isadmin]=="1"} + + {/if} +
    +
    + + + +
    + {loop $strTopic[tags] $key $item} + {$item[tagname]} + {/loop} +
    + + + {if $page == '1'} +
    + +
    + {$strTopic['content']} + {if $strTopic['photos']} + {loop $strTopic['photos'] $key $item} +

    {$strTopic['title']}

    + {/loop} + {/if} + {$tpUrl} +
    + + + + + + {if $strTopic['iscommentshow']==1 && $isComment==0 && $strTopic['userid']!=intval($TS_USER['userid'])} + {else} + + + {if $TS_APP['istopicvideo']} + + {if $arrVideo} +
    + {loop $arrVideo $key $item} +

    + {if $item['siteid']==1 || $item['siteid']==2 || $item['siteid']==3} + + {/if} +

    + {/loop} + +
    + {/if} + + + {if $TS_USER['userid']==$strTopic['userid'] || $TS_USER['isadmin']==1} + + {/if} + + + {/if} + + + + + + + {if $TS_APP['istopicattach']} + + {if $arrAttach} +
    + + + {if $TS_USER['userid']==$strTopic['userid'] || $TS_USER['isadmin']==1} + + {/if} + +
    + + {else} + + {if $TS_USER['userid']==$strTopic['userid'] || $TS_USER['isadmin']==1} + + {/if} + + {/if} + + {/if} + + {/if} +
    {php doAction('group_topic_footer')}
    + + +
    {php doAction('gobad','468') + }
    +
    最后修改 {php echo date('Y-m-d H:i:s',$strTopic[uptime])}
    +
    +
    {$strTopic['count_comment']}
    +
    {$strTopic['count_view']}
    +
    + {if $TS_USER[userid] == $strTopic[userid] || $TS_USER[userid]==$strGroup[userid] ||$strGroupUser[isadmin]=="1" || $TS_USER[isadmin]=="1"} + + {/if} + +
    + + + {/if} +
    +
    + + + +
    +
    用户评论{if $strTopic['count_comment']} ({$strTopic['count_comment']}){/if}
    +
    + + + {if $arrTopicComment} +
    +
      + {loop $arrTopicComment $key $item} + + +
    • +
      + {$item[user][username]} +
      + + + + + +
      +

      {php echo date('Y-m-d H:i:s',$item[addtime])} + {$item[user][username]} + $item[l]# +

      + + + {if $item[referid] !='0'} +
      {$item[recomment][user][username]}:{$item[recomment][content]}
      + {/if} + + + +

      + {if $item['ispublic'] && $item['userid']==$TS_USER['userid'] || $item['ispublic'] && $strTopic['userid']==$TS_USER['userid']} + {$item[content]} + {elseif $item['ispublic'] && $item['userid']!=$TS_USER['userid'] || $item['ispublic'] && $strTopic['userid']!=$TS_USER['userid']} +

      + {else} + {$item[content]} + {/if} +

      + + + + + + + {if $TS_APP['istopicattach']} + {if $item['attach']} +
      + +
      + {/if} + {/if} + + + + + + + +
      + + {if $strGroupUser} + 回复 + {/if} + + {if $TS_USER[userid] == $strGroup[userid] || $TS_USER[userid] == $item[userid] || $strGroupUser[isadmin]==1 || $TS_USER[isadmin]==1} + 删除 + + {/if} +
      + + + +
      +
      + + + + +
    • + + + + {/loop} + +
    +
    +
    {$pageUrl}
    + {/if} + + + + + +
    + {if intval($TS_USER[userid])==0} +
    + 登录 | 注册 +
    + {elseif $strGroupUser==''} +
    + 不是本组成员不能回应此贴哦! +

    加入小组

    + +
    + {elseif $strTopic[iscomment] == 1 && $strTopic[userid] != $TS_USER[userid]} +
    + 本帖除作者外不允许任何人评论 +
    + {elseif $strTopic[isclose]=='1'} +
    + 该帖子已被关闭,无法评论 +
    + {else} +
    + +
    + +
    + + + + +
    + + + + +
    + {if $TS_SITE['isauthcode']} + + 点击刷新验证码 + {/if} + + +
    + + +
    + +
    是否公开:公开 不公开
    + + +
    + + +
    + + + + + + + +
    + +
    + + + +
    + {/if} +
    + +
    +
    + + + + +
    +
    + +
    +
    推荐帖子
    +
    + +
    + +
    + +
    +
    + +
    +
    + + +
    +
    本组热门帖子
    +
    +
    + +
    + + +
    +
    +
    +
    +
    +
    最新帖子
    +
    + +
    +
    +
    +
    +
    +
    +
    热门帖子
    +
    + +
    + +
    +
    +
    +
    + + +
    + + + +
    +
    + + + + + + + + +{php doAction('tseditor','mini')} +{php include pubTemplate("footer")} diff --git a/app/group/html/topic_collect.html b/app/group/html/topic_collect.html new file mode 100644 index 0000000..009cb23 --- /dev/null +++ b/app/group/html/topic_collect.html @@ -0,0 +1,6 @@ +
    +{loop $arrUser $key $item} +{$item[username]} +{/loop} +
    +
    \ No newline at end of file diff --git a/app/group/html/topic_edit.html b/app/group/html/topic_edit.html new file mode 100644 index 0000000..04bbc2f --- /dev/null +++ b/app/group/html/topic_edit.html @@ -0,0 +1,117 @@ +{php include pubTemplate("header")} + +
    + + + + + +
    +
    + + +
    +
    +
    + + + +
    + + +
    + + +
    + +{if $arrGroupType} +
    + + + + +
    +{/if} + + +
    + + +
    {$strTopic['content']}
    + +
    + +
    + +
    + +
    + + +
    + +
    + + +允许 +不允许 + +
    + + +
    + + +不需要 +需要 + +
    + +{if $TS_SITE['isauthcode']} +
    + + + + 点击刷新验证码 + +
    +{/if} + + + + + + + 返回 +

    + +
    + + + +
    +
    +
    + + +
    +
    + + + +
    +{php doAction('tseditor')} +{php include pubTemplate("footer")} diff --git a/app/group/html/topic_isopen.html b/app/group/html/topic_isopen.html new file mode 100644 index 0000000..f3f29d9 --- /dev/null +++ b/app/group/html/topic_isopen.html @@ -0,0 +1,42 @@ +{php include pubTemplate("header")} + +
    + + + + + + + +
    +
    + + + +
    + + 本小组帖子只有小组成员才可以浏览 + + {if $strGroup['joinway']==3} + 需要支付{$strGroup['price']}金币加入小组 + {else} + 加入小组 + {/if} +
    + + + +
    +
    + + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/topic_move.html b/app/group/html/topic_move.html new file mode 100644 index 0000000..daa366d --- /dev/null +++ b/app/group/html/topic_move.html @@ -0,0 +1,30 @@ +{php include pubTemplate("header")} + +
    + +
    +
    +

    移动帖子:{tsTitle($strTopic['title'])}

    +
    +

    选择小组: + +

    +

    + + + + + 返回 + +

    +
    + +
    +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/topic_xuqi.html b/app/group/html/topic_xuqi.html new file mode 100644 index 0000000..fa698fc --- /dev/null +++ b/app/group/html/topic_xuqi.html @@ -0,0 +1,35 @@ +{php include pubTemplate("header")} + +
    + + + + + + + +
    +
    + + + +
    + 你的组费已经到期,请联系组长续期!续期后才可以访问帖子内容。 +
    + + + +
    +
    + + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/html/user.html b/app/group/html/user.html new file mode 100644 index 0000000..f49d394 --- /dev/null +++ b/app/group/html/user.html @@ -0,0 +1,134 @@ +{php include pubTemplate("header")} + +
    + + + + +
    + +
    + + + +
    +
    {$strGroup['groupname']}成员
    +
    + + + +{if $TS_USER['isadmin']==1 && $strGroup['joinway']==3 || $strGroup['userid']==$userid && $strGroup['joinway']==3} +
    +
    +
    + +
    + +
    +
    +{/if} + + +
    + +
      +{loop $arrGroupUser $key $item} +
    • + + {$item[username]} + +
      {$item[username]}
      + +
    • +{/loop} +
    + +
    + + +
    +
    {$pageUrl}
    + + +
    +
    + + + +
    + + +
    + + +
    +
    {$strGroup['groupname']}组长
    +
    + + + +
    +
      + +
    • + + {$strLeader[username]} +
      {$strLeader[username]}
      +
    • + +
    +
    + + + + +
    +
    + + + + + +
    +
    {$strGroup['groupname']}管理员
    +
    + +{if $arrAdmin} +
    +
      + {loop $arrAdmin $key $item} +
    • + {$item[username]} +
      {$item[username]}
      +
    • + {/loop} +
    +
    + + {else} + 暂无 + {/if} + +
    +
    + + + + +
    + + {php doAction('gobad','300')} + + +
    +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/group/icon.png b/app/group/icon.png new file mode 100644 index 0000000..bedb4dd Binary files /dev/null and b/app/group/icon.png differ diff --git a/app/group/js/admin.js b/app/group/js/admin.js new file mode 100644 index 0000000..e69de29 diff --git a/app/group/js/extend.func.js b/app/group/js/extend.func.js new file mode 100644 index 0000000..72852af --- /dev/null +++ b/app/group/js/extend.func.js @@ -0,0 +1,35 @@ + + +//踢出小组 +function kickedGroup(groupid,userid){ + $.post(siteUrl+'index.php?app=group&ac=kicked',{'groupid':groupid,'userid':userid},function(rs){ + if(rs=='0'){ + + tsNotice('非法操作!') + + }else if(rs=='1'){ + + tsNotice('非法操作!') + + }else{ + window.location.reload(); + } + }) + +} + +//加入小组 +function joinGroup(groupid){ + tsPost('index.php?app=group&ac=ajax&ts=joingroup',{'groupid':groupid}); +} +function exitGroup(groupid){ + tsPost('index.php?app=group&ac=ajax&ts=exitgroup',{'groupid':groupid}); +} + + +//续期 +function openXuqi(userid) { + $("#xuqi_userid").val(userid); + var html = $("#xuqi_html").html(); + tsNotice(html); +} \ No newline at end of file diff --git a/app/group/skin/group.jpg b/app/group/skin/group.jpg new file mode 100644 index 0000000..a4cdf15 Binary files /dev/null and b/app/group/skin/group.jpg differ diff --git a/app/group/skin/style.css b/app/group/skin/style.css new file mode 100644 index 0000000..340c659 --- /dev/null +++ b/app/group/skin/style.css @@ -0,0 +1,263 @@ +/*最新CSS*/ +.group_show{overflow:hidden;padding: 50px 20px 20px 20px;border-bottom: solid 1px #dddddd;background-color:#bbb;background-image:url('group.jpg');background-repeat: no-repeat;background-size: 100% 100%;} +.group_show .face{float:left;} +.group_show .face img{} +.group_show .title{float:left;margin-left:20px;} +.group_show .title p{color:#999;margin: 0;margin-top: 6px;} +.group_show .join{float:right;margin-left:20px;color:#fff;} +/*最新CSS*/ + + +.mbtl { + float: left; + margin: 8px 7px 0 0; + padding: 0; + width: 55px; +} +.mbtr { + border-bottom: 1px solid #EEEEEE; + margin: 0px 0 20px 0; + min-height: 55px; + overflow: hidden; + padding: 10px;; + background:#f8f8f8; +} +.mbtr .author{} +.mbtr .author a{color:#8f8f8f;} +.mbtr .title{margin-top:10px;} +.mbtr .title a{color: #444444;font-size:22px;} +.mbtr .content{line-height:30px;font-size:14px;} + + + +/*右侧会员列表*/ + +.pl { + color: #666666; + font: 12px/150% Arial; + padding:10px 0; +} + +.pl2 { + color: #666666; + font: 14px/150% Arial; +} + + + +.pil { + height: 48px; + width: 48px; +} + + + +.plr { + color: #666666; + float: right; + font: 12px/150% Arial; +} + + +.mr5 { + margin-right: 5px; +} + + + + + + +.pl20 { + padding-left: 20px; +} + +.topic-content .topic-opt { + padding: 15px 0 0; +} +.rec-sec { + color: #999999; + text-align: right; +} +.rec-num { + margin: 0 4px; +} +.clearfix { + display: block; +} + + + + + + +/*ob*/ +.ob { + float: left; + margin: 0 0 10px; + text-align: center; + width: 70px; +} +.ob dt { + height: 50px; + margin: 0; + overflow: hidden; + text-align: center; +} +.ob dd { + height: 55px; + margin: 0; + overflow: hidden; + text-align: center; +} +.ob span { + white-space: nowrap; +} + + + + + +/*帖子类型列表*/ +.topictype{} +.topictype td{border-bottom:dashed 1px #DDDDDD;padding:5px;} + + +/*帖子列表*/ +.topic_list{overflow:hidden;} +.topic_list ul, .topic_list ul li{list-style: none;margin:0;padding:0;} +.topic_list ul{overflow:hidden;} +.topic_list ul li{overflow:hidden;padding:15px 0;display: block;border-bottom: 1px dashed #ccc;} + +.topic_list .userimg{float:left;width:38px;overflow:hidden;} + +.topic_list .topic_title{margin-left:40px;overflow:hidden;} + +.topic_list .topic_title .title a{font-size:18px;font-weight: bold;} + +.topic_list .topic_info{overflow: hidden;font-size:12px;color:#999999;} + +.rank { + background: none repeat scroll 0 0 #BBBBBB; + height: 15px; + line-height: 15px; + margin: 0 0 0 5px; + padding: 0 3px; + border-radius:5px 5px 5px 5px; +} + +/*小组列表*/ +.sub-item{ + border-bottom: 1px dashed #AAAAAA; + height: 72px; + margin: 0 2px 15px 0; + overflow: hidden; + width: 100%; + padding-bottom: 15px; +} +.sub-item .pic { + float: left; + width: 48px; +} +.sub-item .info { + vertical-align: top; + word-wrap: break-word; + margin-left:60px; +} + +.sub-item .info .content{ line-height:20px;font-size: 12px;color:#999999} + +.sub-item .pic img { + height: 48px; + margin-bottom: -3px; + width: 48px; +} +.sub-item p { + margin: 0; +} + + +/*热门帖子列表*/ +.group_index_right_hottopic{} +.group_index_right_hottopic ul { + word-wrap: break-word; + list-style: none; + margin: 0; + padding: 0; +} +.group_index_right_hottopic ul li { + border-bottom: 1px dashed #CCCCCC; + color: #999999; + overflow: hidden; + padding: 10px 0; + list-style: none; + margin: 0; +} +.group_index_right_hottopic ul li h3 {margin: 0;padding:0;white-space: nowrap; overflow: hidden;} +.group_index_right_hottopic ul li .info{overflow: hidden;margin-top: 10px;font-size: 12px;} +.group_index_right_hottopic ul li .info .left{float: left} +.group_index_right_hottopic ul li .info .right{float: right} + + +/*小组分类*/ +.catelist{ margin-bottom: 20px;overflow: hidden;} +.catelist ul{} +.catelist ul li{float:left;width:150px;font-size:14px;} + +/*分类下小组*/ +.categroup{} +.categroup ul{} +.categroup ul li{padding:10px;border-bottom: 1px dashed #CCCCCC;overflow:hidden;} +.categroup ul li img{float:left;padding:0 10px 0 0;} + +/*帖子页*/ + +.newtopic{} +.newtopic ul, .newtopic ul li{list-style: none;margin:0;padding:0;} +.newtopic ul{} +.newtopic ul li{border-top: 1px dashed #CCCCCC;padding: 5px 0;} + +.title2{float:right;border: 1px solid #DDDDDD;border-bottom:none;margin-top:10px;} +.title2 li{width:150px;border-bottom: 1px solid #DDDDDD;font-size:12px;padding:5px;line-height: 15px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} + + + + +.bltool a{margin-right:10px;padding:0px;} +.after-view{font-size:14px;} + +/*专辑*/ +.album{} +.album li{float:left;width:225px;margin: 0 5px 10px;height: 80px;} +.album li .al{float:left;width:50px;height:50px;text-align:center;} +.album li .al .num{background:#F0F0F0;padding:10px 0} +.album li .al .tz{background:#CCCCCC;} +.album li .ar{margin-left:60px;} +.album li .ar h3{margin:0px;font-weight:bold;} +.album li .ar .info{} +.album li .ar .time{color:#999999;} + + + +/** +帖子附件 + */ +.topic_attach{ + background-color: #FFEAAA; + border:dashed 2px #EDCEBA; + padding:10px; +} +.topic_attach ul{list-style: none;margin:0;padding: 0;} +.topic_attach ul li{list-style: none;margin: 0;padding: 0;} + +/**帖子视频**/ +.topic_video{ + background-color: #FFFFFF; + border:dashed 2px #66afe9; + padding:10px; +} + +.topic_video iframe{width: 100%;height:450px;} +@media (max-width: 575.98px) { + .topic_video iframe{width: 100%;height:230px;} +} \ No newline at end of file diff --git a/app/group/skins/default/group.jpg b/app/group/skins/default/group.jpg new file mode 100644 index 0000000..a4cdf15 Binary files /dev/null and b/app/group/skins/default/group.jpg differ diff --git a/app/group/skins/default/style.css b/app/group/skins/default/style.css new file mode 100644 index 0000000..ce668cc --- /dev/null +++ b/app/group/skins/default/style.css @@ -0,0 +1,291 @@ + + + +.mbtl { + float: left; + margin: 8px 7px 0 0; + padding: 0; + width: 55px; +} +.mbtr { + border-bottom: 1px solid #EEEEEE; + margin: 0px 0 20px 0; + min-height: 55px; + overflow: hidden; + padding: 10px;; + background:#f8f8f8; +} +.mbtr .author{} +.mbtr .author a{color:#8f8f8f;} +.mbtr .title{margin-top:10px;} +.mbtr .title a{color: #444444;font-size:22px;} +.mbtr .content{line-height:30px;font-size:14px;} + + + +/*右侧会员列表*/ + +.pl { + color: #666666; + font: 12px/150% Arial; + padding:10px 0; +} + +.pl2 { + color: #666666; + font: 14px/150% Arial; +} + + + +.pil { + height: 48px; + width: 48px; +} + + + +.plr { + color: #666666; + float: right; + font: 12px/150% Arial; +} + + +.mr5 { + margin-right: 5px; +} + + + + +/*内容页*/ +.topic-content{width: 100%;overflow:hidden;} + +.topic-content .user-face{float: left;height: 48px;overflow: hidden;width: 48px;} + +.topic-content .topic-doc { + margin-bottom: 30px; + overflow: hidden; + margin-left:60px; +} +.topic-content .topic-doc .author { + height: auto; + margin: 0; + margin-bottom: 1px; + color: #666666; + background:#f4f4ec; + padding:5px; + font-size:12px; +} + +.topic-content img{max-width:100%;} +.topic-content .topic-view{font-size:16px;line-height:30px;overflow: hidden;word-wrap: break-word;word-break: normal;} + +.topic-content .topic-view a{color:#49a5de} + +.topic-content .topic-view p{font-size:16px;} + +.topic-content .topic-view table{border:#CCCCCC 1px solid;} +.topic-content .topic-view table td{ border:1px #CCCCCC solid; border-right:none; border-top:none;} + + + +.pl20 { + padding-left: 20px; +} + +.topic-content .topic-opt { + padding: 15px 0 0; +} +.rec-sec { + color: #999999; + text-align: right; +} +.rec-num { + margin: 0 4px; +} +.clearfix { + display: block; +} + + + + + + +/*ob*/ +.ob { + float: left; + margin: 0 0 10px; + text-align: center; + width: 70px; +} +.ob dt { + height: 50px; + margin: 0; + overflow: hidden; + text-align: center; +} +.ob dd { + height: 55px; + margin: 0; + overflow: hidden; + text-align: center; +} +.ob span { + white-space: nowrap; +} + + + + + +/*帖子类型列表*/ +.topictype{} +.topictype td{border-bottom:dashed 1px #DDDDDD;padding:5px;} + + +/*帖子列表*/ +.topic_list{overflow:hidden;} +.topic_list ul, .topic_list ul li{list-style: none;margin:0;padding:0;} +.topic_list ul{overflow:hidden;} +.topic_list ul li{overflow:hidden;padding:15px 0;display: block;border-bottom: 1px dashed #ccc;} + +.topic_list .userimg{float:left;width:38px;overflow:hidden;} + +.topic_list .topic_title{margin-left:40px;overflow:hidden;} + +.topic_list .topic_title .title a{color:#343434;font-size:14px;} + +.topic_list .topic_info{overflow: hidden;font-size:12px;color:#999999;} + +.rank { + background: none repeat scroll 0 0 #BBBBBB; + height: 15px; + line-height: 15px; + margin: 0 0 0 5px; + padding: 0 3px; + border-radius:5px 5px 5px 5px; +} + +/*小组列表*/ +.sub-item{ + border-bottom: 1px dashed #AAAAAA; + height: 72px; + margin: 0 2px 15px 0; + overflow: hidden; + width: 100%; + padding-bottom: 15px; +} +.sub-item .pic { + float: left; + width: 48px; +} +.sub-item .info { + vertical-align: top; + word-wrap: break-word; + margin-left:60px; +} + +.sub-item .info .content{ line-height:20px;font-size: 12px;color:#999999} + +.sub-item .pic img { + height: 48px; + margin-bottom: -3px; + width: 48px; +} +.sub-item p { + margin: 0; +} + + +/*热门帖子列表*/ +.group_index_right_hottopic{} +.group_index_right_hottopic ul { + word-wrap: break-word; + list-style: none; + margin: 0; + padding: 0; +} +.group_index_right_hottopic ul li { + border-bottom: 1px dashed #CCCCCC; + color: #999999; + overflow: hidden; + padding: 10px 0; + list-style: none; + margin: 0; +} +.group_index_right_hottopic ul li h3 {margin: 0;padding:0;white-space: nowrap; overflow: hidden;} +.group_index_right_hottopic ul li .info{overflow: hidden;margin-top: 10px;font-size: 12px;} +.group_index_right_hottopic ul li .info .left{float: left} +.group_index_right_hottopic ul li .info .right{float: right} + + +/*小组分类*/ +.catelist{ margin-bottom: 20px;overflow: hidden;} +.catelist ul{} +.catelist ul li{float:left;width:150px;font-size:14px;} + +/*分类下小组*/ +.categroup{} +.categroup ul{} +.categroup ul li{padding:10px;border-bottom: 1px dashed #CCCCCC;overflow:hidden;} +.categroup ul li img{float:left;padding:0 10px 0 0;} + +/*帖子页*/ + +.newtopic{} +.newtopic ul, .newtopic ul li{list-style: none;margin:0;padding:0;} +.newtopic ul{} +.newtopic ul li{border-top: 1px dashed #CCCCCC;padding: 5px 0;} + +.title2{float:right;border: 1px solid #DDDDDD;border-bottom:none;margin-top:10px;} +.title2 li{width:150px;border-bottom: 1px solid #DDDDDD;font-size:12px;padding:5px;line-height: 15px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} + +.btool{ + border-top: 1px solid #EEEEEE; + font-size: 12px; + padding: 10px 10px 0 10px; + text-align: right;} +.btool a{margin-left:10px;padding:0px;color:#999999} + + +.bltool a{margin-right:10px;padding:0px;} +.after-view{font-size:14px;} + +/*专辑*/ +.album{} +.album li{float:left;width:225px;margin: 0 5px 10px;height: 80px;} +.album li .al{float:left;width:50px;height:50px;text-align:center;} +.album li .al .num{background:#F0F0F0;padding:10px 0} +.album li .al .tz{background:#CCCCCC;} +.album li .ar{margin-left:60px;} +.album li .ar h3{margin:0px;font-weight:bold;} +.album li .ar .info{} +.album li .ar .time{color:#999999;} + + + +/** +帖子附件 + */ +.topic_attach{ + background-color: #FFEAAA; + border:dashed 2px #EDCEBA; + padding:10px; +} +.topic_attach ul{list-style: none;margin:0;padding: 0;} +.topic_attach ul li{list-style: none;margin: 0;padding: 0;} + +/**帖子视频**/ +.topic_video{ + background-color: #FFFFFF; + border:dashed 2px #66afe9; + padding:10px; +} + +.topic_video iframe{width: 100%;height:450px;} +@media (max-width: 575.98px) { + .topic_video iframe{width: 100%;height:230px;} +} \ No newline at end of file diff --git a/app/home/about.php b/app/home/about.php new file mode 100644 index 0000000..82ad4a3 --- /dev/null +++ b/app/home/about.php @@ -0,0 +1,24 @@ + '首页', + 'version' => '1.2', + 'desc' => '首页', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '1', + 'ismy'=>0, + 'hook'=>array( + //插件钩子 + 'home_index_header'=>'上通栏', + 'home_index_left'=>'中左栏', + 'home_index_right'=>'中右栏', + 'home_index_footer'=>'下通栏', + ), +); \ No newline at end of file diff --git a/app/home/action/admin.php b/app/home/action/admin.php new file mode 100644 index 0000000..b04d6eb --- /dev/null +++ b/app/home/action/admin.php @@ -0,0 +1,10 @@ +findAll('home_info',null,'orderid asc'); + + include template('admin/info_list'); + break; + + //添加 + case "add": + + include template('admin/info_add'); + break; + + case "adddo": + + $title = tsTrim($_POST['title']); + $content = tsClean($_POST['content']); + + $orderid = tsIntval($_POST['orderid']); + + $new['home']->create('home_info',array( + + 'title'=>$title, + 'content'=>$content, + 'orderid'=>$orderid, + + )); + + header('Location: '.SITE_URL.'index.php?app=home&ac=admin&mg=info&ts=list'); + + break; + + //编辑 + case "edit": + + $infoid = tsIntval($_GET['infoid']); + + $strInfo = $new['home']->find('home_info',array( + 'infoid'=>$infoid, + )); + + //$strInfo['content'] = tsDecode($strInfo['content']); + + + include template('admin/info_edit'); + + break; + + case "editdo": + + $infoid = tsIntval($_POST['infoid']); + + $title = tsTrim($_POST['title']); + + $content = tsClean($_POST['content']); + + $orderid = tsIntval($_POST['orderid']); + + $new['home']->update('home_info',array( + + 'infoid'=>$infoid, + + ),array( + + 'title'=>$title, + 'content'=>$content, + 'orderid'=>$orderid, + + )); + + header('Location: '.SITE_URL.'index.php?app=home&ac=admin&mg=info&ts=list'); + + break; + + //删除 + case "delete": + + $infoid = tsIntval($_GET['infoid']); + + $new['home']->delete('home_info',array( + 'infoid'=>$infoid, + )); + + qiMsg('删除成功!'); + + break; + +} \ No newline at end of file diff --git a/app/home/action/admin/options.php b/app/home/action/admin/options.php new file mode 100644 index 0000000..b6861ef --- /dev/null +++ b/app/home/action/admin/options.php @@ -0,0 +1,11 @@ +find('home_info',array( + 'infoid'=>$infoid, +)); + +if($strInfo==''){ + ts404(); +} + +$strInfo['title'] = tsTitle($strInfo['title']); +$strInfo['content'] = nl2br(tsDecode($strInfo['content'])); + +$arrInfo = $new['home']->findAll('home_info',null,'orderid asc'); + +$title = $strInfo['title']; +include template('info'); \ No newline at end of file diff --git a/app/home/action/my.php b/app/home/action/my.php new file mode 100644 index 0000000..e69de29 diff --git a/app/home/action/plugin.php b/app/home/action/plugin.php new file mode 100644 index 0000000..4198d4d --- /dev/null +++ b/app/home/action/plugin.php @@ -0,0 +1,9 @@ +create('anti_report',array( + 'url'=>$url, + 'content'=>$content, + 'addtime'=>date('Y-m-d H:i:s') + )); + + tsNotice('举报提交成功!','点击返回',$url); + + break; +} \ No newline at end of file diff --git a/app/home/action/theme.php b/app/home/action/theme.php new file mode 100644 index 0000000..8fdc145 --- /dev/null +++ b/app/home/action/theme.php @@ -0,0 +1,15 @@ + +
    + +{php include template("admin/menu");} + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    标题:
    内容: + + +
    + +
    + +
    排序ID:
    + + + + +
    +
    + + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/home/html/admin/info_edit.html b/app/home/html/admin/info_edit.html new file mode 100644 index 0000000..57c1e7a --- /dev/null +++ b/app/home/html/admin/info_edit.html @@ -0,0 +1,58 @@ +{php include pubTemplate("header_admin")} +{php doAction('tseditor')} + +
    + +{php include template("admin/menu");} + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    标题:
    内容: + + + +
    + +
    + + + +
    排序ID:
    + + + + +
    +
    + + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/home/html/admin/info_list.html b/app/home/html/admin/info_list.html new file mode 100644 index 0000000..9d6020e --- /dev/null +++ b/app/home/html/admin/info_list.html @@ -0,0 +1,42 @@ +{php include pubTemplate("header_admin")} + + +
    + +{php include template("admin/menu");} + + + + + + + + + + + + + + + + + + +{loop $arrInfo $key $item} + + + + + + + +{/loop} + + + +
    InfoID标题调用链接排序ID操作
    {$item['infoid']}{tsTitle($item['title'])}{tsUrl('home','info',array('id'=>$item['infoid']))}{$item['orderid']}修改 | 删除
    + + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/home/html/admin/menu.html b/app/home/html/admin/menu.html new file mode 100644 index 0000000..5c64ec5 --- /dev/null +++ b/app/home/html/admin/menu.html @@ -0,0 +1,14 @@ + +
    +
    首页管理
    + +
    +
    \ No newline at end of file diff --git a/app/home/html/admin/options.html b/app/home/html/admin/options.html new file mode 100644 index 0000000..6f01bfd --- /dev/null +++ b/app/home/html/admin/options.html @@ -0,0 +1,11 @@ +{php include pubTemplate("header_admin")} + + +
    + +{php include template("admin/menu");} + +
    暂无配置
    +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/home/html/index.html b/app/home/html/index.html new file mode 100644 index 0000000..520041e --- /dev/null +++ b/app/home/html/index.html @@ -0,0 +1,27 @@ +{php include pubTemplate("header")} +{php doAction('home_index_js')} +{php doAction('home_index_css')} +

    {$GLOBALS['TS_SITE']['site_title']} - {$GLOBALS['TS_SITE']['site_subtitle']}

    +
    +{php doAction('home_index_header')} + +{php doAction('wordad')} + +
    +
    +{php doAction('home_index_left')} + +
    + +
    +{php doAction('home_index_right')} + + +{php doAction('gobad','300')} +
    +
    + +{php doAction('home_index_footer')} + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/home/html/info.html b/app/home/html/info.html new file mode 100644 index 0000000..ee215af --- /dev/null +++ b/app/home/html/info.html @@ -0,0 +1,49 @@ +{php include pubTemplate("header")} + +
    +
    + + + + +
    + + +
    + {loop $arrInfo $key $item} + + {tsTitle($item['title'])} + + {/loop} +
    + + +
    +
    + + +
    +
    + +

    {$strInfo['title']}

    + +
    + +
    + {$strInfo[content]} +
    + +
    +
    + + + +
    + + + + +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/home/html/menu.html b/app/home/html/menu.html new file mode 100644 index 0000000..ea8b2bf --- /dev/null +++ b/app/home/html/menu.html @@ -0,0 +1,9 @@ +
    + +
    \ No newline at end of file diff --git a/app/home/html/my.html b/app/home/html/my.html new file mode 100644 index 0000000..b9d2036 --- /dev/null +++ b/app/home/html/my.html @@ -0,0 +1,72 @@ +{php include pubTemplate("header")} +
    +
    + +
    + +
    + +

    我关注的...

    + +
    +
    +
    +
    + +
    + +
    + +
    + +
    +
    +{$strUser[username]} +
    + +
    +

    {$strUser[username]}

    +
    + +{if $strUser['userid']==$TS_USER['userid']} +我的空间 +{else} +关注 +{/if} + +
    +
    + +
    + + + +
    + + + +
    + + +
    + +
    + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/home/html/report.html b/app/home/html/report.html new file mode 100644 index 0000000..706a379 --- /dev/null +++ b/app/home/html/report.html @@ -0,0 +1,41 @@ +{php include pubTemplate("header")} +
    + + +
    +
    +
    + +
    +
    + + + + +
    +
    + + + +
    +
    + + +
    + + +
    + + +
    +
    + +
    +
    +
    + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/home/html/theme.html b/app/home/html/theme.html new file mode 100644 index 0000000..373351f --- /dev/null +++ b/app/home/html/theme.html @@ -0,0 +1,36 @@ +{php include pubTemplate("header")} + +
    + + + + +
    +
    更换皮肤
    +
    +
    +
      + {loop $arrTheme $key $item} +
    • + +

      {$item}

      +
    • + {if is_int(($key+1)/7)} +
      + {/if} + {/loop} +
    +
    +
    +
    + + + + + + + + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/home/icon.png b/app/home/icon.png new file mode 100644 index 0000000..43947b1 Binary files /dev/null and b/app/home/icon.png differ diff --git a/app/home/js/admin.js b/app/home/js/admin.js new file mode 100644 index 0000000..e69de29 diff --git a/app/home/js/extend.func.js b/app/home/js/extend.func.js new file mode 100644 index 0000000..3e70b7f --- /dev/null +++ b/app/home/js/extend.func.js @@ -0,0 +1,8 @@ +function selectTheme(theme){ + var date=new Date(); + var expireDays=10; + //将date设置为10天以后的时间 + date.setTime(date.getTime()+expireDays*24*3600*1000); + $('#tsTheme').attr('href',siteUrl+'theme/'+theme+'/style.css'); + document.cookie="tsTheme="+theme+";path=/;expire="+date.toGMTString(); +} \ No newline at end of file diff --git a/app/home/skin/style.css b/app/home/skin/style.css new file mode 100644 index 0000000..e3ea7ff --- /dev/null +++ b/app/home/skin/style.css @@ -0,0 +1,11 @@ + +.inforight{margin:0 80px;} +.inforight h1{padding:10px 0;} +.infocontent{font-size:14px;line-height:30px;} + +.tstheme{} +.tstheme ul,.tstheme ul li{list-style: none;margin:0;padding:0;} +.tstheme ul{} +.tstheme ul li{float:left;padding:5px;height:130px;margin:1px;text-align:center;border:solid 1px #fff} +.tstheme ul li a{} +.tstheme ul li:hover{border:solid 1px #336699} \ No newline at end of file diff --git a/app/home/skins/default/style.css b/app/home/skins/default/style.css new file mode 100644 index 0000000..e3ea7ff --- /dev/null +++ b/app/home/skins/default/style.css @@ -0,0 +1,11 @@ + +.inforight{margin:0 80px;} +.inforight h1{padding:10px 0;} +.infocontent{font-size:14px;line-height:30px;} + +.tstheme{} +.tstheme ul,.tstheme ul li{list-style: none;margin:0;padding:0;} +.tstheme ul{} +.tstheme ul li{float:left;padding:5px;height:130px;margin:1px;text-align:center;border:solid 1px #fff} +.tstheme ul li a{} +.tstheme ul li:hover{border:solid 1px #336699} \ No newline at end of file diff --git a/app/index.php b/app/index.php new file mode 100644 index 0000000..04bcd52 --- /dev/null +++ b/app/index.php @@ -0,0 +1,17 @@ + + + + +你找的页面不存在 + + + +

    404

    +

    你找的页面不存在

    + + +'; \ No newline at end of file diff --git a/app/location/about.php b/app/location/about.php new file mode 100644 index 0000000..d065ec2 --- /dev/null +++ b/app/location/about.php @@ -0,0 +1,17 @@ + '同城', + 'version' => '1.2', + 'desc' => '同城APP', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '0', + 'issystem' => '1', + 'isappnav' => '1', + 'ismy'=>'1', +); \ No newline at end of file diff --git a/app/location/action/admin.php b/app/location/action/admin.php new file mode 100644 index 0000000..b04d6eb --- /dev/null +++ b/app/location/action/admin.php @@ -0,0 +1,10 @@ +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; +} \ No newline at end of file diff --git a/app/location/action/admin/options.php b/app/location/action/admin/options.php new file mode 100644 index 0000000..edef197 --- /dev/null +++ b/app/location/action/admin/options.php @@ -0,0 +1,4 @@ +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; + +} \ No newline at end of file diff --git a/app/location/action/all.php b/app/location/action/all.php new file mode 100644 index 0000000..76d7748 --- /dev/null +++ b/app/location/action/all.php @@ -0,0 +1,7 @@ +findAll('location'); + +$title = '全部同城'; +include template('all'); \ No newline at end of file diff --git a/app/location/action/index.php b/app/location/action/index.php new file mode 100644 index 0000000..b3fe6e3 --- /dev/null +++ b/app/location/action/index.php @@ -0,0 +1,21 @@ +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; \ No newline at end of file diff --git a/app/location/action/my.php b/app/location/action/my.php new file mode 100644 index 0000000..a082e40 --- /dev/null +++ b/app/location/action/my.php @@ -0,0 +1,10 @@ +isLogin(); + +$strUser = aac('user')->getOneUser($userid); \ No newline at end of file diff --git a/app/location/action/my/index.php b/app/location/action/my/index.php new file mode 100644 index 0000000..50514da --- /dev/null +++ b/app/location/action/my/index.php @@ -0,0 +1,15 @@ +find('location',array( + 'locationid'=>$strUser['locationid'], + )); + +} + + +$title = '我的同城'; +include template('my/index'); \ No newline at end of file diff --git a/app/location/action/show.php b/app/location/action/show.php new file mode 100644 index 0000000..9d79ab4 --- /dev/null +++ b/app/location/action/show.php @@ -0,0 +1,64 @@ +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'); \ No newline at end of file diff --git a/app/location/class.location.php b/app/location/class.location.php new file mode 100644 index 0000000..d62c757 --- /dev/null +++ b/app/location/class.location.php @@ -0,0 +1,23 @@ + +
    +{php include template("admin/menu");} + +
    + + + + + + + + + +
    名称:
    内容:
    图片:
    排序ID:
    + +
    +
    + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/location/html/admin/location_edit.html b/app/location/html/admin/location_edit.html new file mode 100644 index 0000000..345b539 --- /dev/null +++ b/app/location/html/admin/location_edit.html @@ -0,0 +1,28 @@ +{php include pubTemplate("header_admin")} + +
    +{php include template("admin/menu");} + +
    + + + + + + + + + +
    名称:
    内容:
    图片: +{if $strLocation['photo']} + +
    +{/if} +
    排序ID:
    + + +
    +
    + +
    +{php include template("admin/footer")} \ No newline at end of file diff --git a/app/location/html/admin/location_list.html b/app/location/html/admin/location_list.html new file mode 100644 index 0000000..f4978d5 --- /dev/null +++ b/app/location/html/admin/location_list.html @@ -0,0 +1,36 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + + + + + + + + + + {loop $arrLocation $key $item} + + + + + + + + + {/loop} + + + + +
    ID名称排序操作
    {$item[locationid]}{$item[title]}{$item[orderid]} + + + + [修改] [删除]
    + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/location/html/admin/menu.html b/app/location/html/admin/menu.html new file mode 100644 index 0000000..ed47cf2 --- /dev/null +++ b/app/location/html/admin/menu.html @@ -0,0 +1,11 @@ +
    区域管理
    + \ No newline at end of file diff --git a/app/location/html/admin/options.html b/app/location/html/admin/options.html new file mode 100644 index 0000000..6f01bfd --- /dev/null +++ b/app/location/html/admin/options.html @@ -0,0 +1,11 @@ +{php include pubTemplate("header_admin")} + + +
    + +{php include template("admin/menu");} + +
    暂无配置
    +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/location/html/all.html b/app/location/html/all.html new file mode 100644 index 0000000..ae54a10 --- /dev/null +++ b/app/location/html/all.html @@ -0,0 +1,33 @@ +{php include pubTemplate("header")} + +
    + + +
    +
    全部同城
    +
    + +
    +
      + {loop $arrLocation $key $item} +
    • +
      {$item['title']}
      +
      +
      {$item['title']}
      +
      {$item['content']}
      + + + +
      +
    • + {/loop} +
    +
    + +
    +
    + + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/location/html/index.html b/app/location/html/index.html new file mode 100644 index 0000000..0be083b --- /dev/null +++ b/app/location/html/index.html @@ -0,0 +1,33 @@ +{php include pubTemplate("header")} + +
    + + +
    +
    选择加入同城
    +
    + +
    +
      +{loop $arrLocation $key $item} +
    • +
      {$item['title']}
      +
      +
      {$item['title']}
      +
      {$item['content']}
      + + + +
      +
    • +{/loop} +
    +
    + +
    +
    + + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/location/html/my/index.html b/app/location/html/my/index.html new file mode 100644 index 0000000..1f64580 --- /dev/null +++ b/app/location/html/my/index.html @@ -0,0 +1,64 @@ +{php include pubTemplate("header")} +
    + + +
    + + +
    +
    + + {php include pubTemplate("my")} + +
    +
    + +
    + + +
    +
    我的同城
    +
    + + + {if $strUser['locationid']} + + +
    +
    + + {$strLocation['title']} + +
    +
    +

    + {tsTitle($strLocation['title'])} +

    +

    {$strLocation['content']}

    +
    +
    + + + + {else} + +
    + 你还没有加入同城 + +
    + + {/if} + + +
    +
    + + +
    + + +
    +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/location/html/show.html b/app/location/html/show.html new file mode 100644 index 0000000..cfad95f --- /dev/null +++ b/app/location/html/show.html @@ -0,0 +1,207 @@ +{php include pubTemplate("header")} + +
    + + +
    +
    + +
    +
    {$strLocation['title']}
    +
    +

    {tsTitle($strLocation['title'])}{if $isLocationId==$strLocation['locationid']}退出同城 + {/if}

    +

    {$strLocation['content']}

    + + + +
    +
    + +
    +
    + +
    +
    + +
    +
    同城用户
    +
    +
    + +
    +
    +
    +
    + + +
    +
    同城图片
    +
    +
    + +
      +{loop $arrPhoto $key $item} +
    • + +{$item['albumname']} + +
    • +{/loop} +
    + +
    +
    +
    + +
    +
    同城帖子
    +
    + + +
    + +
    + + +
    +
    + + +
    + + +
    + +
    +
    开心每一天
    +
    + +
    + + +
    +
    +
    + + +
    +
    同城文章
    +
    +
    + + + +
    +
    +
    + + + + + + + + + +
    + + +
    +
    + +{php include pubTemplate("footer")} diff --git a/app/location/js/admin.js b/app/location/js/admin.js new file mode 100644 index 0000000..e69de29 diff --git a/app/location/js/extend.func.js b/app/location/js/extend.func.js new file mode 100644 index 0000000..e69de29 diff --git a/app/location/skins/default/style.css b/app/location/skins/default/style.css new file mode 100644 index 0000000..2f22299 --- /dev/null +++ b/app/location/skins/default/style.css @@ -0,0 +1,95 @@ +.location_list{} +.location_list ul, .location_list ul li{list-style: none;margin:0;padding:0;} +.location_list ul{} +.location_list ul li{float:left;padding:20px;width:420px;} +.location_list ul li .photo{float:left;width:100px;} +.location_list ul li .info{margin-left:100px;} + +.location_list ul li .info .content{line-height:25px;font-size:12px;color:#999} + + +.location{} +.location .photo{float:left;width:100px;} +.location .info{margin-left:100px;} +.location .info h1{padding:0 10px;} +.location .info p{padding:10px;} + + +.photo{} +.photo ul, .photo ul li{list-style: none;margin:0;padding: 0;} +.photo ul{} +.photo ul li{float:left;} + + +.weilist{} +.weilist ul, .weilist ul li{list-style: none;margin:0;padding:0;} +.weilist ul li { + border-bottom: 1px dashed #DDDDDD; + margin: 0 0 5px; + padding: 0 0 8px; +} +.weilist ul li .portrait { + float: left; + padding-top: 3px; + width: 45px; +} +.weilist ul li .portrait img { + background: none repeat scroll 0 0 #FFFFFF; + + height: 32px; + + width: 32px; +} +.weilist ul li .body { + float: left; + font-size: 9pt; + overflow: hidden; + width: 230px; +} +.weilist ul li .user a { + +} + +.weilist ul li .log { + color: #999; + word-break: break-all; +} +.weilist ul li .time { + color: #9A9A9A; + display: block; + margin: 5px 0 0; +} +.weilist ul li .time a { + color: #9A9A9A; + text-decoration: none; +} + +/*帖子列表*/ +.topic_list{overflow:hidden;} +.topic_list ul, .topic_list ul li{list-style: none;margin:0;padding:0;} +.topic_list ul{overflow:hidden;} +.topic_list ul li{overflow:hidden;padding:15px 0;display: block;border-bottom: 1px dashed #999999;} + +.topic_list ul li .other{background: none repeat scroll 0 0 #F8F8F8; + border-left: 3px solid #EEEEEE; + margin-left: 38px; + margin-top: 5px; + padding: 5px;} +.topic_list ul li .other p{margin:0px;padding:5px 0;} + +.topic_list .userimg{float:left;width:38px;overflow:hidden;} + +.topic_list .topic_title{margin-left:40px;overflow:hidden;} + +.topic_list .topic_title .title a{color:#343434;font-size:14px;} + +.topic_list .topic_info{overflow: hidden;font-size:12px;color:#999999;} + +.rank { + background: none repeat scroll 0 0 #BBBBBB; + height: 15px; + line-height: 15px; + margin: 0 0 0 5px; + padding: 0 3px; + border-radius:5px 5px 5px 5px; +} \ No newline at end of file diff --git a/app/mail/about.php b/app/mail/about.php new file mode 100644 index 0000000..0e8c562 --- /dev/null +++ b/app/mail/about.php @@ -0,0 +1,17 @@ + '邮件短信', + 'version' => '1.2', + 'desc' => '邮件短信', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '0', + 'ismy'=>'0', +); \ No newline at end of file diff --git a/app/mail/action/admin.php b/app/mail/action/admin.php new file mode 100644 index 0000000..b04d6eb --- /dev/null +++ b/app/mail/action/admin.php @@ -0,0 +1,10 @@ + tsTrim($_POST['appname']), + 'appdesc' => tsTrim($_POST['appdesc']), + 'isenable' => tsTrim($_POST['isenable']), + 'mailhost' => tsTrim($_POST['mailhost']), + 'ssl' => tsIntval($_POST['ssl']), + 'mailport' => tsTrim($_POST['mailport']), + 'mailuser' => tsTrim($_POST['mailuser']), + 'mailpwd' => tsTrim($_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; + + + case "sms": + + $arrData = array( + 'sms_server' => tsTrim($_POST['sms_server']), + 'sms_appid' => tsTrim($_POST['sms_appid']), + 'sms_appkey' => tsTrim($_POST['sms_appkey']), + 'sms_tpid' => tsTrim($_POST['sms_tpid']), + 'sms_sign' => tsTrim($_POST['sms_sign']), + ); + + //更新缓存 + fileWrite('sms_options.php','data',$arrData); + $GLOBALS['tsMySqlCache']->set('sms_options',$arrData); + + qiMsg("短信配置更新成功,并重置了缓存文件^_^"); + + break; + +} \ No newline at end of file diff --git a/app/mail/action/admin/options.php b/app/mail/action/admin/options.php new file mode 100644 index 0000000..7f18eb9 --- /dev/null +++ b/app/mail/action/admin/options.php @@ -0,0 +1,31 @@ +fetch_all_assoc("select * from ".dbprefix."mail_options"); + + foreach($arrOptions as $item){ + $strOption[$item['optionname']] = $item['optionvalue']; + } + + include template("admin/options"); + + break; + + //短信配置 + case "sms": + + $strOption = fileRead('data/sms_options.php'); + if($strOption==''){ + $strOption = $GLOBALS['tsMySqlCache']->get('sms_options'); + } + + + include template("admin/options_sms"); + + break; + +} \ No newline at end of file diff --git a/app/mail/class.mail.php b/app/mail/class.mail.php new file mode 100644 index 0000000..fad5c69 --- /dev/null +++ b/app/mail/class.mail.php @@ -0,0 +1,227 @@ +get('mail_options'); + } + + + + $mail = new PHPMailer(true); // Passing `true` enables exceptions + try { + //Server settings + $mail->SMTPDebug = 0; // Enable verbose debug output + $mail->isSMTP(); // Set mailer to use SMTP + $mail->Host = $options['mailhost']; // Specify main and backup SMTP servers + $mail->SMTPAuth = true; // Enable SMTP authentication + $mail->Username = $options['mailuser']; // SMTP username + $mail->Password = $options['mailpwd']; // SMTP password + + + if($options['ssl']){ + $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted + } + + $mail->CharSet = 'UTF-8'; + + + $mail->Port = $options['mailport']; // TCP port to connect to + + //Recipients + $mail->setFrom($options['mailuser'], $TS_SITE['site_title']); + $mail->addAddress($sendmail, ''); // Add a recipient + //$mail->addAddress($sendmail); // Name is optional + $mail->addReplyTo($options['mailuser'], $TS_SITE['site_title']); + + /* + $mail->addCC('cc@example.com'); + $mail->addBCC('bcc@example.com'); + */ + + //Attachments + /* + $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments + $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name + */ + + //Content + $mail->isHTML(true); // Set email format to HTML + $mail->Subject = $subject; + $mail->Body = $content; + $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; + + $mail->send(); + //echo 'Message has been sent'; + + return 1; + + } catch (Exception $e) { + //echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo; + + return 0; + } + + //date_default_timezone_set('Asia/Shanghai'); + + /* + require_once 'PHPMailer/PHPMailerAutoload.php'; + $mail = new PHPMailer(); + + //邮件配置 + $mail->CharSet = "UTF-8"; + $mail->IsSMTP(); + //Enable SMTP debugging + // 0 = off (for production use) + // 1 = client messages + // 2 = client and server messages + $mail->SMTPDebug = 0; + + $mail->Debugoutput = 'html'; + + if($options['ssl']){ + $mail->SMTPSecure = 'ssl'; + } + $mail->SMTPAuth = true; + + $mail->Host = $options['mailhost']; + $mail->Port = $options['mailport']; + $mail->Username = $options['mailuser']; + $mail->Password = $options['mailpwd']; + + //POST过来的信息 + $frommail = $options['mailuser']; + $fromname = $TS_SITE['site_title']; + $replymail = $options['mailuser']; + $replyname = $TS_SITE['site_title']; + $sendname = ''; + + if(empty($frommail) || empty($subject) || empty($content) || empty($sendmail)){ + return '0'; + }else{ + + //邮件发送 + $mail->SetFrom($frommail, $fromname); + $mail->AddReplyTo($replymail,$replyname); + $mail->Subject = $subject; + $mail->AltBody = "要查看邮件,请使用HTML兼容的电子邮件阅读器!"; + //$mail->MsgHTML(eregi_replace("[\]",'',$content)); + $mail->MsgHTML(strtr($content,'[\]','')); + $mail->AddAddress($sendmail, $sendname); + $mail->send(); + + return '1'; + + } + */ + + } + + + function sendSms($phone,$text,$tpid=0,$type=86){ + + $strOption = fileRead('data/sms_options.php'); + if($strOption==''){ + $strOption = $GLOBALS['tsMySqlCache']->get('sms_options'); + } + + $sms_server = $strOption['sms_server']; + + // 短信应用SDK AppID + $appid = $strOption['sms_appid']; // 1400开头 + // 短信应用SDK AppKey + $appkey = $strOption['sms_appkey']; + // 短信模板ID,需要在短信应用中申请 + $templateId = $strOption['sms_tpid']; // NOTE: 这里的模板ID`7839`只是一个示例,真实的模板ID需要在短信控制台中申请 + if($tpid!=0){ + $templateId = $tpid; + } + // 签名 + $smsSign = $strOption['sms_sign']; // NOTE: 这里的签名只是示例,请使用真实的已申请的签名,签名参数使用的是`签名内容`,而不是`签名ID` + + #腾讯云发送短信 + if($sms_server=='qcloud'){ + // 指定模板ID单发短信 + try { + $ssender = new SmsSingleSender($appid, $appkey); + $params = ["$text"]; + $result = $ssender->sendWithParam("$type", $phone, $templateId, + $params, $smsSign, "", ""); // 签名参数未提供或者为空时,会使用默认签名发送短信 + #$rsp = json_decode($result); + //echo $result; + } catch(\Exception $e) { + //echo var_dump($e); + } + } + + + #阿里云发送短信 + if($sms_server=='aliyun'){ + AlibabaCloud::accessKeyClient($appid, $appkey) + ->regionId('cn-hangzhou') // replace regionId as you need + ->asGlobalClient(); + + try { + $result = AlibabaCloud::rpcRequest() + ->product('Dysmsapi') + // ->scheme('https') // https | http + ->version('2017-05-25') + ->action('SendSms') + ->method('POST') + ->options([ + 'query' => [ + 'RegionId' => 'cn-hangzhou', + 'PhoneNumbers' => $phone, + 'SignName' => $smsSign, + 'TemplateCode' => $templateId, + 'TemplateParam' => '{"code":"'.$text.'"}', + ], + ]) + ->request(); + //print_r($result->toArray()); + } catch (ClientException $e) { + //echo $e->getErrorMessage() . PHP_EOL; + } catch (ServerException $e) { + //echo $e->getErrorMessage() . PHP_EOL; + } + } + + + } + + + //析构函数 + public function __destruct(){ + + } + +} \ No newline at end of file diff --git a/app/mail/config.php b/app/mail/config.php new file mode 100644 index 0000000..12cc3e6 --- /dev/null +++ b/app/mail/config.php @@ -0,0 +1,4 @@ + + +
    Email短信管理
    + + + + +
    \ No newline at end of file diff --git a/app/mail/html/admin/options.html b/app/mail/html/admin/options.html new file mode 100644 index 0000000..9ef3b43 --- /dev/null +++ b/app/mail/html/admin/options.html @@ -0,0 +1,43 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + +
    + + + + + + + + + + + + + + + + + + +
    邮箱Host : (例如:smtp.exmail.qq.com)
    使用ssl/tls:不使用 使用(使用SSL需要空间开启php_openssl扩展)
    邮箱端口 : (例如:默认为25,ssl为465,tls为587)
    邮箱用户 : (例如:user@qq.com)
    邮箱密码 : (例如:123456)
    + +

    建议使用QQ企业邮箱 去申请

    + +

    + 不懂怎么配置? ThinkSAAS邮件配置教程 +

    + + +
    + + + + +
    +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/mail/html/admin/options_sms.html b/app/mail/html/admin/options_sms.html new file mode 100644 index 0000000..065fa7f --- /dev/null +++ b/app/mail/html/admin/options_sms.html @@ -0,0 +1,55 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + +
    + + + + + + + + + + + + + + + +
    短信平台: + + + 阿里云 + + 腾讯云 + + +
    APPID:
    APPKEY:
    短信模板ID:
    短信签名:
    + + +
    + +
    【推荐使用阿里云短信服务】
    + +
    阿里云参数配置请点击 阿里云短信服务 获取
    +
    腾讯云参数配置请点击 腾讯云 获取
    + +
    + + + +
    + + + + + + +
    +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/message/about.php b/app/message/about.php new file mode 100644 index 0000000..80e18a0 --- /dev/null +++ b/app/message/about.php @@ -0,0 +1,17 @@ + '消息盒子', + 'version' => '1.2', + 'desc' => 'ImBox消息盒子', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '0', + 'issystem' => '1', + 'isappnav' => '0', + 'ismy'=>'0', +); \ No newline at end of file diff --git a/app/message/action/admin.php b/app/message/action/admin.php new file mode 100644 index 0000000..b04d6eb --- /dev/null +++ b/app/message/action/admin.php @@ -0,0 +1,10 @@ +findAll('message',null,'addtime desc',null,$lstart.',20'); + + $msgNum = $new['message']->findCount('message'); + $pageUrl = pagination($msgNum, 20, $page, $url); + + include template('admin/msg_list'); + break; + + //删除 + case "delete": + + $messageid = tsIntval($_GET['messageid']); + $page = tsIntval($_GET['page']); + + $new['message']->delete('message',array( + 'messageid'=>$messageid, + )); + + header('Location: '.SITE_URL.'index.php?app=message&ac=admin&mg=msg&ts=list&page='.$page); + + break; + + +} \ No newline at end of file diff --git a/app/message/action/admin/options.php b/app/message/action/admin/options.php new file mode 100644 index 0000000..b6861ef --- /dev/null +++ b/app/message/action/admin/options.php @@ -0,0 +1,11 @@ + +----------------------------------------------- +Message Http Api List +URL:https://demo.thinksaas.cn +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +'; \ No newline at end of file diff --git a/app/message/action/common.php b/app/message/action/common.php new file mode 100644 index 0000000..ad4462c --- /dev/null +++ b/app/message/action/common.php @@ -0,0 +1,7 @@ +isLogin(); + $strUser = aac('user')->getOneUser($userid); +} \ No newline at end of file diff --git a/app/message/action/friend.php b/app/message/action/friend.php new file mode 100644 index 0000000..f35e3fe --- /dev/null +++ b/app/message/action/friend.php @@ -0,0 +1,31 @@ +isLogin(); + +$page = tsIntval($_GET['page'],1); +$url = tsUrl('message','friend',array('page'=>'')); +$lstart = $page*40-40; + +$arrToUsers = $db->fetch_all_assoc("select `userid` from ".dbprefix."message where `userid` > '0' and `touserid`='$userid' group by userid order by addtime desc limit $lstart,40"); + +$userNum = $db->once_num_rows("select `userid` from ".dbprefix."message where `userid` > '0' and `touserid`='$userid' group by userid"); + +$pageUrl = pagination($userNum, 40, $page, $url); + +if(is_array($arrToUsers)){ + foreach($arrToUsers as $key=>$item){ + $arrToUser[] = $item; + $arrToUser[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + $arrToUser[$key]['count'] = $new['message']->findCount('message',array( + 'touserid'=>$userid, + 'userid'=>$item['userid'], + 'isread'=>0, + )); + + } +} + +$title = '好友消息'; +include template('friend'); \ No newline at end of file diff --git a/app/message/action/index.php b/app/message/action/index.php new file mode 100644 index 0000000..1ff146d --- /dev/null +++ b/app/message/action/index.php @@ -0,0 +1,2 @@ +isLogin(); + +$touserid= tsIntval($_GET['userid']); + +if($userid == 0 || $touserid == 0) { + exit; +}; + +$msgCount = $new['message']->findCount('message',"(userid='$userid' and touserid='$touserid') or (userid='$touserid' and touserid='$userid')"); + +if($msgCount ==0) { + exit; +}; + +$arrMessage = $new['message']->findAll('message',"(userid='$userid' and touserid='$touserid') or (userid='$touserid' and touserid='$userid')",'addtime desc',null,10); + + +foreach($arrMessage as $key=>$item){ + $arrMessage[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + $arrMessage[$key]['content'] = tsTitle($item['content']); +} + +$arrMessage = array_reverse($arrMessage); + + +//isread设为已读 +$new['message']->update('message',array( + 'userid'=>$touserid, + 'touserid'=>$userid, + 'isread'=>0, +),array( + 'isread'=>1, +)); + +$title = '消息盒子'; + +include template("msgbox"); \ No newline at end of file diff --git a/app/message/action/my.php b/app/message/action/my.php new file mode 100644 index 0000000..3bb97f4 --- /dev/null +++ b/app/message/action/my.php @@ -0,0 +1,19 @@ +findAll('message',array( + 'touserid'=>$strUser['userid'], + 'isread'=>'0', +)); + +foreach($arrMessage as $key=>$item){ + $arrMessage[$key]['content'] = tsTitle($item['content']); + if($item['userid']){ + $arrMessage[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + } +} + +$title = '我的消息盒子'; + +include template("my"); \ No newline at end of file diff --git a/app/message/action/newmsg.php b/app/message/action/newmsg.php new file mode 100644 index 0000000..2275ed4 --- /dev/null +++ b/app/message/action/newmsg.php @@ -0,0 +1,19 @@ +findCount('message',array( + 'touserid'=>$userid, + 'isread'=>0, +)); + +if($newMsgNum == '0'){ + echo '0'; +}else{ + echo $newMsgNum; +} \ No newline at end of file diff --git a/app/message/action/read.php b/app/message/action/read.php new file mode 100644 index 0000000..519ce47 --- /dev/null +++ b/app/message/action/read.php @@ -0,0 +1,18 @@ +isLogin(); +//isread设为已读 +$new['message']->update('message',array( + 'touserid'=>$touserid, + 'isread'=>0, +),array( + 'isread'=>1, +)); + +tsNotice('操作成功!'); \ No newline at end of file diff --git a/app/message/action/sendbox.php b/app/message/action/sendbox.php new file mode 100644 index 0000000..5b4c92f --- /dev/null +++ b/app/message/action/sendbox.php @@ -0,0 +1,13 @@ +getSimpleUser($userid); + +$title = '发送盒子'; + +include template("sendbox"); \ No newline at end of file diff --git a/app/message/action/sendmsg.php b/app/message/action/sendmsg.php new file mode 100644 index 0000000..19807ff --- /dev/null +++ b/app/message/action/sendmsg.php @@ -0,0 +1,10 @@ +isLogin(); +$touserid = tsIntval($_POST['touserid']); +$content = tsTrim($_POST['content']); + +$new['message']->sendmsg($userid,$touserid,$content); + +echo '1'; \ No newline at end of file diff --git a/app/message/action/system.php b/app/message/action/system.php new file mode 100644 index 0000000..20d0872 --- /dev/null +++ b/app/message/action/system.php @@ -0,0 +1,32 @@ +isLogin(); + +$arrMessage = $new['message']->findAll('message',array( + //'userid'=>0, + 'touserid'=>$touserid, +),'addtime desc',null,10); + +foreach($arrMessage as $key=>$item){ + $arrMessage[$key]['content'] = tsTitle($item['content']); + if($item['userid']){ + $arrMessage[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + } +} + +//isread设为已读 +$new['message']->update('message',array( + 'userid'=>0, + 'touserid'=>$touserid, + 'isread'=>0, +),array( + 'isread'=>1, +)); + +$title = '系统消息'; + +include template("system"); \ No newline at end of file diff --git a/app/message/action/user.php b/app/message/action/user.php new file mode 100644 index 0000000..6678e31 --- /dev/null +++ b/app/message/action/user.php @@ -0,0 +1,37 @@ +isLogin(); + +$touserid= tsIntval($_GET['touserid']); + + +$strTouser = aac('user')->getSimpleUser($touserid); + +$where = "(userid='$userid' and touserid='$touserid' and `tourl`='') or (userid='$touserid' and touserid='$userid' and `tourl`='')"; + +$msgCount = $new['message']->findCount('message',$where); + +$arrMessage = $new['message']->findAll('message',$where,'addtime desc',null,10); + + +foreach($arrMessage as $key=>$item){ + $arrMessage[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + $arrMessage[$key]['content'] = tsTitle($item['content']); +} + +$arrMessage = array_reverse($arrMessage); + + +//isread设为已读 +$new['message']->update('message',array( + 'userid'=>$touserid, + 'touserid'=>$userid, + 'isread'=>0, +),array( + 'isread'=>1, +)); + +$title = '消息盒子'; + +include template("user"); \ No newline at end of file diff --git a/app/message/class.message.php b/app/message/class.message.php new file mode 100644 index 0000000..666691b --- /dev/null +++ b/app/message/class.message.php @@ -0,0 +1,48 @@ +create('message',array( + 'userid' => $userid, + 'touserid' => $touserid, + 'content' => $content, + 'tourl'=>$tourl, + 'extend'=>$extend, + 'addtime' => time(), + )); + + } + } + + +} \ No newline at end of file diff --git a/app/message/config.php b/app/message/config.php new file mode 100644 index 0000000..c284644 --- /dev/null +++ b/app/message/config.php @@ -0,0 +1,6 @@ + +
    消息管理
    + + + +
    \ No newline at end of file diff --git a/app/message/html/admin/msg_list.html b/app/message/html/admin/msg_list.html new file mode 100644 index 0000000..62f212f --- /dev/null +++ b/app/message/html/admin/msg_list.html @@ -0,0 +1,41 @@ +{php include pubTemplate("header_admin")} + + +
    + +{php include template("admin/menu");} + +
    {$pageUrl}
    + + + + + + + + + + + + + + +{loop $arrMsg $key $item} + + + + +{/loop} + + + + + +
    messageiduseridtouseridcontentaddtime 操作
    {$item['messageid']}{$item['userid']}{$item['touserid']}{$item['content']}{php echo date('Y-m-d H:i:s',$item['addtime'])} + + 删除 +
    + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/message/html/admin/options.html b/app/message/html/admin/options.html new file mode 100644 index 0000000..9c9e123 --- /dev/null +++ b/app/message/html/admin/options.html @@ -0,0 +1,11 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + +暂无配置 + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/message/html/friend.html b/app/message/html/friend.html new file mode 100644 index 0000000..053d7af --- /dev/null +++ b/app/message/html/friend.html @@ -0,0 +1,52 @@ +{php include pubTemplate("header")} + +
    + +
    + + +
    +
    + +{php include pubTemplate("my")} + +
    +
    + + + +
    +
    +
    + +{template menu} + +
    + + + + + +
    + +
    {$pageUrl}
    + + + +
    +
    + + +
    + +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/message/html/menu.html b/app/message/html/menu.html new file mode 100644 index 0000000..e44ef85 --- /dev/null +++ b/app/message/html/menu.html @@ -0,0 +1,7 @@ + + +
    \ No newline at end of file diff --git a/app/message/html/msgbox.html b/app/message/html/msgbox.html new file mode 100644 index 0000000..50dff7a --- /dev/null +++ b/app/message/html/msgbox.html @@ -0,0 +1,11 @@ +
    +
      +{loop $arrMessage $key $item} +
    • +{if $item[userid]==$TS_USER[userid]}{$item[user][username]} {php echo date('Y-m-d H:i:s',$item[addtime])}{else}{$item[user][username]} {php echo date('Y-m-d H:i:s',$item[addtime])}{/if} +
      +{$item[content]} +
    • +{/loop} +
    +
    \ No newline at end of file diff --git a/app/message/html/my.html b/app/message/html/my.html new file mode 100644 index 0000000..763b163 --- /dev/null +++ b/app/message/html/my.html @@ -0,0 +1,98 @@ +{php include pubTemplate("header")} +
    + + +
    + +
    +
    + +{php include pubTemplate("my")} + +
    +
    + + + +
    + +
    +
    +{template menu} + + + + +{if $arrMessage} + + + + + + + + + + + + + + {loop $arrMessage $key $item} + + + + + + + {/loop} + + +
    消息状态操作
    +

    {php echo date('Y-m-d H:i:s',$item[addtime])}

    + {if $item['userid']}{$item['user']['username']}{/if} {$item[content]} +
    + {if $item['isread']==1} + 已读 + {else} + 未读 + {/if} + + {if $item['tourl']} + 查看 + {/if} + + {if $item['userid'] && $item['tourl']==''} + 聊天 + {/if} + +
    + + + + + + +{else} + +
    暂无消息
    + +{/if} + + + +
    +
    +
    + +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/message/html/sendbox.html b/app/message/html/sendbox.html new file mode 100644 index 0000000..ef02cb1 --- /dev/null +++ b/app/message/html/sendbox.html @@ -0,0 +1,8 @@ +
    +

    {$strTouser[username]}进行及时消息通话中

    +

    +

    +发送 + +

    +
    \ No newline at end of file diff --git a/app/message/html/system.html b/app/message/html/system.html new file mode 100644 index 0000000..f0a78b8 --- /dev/null +++ b/app/message/html/system.html @@ -0,0 +1,85 @@ +{php include pubTemplate("header")} + +
    + +
    + +
    +
    + +{php include pubTemplate("my")} + +
    +
    + + + +
    +
    +
    + +{template menu} + +
    + + + + + + + + + + + + + + {loop $arrMessage $key $item} + + + + + + + {/loop} + + +
    消息状态操作
    +

    {php echo date('Y-m-d H:i:s',$item[addtime])}

    + {if $item['userid']}{$item['user']['username']}{/if} {$item[content]} +
    + {if $item['isread']==1} + 已读 + {else} + 未读 + {/if} + + {if $item['tourl']} + 查看 + {/if} + + {if $item['userid'] && $item['tourl']==''} + 聊天 + {/if} + +
    + + + + + +
    + + +
    +
    +
    + + +
    + +
    + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/message/html/user.html b/app/message/html/user.html new file mode 100644 index 0000000..d77bb18 --- /dev/null +++ b/app/message/html/user.html @@ -0,0 +1,56 @@ +{php include pubTemplate("header")} +
    +
    + + + +
    +
    + + {php include pubTemplate("my")} + +
    +
    + + +
    +
    +
    + + {template menu} + + +
    +
      +{loop $arrMessage $key $item} +
    • +{if $item[userid]==$TS_USER[userid]}{$item[user][username]} {php echo date('Y-m-d H:i:s',$item[addtime])}{else}{$item[user][username]} {php echo date('Y-m-d H:i:s',$item[addtime])}{/if} +
      +{$item[content]} +
    • +{/loop} +
    +
    + +
    + +
    +

    {$strTouser[username]}进行及时消息通话中

    +

    +

    + 发送 + +

    +
    + + +
    +
    +
    + + + +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/message/js/extend.func.js b/app/message/js/extend.func.js new file mode 100644 index 0000000..ca9e0c8 --- /dev/null +++ b/app/message/js/extend.func.js @@ -0,0 +1,72 @@ +//发送盒子 +function sendbox(userid){ + +$("#msgbox").html("加载消息中......") +$("#sendbox").html("加载输入框中......") + + $.ajax({ + type: "GET", + url: siteUrl+"index.php?app=message&ac=msgbox&userid="+userid, + success: function(msg){ + $('#msgbox').html(msg); + + var msgbox=document.getElementById('msgbox'); + if(msgbox.scrollHeight>msgbox.offsetHeight) msgbox.scrollTop=msgbox.scrollHeight-msgbox.offsetHeight+20; + + } + }); + + $.ajax({ + type: "GET", + url: siteUrl+"index.php?app=message&ac=sendbox&userid="+userid, + success: function(msg){ + $('#sendbox').html(msg); + } + }); +} + +//发送消息 +function sendmsg(userid,touserid){ + var content = $("#boxcontent").val(); + if(content == ''){ + alert("请输入你要发送的内容!");return false; + } + //清空内容 + $("#boxcontent").attr("value",''); + $("#sendbutton").css('display','none'); + $("#loading").css('display','block'); + + + $.ajax({ + type: "POST", + url: siteUrl+"index.php?app=message&ac=sendmsg", + data: "userid="+userid+"&touserid="+touserid+"&content="+content, + beforeSend: function(){}, + success: function(result){ + if(result == '1'){ + $("#loading").css('display','none'); + $("#sendbutton").css('display','block'); + + window.location.reload(); + + } + + } + }); +} + +//系统消息盒子 +function systembox(userid){ + $("#sendbox").html(""); + $("#msgbox").html("加载系统消息中......") + $.ajax({ + type: "GET", + url: siteUrl+"index.php?app=message&ac=systembox&userid="+userid, + success: function(msg){ + $('#msgbox').html(msg); + var msgbox=document.getElementById('msgbox'); + if(msgbox.scrollHeight>msgbox.offsetHeight) msgbox.scrollTop=msgbox.scrollHeight-msgbox.offsetHeight+20; + + } + }); +} \ No newline at end of file diff --git a/app/message/skin/style.css b/app/message/skin/style.css new file mode 100644 index 0000000..8cf5f8e --- /dev/null +++ b/app/message/skin/style.css @@ -0,0 +1,35 @@ +/*imbox*/ +.imbox{} +.leftbar{} +.leftbar .bartitle{background:#dae9ef;padding:5px;} +.leftbar ul{} +.leftbar ul, .leftbar ul li{list-style: none;margin:0;padding:0;} +.leftbar ul li{line-height:23px;padding-left:10px;} + +.msgbox{overflow:hidden;} +.msgbox ul, .msgbox ul li{list-style: none;margin:0;padding:0;} +.msgbox ul{} +.msgbox ul li{width:175px;float:left;line-height:23px;padding-left:10px;} +.mysend{background:#f5f8fa} + +.system{overflow:hidden;} +.system ul, .system ul li{list-style: none;margin:0;padding:0;} +.system ul{} +.system ul li{line-height:23px;padding-left:10px;} + +.sendbox{padding:0px 20px 20px 0px;overflow:hidden;} +.sendbox p{} +.sendbox textarea{width:100%;height:50px;} + +.boxabout{line-height:23px;padding:0 10px;} + +.usermsg{overflow:hidden;} +.usermsg ul, .usermsg ul li{list-style: none;margin:0;padding:0;} +.usermsg ul{} +.usermsg ul li{line-height:23px;padding:0 10px;} + + +.newmsg{} +.newmsg ul, .newmsg ul li{list-style: none;margin:0;padding:0;} +.newmsg ul{} +.newmsg ul li{padding:5px 10px;} \ No newline at end of file diff --git a/app/message/skins/default/loading.gif b/app/message/skins/default/loading.gif new file mode 100644 index 0000000..d43340d Binary files /dev/null and b/app/message/skins/default/loading.gif differ diff --git a/app/message/skins/default/style.css b/app/message/skins/default/style.css new file mode 100644 index 0000000..abecac4 --- /dev/null +++ b/app/message/skins/default/style.css @@ -0,0 +1,35 @@ +/*imbox*/ +.imbox{} +.leftbar{} +.leftbar .bartitle{background:#dae9ef;padding:5px;} +.leftbar ul{} +.leftbar ul, .leftbar ul li{list-style: none;margin:0;padding:0;} +.leftbar ul li{line-height:23px;padding-left:10px;} + +.msgbox{overflow:hidden;} +.msgbox ul, .msgbox ul li{list-style: none;margin:0;padding:0;} +.msgbox ul{} +.msgbox ul li{width:175px;float:left;line-height:23px;padding-left:10px;} +.mysend{background:#f5f8fa} + +.system{overflow:hidden;} +.system ul, .system ul li{list-style: none;margin:0;padding:0;} +.system ul{} +.system ul li{line-height:23px;padding-left:10px;} + +.sendbox{padding:0 20px 20px 20px;overflow:hidden;} +.sendbox p{} +.sendbox textarea{width:350px;height:50px;} + +.boxabout{line-height:23px;padding:0 10px;} + +.usermsg{overflow:hidden;} +.usermsg ul, .usermsg ul li{list-style: none;margin:0;padding:0;} +.usermsg ul{} +.usermsg ul li{line-height:23px;padding:0 10px;} + + +.newmsg{} +.newmsg ul, .newmsg ul li{list-style: none;margin:0;padding:0;} +.newmsg ul{} +.newmsg ul li{padding:5px 10px;} \ No newline at end of file diff --git a/app/message/skins/default/system.gif b/app/message/skins/default/system.gif new file mode 100644 index 0000000..9846bfb Binary files /dev/null and b/app/message/skins/default/system.gif differ diff --git a/app/my/about.php b/app/my/about.php new file mode 100644 index 0000000..46d02aa --- /dev/null +++ b/app/my/about.php @@ -0,0 +1,17 @@ + '我的社区', + 'version' => '1.2', + 'desc' => '我的社区', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '0', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '1', + 'ismy'=>'0', +); \ No newline at end of file diff --git a/app/my/action/admin.php b/app/my/action/admin.php new file mode 100644 index 0000000..b04d6eb --- /dev/null +++ b/app/my/action/admin.php @@ -0,0 +1,10 @@ +isLogin(); + +$strUser = aac('user')->getOneUser($userid); \ No newline at end of file diff --git a/app/my/action/index.php b/app/my/action/index.php new file mode 100644 index 0000000..3ca1a24 --- /dev/null +++ b/app/my/action/index.php @@ -0,0 +1,41 @@ +findAll('group_user',array( + 'userid'=>$strUser['userid'], +),null,'groupid',12); + +foreach($arrGroupsList as $key=>$item){ + $strGroup = aac('group')->getOneGroup($item['groupid']); + if($strGroup){ + $arrGroup[] = $strGroup; + }else{ + $new['my']->delete('group_user',array( + 'userid'=>$strUser['userid'], + 'groupid'=>$item['groupid'], + )); + } +} + +#加入的小组数 +$joinGroupNum = $new['my']->findCount('group_user',array( + 'userid'=>$strUser['userid'], +)); + +//我的帖子 +$arrTopic = $new['my']->findAll('topic',array( + 'userid'=>$strUser['userid'], +),'addtime desc',null,10); + + +//我的文章 +$arrArticle = $new ['my']->findAll ( 'article', array ( + 'userid' => $strUser['userid'], +), 'addtime desc', null, 10 ); + + + +$title = '我的社区'; +include template("index"); \ No newline at end of file diff --git a/app/my/action/invite.php b/app/my/action/invite.php new file mode 100644 index 0000000..c88ac98 --- /dev/null +++ b/app/my/action/invite.php @@ -0,0 +1,10 @@ +findAll('user_info',array( + 'fuserid'=>$userid, +),'addtime desc','userid,username'); + +$title = '我的邀请'; +include template('invite'); \ No newline at end of file diff --git a/app/my/action/score.php b/app/my/action/score.php new file mode 100644 index 0000000..60be7e7 --- /dev/null +++ b/app/my/action/score.php @@ -0,0 +1,20 @@ +'')); +$lstart = $page*50-50; + +$arrScore = $new['my']->findAll('user_score_log',array( + 'userid'=>$strUser['userid'], +),'addtime desc',null,$lstart.',50'); + +$scoreNum = $new['my']->findCount('user_score_log',array( + 'userid'=>$strUser['userid'], +)); +$pageUrl = pagination($scoreNum, 50, $page, $url); + +$title = '我的积分'; +include template('score'); \ No newline at end of file diff --git a/app/my/action/setting.php b/app/my/action/setting.php new file mode 100644 index 0000000..aa68965 --- /dev/null +++ b/app/my/action/setting.php @@ -0,0 +1,278 @@ + 20) { + + tsNotice("用户名长度必须在4到20字符之间!"); + + } + + if($username != $strUser['username']){ + + if($TS_APP['banuser']){ + + $arrUserName = explode('|',$TS_APP['banuser']); + if(in_array($username,$arrUserName)){ + tsNotice("用户名已经存在,请换个用户名!"); + } + + } + + $isUserName = $new['my']->findCount('user_info',array( + 'username'=>$username, + )); + + if($isUserName > 0) { + + tsNotice("用户名已经存在,请换个用户名!"); + + } + } + + if(tsIntval($TS_USER['isadmin'])==0){ + //过滤内容开始 + $username = antiWord($username); + $signed = antiWord($signed); + $phone = antiWord($phone); + $about = antiWord($about); + //过滤内容结束 + } + + + //签名中禁止写URL,Email + /* + if(filter_var($signed, FILTER_SANITIZE_URL) || filter_var($signed, FILTER_VALIDATE_EMAIL)){ + tsNotice('签名不合法!请修改后再提交!'); + } + + if(filter_var($about, FILTER_SANITIZE_URL) || filter_var($about, FILTER_VALIDATE_EMAIL)){ + tsNotice('个人介绍不合法!请修改后再提交!'); + } + */ + + $username = str_replace('.','',$username); + + //更新数据 + $new['my']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'username' => $username, + 'sex' => $sex, + 'signed' => $signed, + 'phone' => $phone, + 'about' => $about, + )); + + #更新session用户名 + $_SESSION['tsuser']['username'] = $username; + + tsNotice("基本资料更新成功!"); + + break; + + + case "face": + + + $_SESSION['tsuser']['face'] = $strUser['face']; + + + $title = '头像设置'; + + include template("setting_face"); + + break; + //执行上传头像 + case "facedo": + + if($_FILES['photo']){ + + //上传 + $arrUpload = tsUpload($_FILES['photo'],$userid,'user',array('jpg','gif','png','jpeg')); + + if($arrUpload){ + + $new['my']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'path'=>$arrUpload['path'], + 'face'=>$arrUpload['url'], + 'uptime'=>time(), + )); + + + + if($TS_SITE['file_upload_type']=='0' || $TS_SITE['file_upload_type']==''){ + $filesize=abs(filesize('uploadfile/user/'.$arrUpload['url'])); + if($filesize<=0){ + $new['my']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'path'=>'', + 'face'=>'', + )); + tsNotice('上传头像失败,你可以使用系统默认头像!'); + } + } + + tsDimg($arrUpload['url'],'user','120','120',$arrUpload['path']); + + header('Location: '.tsUrl('my','setting',array('ts'=>'face'))); + + + }else{ + tsNotice('头像修改失败'); + } + + } + + break; + + //设置密码 + case "pwd": + + $title = '密码修改'; + include template("setting_pwd"); + + break; + + case "pwddo": + + $theUser = $new['my']->find('user',array( + 'userid'=>$strUser['userid'], + )); + + $oldpwd = tsTrim($_POST['oldpwd']); + $newpwd = tsTrim($_POST['newpwd']); + $renewpwd = tsTrim($_POST['renewpwd']); + + if($oldpwd == '' || $newpwd=='' || $renewpwd=='') tsNotice("所有项都不能为空!"); + + if($newpwd != $renewpwd) tsNotice('两次输入新密码密码不一样!'); + + //更新密码 + if(md5($theUser['salt'].$oldpwd) != $theUser['pwd']) tsNotice("旧密码输入有误!"); + + $salt = md5(rand()); + + $new['my']->update('user',array( + 'userid'=>$strUser['userid'], + ),array( + 'pwd'=>md5($salt.$newpwd), + 'salt'=>$salt, + )); + + tsNotice("密码修改成功!"); + + break; + + //修改登录Email + case "email": + $title = '修改登录Email'; + include template('setting_email'); + break; + + case "emaildo": + + $email = tsTrim($_POST['email']); + + if($email=='') tsNotice('Email不能为空!'); + + if(valid_email($email) == false) tsNotice('Email输入有误!'); + + if($email != $strUser['email']){ + $emailNum = $new['my']->findCount('user',array( + 'email'=>$email, + )); + + if($emailNum > 0) tsNotice("Email帐号已经存在,请换个其他Email帐号!"); + + //更新Email + $new['my']->update('user',array( + 'userid'=>$strUser['userid'], + ),array( + 'email'=>$email, + )); + + //修改信息并将用户设为未验证状态 + $new['my']->update('user_info',array( + 'userid'=>$strUser['userid'], + ),array( + 'email'=>$email, + 'isverify'=>'0', + )); + + tsNotice('Email帐号修改成功,下次请用'.$email.'登录网站!'); + + }else{ + tsNotice('新Email帐号不能和旧Email帐号一样!'); + } + + break; + + //设置常居地 + case "city": + + $title = '常居地修改'; + include template("setting_city"); + break; + + case "citydo": + + $province = tsTrim($_POST['province']); + $city = tsTrim($_POST['city']); + + + $new['my']->update('user_info',array( + 'userid'=>$userid, + ),array( + + 'province'=>$province, + 'city'=>$city, + + )); + + tsNotice("常居地更新成功!"); + + break; + + //个人标签 + case "tag": + + $arrTag = aac('tag')->getObjTagByObjid('user','userid',$userid); + + $title = '个人标签修改'; + include template("setting_tag"); + break; + + case "tagdo": + break; + +} \ No newline at end of file diff --git a/app/my/class.my.php b/app/my/class.my.php new file mode 100644 index 0000000..14fe952 --- /dev/null +++ b/app/my/class.my.php @@ -0,0 +1,18 @@ + +
    + +
    暂无配置
    +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/my/html/index.html b/app/my/html/index.html new file mode 100644 index 0000000..b8774de --- /dev/null +++ b/app/my/html/index.html @@ -0,0 +1,104 @@ +{php include pubTemplate("header")} + +
    + + + +
    + + +
    +
    + +{php include pubTemplate("my")} + +
    +
    + + + +
    + + +
    +
    我的小组
    +
    + + +
    +
    已加入{$joinGroupNum}个小组
    + 创建小组 +
    + +
    + + {loop $arrGroup $key $item} +
    +
    + {$item['groupname']} +
    +
    {$item['groupname']}
    +
    +
    +
    + {/loop} + + +
    + +
    +
    + + +
    +
    我的帖子
    +
    + + + + + + + {loop $arrTopic $key $item} + + {/loop} + +
    发布时间标题浏览/评论操作
    {php echo date('Y-m-d',$item['addtime'])}{php echo tsTitle($item['title'])}{$item['count_view']}/{$item['count_comment']}修改
    + +
    +
    + + +
    +
    我的文章
    +
    + + + + + + + {loop $arrArticle $key $item} + + {/loop} + +
    发布时间标题浏览/评论操作
    {php echo date('Y-m-d',strtotime($item['addtime']))}{tsTitle($item['title'])}{$item['count_view']}/{$item['count_comment']}修改
    + +
    +
    + + +
    + + + + +
    + + + +
    + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/my/html/invite.html b/app/my/html/invite.html new file mode 100644 index 0000000..80b993a --- /dev/null +++ b/app/my/html/invite.html @@ -0,0 +1,70 @@ +{php include pubTemplate("header")} +
    + + +
    + + +
    +
    + +{php include pubTemplate("my")} + +
    +
    + +
    + + +
    +
    我的邀请
    +
    + + +
    + +
    + +
    +
    + + + + + + + + + + + + + + + {loop $arrInviteUser $key $item} + + + + + + {/loop} + + + +
    用户ID用户名加入时间
    {$item['userid']}{$item['username']}{php echo date('Y-m-d H:i:s',$item['addtime'])}
    + + + + +
    +
    +
    + + +
    +
    + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/my/html/score.html b/app/my/html/score.html new file mode 100644 index 0000000..7edd7bd --- /dev/null +++ b/app/my/html/score.html @@ -0,0 +1,56 @@ +{php include pubTemplate("header")} +
    + + +
    + + +
    +
    + +{php include pubTemplate("my")} + +
    +
    + +
    + + +
    +
    我的积分
    +
    + + + + + + + + + + + {loop $arrScore $key $item} + + {/loop} + + + +
    名称积分状态时间
    {$item['scorename']}{$item['score']}{if $item['status']==0}+{else}-{/if}{php echo date('Y-m-d H:i:s',$item['addtime'])}
    + +
    +
    {$pageUrl}
    + + + + + + +
    +
    +
    + + +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/my/html/setting_base.html b/app/my/html/setting_base.html new file mode 100644 index 0000000..b025fb6 --- /dev/null +++ b/app/my/html/setting_base.html @@ -0,0 +1,85 @@ +{php include pubTemplate("header")} +
    + + +
    + + +
    +
    + +{php include pubTemplate("my")} + +
    +
    + +
    + + +
    +
    + + + +{template setting_menu} + + + +
    +
    +
    + + +
    + +
    + + +
    + +
    + +
    + 保密 + 男 + 女 +
    + +
    + + +
    + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    +
    +
    + + + + +
    +
    +
    + + +
    +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/my/html/setting_city.html b/app/my/html/setting_city.html new file mode 100644 index 0000000..4507102 --- /dev/null +++ b/app/my/html/setting_city.html @@ -0,0 +1,75 @@ +{php include pubTemplate("header")} + + + +
    +
    + +
    +
    + +{php include pubTemplate("my")} + +
    +
    + +
    +
    +
    + + + +{template setting_menu} + + + + +
    +
    +
    + +
    + +
    + + +
    +

    +

    +
    + +
    + + + +
    + +
    +
    +
    + + + +
    +
    +
    + + +
    + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/my/html/setting_cut.html b/app/my/html/setting_cut.html new file mode 100644 index 0000000..230ee3a --- /dev/null +++ b/app/my/html/setting_cut.html @@ -0,0 +1,96 @@ +{php include pubTemplate("header")} + + + + +
    +{template set_menu} + + +
    + +

    裁切头像

    + +
    + +
    + +
    + + + + + +
    + + 返回头像设置 + +
    + +
    + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/my/html/setting_email.html b/app/my/html/setting_email.html new file mode 100644 index 0000000..af0bec6 --- /dev/null +++ b/app/my/html/setting_email.html @@ -0,0 +1,177 @@ +{php include pubTemplate("header")} + +
    + +
    + +
    +
    + + {php include pubTemplate("my")} + +
    +
    + + +
    +
    +
    + + + + {template setting_menu} + + + +
    +
    +
    + + + {if $TS_SITE['regtype']=='0' || $TS_SITE['regtype']=='2'} +
    + +
    + +
    {$strUser['email']}
    +
    + +
    + + +
    + + + + + (修改Email登录帐号将需要重新验证Email) + +
    + {/if} + + {if $TS_SITE['regtype']=='2'} +
    + {/if} + + + {if $TS_SITE['regtype']=='1' || $TS_SITE['regtype']=='2'} +
    + +
    + +
    {$strUser['phone']}
    + +
    + +
    + + +
    + +
    + + +
    +
    +
    + + 点击刷新验证码 + +
    +
    + +
    + +
    + + +
    +
    +
    +
    + +
    + + + + + + +
    + {/if} + + +
    +
    +
    + + +
    +
    +
    + +
    + +
    + + + + + + + + + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/my/html/setting_face.html b/app/my/html/setting_face.html new file mode 100644 index 0000000..59953e1 --- /dev/null +++ b/app/my/html/setting_face.html @@ -0,0 +1,68 @@ +{php include pubTemplate("header")} +
    + + +
    + + +
    +
    + +{php include pubTemplate("my")} + +
    +
    + +
    +
    +
    + + + +{template setting_menu} + + + + +
    +
    +
    + +{if $TS_SITE['isface']=='1' && $strUser['face'] == SITE_URL.'public/images/user_large.jpg'} + +{/if} + + +
    + +
    +

    {$strUser['username']}

    +
    + +
    + +

    +
    + + + + + +
    + +
    +
    +
    + + + + + +
    +
    +
    + + +
    +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/my/html/setting_menu.html b/app/my/html/setting_menu.html new file mode 100644 index 0000000..3b923d6 --- /dev/null +++ b/app/my/html/setting_menu.html @@ -0,0 +1,10 @@ + + +
    \ No newline at end of file diff --git a/app/my/html/setting_pwd.html b/app/my/html/setting_pwd.html new file mode 100644 index 0000000..af0026b --- /dev/null +++ b/app/my/html/setting_pwd.html @@ -0,0 +1,64 @@ +{php include pubTemplate("header")} + +
    + +
    + +
    +
    + +{php include pubTemplate("my")} + +
    +
    + +
    +
    +
    + + +{template setting_menu} + + + + +
    +
    +
    + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + + + +
    + +
    +
    +
    + + + +
    +
    +
    + +
    + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/my/html/setting_tag.html b/app/my/html/setting_tag.html new file mode 100644 index 0000000..f2c9b89 --- /dev/null +++ b/app/my/html/setting_tag.html @@ -0,0 +1,85 @@ +{php include pubTemplate("header")} + +
    + +
    + + +
    +
    + +{php include pubTemplate("my")} + +
    +
    + +
    +
    +
    + + + +{template setting_menu} + + + + +
    +
    +
    + + +
    + {loop $arrTag $key $item} + {$item[tagname]} + {/loop} +
    + + + + + + +
    + + + + + + + +
    + +
    +
    +
    + + + + + +
    +
    +
    + + + +
    + + +
    + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/my/icon.png b/app/my/icon.png new file mode 100644 index 0000000..a2193e4 Binary files /dev/null and b/app/my/icon.png differ diff --git a/app/my/js/admin.js b/app/my/js/admin.js new file mode 100644 index 0000000..e69de29 diff --git a/app/my/js/extend.func.js b/app/my/js/extend.func.js new file mode 100644 index 0000000..e69de29 diff --git a/app/my/skin/style.css b/app/my/skin/style.css new file mode 100644 index 0000000..08d0de1 --- /dev/null +++ b/app/my/skin/style.css @@ -0,0 +1,22 @@ +.my .my_right .rl{float:left;width:530px;padding:10px;} + +.my .my_right .rr{float:right;width:230px;padding:10px 10px 10px 0;} + +/*ǩ*/ +.qiandao{background-color: #F9F9F9; +border: 1px solid #EEE; +border-radius: 5px;text-align:center;padding:10px;} +.qiandao a{font-size:14px;} + + + +/**/ +.newtopic{} +.newtopic ul{} +.newtopic ul li{border-bottom:1px dashed #DDD;padding:5px 0;overflow:hidden} +.newtopic ul li .photo{width:36px;float:left;} +.newtopic ul li .info{margin-left:36px;color:#999;} +.newtopic ul li .info .title{float:left;width:50%} +.newtopic ul li .info .comment{float:left;width:15%} +.newtopic ul li .info .uptime{float:left;width:15%} +.newtopic ul li .info .group{float:left;width:20%} \ No newline at end of file diff --git a/app/my/skins/default/style.css b/app/my/skins/default/style.css new file mode 100644 index 0000000..08d0de1 --- /dev/null +++ b/app/my/skins/default/style.css @@ -0,0 +1,22 @@ +.my .my_right .rl{float:left;width:530px;padding:10px;} + +.my .my_right .rr{float:right;width:230px;padding:10px 10px 10px 0;} + +/*ǩ*/ +.qiandao{background-color: #F9F9F9; +border: 1px solid #EEE; +border-radius: 5px;text-align:center;padding:10px;} +.qiandao a{font-size:14px;} + + + +/**/ +.newtopic{} +.newtopic ul{} +.newtopic ul li{border-bottom:1px dashed #DDD;padding:5px 0;overflow:hidden} +.newtopic ul li .photo{width:36px;float:left;} +.newtopic ul li .info{margin-left:36px;color:#999;} +.newtopic ul li .info .title{float:left;width:50%} +.newtopic ul li .info .comment{float:left;width:15%} +.newtopic ul li .info .uptime{float:left;width:15%} +.newtopic ul li .info .group{float:left;width:20%} \ No newline at end of file diff --git a/app/photo/about.php b/app/photo/about.php new file mode 100644 index 0000000..66ced8f --- /dev/null +++ b/app/photo/about.php @@ -0,0 +1,17 @@ + '相册', + 'version' => '1.2', + 'desc' => '相册APP', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '1', + 'ismy'=>'1', +); \ No newline at end of file diff --git a/app/photo/action/admin.php b/app/photo/action/admin.php new file mode 100644 index 0000000..b04d6eb --- /dev/null +++ b/app/photo/action/admin.php @@ -0,0 +1,10 @@ +findAll('photo_album',null,'albumid desc',null,$lstart.',10'); + + + $albumNum = $new['photo']->findCount('photo_album'); + + + $pageUrl = pagination($albumNum, 10, $page, $url); + + include template("admin/album_list"); + break; + + //图片 + case "photo": + $albumid = tsIntval($_GET['albumid']); + + $page = tsIntval($_GET['page'],1); + + $lstart = $page*10-10; + + $url = SITE_URL.'index.php?app=photo&ac=admin&mg=album&ts=photo&albumid='.$albumid.'&page='; + + $arrPhoto = $db->fetch_all_assoc("select * from ".dbprefix."photo where albumid='$albumid' limit $lstart,10"); + + $photo_num = $db->once_fetch_assoc("select count(photoid) from ".dbprefix."photo where albumid='$albumid'"); + + $pageUrl = pagination($photo_num['count(photoid)'], 10, $page, $url); + + include template("admin/album_photo"); + + break; + + //删除相册 + case "del_album": + $albumid = tsIntval($_GET['albumid']); + + $new['photo']->deletePhotoAlbum($albumid); + + qiMsg("相册删除成功!"); + + break; + + //删除照片 + case "del_photo": + $photoid = tsIntval($_GET['photoid']); + + $strPhoto = $new['photo']->find('photo',array( + 'photoid'=>$photoid, + )); + + $albumid = $strPhoto['albumid']; + + $new['photo']->deletePhoto($strPhoto); + + $count_photo = $db->once_num_rows("select * from ".dbprefix."photo where albumid='$albumid'"); + + $db->query("update ".dbprefix."photo_album set `count_photo`='$count_photo' where albumid='$albumid'"); + + qiMsg("图片删除成功!"); + + break; + + //设为封面 + case "face": + $photoid = tsIntval($_GET['photoid']); + $strPhoto = $db->once_fetch_assoc("select * from ".dbprefix."photo where photoid='$photoid'"); + + $albumid = $strPhoto['albumid']; + $albumface = $strPhoto['photourl']; + + $db->query("update ".dbprefix."photo_album set `albumface`='$albumface' where albumid='$albumid'"); + + qiMsg("封面设置成功!"); + + break; + + //统计 + case "count": + + $arrAlbum = $db->fetch_all_assoc("select albumid from ".dbprefix."photo_album"); + + foreach($arrAlbum as $item){ + $albumid = $item['albumid']; + $count_photo = $db->once_num_rows("select photoid from ".dbprefix."photo where albumid='$albumid'"); + $db->query("update ".dbprefix."photo_album set `count_photo`='$count_photo' where albumid='$albumid'"); + } + + qiMsg("统计完成!"); + + break; + + //推荐相册 + case "isrecommend": + + $albumid = tsIntval($_GET['albumid']); + + $strAlbum = $db->once_fetch_assoc("select isrecommend from ".dbprefix."photo_album where `albumid`='$albumid'"); + + if($strAlbum['isrecommend']==0){ + $db->query("update ".dbprefix."photo_album set `isrecommend`='1' where `albumid`='$albumid'"); + }else{ + $db->query("update ".dbprefix."photo_album set `isrecommend`='0' where `albumid`='$albumid'"); + } + + qiMsg("操作成功!"); + + break; + + //是否审核 + case "isaudit": + + $albumid = tsIntval($_GET['albumid']); + + $strAlbum = $new['photo']->find('photo_album',array( + 'albumid'=>$albumid, + )); + + if($strAlbum['isaudit']==0){ + + $new['photo']->update('photo_album',array( + 'albumid'=>$albumid, + ),array( + 'isaudit'=>1, + )); + + }else{ + $new['photo']->update('photo_album',array( + 'albumid'=>$albumid, + ),array( + 'isaudit'=>0, + )); + } + + 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 = tsIntval($_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; + +} \ No newline at end of file diff --git a/app/photo/action/admin/comment.php b/app/photo/action/admin/comment.php new file mode 100644 index 0000000..6124a98 --- /dev/null +++ b/app/photo/action/admin/comment.php @@ -0,0 +1,73 @@ +$userid, + ); + } + + if($photoid){ + $where = array( + 'photoid'=>$photoid, + ); + } + + $arrComment = $new['photo']->findAll('photo_comment',$where,'addtime desc',null,$lstart.',10'); + + $commentNum = $new['photo']->findCount('photo_comment',$where); + + $pageUrl = pagination($commentNum, 10, $page, $url); + + include template("admin/comment_list"); + + break; + + + case "delete": + + $commentid = intval($_GET['commentid']); + + $strComment = $new['photo']->find('photo_comment',array( + 'commentid'=>$commentid, + )); + + $new['photo']->delete('photo_comment',array( + 'commentid'=>$commentid, + )); + + #统计评论数 + $count_comment = $new['photo']->findCount('photo_comment',array( + 'photoid'=>$strComment['photoid'], + )); + + //更新评论数 + $new['photo']->update('photo',array( + 'photoid'=>$strComment['photoid'], + ),array( + 'count_comment'=>$count_comment, + )); + + + #处理积分 + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'], $TS_URL['ts'],$strComment['userid'],$TS_URL['mg']); + + qiMsg('删除成功'); + + break; + + +} \ No newline at end of file diff --git a/app/photo/action/admin/options.php b/app/photo/action/admin/options.php new file mode 100644 index 0000000..7d730b2 --- /dev/null +++ b/app/photo/action/admin/options.php @@ -0,0 +1,26 @@ +findAll('user_group',null,'ugid asc'); + + + + + include template('admin/permissions'); + + break; + + case "do": + + /** + * 权限参数说明,app,action必须,其他参数可选 + * app-action-ts + * app-action-mg-ts 当action=admin + * app-action-api-ts 当action=api + */ + + $ugid = tsIntval($_POST['ugid']); + + $arrOption = $_POST['option']; + + aac('pubs')->upAppPermissions($ugid,'photo',$arrOption); + + qiMsg('操作成功!'); + + + break; + +} \ No newline at end of file diff --git a/app/photo/action/admin/photo.php b/app/photo/action/admin/photo.php new file mode 100644 index 0000000..915a39e --- /dev/null +++ b/app/photo/action/admin/photo.php @@ -0,0 +1,40 @@ +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 = tsIntval($_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; + +} \ No newline at end of file diff --git a/app/photo/action/ajax.php b/app/photo/action/ajax.php new file mode 100644 index 0000000..5729c9d --- /dev/null +++ b/app/photo/action/ajax.php @@ -0,0 +1,157 @@ +findCount('photo_album',array( + + 'userid'=>$userid, + + )); + + if($isAlbum == 0){ + + $new['photo']->create('photo_album',array( + + 'userid'=>$userid, + 'albumname'=>'默认相册', + 'albumdesc'=>'默认相册', + 'addtime'=>time(), + 'uptime'=>time(), + + + )); + + } + + $arrAlbum = $new['photo']->findAll('photo_album',array( + 'userid'=>$userid, + )); + + + include template("ajax/album"); + + break; + //图片 + case "photo": + + $albumid = tsIntval($_GET['albumid']); + $strAlbum = $new['photo']->find('photo_album',array( + 'albumid'=>$albumid, + )); + + $page = tsIntval($_GET['page'],1); + $url = SITE_URL."index.php?app=photo&ac=ajax&ts=photo&albumid=".$albumid."&page="; + $lstart = $page*6-6; + + $arrPhoto = $new['photo']->findAll('photo',array( + 'albumid'=>$albumid, + ),'photoid desc',null,$lstart.',6'); + + $photoNum = $new['photo']->findCount('photo',array( + 'albumid'=>$albumid, + )); + + $pageUrl = pagination($photoNum, 6, $page, $url); + + include template("ajax/photo"); + break; + //创建相册 + case "create": + include template("ajax/create"); + break; + + case "create_do": + $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 = tsIntval($_GET['albumid']); + $addtime = tsIntval($_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; +} \ No newline at end of file diff --git a/app/photo/action/album.php b/app/photo/action/album.php new file mode 100644 index 0000000..8d5eeb9 --- /dev/null +++ b/app/photo/action/album.php @@ -0,0 +1,299 @@ +find('photo_album',array( + 'albumid'=>$albumid, + )); + //404 + if($strAlbum==''){ + header("HTTP/1.1 404 Not Found"); + header("Status: 404 Not Found"); + $title = '404'; + include pubTemplate("404"); + exit; + } + + if($strAlbum['isaudit']==1){ + tsNotice('内容审核中...'); + } + + $strAlbum['albumname'] = tsTitle($strAlbum['albumname']); + $strAlbum['albumdesc'] = tsTitle($strAlbum['albumdesc']); + + + $page = tsIntval($_GET['page'],1); + + $url = tsUrl('photo','album',array('id'=>$albumid,'page'=>'')); + + $lstart = $page*20-20; + + $strUser = aac('user')->getSimpleUser($strAlbum['userid']); + + $arrPhoto = $new['photo']->findAll('photo',array( + 'albumid'=>$albumid, + ),'photoid desc',null,$lstart.',20'); + + foreach($arrPhoto as $key=>$item){ + $arrPhoto[$key]['photodesc'] = tsTitle($item['photodesc']); + } + + $photoNum = $new['photo']->findCount('photo',array( + 'albumid'=>$albumid, + )); + + $pageUrl = pagination($photoNum, 20, $page, $url); + + + $title = $strAlbum['albumname']; + + + include template("album"); + + $new['photo']->update('photo_album',array( + 'albumid'=>$strAlbum['albumid'], + ),array( + 'count_view'=>$strAlbum['count_view']+1, + )); + + + break; + + + //修改相册 + case "edit": + + //用户是否登录 + $userid = aac('user')->isLogin(); + + $albumid = tsIntval($_GET['albumid']); + + $strAlbum = $new['photo']->find('photo_album',array( + 'albumid'=>$albumid, + )); + + if($strAlbum['userid'] == $userid || $TS_USER['isadmin']==1) { + + $strAlbum['albumname'] = tsTitle($strAlbum['albumname']); + $strAlbum['albumdesc'] = tsTitle($strAlbum['albumdesc']); + + $title = '修改相册属性-'.$strAlbum['albumname']; + include template("album_edit"); + + }else{ + + tsNotice('非法操作!'); + + } + + break; + + case "editdo": + + //用户是否登录 + $userid = aac('user')->isLogin(); + + $albumid = tsIntval($_POST['albumid']); + + $strAlbum = $new['photo']->find('photo_album',array( + 'albumid'=>$albumid, + )); + + if($strAlbum['userid']==$userid || $TS_USER['isadmin']==1){ + + $albumname = tsTrim($_POST['albumname']); + if($albumname == '') qiMsg("相册名称不能为空!"); + + $albumdesc = tsTrim($_POST['albumdesc']); + + + if($TS_USER['isadmin']==0){ + //过滤内容开始 + $albumname = antiWord($albumname); + $albumdesc = 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; + + //批量修改 + case "info": + + //用户是否登录 + $userid = aac('user')->isLogin(); + + $albumid = tsIntval($_GET['albumid']); + $addtime = tsIntval($_GET['addtime']); + + $strAlbum = $new['photo']->find('photo_album',array( + 'albumid'=>$albumid, + )); + + $strAlbum['albumname'] = tsTitle($strAlbum['albumname']); + $strAlbum['albumdesc'] = tsTitle($strAlbum['albumdesc']); + + if($strAlbum['userid'] != $userid) { + + tsNotice('非法操作'); + + } + + //统计 + $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',array( + 'albumid'=>$strAlbum['albumid'], + )); + + $new['photo']->update('photo_album',array( + 'albumid'=>$albumid, + ),array( + 'path'=>$strPhoto['path'], + 'albumface'=>$strPhoto['photourl'], + )); + } + + if($addtime){ + $arr = array( + 'albumid'=>$albumid, + 'addtime'=>date('Y-m-d H:i:s',$addtime), + ); + }else{ + $arr = array( + 'albumid'=>$albumid, + ); + } + + $arrPhoto = $new['photo']->findAll('photo',$arr); + + foreach($arrPhoto as $key=>$item){ + $arrPhoto[$key]['title'] = tsTitle($item['title']); + $arrPhoto[$key]['photodesc'] = tsTitle($item['photodesc']); + } + + + $title = '批量修改-'.$strAlbum['albumname']; + include template("album_info"); + break; + + //批量修改执行 + case "info_do": + + //用户是否登录 + $userid = aac('user')->isLogin(); + + $albumid = tsIntval($_POST['albumid']); + + $albumface = tsIntval($_POST['albumface']); + + $arrPhotoId = $_POST['photoid']; + $arrPhotoDesc = $_POST['photodesc']; + + + if(is_array($arrPhotoId)==false || is_array($arrPhotoDesc)==false){ + tsNotice('非法操作'); + } + + + if($TS_USER['isadmin']==0){ + + foreach($arrPhotoDesc as $key=>$item){ + + //过滤内容开始 + $arrPhotoDesc[$key] = antiWord($item); + //过滤内容结束 + + } + + } + + foreach($arrPhotoDesc as $key=>$item){ + + $item = str_replace('../','',$item); + $item = str_replace('/','',$item); + + if($item){ + + $photoid = tsIntval($arrPhotoId[$key]); + + $new['photo']->update('photo',array( + 'photoid'=>$photoid, + 'userid'=>$userid, + ),array( + + 'photodesc'=>tsTrim($item), + + )); + + } + } + + //更新相册封面 + if (preg_match('#(..(\\|/)){2,}#sim', $albumface) != false) { die('request error');} #针对阿里云误报只能添加下 + if($albumface){ + + $strPhoto = $new['photo']->find('photo',array( + 'photoid'=>$albumface, + )); + + $new['photo']->update('photo_album',array( + 'userid'=>$userid, + 'albumid'=>$albumid, + ),array( + 'path'=>$strPhoto['path'], + 'albumface'=>$strPhoto['photourl'], + )); + } + + header("Location: ".tsUrl('photo','album',array('id'=>$albumid))); + + break; + + //删除相册 + case "del": + + //用户是否登录 + $userid = aac('user')->isLogin(); + + $albumid = tsIntval($_GET['albumid']); + + $strAlbum = $new['photo']->find('photo_album',array( + 'albumid'=>$albumid, + )); + + if($strAlbum['userid'] == $userid || $TS_USER['isadmin'] == 1) { + + $new['photo']->deletePhotoAlbum($strAlbum['albumid']); + + } + + + header("Location: ".tsUrl('photo')); + + break; +} \ No newline at end of file diff --git a/app/photo/action/api.php b/app/photo/action/api.php new file mode 100644 index 0000000..0608b65 --- /dev/null +++ b/app/photo/action/api.php @@ -0,0 +1,9 @@ + +----------------------------------------------- +Photo Http Api List +URL:https://demo.thinksaas.cn +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +'; \ No newline at end of file diff --git a/app/photo/action/create.php b/app/photo/action/create.php new file mode 100644 index 0000000..16de010 --- /dev/null +++ b/app/photo/action/create.php @@ -0,0 +1,66 @@ +isLogin(); + +//判断发布者状态 +if(aac('user')->isPublisher()==false) tsNotice('不好意思,你还没有权限发布内容!'); + +//发布时间限制 +if(aac('system')->pubTime()==false) tsNotice('不好意思,当前时间不允许发布内容!'); + +switch($ts){ + + + case "": + + $title = '创建相册'; + include template("create"); + + break; + + case "do": + + //用户是否登录 + $userid = aac('user')->isLogin(); + + $albumname = tsTrim($_POST['albumname']); + $albumdesc = tsTrim($_POST['albumdesc']); + + if($albumname == '') { + tsNotice("相册名称不能为空!"); + } + + //1审核后显示0不审核 + if ($TS_APP['isaudit']==1) { + $isaudit = 1; + } else { + $isaudit = 0; + } + + if($TS_USER['isadmin']==0){ + //过滤内容开始 + $albumname = antiWord($albumname); + $albumdesc = antiWord($albumdesc); + //过滤内容结束 + } + + $albumid = $new['photo']->create('photo_album',array( + + 'userid'=>$userid, + 'albumname'=>$albumname, + 'albumdesc'=>$albumdesc, + 'isaudit'=>$isaudit, + 'addtime'=>date('Y-m-d H:i:s'), + 'uptime'=>date('Y-m-d H:i:s'), + + )); + + header("Location: ".tsUrl('photo','upload',array('albumid'=>$albumid))); + + + break; + + +} \ No newline at end of file diff --git a/app/photo/action/delete.php b/app/photo/action/delete.php new file mode 100644 index 0000000..24b4808 --- /dev/null +++ b/app/photo/action/delete.php @@ -0,0 +1,40 @@ +isLogin(); + +$photoid = tsIntval($_GET['photoid']); + +$strPhoto = $new['photo']->find('photo',array( + 'photoid'=>$photoid, +)); + +if($strPhoto['userid']==$userid || $TS_USER['isadmin']==1) { + + + $albumid = $strPhoto['albumid']; + + + $new['photo']->deletePhoto($strPhoto); + + + $count_photo = $new['photo']->findCount('photo',array( + 'albumid'=>$albumid, + )); + + $new['photo']->update('photo_album',array( + + 'albumid'=>$albumid, + + ),array( + + 'count_photo'=>$count_photo, + + )); + + tsNotice('照片删除成功!','点击返回',tsUrl('photo','album',array('id'=>$albumid))); + + +} \ No newline at end of file diff --git a/app/photo/action/do.php b/app/photo/action/do.php new file mode 100644 index 0000000..9ffdd45 --- /dev/null +++ b/app/photo/action/do.php @@ -0,0 +1,111 @@ +isLogin(); + + $photoid = intval($_GET['photoid']); + + $strPhoto = $new['photo']->find('photo',array( + 'photoid'=>$photoid, + )); + + if($strPhoto['userid']==$userid || $TS_USER['isadmin']==1) { + + + $albumid = $strPhoto['albumid']; + + unlink('uploadfile/photo/'.$strPhoto['photourl']); + + $new['photo']->delete('photo',array( + 'photoid'=>$photoid, + )); + + $count_photo = $new['photo']->findCount('photo',array( + 'albumid'=>$albumid, + )); + + $new['photo']->update('photo_album',array( + + 'albumid'=>$albumid, + + ),array( + + 'count_photo'=>$count_photo, + + )); + + tsNotice('照片删除成功!','点击返回',tsUrl('photo','album',array('id'=>$albumid))); + + + } + + break; + + //添加评论 + case "comment_do": + + //用户是否登录 + $userid = aac('user')->isLogin(); + + $photoid = intval($_POST['photoid']); + $content = trim($_POST['content']); + + if($content==''){ + tsNotice('评论内容不能为空!'); + } + + if($TS_USER['isadmin']==0){ + //过滤内容开始 + aac('system')->antiWord($content); + //过滤内容结束 + } + + $commentid = $new['photo']->create('photo_comment',array( + 'photoid'=> $photoid, + 'userid'=> $userid, + 'content'=> $content, + 'addtime'=> time(), + )); + + header("Location: ".tsUrl('photo','show',array('id'=>$photoid))); + + break; + + //删除评论 + case "delcomment": + + //用户是否登录 + $userid = aac('user')->isLogin(); + + $commentid = intval($_GET['commentid']); + + $strComment = $new['photo']->find('photo_comment',array( + 'commentid'=>$commentid, + )); + + $strPhoto = $new['photo']->find('photo',array( + + 'photoid'=>$strComment['photoid'], + + )); + + + if($userid == $strPhoto['userid'] || $TS_USER['isadmin']=='1'){ + + $new['photo']->delete('photo_comment',array( + 'commentid'=>$commentid, + )); + + tsNotice("删除评论成功!"); + + }else{ + tsNotice("非法操作!"); + } + + break; +} diff --git a/app/photo/action/edit.php b/app/photo/action/edit.php new file mode 100644 index 0000000..fee60c4 --- /dev/null +++ b/app/photo/action/edit.php @@ -0,0 +1,52 @@ +isLogin(); + +switch($ts){ + + case "": + + $photoid = tsIntval($_GET['photoid']); + + $strPhoto = $new['photo']->find('photo',array( + 'photoid'=>$photoid, + )); + + $strPhoto['title'] = tsTitle($strPhoto['title']); + $strPhoto['photodesc'] = tsTitle($strPhoto['photodesc']); + + if($strPhoto['userid']==$userid || $TS_USER['isadmin']==1){ + + $title = '修改图片信息'; + include template('photo_edit'); + + }else{ + + + tsNotice('非法操作!'); + + } + + break; + + + case "do": + + $photoid = tsIntval($_POST['photoid']); + $title = tsTrim($_POST['title']); + $photodesc = tsTrim($_POST['photodesc']); + + $new['photo']->update('photo',array( + 'photoid'=>$photoid, + ),array( + 'title'=>$title, + 'photodesc'=>$photodesc, + )); + + header('Location: '.tsUrl('photo','show',array('id'=>$photoid))); + + break; + +} \ No newline at end of file diff --git a/app/photo/action/index.php b/app/photo/action/index.php new file mode 100644 index 0000000..2864286 --- /dev/null +++ b/app/photo/action/index.php @@ -0,0 +1,25 @@ +'')); + +$lstart = $page*30-30; + +$arrAlbum = $new['photo']->findAll('photo_album',"`count_photo`>0 and `isaudit`=0",'albumid desc',null,$lstart.',30'); + +foreach($arrAlbum as $key=>$item){ + $arrAlbum[$key]['albumname'] = tstitle($item['albumname']); + $arrAlbum[$key]['albumdesc'] = tstitle($item['albumdesc']); +} + +$albumNum = $new['photo']->findCount('photo_album',"`count_photo`>0 and `isaudit`=0"); + +$pageUrl = pagination($albumNum, 30, $page, $url); + +$title = '最新专辑'; + +$sitekey = $TS_APP['appkey']; +$sitedesc = $TS_APP['appdesc']; +include template("index"); \ No newline at end of file diff --git a/app/photo/action/my.php b/app/photo/action/my.php new file mode 100644 index 0000000..0f8df1f --- /dev/null +++ b/app/photo/action/my.php @@ -0,0 +1,11 @@ +isLogin(); + $strUser = aac('user')->getOneUser($userid); + include_once 'app/' . $TS_URL['app'] . '/action/my/' . $TS_URL['my'] . '.php'; +} else { + qiMsg ( 'sorry:no index!' ); +} \ No newline at end of file diff --git a/app/photo/action/my/common.php b/app/photo/action/my/common.php new file mode 100644 index 0000000..59b5488 --- /dev/null +++ b/app/photo/action/my/common.php @@ -0,0 +1,6 @@ +isLogin(); + +$strUser = aac('user')->getOneUser($userid); \ No newline at end of file diff --git a/app/photo/action/my/index.php b/app/photo/action/my/index.php new file mode 100644 index 0000000..4862fe3 --- /dev/null +++ b/app/photo/action/my/index.php @@ -0,0 +1,29 @@ +'index','page'=>'')); + +$lstart = $page*6-6; + +$arrAlbum = $new['photo']->findAll('photo_album',array( + 'userid'=>$strUser['userid'], +),'albumid desc',null,$lstart.',6'); + +foreach($arrAlbum as $key=>$item){ + $arrAlbum[$key]['albumname'] = tsTitle($item['albumname']); + $arrAlbum[$key]['albumdesc'] = tsTitle($item['albumdesc']); +} + +$albumNum = $new['photo']->findCount('photo_album',array( + + 'userid'=>$strUser['userid'], + +)); + +$pageUrl = pagination($albumNum, 6, $page, $url); + +$title = '我的相册'; +include template('my/index'); \ No newline at end of file diff --git a/app/photo/action/show.php b/app/photo/action/show.php new file mode 100644 index 0000000..3d1c4f6 --- /dev/null +++ b/app/photo/action/show.php @@ -0,0 +1,92 @@ +find('photo',array( + 'photoid'=>$photoid, +)); + +//404 +if($strPhoto == ''){ + header("HTTP/1.1 404 Not Found"); + header("Status: 404 Not Found"); + $title = '404'; + include pubTemplate("404"); + exit; +} + +$strPhoto['title'] = tsTitle($strPhoto['title']); +$strPhoto['photodesc'] = tsTitle($strPhoto['photodesc']); + +#原图 +if($TS_SITE['file_upload_type']==1){ + #阿里云oss + $strPhoto['photo_url'] = $TS_SITE['alioss_bucket_url'].'/uploadfile/photo/'.$strPhoto['photourl']; +}else{ + #本地 + $strPhoto['photo_url'] = SITE_URL.'uploadfile/photo/'.$strPhoto['photourl']; +} + +$albumid = $strPhoto['albumid']; + +//图片标签 +$strPhoto['tags'] = aac('tag')->getObjTagByObjid('photo', 'photoid', $strPhoto['photoid']); + +//用户 +$strPhoto['user'] = aac('user')->getSimpleUser($strPhoto['userid']); + +//相册下所有图片 +$arrPhoto = $new['photo']->findAll('photo',array( + 'albumid'=>$strPhoto['albumid'], +),null,null,8); + +//所在专辑 +$strAlbum = $new['photo']->find('photo_album',array( + 'albumid'=>$albumid, +)); + +$strAlbum['albumname'] = tsTitle($strAlbum['albumname']); +$strAlbum['albumdesc'] = tsTitle($strAlbum['albumdesc']); + +$arrPhotoIds = $new['photo']->findAll('photo',array( + + 'albumid'=>$albumid, + +),'photoid desc'); + +foreach($arrPhotoIds as $item){ + $arrPhotoId[] = $item['photoid']; +} + +rsort($arrPhotoId); + +$nowkey = array_search($photoid,$arrPhotoId); +$nowPage = $nowkey+1 ; +$conutPage = count($arrPhotoId); +$prev = $arrPhotoId[$nowkey - 1]; +$next = $arrPhotoId[$nowkey +1]; + +$userid = $strAlbum['userid']; +$strUser = aac('user')->getSimpleUser($userid); + +//评论列表 +$page = tsIntval($_GET['page'],1); +$url = tsUrl('photo','show',array('id'=>$photoid,'page'=>'')); +$lstart = $page*15-15; +$arrComment = aac('comment')->getCommentList('photo','photoid',$strPhoto['photoid'],$page,$lstart,$strPhoto['userid']); +$commentNum = aac('comment')->getCommentNum('photo','photoid',$strPhoto['photoid']); +$pageUrl = pagination($commentNum, 15, $page, $url); + + + +$title = $strAlbum['albumname'].'(第'.$nowPage.'张)'; + + +include template("show"); + +$new['photo']->update('photo',array( + 'photoid'=>$strPhoto['photoid'], +),array( + 'count_view'=>$strPhoto['count_view']+1, +)); \ No newline at end of file diff --git a/app/photo/action/upload.php b/app/photo/action/upload.php new file mode 100644 index 0000000..63110f6 --- /dev/null +++ b/app/photo/action/upload.php @@ -0,0 +1,129 @@ +isLogin(); + + //判断发布者状态 + if(aac('user')->isPublisher()==false) tsNotice('不好意思,你还没有权限发布内容!'); + + //发布时间限制 + if(aac('system')->pubTime()==false) tsNotice('不好意思,当前时间不允许发布内容!'); + + + $albumid = tsIntval($_GET['albumid']); + + $strAlbum = $new['photo']->find('photo_album',array( + 'albumid'=>$albumid, + )); + + $strAlbum['albumname'] = tsTitle($strAlbum['albumname']); + $strAlbum['albumdesc'] = tsTitle($strAlbum['albumdesc']); + + if($userid != $strAlbum['userid']) { + + tsNotice('非法操作!'); + + } + + $addtime = time(); + + $title = '上传照片'; + include template("upload"); + + break; + + case "do": + + $userid = aac('user')->isLogin(); + + $albumid = tsIntval($_POST['albumid']); + + $addtime = tsIntval($_POST['addtime']); + + if($albumid==0){ + getJson('非法操作1!'); + } + + if($addtime==0){ + getJson('上传时间有误!'); + } + + $strAlbum = $new['photo']->find('photo_album',array( + 'albumid'=>$albumid, + )); + + if($strAlbum==''){ + getJson('非法操作2!'); + } + + if($strAlbum['userid']!=$userid){ + getJson('非法操作3!'); + } + + $type = getImagetype($_FILES['file']['tmp_name']); + if(!in_array($type,array('jpg','gif','png','jpeg'))){ + getJson('非法操作4!'); + } + + $photoid = $new['photo']->create('photo',array( + 'albumid'=>$strAlbum['albumid'], + 'userid'=>$strAlbum['userid'], + 'addtime' => date('Y-m-d H:i:s',$addtime), + )); + + //上传 + $arrUpload = tsUpload($_FILES['file'],$photoid,'photo',array('jpg','png','jpeg','gif')); + + if($arrUpload && $arrUpload['path'] && $arrUpload['url']){ + + $new['photo']->update('photo',array( + 'photoid'=>$photoid, + ),array( + 'title'=>$arrUpload['name'], + 'phototype'=>$arrUpload['type'], + 'path'=>$arrUpload['path'], + 'photourl'=>$arrUpload['url'], + 'photosize'=>$arrUpload['size'], + )); + + + #生成对应大小的图片 + tsXimg($arrUpload['url'],'photo',320,320,$arrUpload['path'],1); + tsXimg($arrUpload['url'],'photo',640,'',$arrUpload['path']); + + + #统计相册图片数 + $count_photo = $new['photo']->findCount('photo',array( + 'albumid'=>$albumid, + )); + + $new['photo']->update('photo_album',array( + 'albumid'=>$albumid, + ),array( + 'count_photo'=>$count_photo + )); + + //对积分进行出来 + aac('user')->doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'],$TS_URL['ts'],$strAlbum['userid']); + + }else{ + + $new['photo']->delete('photo',array( + 'photoid'=>$photoid, + )); + + } + + + + #echo $photoid; + getJson('上传成功!'); + + break; + +} \ No newline at end of file diff --git a/app/photo/action/user.php b/app/photo/action/user.php new file mode 100644 index 0000000..341135b --- /dev/null +++ b/app/photo/action/user.php @@ -0,0 +1,34 @@ +getSimpleUser($userid); + +$page = tsIntval($_GET['page'],1); + +$url = tsUrl('photo','user',array('id'=>$userid,'page'=>'')); + +$lstart = $page*6-6; + +$arrAlbum = $new['photo']->findAll('photo_album',array( + 'userid'=>$userid, +),'albumid desc',null,$lstart.',6'); + +foreach($arrAlbum as $key=>$item){ + $arrAlbum[$key]['albumname'] = tsTitle($item['albumname']); + $arrAlbum[$key]['albumdesc'] = tsTitle($item['albumdesc']); +} + +$albumNum = $new['photo']->findCount('photo_album',array( + 'userid'=>$userid, +)); + +$pageUrl = pagination($albumNum, 6, $page, $url); + + +$title = $strUser['username'].'的相册'; + +include template("user"); \ No newline at end of file diff --git a/app/photo/class.photo.php b/app/photo/class.photo.php new file mode 100644 index 0000000..a71155f --- /dev/null +++ b/app/photo/class.photo.php @@ -0,0 +1,99 @@ +db->once_fetch_assoc("select * from ".dbprefix."photo where photoid='$photoid'"); + return $strPhoto; + } + + function getSamplePhoto($photoid){ + $strPhoto = $this->db->once_fetch_assoc("select path,photourl from ".dbprefix."photo where photoid='$photoid'"); + return $strPhoto; + } + + //是否存在图片 + public function isPhoto($photoid){ + $photoNum = $this->findCount('photo',array( + 'photoid'=>$photoid, + )); + + if($photoNum > 0){ + return true; + }else{ + return false; + } + + } + + /** + * 删除图片 + * + * @param [type] $strPhoto + * @return void + */ + public function deletePhoto($strPhoto){ + #删除文件 + if($strPhoto['photourl']){ + if($GLOBALS['TS_SITE']['file_upload_type']==1){ + deleteAliOssFile('uploadfile/photo/'.$strPhoto['photourl']); + }else{ + unlink('uploadfile/photo/'.$strPhoto['photourl']); + tsDimg($strPhoto['photourl'],'photo','320','320',$strPhoto['path']); + } + } + #删除记录 + $this->delete('photo',array( + 'photoid'=>$strPhoto['photoid'], + )); + + #删除评论 + $this->delete ( 'comment', array ( + 'ptable'=>'photo', + 'pkey'=>'photoid', + 'pid'=>$strPhoto['photoid'], + )); + + return true; + + } + + //删除相册 + public function deletePhotoAlbum($albumid){ + + $this->delete('photo_album',array( + 'albumid'=>$albumid, + )); + + $arrPhoto = $this->findAll('photo',array( + 'albumid'=>$albumid, + )); + + foreach($arrPhoto as $key=>$item){ + + $this->deletePhoto($item); + + } + + $this->delete('photo',array( + 'albumid'=>$albumid, + )); + + } + + +} \ No newline at end of file diff --git a/app/photo/config.php b/app/photo/config.php new file mode 100644 index 0000000..c622938 --- /dev/null +++ b/app/photo/config.php @@ -0,0 +1,6 @@ + + +{php include template("admin/menu");} + +
    {$pageUrl}
    + + + + + + + + + + + + + {loop $arrAlbum $key $item} + + + + + + + + + + + + + {/loop} + + + + + + +
    AlbumID图片标题UserID统计addtime操作
    {$item[albumid]} + + {if $item[albumface]} + + {else} + + {/if} + + {tsTitle($item['albumname'])}{$item[userid]}图片:{$item['count_photo']}{$item['addtime']} + + + + {if $item['isaudit']} + 审核 + {else} + 取消审核 + {/if} + + + + + {if $item[isrecommend]==0} + 推荐 + {else} + 取消推荐 + {/if} + + + 删除 + +
    + + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/photo/html/admin/album_photo.html b/app/photo/html/admin/album_photo.html new file mode 100644 index 0000000..df94be2 --- /dev/null +++ b/app/photo/html/admin/album_photo.html @@ -0,0 +1,42 @@ +{php include pubTemplate("header_admin")} + + +
    + +{php include template("admin/menu");} + +
    {$pageUrl}
    + + + + + + + + + + + + + {loop $arrPhoto $key $item} + + {/loop} + + + + + + +
    PhotoId图片AlbumIDUserId操作
    {$item[photoid]} + + {if $item[photourl]} + + {else} + + {/if} + + {$item[albumid]}{$item[userid]}设为封面 修改 删除
    + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/photo/html/admin/comment_list.html b/app/photo/html/admin/comment_list.html new file mode 100644 index 0000000..0339dde --- /dev/null +++ b/app/photo/html/admin/comment_list.html @@ -0,0 +1,89 @@ +{php include pubTemplate("header_admin")} + + +
    + + {php include template("admin/menu");} + +
    {$pageUrl}
    + + +
    + + +
    + + + + + + + + + + + + + 全部 + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + {loop $arrComment $key $item} + + + + + + + + + + + + + + + {/loop} + + + +
    IDUserIDphotoid内容时间操作
    {$item['commentid']}{$item['userid']}{$item['photoid']} [查看内容] + +
    {php echo tsTitle($item['content'])}
    + +
    {php echo date('Y-m-d H:i:s',$item['addtime'])} + + + + 删除 + +
    + +
    +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/photo/html/admin/menu.html b/app/photo/html/admin/menu.html new file mode 100644 index 0000000..e6800b2 --- /dev/null +++ b/app/photo/html/admin/menu.html @@ -0,0 +1,16 @@ + +
    +
    相册管理
    + +
    + +
    \ No newline at end of file diff --git a/app/photo/html/admin/options.html b/app/photo/html/admin/options.html new file mode 100644 index 0000000..2be052c --- /dev/null +++ b/app/photo/html/admin/options.html @@ -0,0 +1,34 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu")} + + +
    + + + + + + + + + + +
    APP名称:
    APP介绍:
    APP关键词:
    是否审核:不审核 审核
    + +
    +
    + + + + + + +
    重新统计相册执行
    删除空相册执行
    + + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/photo/html/admin/permissions.html b/app/photo/html/admin/permissions.html new file mode 100644 index 0000000..1a46360 --- /dev/null +++ b/app/photo/html/admin/permissions.html @@ -0,0 +1,165 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + + + +
    + {loop $arrUg $key $item} + {$item['ugname']} + {/loop} +
    + + +
    + + +
    前台权限
    + + + + + + + + + + {if $ugid==1 || $ugid==2 || $ugid==3} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {/if} + + + + +
    查看图片: + +
    创建相册: + +
    修改相册: + +
    删除相册: + +
    上传图片: + +
    修改图片: + +
    删除图片: + +
    + + + + {if $ugid==1 || $ugid==2} +
    后台权限
    + + + + + + + + + + + + +
    图片配置: + +
    权限配置: + +
    + {/if} + + + +
    API权限
    + + + + + + + + + + + +
    查看图片: + +
    + + + + + + +
    + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/photo/html/admin/photo_list.html b/app/photo/html/admin/photo_list.html new file mode 100644 index 0000000..7198d40 --- /dev/null +++ b/app/photo/html/admin/photo_list.html @@ -0,0 +1,60 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + +
    {$pageUrl}
    + + + + + + + + + + + + + + + + + {loop $arrPhoto $key $item} + + + + + + + + {/loop} + + + + +
    PhotoId图片AlbumIDUserId统计操作
    {$item[photoid]} + + {if $item[photourl]} + + {else} + + {/if} + + {$item[albumid]}{$item[userid]} + 浏览:{$item['count_view']}
    + 评论:{$item['count_comment']} +
    + + 设为封面 + + {if $item[isrecommend]==0}推荐{else}取消推荐{/if} + + + + 删除
    + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/photo/html/album.html b/app/photo/html/album.html new file mode 100644 index 0000000..3475ef7 --- /dev/null +++ b/app/photo/html/album.html @@ -0,0 +1,96 @@ +{php include pubTemplate("header")} + +
    + + + + + +
    +
    + + +

    {$title}

    + +
    + +
    + + {$strAlbum[count_view]} 人浏览 + + {$strAlbum[count_photo]} 张照片 +  {$strAlbum[addtime]} 创建 + + +
    + + + +
    + + +{if $arrPhoto} + + {loop $arrPhoto $key $item} +
    +
    + + {$strAlbum['albumname']}{$item['title']} + +
    + +
    {$item[count_view]}浏览
    + +
    +
    +
    + {/loop} + +{else} + +
    这个相册现在还没有照片 + {if $strAlbum[userid] == $TS_USER[userid]}, 你可以 添加照片{/if} +
    + +{/if} +
    + + +
    {$pageUrl}
    + +
    {$strAlbum[albumdesc]}
    + + +
    + +
    + + {if $strAlbum[userid] == $TS_USER[userid] || $TS_USER[isadmin]==1}   + > 修改相册 +  > 添加照片 + {if $strAlbum[count_photo]>'0'}  + > 批量修改{/if} + {/if} + + + {if $strAlbum[userid] == $TS_USER[userid] || $TS_USER[isadmin]==1} +  > 删除相册 + {/if} + + +  > {$strUser['username']}的相册 + +
    + + +
    +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/photo/html/album_edit.html b/app/photo/html/album_edit.html new file mode 100644 index 0000000..a6dff09 --- /dev/null +++ b/app/photo/html/album_edit.html @@ -0,0 +1,68 @@ +{php include pubTemplate("header")} + +
    + + + + + + +
    +
    + + + + + + + +
    + +
    +
    + +
    +
    + + +
    + +
    + + +
    + + + + + + + 返回相册 +
    + + +
    +
    + +
    + + + + + + +
    + +
    + +
    + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/photo/html/album_info.html b/app/photo/html/album_info.html new file mode 100644 index 0000000..89ec400 --- /dev/null +++ b/app/photo/html/album_info.html @@ -0,0 +1,79 @@ +{php include pubTemplate("header")} + +
    + + + + + +
    +
    + + + + + + +
    + +
    +
    + + +
    + + {loop $arrPhoto $key $item} +
    +
    + +
    + + + + + + + +
    +
    +
    + +

    删除照片

    +
    +
    +
    + {/loop} + + +
    + + + + + 返回相册 + +
    + + +
    +
    + +
    + + + + + +
    + +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/photo/html/create.html b/app/photo/html/create.html new file mode 100644 index 0000000..a0c4d98 --- /dev/null +++ b/app/photo/html/create.html @@ -0,0 +1,65 @@ +{php include pubTemplate("header")} + +
    + + + + + + +
    +
    + +{template menu} + + + + + +
    +
    +
    + +
    +
    + + +
    + +
    + + +
    + + + + + 返回我的相册 +
    + +

    + +

    +
    +
    +
    + + + + + + + +
    +
    + + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/photo/html/index.html b/app/photo/html/index.html new file mode 100644 index 0000000..752e8d1 --- /dev/null +++ b/app/photo/html/index.html @@ -0,0 +1,48 @@ +{php include pubTemplate("header")} + +
    + + + + +
    +
    + +{template menu} + + +
    +{loop $arrAlbum $key $item} +
    + + {$item[albumname]} + + +
    +
    {$item[albumname]}
    +
    {$item[count_photo]}张图片
    +
    {php echo date('Y-m-d',strtotime($item['addtime']))} 创建
    +
    + +
    +{/loop} +
    + + + +
    +
    {$pageUrl}
    + +
    +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/photo/html/menu.html b/app/photo/html/menu.html new file mode 100644 index 0000000..2ccfc7e --- /dev/null +++ b/app/photo/html/menu.html @@ -0,0 +1,9 @@ +
    + 最新相册 + {if $ac=='album' && $ts=='user'} + {$title} + {/if} + + +
    +
    \ No newline at end of file diff --git a/app/photo/html/my/index.html b/app/photo/html/my/index.html new file mode 100644 index 0000000..24efc03 --- /dev/null +++ b/app/photo/html/my/index.html @@ -0,0 +1,64 @@ +{php include pubTemplate("header")} +
    + + + +
    + + +
    +
    + + {php include pubTemplate("my")} + +
    +
    +
    + + + + +
    +
    我的相册
    +
    + + + +
    + {loop $arrAlbum $key $item} +
    + + + + +
    +
    {$item['albumname']}
    +
    {$item['count_photo']}张照片
    +
    {php echo date('Y-m-d',strtotime($item['addtime']))} 创建
    +
    + +
    + {/loop} +
    + + + + + + +
    {$pageUrl}
    + + +
    +
    + + + +
    +
    + + + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/photo/html/photo_edit.html b/app/photo/html/photo_edit.html new file mode 100644 index 0000000..1613d86 --- /dev/null +++ b/app/photo/html/photo_edit.html @@ -0,0 +1,62 @@ +{php include pubTemplate("header")} + +
    + + + +
    +
    编辑图片信息
    +
    + + + +
    +
    +
    + + + +
    + +

    图片:

    +

    + +

    +

    图片名称:

    +

    +

    图片介绍:

    +

    + +

    + + + + + + + 返回 + +

    +
    + + + + +
    +
    +
    + + + + + +
    +
    + + + + + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/photo/html/show.html b/app/photo/html/show.html new file mode 100644 index 0000000..521361d --- /dev/null +++ b/app/photo/html/show.html @@ -0,0 +1,174 @@ +{php include pubTemplate("header")} + +
    + + + + + + + +
    + + + +
    + +
    +
    + + +

    {$strAlbum['albumname']}(第{$nowPage}张)

    + +
    + +
    + > 返回相册第{$nowPage}张 / 共{$conutPage}张 + +{if $nowPage >1} + +上一张 +{if $nowPage < $conutPage} +/ +{/if} +{/if} +{if $nowPage < $conutPage} + +下一张 +{/if} +
    + + +
    + {if $nowPage < $conutPage} + +{/if} + {$strAlbum['albumname']}{$strPhoto['title']} + {if $nowPage < $conutPage} + + {/if} +
    + + +
    +{$strPhoto[title]} {$strPhoto[photodesc]} + +
    + + +
    + {$strPhoto[count_view]}人浏览  +上传于{$strPhoto[addtime]} + +查看原图 + +  +
    + + +
    + {if $TS_USER[userid] == $strPhoto[userid] || $TS_USER[isadmin]==1}修改 | + + 删除照片 + + + {/if} +
    + + + + +
    +
    + + + + + + + +
    +
    评论{if $strPhoto['count_comment']} ({$strPhoto['count_comment']}){/if}
    +
    + + + + + + {php include pubTemplate("comment")} + + + + + +
    + + {if tsIntval($TS_USER[userid])==0} +
    + 登录 | 注册 +
    + {else} + +
    +
    + +
    +
    +
    + {if $TS_SITE['isauthcode']} + + 点击刷新验证码 + {/if} +
    +
    +
    是否公开:公开 不公开
    +
    +
    + + + + + +
    +
    +
    + {/if} + +
    + +
    +
    + + + + + + + + + + +
    + + +
    + + {php doAction('gobad','300')} + + +
    + + + +
    + +
    +{php doAction('tseditor','mini')} +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/photo/html/upload.html b/app/photo/html/upload.html new file mode 100644 index 0000000..c77cb79 --- /dev/null +++ b/app/photo/html/upload.html @@ -0,0 +1,77 @@ +{php include pubTemplate("header")} + + + + +
    + + + + + + +
    +
    + + + + +
    上传文件只支持:jpg,gif,png格式。
    + + + +
    + + +
    + + + + + +
    + + +
    + + 返回相册 + +
    + + +
    +
    + + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/photo/html/user.html b/app/photo/html/user.html new file mode 100644 index 0000000..103b014 --- /dev/null +++ b/app/photo/html/user.html @@ -0,0 +1,47 @@ +{php include pubTemplate("header")} + +
    + + + + + +
    +
    + +

    {$strUser['username']}的相册

    + +
    + +
    + {loop $arrAlbum $key $item} +
    + + {$item[albumname]} + + +
    +
    {$item['albumname']}
    +
    {$item['count_photo']}张照片
    +
    {php echo date('Y-m-d',strtotime($item['addtime']))} 创建
    +
    + +
    + {/loop} +
    + + +
    {$pageUrl}
    +
    + +
    + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/photo/js/admin.js b/app/photo/js/admin.js new file mode 100644 index 0000000..e69de29 diff --git a/app/photo/js/extend.func.js b/app/photo/js/extend.func.js new file mode 100644 index 0000000..e69de29 diff --git a/app/photo/skin/photo_album.png b/app/photo/skin/photo_album.png new file mode 100644 index 0000000..a75ed6d Binary files /dev/null and b/app/photo/skin/photo_album.png differ diff --git a/app/photo/skin/style.css b/app/photo/skin/style.css new file mode 100644 index 0000000..ed2f6c0 --- /dev/null +++ b/app/photo/skin/style.css @@ -0,0 +1,272 @@ +.show_photo{} +.show_photo img{max-width:100%;} + +.wr { + overflow: hidden; + table-layout: fixed; + width: 100%; + word-wrap: break-word; +} + +.albumlst { + float: left; + margin: 7px; + width: 170px; + border:solid 1px #CCCCCC; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.4); +} + +.album_photo { +display: block; +overflow: hidden; +width: 181px; +} + +.album_photo img{} + +.album_photo:link { + color: #777777; + display: block; + font-style: italic; +} + +.album { + background: url("albumback.gif") no-repeat scroll 1px 1px transparent; + padding: 4px 7px 7px 4px; +} + +.albumlst_r { + color: #777777; + overflow: hidden; + padding-top: 4px; + word-wrap: break-word; +} + +.pl2 { + color: #666666; + font: 14px/150% Arial,Helvetica,sans-serif; +} +.albumlst_descri { + color: #333333; + margin-bottom: 10px; +} + +.mbt { + clear: both; + margin: 0; + padding: 0; +} +.mbtl { +float: left; + margin: 8px 7px 0 0; + padding: 0; + width: 55px; +} + +.mbtrdot { + min-height: 55px; + overflow: hidden; + padding: 4px 0; +} + +.extra { + clear: both; + text-align: right; +} + +.photitle { + border-bottom: 1px solid #DDDDDD; + margin-bottom: 5px; + padding-bottom: 5px; + text-align: right; +} +.photo_wrap { + display: inline; + float: left; + margin: 10px 7px; + overflow: hidden; + width: 170px; + border:solid 1px #CCCCCC; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.4); + +} +.photolst_photo { + margin: 0; + width: 180px; +} +.photo_wrap .pl { + margin: 6px 0 3px; +} +.gact { + color: #BBBBBB; + cursor: pointer; + font-size: 12px; + text-align: center; +} + +.sns-bar { + clear: both; + color: #666666; + margin-bottom: 20px; + overflow: hidden; + padding-top: 20px; +} +.sns-bar-donate { + float: left; + margin-right: 15px; +} +.sns-bar-rec { + float: left; +} +.sns-bar form, .sns-bar .rec-sec { + display: inline-block; + float: none; +} +.rec-sec { + color: #999999; + text-align: right; +} +.lnk-sharing { + border: 1px solid #B9DCD0; + border-radius: 3px 3px 3px 3px; + display: inline-block; + height: 19px; + line-height: 19px; + overflow: hidden; + padding: 0 8px; + vertical-align: middle; +} +a.lnk-sharing:link, a.lnk-sharing:visited { + background-color: #F2F8F2; + border-color: #E3F1ED; + color: #4F946E; +} +.sns-bar-fav { + float: right; +} + +.btn-fav { + border: 1px solid #EDCEBA; + border-radius: 3px 3px 3px 3px; + display: inline-block; + height: 19px; + line-height: 19px; + margin-left: 4px; + overflow: hidden; + padding: 0 8px 0 30px; + vertical-align: middle; +} +.fav-add, .fav-add:link, .fav-add:hover { + background: url("ic_like.png") no-repeat scroll 8px 3px transparent; +} +a.btn-fav:link, a.btn-fav:visited { + background-color: #FFF6EE; + border-color: #F2ECE7; + color: #99776B; +} +.clearfix { + display: block; +} + +.rr { + float: right; +} +.ll { + float: left; +} +.photo_descri { + overflow: hidden; + padding: 0 0 0 14px; + word-wrap: break-word; +} +.edtext { + margin: 7px 0 15px; + width: 100%; +} + +#comments { + overflow: hidden; + padding: 20px 0 0; + width: 100%; + word-wrap: break-word; +} +.wrap { + background: url("topicbar.gif") no-repeat scroll 0 0 transparent; + display: block; +} +h4 { + background: url("topicbar.gif") no-repeat scroll right top transparent; + color: #666666; + font: 12px/1.8em Arial,Helvetica,sans-serif; + height: 26px; + margin: 0 0 10px 4px; + overflow: hidden; +} +.align-right { + text-align: right; +} +.gact a:link, a.gact:link { + color: #BBBBBB; + font-size: 12px; + text-align: center; + text-decoration: none; +} +.txd textarea { + width: 90%; +} +textarea { + border: 1px solid #CCCCCC; + font-size: 14px; + padding: 3px; +} +textarea { + font-family: Arial; + overflow: auto; +} +textarea { + resize: none; +} + +.photo-complete { + background: none repeat scroll 0 0 #F8F8F8; + margin-bottom: 15px; + padding: 15px 20px 1px; +} +.photo-item { + margin-bottom: 15px; +} + +.photo-item .cover { + float:left; + margin-right: 10px; + vertical-align: top; +} +.photo-item .cover a { + display: block; + margin-bottom: -3px; + text-align: center; + width: 100px; +} +.photo-item .choose-cover { + text-align: center; +} +label { + font-family: Tahoma; + vertical-align: middle; +} + + +.photo-item .intro{margin-left: 110px;} + +.photo-item .intro textarea { + border: 1px solid #DDDDDD; + color: #666666; + padding: 5px; + width: 100%; + border-radius: 5px; + +} +.photo-item .intro p { + margin: 0; + text-align: right; +} \ No newline at end of file diff --git a/app/photo/skins/default/photo_album.png b/app/photo/skins/default/photo_album.png new file mode 100644 index 0000000..a75ed6d Binary files /dev/null and b/app/photo/skins/default/photo_album.png differ diff --git a/app/photo/skins/default/style.css b/app/photo/skins/default/style.css new file mode 100644 index 0000000..ed2f6c0 --- /dev/null +++ b/app/photo/skins/default/style.css @@ -0,0 +1,272 @@ +.show_photo{} +.show_photo img{max-width:100%;} + +.wr { + overflow: hidden; + table-layout: fixed; + width: 100%; + word-wrap: break-word; +} + +.albumlst { + float: left; + margin: 7px; + width: 170px; + border:solid 1px #CCCCCC; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.4); +} + +.album_photo { +display: block; +overflow: hidden; +width: 181px; +} + +.album_photo img{} + +.album_photo:link { + color: #777777; + display: block; + font-style: italic; +} + +.album { + background: url("albumback.gif") no-repeat scroll 1px 1px transparent; + padding: 4px 7px 7px 4px; +} + +.albumlst_r { + color: #777777; + overflow: hidden; + padding-top: 4px; + word-wrap: break-word; +} + +.pl2 { + color: #666666; + font: 14px/150% Arial,Helvetica,sans-serif; +} +.albumlst_descri { + color: #333333; + margin-bottom: 10px; +} + +.mbt { + clear: both; + margin: 0; + padding: 0; +} +.mbtl { +float: left; + margin: 8px 7px 0 0; + padding: 0; + width: 55px; +} + +.mbtrdot { + min-height: 55px; + overflow: hidden; + padding: 4px 0; +} + +.extra { + clear: both; + text-align: right; +} + +.photitle { + border-bottom: 1px solid #DDDDDD; + margin-bottom: 5px; + padding-bottom: 5px; + text-align: right; +} +.photo_wrap { + display: inline; + float: left; + margin: 10px 7px; + overflow: hidden; + width: 170px; + border:solid 1px #CCCCCC; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.4); + +} +.photolst_photo { + margin: 0; + width: 180px; +} +.photo_wrap .pl { + margin: 6px 0 3px; +} +.gact { + color: #BBBBBB; + cursor: pointer; + font-size: 12px; + text-align: center; +} + +.sns-bar { + clear: both; + color: #666666; + margin-bottom: 20px; + overflow: hidden; + padding-top: 20px; +} +.sns-bar-donate { + float: left; + margin-right: 15px; +} +.sns-bar-rec { + float: left; +} +.sns-bar form, .sns-bar .rec-sec { + display: inline-block; + float: none; +} +.rec-sec { + color: #999999; + text-align: right; +} +.lnk-sharing { + border: 1px solid #B9DCD0; + border-radius: 3px 3px 3px 3px; + display: inline-block; + height: 19px; + line-height: 19px; + overflow: hidden; + padding: 0 8px; + vertical-align: middle; +} +a.lnk-sharing:link, a.lnk-sharing:visited { + background-color: #F2F8F2; + border-color: #E3F1ED; + color: #4F946E; +} +.sns-bar-fav { + float: right; +} + +.btn-fav { + border: 1px solid #EDCEBA; + border-radius: 3px 3px 3px 3px; + display: inline-block; + height: 19px; + line-height: 19px; + margin-left: 4px; + overflow: hidden; + padding: 0 8px 0 30px; + vertical-align: middle; +} +.fav-add, .fav-add:link, .fav-add:hover { + background: url("ic_like.png") no-repeat scroll 8px 3px transparent; +} +a.btn-fav:link, a.btn-fav:visited { + background-color: #FFF6EE; + border-color: #F2ECE7; + color: #99776B; +} +.clearfix { + display: block; +} + +.rr { + float: right; +} +.ll { + float: left; +} +.photo_descri { + overflow: hidden; + padding: 0 0 0 14px; + word-wrap: break-word; +} +.edtext { + margin: 7px 0 15px; + width: 100%; +} + +#comments { + overflow: hidden; + padding: 20px 0 0; + width: 100%; + word-wrap: break-word; +} +.wrap { + background: url("topicbar.gif") no-repeat scroll 0 0 transparent; + display: block; +} +h4 { + background: url("topicbar.gif") no-repeat scroll right top transparent; + color: #666666; + font: 12px/1.8em Arial,Helvetica,sans-serif; + height: 26px; + margin: 0 0 10px 4px; + overflow: hidden; +} +.align-right { + text-align: right; +} +.gact a:link, a.gact:link { + color: #BBBBBB; + font-size: 12px; + text-align: center; + text-decoration: none; +} +.txd textarea { + width: 90%; +} +textarea { + border: 1px solid #CCCCCC; + font-size: 14px; + padding: 3px; +} +textarea { + font-family: Arial; + overflow: auto; +} +textarea { + resize: none; +} + +.photo-complete { + background: none repeat scroll 0 0 #F8F8F8; + margin-bottom: 15px; + padding: 15px 20px 1px; +} +.photo-item { + margin-bottom: 15px; +} + +.photo-item .cover { + float:left; + margin-right: 10px; + vertical-align: top; +} +.photo-item .cover a { + display: block; + margin-bottom: -3px; + text-align: center; + width: 100px; +} +.photo-item .choose-cover { + text-align: center; +} +label { + font-family: Tahoma; + vertical-align: middle; +} + + +.photo-item .intro{margin-left: 110px;} + +.photo-item .intro textarea { + border: 1px solid #DDDDDD; + color: #666666; + padding: 5px; + width: 100%; + border-radius: 5px; + +} +.photo-item .intro p { + margin: 0; + text-align: right; +} \ No newline at end of file diff --git a/app/pubs/about.php b/app/pubs/about.php new file mode 100644 index 0000000..f786ea8 --- /dev/null +++ b/app/pubs/about.php @@ -0,0 +1,17 @@ + '公共', + 'version' => '1.2', + 'desc' => '辅助性APP', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '0', + 'ismy'=>'0', +); \ No newline at end of file diff --git a/app/pubs/action/admin.php b/app/pubs/action/admin.php new file mode 100644 index 0000000..b04d6eb --- /dev/null +++ b/app/pubs/action/admin.php @@ -0,0 +1,10 @@ +"Ok"); + echo json_encode($data); + } + else + { + //header("http/1.1 403 Forbidden"); + exit(); + } + + break; + +} \ No newline at end of file diff --git a/app/pubs/action/api.php b/app/pubs/action/api.php new file mode 100644 index 0000000..0608b65 --- /dev/null +++ b/app/pubs/action/api.php @@ -0,0 +1,9 @@ +buildImageVerify($width=65,$height=30,$randval=NULL,$verifyName='verify'); \ No newline at end of file diff --git a/app/pubs/action/download.php b/app/pubs/action/download.php new file mode 100644 index 0000000..0a4e0c0 --- /dev/null +++ b/app/pubs/action/download.php @@ -0,0 +1,113 @@ +isLogin(); + $ts=tsUrlCheck($ts); + if(aac('user')->isPublisher()==false) {tsNotice('你可能被限制或没有验证邮箱,检查邮箱是否认证。','->点击认证<-',tsUrl('user','verify'));} + $userme=aac('user')->getOneUser($userid); + + $the_file=$new['pubs']->find('editor',array( + 'pwd'=>$ts, + + )); + if($the_file) + { + $file_dir = "uploadfile/editor/".$the_file['url']; + if (!file_exists($file_dir)) { //检查文件是否存在 + echo "文件已删除"; + exit; + }else{ + if($the_file['userid']==$userid) + { + download($file_dir,$the_file['title']); + exit; + }else + { + if(aac('user')->delScore($userid,"download file:" . $the_file['title'],2)) + { + download($file_dir,$the_file['title']); + aac('user')->addScore($the_file['userid'],$userme['username']."download:" . $the_file['title'],1,1); + exit; + }else + { + tsNotice('下载文件需要2积分,你似乎不够!'); + } + } + + + + } + + }else + { + echo "文件已删除"; + exit; + + } + + /* + $file_name = "187.doc"; + $file_dir = "uploadfile/editor/0/0/"; + if (!file_exists($file_dir . $file_name)) { //检查文件是否存在 + echo "文件已删除"; + exit; + }else{ + + $file = fopen($file_dir . $file_name,"r"); // 打开文件 + // 输入文件标签 + Header("Content-type: application/octet-stream"); + Header("Accept-Ranges: bytes"); + Header("Accept-Length: ".filesize($file_dir . $file_name)); + Header("Content-Disposition: attachment; filename=" . $file_name); + // 输出文件内容 + echo fread($file,filesize($file_dir . $file_name)); + fclose($file); + exit; + + } + */ + +?> diff --git a/app/pubs/action/draft.php b/app/pubs/action/draft.php new file mode 100644 index 0000000..7226c25 --- /dev/null +++ b/app/pubs/action/draft.php @@ -0,0 +1,37 @@ +replace('draft',array( + 'userid'=>$userid, + 'types'=>$types, + ),array( + 'userid'=>$userid, + 'types'=>$types, + 'title'=>$title, + 'content'=>$content, + 'addtime'=>time(), + )); + + getJson('已自动保存内容到草稿箱!',1); + +} \ No newline at end of file diff --git a/app/pubs/action/editor.php b/app/pubs/action/editor.php new file mode 100644 index 0000000..a96c979 --- /dev/null +++ b/app/pubs/action/editor.php @@ -0,0 +1,126 @@ +isLogin(); + + $id = $new['pubs']->create('editor',array( + 'userid'=>$userid, + 'type'=>'photo', + 'addtime'=>time(), + )); + + $arrUpload = tsUpload($_FILES['photo'], $id, 'editor', array('jpg', 'gif', 'png', 'jpeg'),'sy.png'); + if ($arrUpload) { + $new['pubs'] -> update('editor', array( + 'id' => $id + ), array( + 'title'=>$arrUpload['name'], + 'path' => $arrUpload['path'], + 'url' => $arrUpload['url'] + )); + + if($TS_SITE['file_upload_type']==1){ + #阿里云(对象云存储OSS)数据 + $url = $TS_SITE['alioss_bucket_url'].'/'.'uploadfile/editor/'.$arrUpload['url'].'?x-oss-process=image/resize,w_800'; + }else{ + #本地数据 + $url = SITE_URL.'uploadfile/editor/'.$arrUpload['url']; + } + + if($js==1){ + + echo json_encode(array( + 'errno'=>0, + 'data'=>array( + 0=>$url, + //0=>tsXimg($arrUpload['url'],'editor','640','',$arrUpload['path']), + ), + )); + exit(); + + }else{ + + echo $url; + //echo tsXimg($arrUpload['url'],'editor','640','',$arrUpload['path']); + exit(); + + } + + + }else{ + + $new['pubs']->delete('editor',array( + 'id'=>$id, + )); + + } + + + break; + + + //针对editor.md编辑器的图片上传 + case "markdown": + //var_dump($_FILES['editormd-image-file']); + $userid = aac('user')->isLogin(); + + $id = $new['pubs']->create('editor',array( + 'userid'=>$userid, + 'type'=>'photo', + 'addtime'=>time(), + )); + + $arrUpload = tsUpload($_FILES['editormd-image-file'], $id, 'editor', array('jpg', 'gif', 'png', 'jpeg'),'sy.png'); + if ($arrUpload) { + $new['pubs'] -> update('editor', array( + 'id' => $id + ), array( + 'title'=>$arrUpload['name'], + 'path' => $arrUpload['path'], + 'url' => $arrUpload['url'] + )); + + + if($TS_SITE['file_upload_type']==1){ + #阿里云(对象云存储OSS)数据 + $url = $TS_SITE['alioss_bucket_url'].'/'.'uploadfile/editor/'.$arrUpload['url'].'?x-oss-process=image/resize,w_800'; + }else{ + #本地数据 + $url = SITE_URL.'uploadfile/editor/'.$arrUpload['url']; + } + + echo json_encode(array( + 'success'=>1, + 'message'=>'图片上传成功!', + 'url'=>$url, + )); + + + }else{ + + $new['pubs']->delete('editor',array( + 'id'=>$id, + )); + + echo json_encode(array( + 'success'=>0, + 'message'=>'图片上传失败!', + 'url'=>'', + )); + + } + + break; + +} \ No newline at end of file diff --git a/app/pubs/action/email.php b/app/pubs/action/email.php new file mode 100644 index 0000000..12a2b60 --- /dev/null +++ b/app/pubs/action/email.php @@ -0,0 +1,103 @@ +find('anti_email',array( + 'email'=>$email, +)); +if($is_anti_email>0){ + getJson('非法操作!',1,0); +} + +if($typeid==1){ + $strUserEmail = $new['pubs']->find('user',array( + 'email'=>$email, + )); + if($strUserEmail){ + getJson('Email已经存在!',1,0); + } +}elseif($typeid==2){ + $strUserEmail = $new['pubs']->find('user',array( + 'email'=>$email, + )); + + if($strUserEmail==''){ + getJson('Email不存在!',1,0); + } +} + + +$strEmail = $new['pubs']->find('email_code',array( + 'email'=>$email, +)); + +$code = random(4,1); + +if($strEmail){ + + $time = time(); + $ptime = strtotime($strEmail['addtime']); + + $ntime = $time-$ptime; + + #短信发送间隔时间 + $email_code_send_time = tsIntval($TS_APP['email_code_send_time']); + if($email_code_send_time==0) $email_code_send_time = 30; + + $time30 = 60*$email_code_send_time; + + if($ntime<$time30){ + //echo 1;exit;//30分钟内只能发送一次短信验证码 + getJson('30分钟内只能发送一次Email验证码!',1,0); + }else{ + + $new['pubs']->update('email_code',array( + 'email'=>$email, + ),array( + 'code'=>$code, + 'nums'=>0, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + $result = aac('mail')->postMail($email,$TS_SITE['site_title'].' Email验证码:'.$code,$TS_SITE['site_title'].' Email验证码:'.$code); + + getJson('发送成功!',1,1); + + } + +}else{ + + $new['pubs']->create('email_code',array( + 'email'=>$email, + 'code'=>$code, + 'nums'=>0, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + $result = aac('mail')->postMail($email,$TS_SITE['site_title'].' Email验证码:'.$code,$TS_SITE['site_title'].' Email验证码:'.$code); + + getJson('发送成功!',1,1); + +} \ No newline at end of file diff --git a/app/pubs/action/file.php b/app/pubs/action/file.php new file mode 100644 index 0000000..fe81e50 --- /dev/null +++ b/app/pubs/action/file.php @@ -0,0 +1,30 @@ +isLogin(); + +$dest_dir = 'cache/upload'; + +createFolders ( $dest_dir ); + +$arrType = explode ( '.', strtolower ( $_FILES ['filedata'] ['name'] ) ); + +$type = array_pop ( $arrType ); + +if (in_array ( $type, array('doc','pdf','ppt','xls','txt') )) { + + $name = $userid .'.'. $type; + + $dest = $dest_dir . '/' . $name; + + unlink ( $dest ); + + move_uploaded_file ( $_FILES ['filedata'] ['tmp_name'], mb_convert_encoding ( $dest, "gb2312", "UTF-8" ) ); + + chmod ( $dest, 0777 ); + + echo SITE_URL.$dest; + +} \ No newline at end of file diff --git a/app/pubs/action/home.php b/app/pubs/action/home.php new file mode 100644 index 0000000..a5631e7 --- /dev/null +++ b/app/pubs/action/home.php @@ -0,0 +1,10 @@ +find('anti_phone',array( + 'phone'=>$phone, +)); +if($is_anti_phone>0){ + getJson('非法操作!',1,0); +} + +if($typeid==1){ + $strUserPhone = $new['pubs']->find('user',array( + 'phone'=>$phone, + )); + + if($strUserPhone){ + //echo 3;exit;//手机号已经存在 + getJson('手机号已经存在!',1,0); + } +}elseif($typeid==2){ + + $strUserPhone = $new['pubs']->find('user',array( + 'phone'=>$phone, + )); + + if($strUserPhone==''){ + //echo 4;exit;//手机号不存在 + getJson('手机号不存在!',1,0); + } +} + + +$strPhone = $new['pubs']->find('phone_code',array( + 'phone'=>$phone, +)); + +$code = random(4,1); + +if($strPhone){ + + $time = time(); + $ptime = strtotime($strPhone['addtime']); + + $ntime = $time-$ptime; + + #短信发送间隔时间 + $phone_code_send_time = tsIntval($TS_APP['phone_code_send_time']); + if($phone_code_send_time==0) $phone_code_send_time = 30; + + $time30 = 60*$phone_code_send_time; + + if($ntime<$time30){ + //echo 1;exit;//30分钟内只能发送一次短信验证码 + getJson($phone_code_send_time.'分钟内只能发送一次短信验证码!',1,0); + }else{ + + $new['pubs']->update('phone_code',array( + 'phone'=>$phone, + ),array( + 'code'=>$code, + 'nums'=>0, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + $response = aac('mail')->sendSms($phone,$code); + #var_dump($response); + + //echo 2;exit;//发送成功 + getJson('发送成功!',1,1); + + } + +}else{ + + $new['pubs']->create('phone_code',array( + 'phone'=>$phone, + 'code'=>$code, + 'nums'=>0, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + $response = aac('mail')->sendSms($phone,$code); + #var_dump($response); + + //echo 2;exit;//发送成功 + getJson('发送成功!',1,1); + +} \ No newline at end of file diff --git a/app/pubs/action/photo.php b/app/pubs/action/photo.php new file mode 100644 index 0000000..9a35c0b --- /dev/null +++ b/app/pubs/action/photo.php @@ -0,0 +1,51 @@ + + + */ + +//集合JS的临时上传 + +$userid = aac('user')->isLogin(); + +$dest_dir = 'cache/upload'; + +createFolders ( $dest_dir ); + +$arrType = explode ( '.', strtolower ( $_FILES ['filedata'] ['name'] ) ); + +$type = array_pop ( $arrType ); + +if (in_array ( $type, array('jpg','jpeg','gif','png') )) { + + $name = $userid .'.'. $type; + + $dest = $dest_dir . '/' . $name; + + unlink ( $dest ); + + move_uploaded_file ( $_FILES ['filedata'] ['tmp_name'], mb_convert_encoding ( $dest, "gb2312", "UTF-8" ) ); + + chmod ( $dest, 0777 ); + + echo SITE_URL.$dest.'?v='.rand(); + +} \ No newline at end of file diff --git a/app/pubs/action/plugin.php b/app/pubs/action/plugin.php new file mode 100644 index 0000000..900f39b --- /dev/null +++ b/app/pubs/action/plugin.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/app/pubs/action/urltoid.php b/app/pubs/action/urltoid.php new file mode 100644 index 0000000..0048c3e --- /dev/null +++ b/app/pubs/action/urltoid.php @@ -0,0 +1,56 @@ +isLogin(); + $ts=tsFilter($ts); + $url=str_replace("/uploadfile/editor/","",$ts); + if($url=='') + { + echo "erro"; + exit; + + } + $the_file=$new['pubs']->find('editor',array( + 'url'=>$url, + + )); + if($the_file) + { + echo $the_file['id']; + }else + { + echo "-1"; + + } + + /* + $file_name = "187.doc"; + $file_dir = "uploadfile/editor/0/0/"; + if (!file_exists($file_dir . $file_name)) { //检查文件是否存在 + echo "文件已删除"; + exit; + }else{ + + $file = fopen($file_dir . $file_name,"r"); // 打开文件 + // 输入文件标签 + Header("Content-type: application/octet-stream"); + Header("Accept-Ranges: bytes"); + Header("Accept-Length: ".filesize($file_dir . $file_name)); + Header("Content-Disposition: attachment; filename=" . $file_name); + // 输出文件内容 + echo fread($file,filesize($file_dir . $file_name)); + fclose($file); + exit; + + } + */ + + ?> + diff --git a/app/pubs/class.pubs.php b/app/pubs/class.pubs.php new file mode 100644 index 0000000..00b9c48 --- /dev/null +++ b/app/pubs/class.pubs.php @@ -0,0 +1,556 @@ +decrypt($userkey,$GLOBALS['TS_SITE']['site_pkey']); + $isUser = $this->findCount('user',array( + 'userid'=>$userid, + )); + if($isUser == 0){ + echo json_encode(array( + 'status'=> 0, + 'msg'=> '非法操作', + 'data'=> '', + )); + exit; + }else{ + return $userid; + } + } + + /** + * @param $string + * @param string $action + * @return string + */ + public function strCode($string, $action = 'ENCODE'){ + $action != 'ENCODE' && $string = base64_decode($string); + $code = ''; + $key = $GLOBALS['TS_SITE']['site_pkey']; + $keyLen = strlen($key); + $strLen = strlen($string); + for ($i = 0; $i < $strLen; $i++) { + $k = $i % $keyLen; + $code .= $string[$i] ^ $key[$k]; + } + return ($action != 'DECODE' ? base64_encode($code) : $code); + } + + /** + * @param $phone + * @param $code + * @return bool + */ + public function verifyPhoneCode($phone, $code){ + $strPhoneCode = $this->find('phone_code',array( + 'phone'=>$phone, + )); + + #空数据 + if($strPhoneCode==''){ + return false;exit; + } + + #空验证码 + if($strPhoneCode['code']==''){ + return false;exit; + } + + #手机验证码错误次数>=2 + if($strPhoneCode['nums']>=2){ + $this->update('phone_code',array( + 'phone'=>$phone, + ),array( + 'code'=>'', + 'nums'=>0, + )); + return false;exit; + } + + #手机验证码错误 + if($strPhoneCode['code']!=$code){ + $this->update('phone_code',array( + 'phone'=>$phone, + ),array( + 'nums'=>$strPhoneCode['nums']+1, + )); + return false;exit; + } + return true; + } + + /** + * 验证Email验证码 + */ + public function verifyEmailCode($email, $code){ + $strEmailCode = $this->find('email_code',array( + 'email'=>$email, + )); + + #空数据 + if($strEmailCode==''){ + return false;exit; + } + + #空验证码 + if($strEmailCode['code']==''){ + return false;exit; + } + + #验证码错误次数>=2 + if($strEmailCode['nums']>=2){ + $this->update('email_code',array( + 'email'=>$email, + ),array( + 'code'=>'', + 'nums'=>0, + )); + return false;exit; + } + + #验证码错误 + if($strEmailCode['code']!=$code){ + $this->update('email_code',array( + 'email'=>$email, + ),array( + 'nums'=>$strEmailCode['nums']+1, + )); + return false;exit; + } + return true; + } + + + + /** + * 删除点赞 + * + * @param [type] $ptable + * @param [type] $pkey + * @param [type] $pid + * @param integer $userid + * @return void + */ + public function delLove($ptable,$pkey,$pid,$userid=0){ + if($userid){ + $this->delete('love',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + 'userid'=>$userid, + )); + }else{ + $this->delete('love',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + )); + } + + return true; + } + + /** + * 添加项目数据到ts_topic表 + * + * @param [type] $ptable + * @param [type] $pkey + * @param [type] $pid + * @param string $pjson + * @param [type] $groupid + * @param [type] $userid + * @param [type] $title + * @param [type] $gaiyao + * @return void + */ + public function addPtable($ptable,$pkey,$pid,$pjson,$groupid,$userid,$title,$gaiyao){ + $topicid = $this->create('topic',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + 'pjson'=>$pjson, + 'groupid'=>$groupid, + 'userid'=>$userid, + 'title'=>$title, + 'gaiyao'=>$gaiyao, + 'isaudit'=>0, + 'addtime'=>time(), + 'uptime'=>time(), + )); + return $topicid; + } + + /** + * 更新项目数据到ts_topic表 + * + * @param [type] $ptable + * @param [type] $pkey + * @param [type] $pid + * @param string $pjson + * @param [type] $title + * @param [type] $gaiyao + * @return void + */ + public function editPtable($ptable,$pkey,$pid,$pjson,$title,$gaiyao){ + $this->update('topic',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + ),array( + 'pjson'=>$pjson, + 'title'=>$title, + 'gaiyao'=>$gaiyao, + )); + } + + /** + * 更新项目浏览数到ts_topic表 + * + * @param [type] $ptable + * @param [type] $pkey + * @param [type] $pid + * @param [type] $count_view + * @return void + */ + public function upPtableView($ptable,$pkey,$pid,$count_view){ + $this->update('topic',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + ),array( + 'count_view'=>$count_view, + )); + } + + /** + * 更新项目评论数到ts_topic表 + * + * @param [type] $ptable + * @param [type] $pkey + * @param [type] $pid + * @param [type] $count_comment + * @return void + */ + public function upPtableComment($ptable,$pkey,$pid,$count_comment){ + if($ptable!='topic'){ + $this->update('topic',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + ),array( + 'count_comment'=>$count_comment, + 'uptime'=>time(), + )); + } + } + + /** + * 更新项目点赞数到ts_topic表 + * + * @param [type] $ptable + * @param [type] $pkey + * @param [type] $pid + * @param [type] $count_love + * @return void + */ + public function upPtableLove($ptable,$pkey,$pid,$count_love){ + if($ptable!='topic'){ + $this->update('topic',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + ),array( + 'count_love'=>$count_love, + )); + } + } + + /** + * 从ts_topic表删除项目数据 + * + * @param [type] $ptable + * @param [type] $pkey + * @param [type] $pid + * @return void + */ + public function delPtable($ptable,$pkey,$pid){ + $this->delete('topic',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + )); + } + + /** + * 用户内容添加、修改、删除记录 + * + * @param [type] $ptable + * @param [type] $pkey + * @param [type] $pid + * @param [type] $userid + * @param [type] $title + * @param [type] $content + * @param [type] $status + * @return void + */ + public function addLogs($ptable,$pkey,$pid,$userid,$title,$content,$status){ + $this->create('logs',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + 'userid'=>$userid, + 'title'=>$title, + 'content'=>$content, + 'status'=>$status, + 'addtime'=>time(), + )); + } + + /** + * 更新项目推荐 + * + * @param [type] $ptable + * @param [type] $pkey + * @param [type] $pid + * @param integer $isrecommend 1推荐0不推荐 + * @return void + */ + public function upPtableRecommend($ptable,$pkey,$pid,$isrecommend=1){ + if($ptable!='topic'){ + $this->update('topic',array( + 'ptable'=>$ptable, + 'pkey'=>$pkey, + 'pid'=>$pid, + ),array( + 'isrecommend'=>$isrecommend, + )); + } + } + + /** + * ThinkSAAS分块上传文件 + * upsize和upcount为空的情况下就是单个文件,并且该文件比设定的大小要小 + * + * @param [type] $userid 用户ID + * @param [type] $upsize 总共分几段上传 + * @param [type] $upcount 每次分段的size + * @param array $uptype 上传文件类型 + * @return void + */ + public function chunkUpload($userid,$files,$upsize,$upcount,$uptype=array()){ + + $upid = $this->create('upload',array( + 'userid'=>$userid, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + #分块上传到本地服务器 + $arrUpload = tsUploadLocal($files,$upid,'upload',$uptype); + + if($arrUpload['size']){ + + $this->update('upload',array( + 'upid'=>$upid, + ),array( + 'fileurl'=>$arrUpload['url'], + 'filename'=>$arrUpload['name'], + 'filesize'=>$arrUpload['size'], + 'filetype'=>$arrUpload['type'], + )); + + if($arrUpload['size']<$upsize || $upsize==''){ + + $arrUp = $this->findAll('upload',array( + 'userid'=>$userid, + ),'upid asc'); + + if(count($arrUp)==$upcount || ($arrUp && $upcount=='')){ + + return $arrUp; + + }else{ + + return 1; + + } + + }else{ + + return 1; + + } + + }else{ + + return 0; + + } + + } + + /** + * 合并上传文件 + * + * @param [type] $userid + * @param [type] $projectid + * @param [type] $dir + * @param array $arrUp + * @return void + */ + public function mergeUpload($projectid,$dir,$arrUp=array()){ + + $path = getDirPath($projectid); + $dest_dir = 'uploadfile/' . $dir . '/' . $path; + createFolders($dest_dir); + $name = $projectid . '.' . $arrUp[0]['filetype']; + $dest = $dest_dir . '/' . $name; + + #删除原文件 + unlink($dest); + + $fp = fopen($dest, "ab"); + + $filesize = 0; + + foreach($arrUp as $key=>$item){ + + $upfile = 'uploadfile/upload/'.$item['fileurl']; + $handle = fopen($upfile,"rb"); + fwrite($fp, fread($handle,$item['filesize'])); + fclose($handle); + unset($handle); + unlink($upfile);//合并完毕的文件就删除 + + $filesize = $item['filesize']; + $filesize++; + + #删除ts_upload + $this->delete('upload',array( + 'upid'=>$item['upid'], + )); + + } + + return array( + 'name' => $arrUp[0]['filename'], + 'path' => $path, + 'url' => $path . '/' . $name, + 'type' => $arrUp[0]['filetype'], + 'size' => $filesize, + ); + + } + + /** + * 删除用户分段上传的文件ts_upload + * + * @param [type] $userid + * @return void + */ + public function delUpload($userid){ + $arrUp = $this->findAll('upload',array( + 'userid'=>$userid, + ),'upid asc'); + foreach($arrUp as $key=>$item){ + $upfile = 'uploadfile/upload/'.$item['fileurl']; + unlink($upfile); + } + + #删除ts_upload + $this->delete('upload',array( + 'userid'=>$userid, + )); + + } + + /** + * 更新APP用户组权限 + * + * 权限参数说明,app,action必须,其他参数可选 + * app-action-ts + * app-action-mg-ts 当action=admin + * app-action-api-ts 当action=api + * + */ + public function upAppPermissions($ugid,$app,array $arrOption){ + foreach($arrOption as $key=>$item){ + $status = $item; + if($ugid==1) $status=1; + $arrKey = explode('_',$key); + $key_app = $arrKey[0]; + $key_ac = $arrKey[1]; + $key_mg = ''; + $key_api = ''; + $key_ts = ''; + + if($key_ac=='admin'){ + $key_mg = $arrKey[2]; + $key_ts = $arrKey[3]; + }elseif($key_ac=='api'){ + $key_api = $arrKey[2]; + $key_ts = $arrKey[3]; + }else{ + $key_ts = $arrKey[2]; + } + if($key_ts==null) $key_ts=''; + + $this->replace('permissions',array( + 'ugid'=>$ugid, + 'app'=>$key_app, + 'action'=>$key_ac, + 'mg'=>$key_mg, + 'api'=>$key_api, + 'ts'=>$key_ts, + ),array( + 'ugid'=>$ugid, + 'app'=>$key_app, + 'action'=>$key_ac, + 'mg'=>$key_mg, + 'api'=>$key_api, + 'ts'=>$key_ts, + 'status'=>$status, + )); + + } + + //存储permissions到本地文件 + $arrPermissions = $this->findAll('permissions',array( + 'app'=>$app, + )); + foreach($arrPermissions as $key=>$item){ + + $option = $item['app'].'_'.$item['action']; + if($item['mg']) $option .= '_'.$item['mg']; + if($item['api']) $option .= '_'.$item['api']; + if($item['ts']) $option .= '_'.$item['ts']; + + $arrData[$item['ugid']][$option] = $item['status']; + + } + + fileWrite($app.'_permissions.php','data',$arrData); + $GLOBALS['tsMySqlCache']->set($app.'_permissions',$arrData); + + } + + +} \ No newline at end of file diff --git a/app/pubs/config.php b/app/pubs/config.php new file mode 100644 index 0000000..af06131 --- /dev/null +++ b/app/pubs/config.php @@ -0,0 +1,6 @@ + +
    公共管理
    + + +
    \ No newline at end of file diff --git a/app/pubs/html/admin/options.html b/app/pubs/html/admin/options.html new file mode 100644 index 0000000..0ed5048 --- /dev/null +++ b/app/pubs/html/admin/options.html @@ -0,0 +1,25 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + +
    + + + + + + + + + + +
    手机验证码发送间隔时间: 分钟
    Email验证码发送间隔时间: 分钟
    + +
    +
    + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/pubs/html/admin/plugin_menu.html b/app/pubs/html/admin/plugin_menu.html new file mode 100644 index 0000000..af40968 --- /dev/null +++ b/app/pubs/html/admin/plugin_menu.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/app/pubs/html/home.html b/app/pubs/html/home.html new file mode 100644 index 0000000..5f83cfb --- /dev/null +++ b/app/pubs/html/home.html @@ -0,0 +1,228 @@ + + + + + + + + + + + {$GLOBALS['TS_SITE']['site_title']} - {$title} + + + + + + + + + + + + + + + + + + + + + + + {if $GLOBALS['TS_CF']['urllock']} + + {/if} + + + + + + + + +
    +
    +
    + + + +

    {$GLOBALS['TS_SITE']['site_title']}

    +
    {$title}
    + + + + +
    +
    + + + + + + + + + + + +
    +
    +
    + + + +
    + +
    + + + + + + + + +{php doAction('pub_footer')} + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/pubs/js/admin.js b/app/pubs/js/admin.js new file mode 100644 index 0000000..e69de29 diff --git a/app/pubs/js/extend.func.js b/app/pubs/js/extend.func.js new file mode 100644 index 0000000..e69de29 diff --git a/app/pubs/skins/default/style.css b/app/pubs/skins/default/style.css new file mode 100644 index 0000000..e69de29 diff --git a/app/search/about.php b/app/search/about.php new file mode 100644 index 0000000..424f05d --- /dev/null +++ b/app/search/about.php @@ -0,0 +1,17 @@ + '搜索', + 'version' => '1.2', + 'desc' => '搜索APP', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '1', + 'ismy'=>'0', +); \ No newline at end of file diff --git a/app/search/action/admin.php b/app/search/action/admin.php new file mode 100644 index 0000000..3f99995 --- /dev/null +++ b/app/search/action/admin.php @@ -0,0 +1,9 @@ +'小组', + 'topic'=>'帖子', + 'user'=>'用户', + 'article'=>'文章', + ); + + + $strOption = getAppOptions('search'); + + include template("admin/options"); + + break; + + case "do": + + $arrOption = $_POST['option']; + + #更新app配置选项 + upAppOptions('search',$arrOption); + + #更新app导航和我的导航 + upAppNav('search',$arrOption['appname']); + + qiMsg('修改成功!'); + + break; +} \ No newline at end of file diff --git a/app/search/action/common.php b/app/search/action/common.php new file mode 100644 index 0000000..291f198 --- /dev/null +++ b/app/search/action/common.php @@ -0,0 +1,4 @@ +isLogin(); \ No newline at end of file diff --git a/app/search/action/index.php b/app/search/action/index.php new file mode 100644 index 0000000..d219dec --- /dev/null +++ b/app/search/action/index.php @@ -0,0 +1,30 @@ +'group','kw'=>$kw,'page'=>'')); + $lstart = $page*10-10; + + $arrGroup = $db->fetch_all_assoc("select * from ".dbprefix."group WHERE `groupname` like '%$kw%' order by groupid desc limit $lstart,10"); + + $group_num = $db->once_num_rows("select * from ".dbprefix."group WHERE groupname like '%$kw%'"); + + $pageUrl = pagination($group_num, 10, $page, $url); + + $title = $kw.' - 小组搜索'; + + include template("s_group"); + break; + //帖子 + case "topic": + + $page = tsIntval($_GET['page'],1); + $url = tsUrl('search','s',array('ts'=>'topic','kw'=>$kw,'page'=>'')); + $lstart = $page*10-10; + + $arrTopic = $db->fetch_all_assoc("select * from ".dbprefix."topic WHERE `title` like '%$kw%' order by topicid desc limit $lstart,10"); + + $topic_num = $db->once_num_rows("select * from ".dbprefix."topic WHERE title like '%$kw%'"); + + $pageUrl = pagination($topic_num, 10, $page, $url); + + $title = $kw.' - 帖子搜索'; + include template("s_topic"); + break; + + //用户 + case "user": + + $page = tsIntval($_GET['page'],1); + $url = tsUrl('search','s',array('ts'=>'user','kw'=>$kw,'page'=>'')); + $lstart = $page*10-10; + + $arrUser = $db->fetch_all_assoc("select * from ".dbprefix."user_info WHERE `username` like '%$kw%' order by userid desc limit $lstart,10"); + + $user_num = $db->once_num_rows("select * from ".dbprefix."user_info WHERE `username` like '%$kw%'"); + + $pageUrl = pagination($user_num, 10, $page, $url); + + $title = $kw.' - 用户搜索'; + include template("s_user"); + + break; + + case "article": + + $page = tsIntval($_GET['page'],1); + $url = tsUrl('search','s',array('ts'=>'article','kw'=>$kw,'page'=>'')); + $lstart = $page*10-10; + + $arrArticle = $db->fetch_all_assoc("select * from ".dbprefix."article WHERE `title` like '%$kw%' and `isaudit`='0' order by addtime desc limit $lstart,10"); + + $articleNum = $db->once_num_rows("select * from ".dbprefix."article WHERE `title` like '%$kw%' and `isaudit`='0'"); + + $pageUrl = pagination($articleNum, 10, $page, $url); + + $title = $kw.' - 文章搜索'; + include template("s_article"); + + break; +} \ No newline at end of file diff --git a/app/search/action/xs.php b/app/search/action/xs.php new file mode 100644 index 0000000..8eb3563 --- /dev/null +++ b/app/search/action/xs.php @@ -0,0 +1,4 @@ +search; // 搜索对象来自 XS 的属性 \ No newline at end of file diff --git a/app/search/class.search.php b/app/search/class.search.php new file mode 100644 index 0000000..c0c3024 --- /dev/null +++ b/app/search/class.search.php @@ -0,0 +1,18 @@ + +
    搜索管理
    + + +
    \ No newline at end of file diff --git a/app/search/html/admin/options.html b/app/search/html/admin/options.html new file mode 100644 index 0000000..a2858d2 --- /dev/null +++ b/app/search/html/admin/options.html @@ -0,0 +1,40 @@ +{php include pubTemplate("header_admin")} + +
    + +{php include template("admin/menu");} + +
    + + + + + + + + + + {loop $arrSearch $key $item} + + {/loop} + + + + + +
    APP名称:
    APP介绍:
    APP关键词:
    默认搜索: + + + +
    {$item}搜索:不开启 开启
    + +
    +
    + +
    + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/search/html/index.html b/app/search/html/index.html new file mode 100644 index 0000000..8dde293 --- /dev/null +++ b/app/search/html/index.html @@ -0,0 +1,73 @@ +{php include pubTemplate("header")} + +
    + + + + +
    +
    +
    + + +
    +
    + + +
    + 搜索: + {if $TS_APP['group']==1} | 小组{/if} + {if $TS_APP['topic']==1} | 帖子{/if} + {if $TS_APP['user']==1} | 用户{/if} + {if $TS_APP['article']==1} | 文章{/if} +
    + + + +
    +
    +
    + + + + {if $ts=='group'} + + {elseif $ts=='topic'} + + {elseif $ts=='user'} + + {elseif $ts=='article'} + + {else} + {/if} + + + +
    + +
    +
    +
    +
    + + +
    标题模糊搜索
    + + +
    +
    + + +
    +
    +
    + + + + + + +
    + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/search/html/s_all.html b/app/search/html/s_all.html new file mode 100644 index 0000000..5ac6413 --- /dev/null +++ b/app/search/html/s_all.html @@ -0,0 +1,60 @@ +{php include pubTemplate("header")} + +
    + + +
    +
    +{template s_menu} + +
    获得约 {$all_num} 条结果
    + +{loop $arrGroup $key $item} +
    +
    + +
    创建于 {php echo date('Y-m-d',$item[addtime])}   {$item[count_user]} 人
    +

    {php echo tsCutContent($item[groupdesc])}

    +
    +
    +{/loop} + +{loop $arrTopic $key $item} +
    +
    + +
    发表于 {php echo date('Y-m-d',$item[addtime])}   {$item[count_comment]} 回复
    +

    +
    +
    +{/loop} + +{loop $arrUser $key $item} +
    +
    + +
    {php echo date('Y-m-d',$item[addtime])} 加入  {$item[count_followed]} 人关注
    +

    {$item[signed]}

    +
    +
    +{/loop} + + +{loop $arrArticle $key $item} +
    +
    + +
    发表于 {$item[addtime]}   {$item[count_comment]} 回复
    +

    +
    +
    +{/loop} + + +
    {$pageUrl}
    +
    +
    + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/search/html/s_article.html b/app/search/html/s_article.html new file mode 100644 index 0000000..7b6396e --- /dev/null +++ b/app/search/html/s_article.html @@ -0,0 +1,29 @@ +{php include pubTemplate("header")} + +
    + +
    +
    +{template s_menu} + +
    获得约 {$articleNum} 条结果
    + +{loop $arrArticle $key $item} +
    + +
    + +
    发表于 {$item[addtime]}   {$item[count_comment]} 回复
    +

    +
    +
    +{/loop} + + +
    {$pageUrl}
    +
    +
    + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/search/html/s_group.html b/app/search/html/s_group.html new file mode 100644 index 0000000..ab4a434 --- /dev/null +++ b/app/search/html/s_group.html @@ -0,0 +1,26 @@ +{php include pubTemplate("header")} + +
    + +
    +
    +{template s_menu} +
    获得约 {$group_num} 条结果
    + +{loop $arrGroup $key $item} +
    +
    + +
    创建于 {php echo date('Y-m-d',$item[addtime])}   {$item[count_user]} 人
    +

    {php echo tsCutContent($item[groupdesc])}

    +
    +
    +{/loop} + +
    {$pageUrl}
    +
    +
    + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/search/html/s_menu.html b/app/search/html/s_menu.html new file mode 100644 index 0000000..c33762c --- /dev/null +++ b/app/search/html/s_menu.html @@ -0,0 +1,52 @@ +
    +
    +
    + + + +
    + 搜索: + {if $TS_APP['group']==1} | 小组 {/if} + {if $TS_APP['topic']==1} | 帖子 {/if} + {if $TS_APP['user']==1} | 用户 {/if} + {if $TS_APP['article']==1} | 文章 {/if} +
    + +
    +
    + +
    + + + + + {if $ts=='group'} + + {elseif $ts=='topic'} + + {elseif $ts=='user'} + + {elseif $ts=='article'} + + {else} + {/if} + + + + +
    + +
    + +
    + +
    +
    + + + +
    +
    +
    + +
    diff --git a/app/search/html/s_topic.html b/app/search/html/s_topic.html new file mode 100644 index 0000000..e6b0ee8 --- /dev/null +++ b/app/search/html/s_topic.html @@ -0,0 +1,30 @@ +{php include pubTemplate("header")} + +
    + +
    +
    +{template s_menu} + +
    获得约 {$topic_num} 条结果
    + +{loop $arrTopic $key $item} +
    +
    +
    +
    + +
    发表于 {php echo date('Y-m-d',$item[addtime])}   {$item[count_comment]} 回复
    +

    +
    +
    +{/loop} + + +
    {$pageUrl}
    +
    +
    + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/search/html/s_user.html b/app/search/html/s_user.html new file mode 100644 index 0000000..03d25ef --- /dev/null +++ b/app/search/html/s_user.html @@ -0,0 +1,26 @@ +{php include pubTemplate("header")} + +
    + +
    +
    +{template s_menu} +
    获得约 {$user_num} 条结果
    + +{loop $arrUser $key $item} +
    + +
    + +
    {php echo date('Y-m-d',$item[addtime])} 加入  {$item[count_followed]} 人关注
    +

    {$item[signed]}

    +
    +
    +{/loop} +
    {$pageUrl}
    +
    +
    + +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/search/js/extend.func.js b/app/search/js/extend.func.js new file mode 100644 index 0000000..e69de29 diff --git a/app/search/skin/style.css b/app/search/skin/style.css new file mode 100644 index 0000000..ff08f73 --- /dev/null +++ b/app/search/skin/style.css @@ -0,0 +1,78 @@ +.s_index { + text-align: center; + margin-top: 50px; +} + +.s_menu { + font-size: 14px; + padding-bottom: 20px; +} + +.s_input { + font-size: 14px; + width: 300px; + padding: 5px; +} + +.s_button { + font-size: 14px; + padding: 5px 10px; +} + +.s_hotkey { + padding: 10px; +} + +.s_select { + font-weight: bold; +} + +.s_top { + padding: 5px; + font-size: 14px; +}/*搜索结果*/.result { + padding: 20px 0; + border-bottom: 1px dashed #CCCCCC; + position: relative; + width: 100%; + } + +.result .pic { + float: left; +} + +.result .content { + display: table-cell; +} + +.result .content h3 { + background: none repeat scroll 0 0 transparent; + float: left; + height: auto; + margin: 0 0 5px; + font-weight: normal; +} + +.result .rating-info, .result .info { + color: #999999; + position: absolute; + right: 10px; +} + +.result .content p { + clear: both; + color: #666666; + margin: 0 0 5px; +}/*搜索帖子*/.s_topic { + padding: 10px 0; + } + +.s_topic ul { +} + +.s_topic ul li { + border-bottom: dashed 1px #DDDDDD; + overflow: hidden; + padding: 10px 5px; + font-size: 14px; +} \ No newline at end of file diff --git a/app/search/skins/default/style.css b/app/search/skins/default/style.css new file mode 100644 index 0000000..fa20e68 --- /dev/null +++ b/app/search/skins/default/style.css @@ -0,0 +1,78 @@ +.s_index { + text-align: center; + margin-top: 50px; +} + +.s_menu { + font-size: 14px; + padding: 20px; +} + +.s_input { + font-size: 14px; + width: 300px; + padding: 5px; +} + +.s_button { + font-size: 14px; + padding: 5px 10px; +} + +.s_hotkey { + padding: 10px; +} + +.s_select { + font-weight: bold; +} + +.s_top { + padding: 5px; + font-size: 14px; +}/*搜索结果*/.result { + padding: 20px 0; + border-bottom: 1px dashed #CCCCCC; + position: relative; + width: 100%; + } + +.result .pic { + float: left; +} + +.result .content { + display: table-cell; +} + +.result .content h3 { + background: none repeat scroll 0 0 transparent; + float: left; + height: auto; + margin: 0 0 5px; + font-weight: normal; +} + +.result .rating-info, .result .info { + color: #999999; + position: absolute; + right: 10px; +} + +.result .content p { + clear: both; + color: #666666; + margin: 0 0 5px; +}/*搜索帖子*/.s_topic { + padding: 10px 0; + } + +.s_topic ul { +} + +.s_topic ul li { + border-bottom: dashed 1px #DDDDDD; + overflow: hidden; + padding: 10px 5px; + font-size: 14px; +} \ No newline at end of file diff --git a/app/shop/about.php b/app/shop/about.php new file mode 100644 index 0000000..0d853b0 --- /dev/null +++ b/app/shop/about.php @@ -0,0 +1 @@ + '商店', 'version' => '1.0', 'desc' => '商店', 'url' => 'https://lmve.net', 'email' => '1337087466@qq.com', 'author' => '无闻风', 'author_url' => 'https://lmve.net', 'isoption' => '1', 'isinstall' => '1', 'issql' => '1', 'issystem' => '1', 'isappnav' => '1', 'ismy'=>'1', ); \ No newline at end of file diff --git a/app/shop/action/add.php b/app/shop/action/add.php new file mode 100644 index 0000000..e304380 --- /dev/null +++ b/app/shop/action/add.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/app/shop/action/buy.php b/app/shop/action/buy.php new file mode 100644 index 0000000..d86052c --- /dev/null +++ b/app/shop/action/buy.php @@ -0,0 +1,105 @@ +isLogin(); +$shopid = intval ( $_POST ['shopid'] ); +$much=intval ( $_POST ['much'] ); +$strshop = $new ['shop']->find ( 'shop', array ( + 'shopid' => $shopid +) );/* +if ($strshop == '') { + header ( "HTTP/1.1 404 Not Found" ); + header ( "Status: 404 Not Found" ); + $title = '404'; + include pubTemplate ( "404" ); + exit (); +}*/ +//卖家 +$arrshopuser = aac ( 'user' )->getSimpleUser ( $strshop ['userid'] ); + +// 是否审核 +if ($strshop ['isaudit'] == 1 && $TS_USER['isadmin']==0 && $TS_USER['userid']!=$strshop['userid']) { + tsNotice ( '内容审核中...' ); +} + +switch($_POST ['ts'] ) +{ + case "do": + $address=h($_POST['address']); + + if($strshop['type']==1)//注册类 + { + if($strshop['pay_type']==1)//积分支付 + { + $preg = '/[^|\s]([\s\S])[$|\s]/'; + $arr = explode("\n", $address); + $arr = array_filter($arr); // 删除空元素 + + $a=count($arr); //获取码数量 + + if($a!=$much) + { + tsNotice('你的购买数量是:'.$much.'但输入了:'.$a.'个申请'); + + } + + + if($much>$strshop['stock']) + { + tsNotice('库存不足!!'); + + } + + + + + $need_pay=$much*$strshop['pay']; + if(aac('user')->delScore($userid,"BUY".$strshop['title']."X".$much,$need_pay)) + { + $reorder=''; + for($b=0;$b<$a;$b++) + { + preg_replace('# #','',$arr[$b]); + + $reorder=$reorder.'
    for:'.$arr[$b].'
    Key:'.md5($arr[$b].$strshop['note']).'
    '; + + } + $orderid = $new['shop']->create('shop_order',array( + 'userid'=>$userid, + 'selluserid'=>$strshop['userid'], + 'shopid'=>$strshop['shopid'], + 'title'=>$strshop['title'], + 'content'=>$strshop['content'], + 'type'=>$strshop['type'], + 'pay' => $strshop['pay'], + 'pay_type' => $strshop['pay_type'], + 'much'=> $much, + 'address' => $address, + 'reorder'=>$reorder, + 'state' => 1, + 'addtime'=>date('Y-m-d H:i:s') + )); + $new['shop']->update ( 'shop', array ( + 'shopid' => $strshop['shopid'] + ), array ( + 'stock' => $strshop['stock']-$much + )); + aac('user')->addScore($strshop['userid'],"订单:".$orderid."收益",$need_pay,1); + + }else + { + tsNotice('积分不足!'); + } + + tsNotice('成功提交','查看订单',tsUrl('shop','order',array('id'=>$orderid))); + } + + } + + back; + case "cheack": + include template ( "buy" ); + back; + + +} diff --git a/app/shop/action/comment.php b/app/shop/action/comment.php new file mode 100644 index 0000000..2f7968e --- /dev/null +++ b/app/shop/action/comment.php @@ -0,0 +1,92 @@ +isLogin($js,$userkey); +switch($ts){ + + case "do": + + $authcode = strtolower($_POST['authcode']); + + if ($TS_SITE ['isauthcode']) { + if ($authcode != $_SESSION ['verify']) { + getJson ( "验证码输入有误,请重新输入!" ,$js,0); + } + } + + $shopid = intval($_POST['shopid']); + $content = tsClean($_POST['content'],$js); + $content2 = emptyText($_POST['content']);//测试空内容 + $ispublic = intval($_POST['ispublic']); + + //过滤内容开始 + if($TS_USER['isadmin']==0){ + aac('system')->antiWord($content,$js); + } + //过滤内容结束 + + if($content2==''){ + getJson('没有任何内容是不允许你通过滴^_^',$js); + }else{ + $commentid = $new['shop']->create('shop_comment',array( + 'shopid' => $shopid, + 'userid' => $userid, + 'content' => $content, + 'addtime'=> time(), + )); + + + + //发送系统消息(通知楼主有人回复他的帖子啦) + $strshop = $new['shop']->find('shop',array( + 'shopid'=>$shopid, + )); + + if($strshop['userid'] != $TS_USER['userid']){ + + $msg_userid = '0'; + $msg_touserid = $strshop['userid']; + $msg_content = '你的商品:《'.$strshop['shopname'].'》新增一条评论,快去看看给个回复吧^_^ '; + $msg_tourl = tsUrl('shop','show',array('id'=>$shopid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + + } + + header("Location: ".tsUrl('shop','show',array('id'=>$shopid))); + + } + + break; + + //删除评论 + case "delete": + + $commentid = intval($_GET['commentid']); + + $strComment = $new['shop']->find('shop_comment',array( + 'commentid'=>$commentid, + )); + + $strshop = $new['shop']->find('shop',array( + 'shopid'=>$strComment['shopid'], + )); + + + + if($strshop['userid']==$userid || $TS_USER['isadmin']==1 || $strComment['userid']==$userid){ + + $new['shop']->delete('shop_comment',array( + 'commentid'=>$commentid, + )); + + + + + + } + + //跳转回到帖子页 + header("Location: ".tsUrl('shop','show',array('id'=>$strComment['shopid']))); + + break; +} \ No newline at end of file diff --git a/app/shop/action/do.php b/app/shop/action/do.php new file mode 100644 index 0000000..926c5c5 --- /dev/null +++ b/app/shop/action/do.php @@ -0,0 +1,70 @@ + + + isLogin(); + +//判断发布者状态 +if(aac('user')->isPublisher()==false) tsNotice('你还不能发布内容,检查邮箱是否认证。','->点击认证<-',tsUrl('user','verify')); + +//echo print_r($_POST); + + +$title = trim($_POST['title']); +$type=intval($_POST['type']); +$comkey = trim($_POST['comkey']); +$content = tsClean($_POST['content']); +$pay_type=intval($_POST['pay_type']); +$pay=intval($_POST['pay']); +$stock=intval($_POST['stock']); + + if (intval($TS_USER['isadmin']) == 0) { + // 过滤内容开始 + aac('system') -> antiWord($title); + aac('system') -> antiWord($content); + // 过滤内容结束 + } + + if ($title == '' || $type == '' || $pay_type == '' || $pay == '') + { + tsNotice("Have null"); + } +$isaudit = 0; + + $shopid = $new['shop'] -> create('shop', array( + 'userid' => $userid, + 'locationid' => aac('user') -> getLocationId($userid), + 'type' => $type, + 'note' => $comkey, + 'pay' => $pay, + 'pay_type' => $pay_type, + 'stock' => $stock, + 'title' => $title, + 'content' => $content, + 'isaudit' => $isaudit, + 'addtime' => date('Y-m-d H:i:s') + )); + + // 上传图片开始 + $arrUpload = tsUpload($_FILES['photo'], $shopid, 'shop', array('jpg', 'gif', 'png', 'jpeg')); + if ($arrUpload) { + $new['shop'] -> update('shop', array( + 'shopid' => $shopid + ), array( + 'path' => $arrUpload['path'], + 'photo' => $arrUpload['url'] + )); + + + #生成不同尺寸的图片 + //tsXimg($arrUpload['url'],'shop',320,180,$arrUpload['path'],'1'); + //tsXimg($arrUpload['url'],'shop',640,'',$arrUpload['path']); + + + } + // 上传图片结束 +header("Location: " . tsUrl('shop', 'show', array('id' => $shopid))); +?> \ No newline at end of file diff --git a/app/shop/action/edit.php b/app/shop/action/edit.php new file mode 100644 index 0000000..bfd3751 --- /dev/null +++ b/app/shop/action/edit.php @@ -0,0 +1,24 @@ + + +isLogin(); + +$shopid = intval ( $_GET ['shopid'] ); + +$stredit = $new ['shop']->find ( 'shop', array ('shopid' => $shopid ) ); +$stredit['content'] = tsDecode($stredit['content']); +if($stredit=='') +{ + + tsNotice('NO!'); +} +if($userid!=$stredit['userid']) +{ + tsNotice('NO'); + +} +include template ( "edit" ); + +?> \ No newline at end of file diff --git a/app/shop/action/editdo.php b/app/shop/action/editdo.php new file mode 100644 index 0000000..57dfb2f --- /dev/null +++ b/app/shop/action/editdo.php @@ -0,0 +1,62 @@ +isLogin(); + +$shopid = intval ( $_POST ['shopid'] ); + +$stredit = $new ['shop']->find ( 'shop', array ('shopid' => $shopid ) ); +$stredit['content'] = tsDecode($stredit['content']); +if($stredit=='') +{ + + tsNotice('NO!'); +} +if($userid!=$stredit['userid']) +{ + tsNotice('NO'); + +} + + +$title = trim($_POST['title']); +$type=intval($_POST['type']); +$comkey = trim($_POST['comkey']); +$content = tsClean($_POST['content']); +$pay_type=intval($_POST['pay_type']); +$pay=intval($_POST['pay']); +$stock=intval($_POST['stock']); + +if($_FILES['photo']!='') +{ + // 上传图片开始 + $arrUpload = tsUpload($_FILES['photo'], $shopid, 'shop', array('jpg', 'gif', 'png', 'jpeg')); + if ($arrUpload) { + $new['shop'] -> update('shop', array( + 'shopid' => $shopid + ), array( + 'path' => $arrUpload['path'], + 'photo' => $arrUpload['url'] + )); + + + #生成不同尺寸的图片 + //tsXimg($arrUpload['url'],'shop',320,180,$arrUpload['path'],'1'); + //tsXimg($arrUpload['url'],'shop',640,'',$arrUpload['path']); + + + } + // 上传图片结束 +} +$new['shop'] -> update('shop', array('shopid' => $shopid), array( + 'type' => $type, + 'note' => $comkey, + 'pay' => $pay, + 'pay_type' => $pay_type, + 'stock' => $stock, + 'title' => $title, + 'content' => $content, + 'addtime' => date('Y-m-d H:i:s') + )); +header("Location: " . tsUrl('shop', 'show', array('id' => $shopid))); +?> \ No newline at end of file diff --git a/app/shop/action/index.php b/app/shop/action/index.php new file mode 100644 index 0000000..229eef7 --- /dev/null +++ b/app/shop/action/index.php @@ -0,0 +1,19 @@ +'')); + +$lstart = $page*30-30; + +$arrAlbum = $new['shop']->findAll('shop',"`isaudit`=0",'shopid desc',null,$lstart.',30'); + + + +$albumNum = $new['shop']->findCount('shop'); + +$pageUrl = pagination($albumNum, 30, $page, $url); + +include template ( "index" ); diff --git a/app/shop/action/myorder.php b/app/shop/action/myorder.php new file mode 100644 index 0000000..c2f7d85 --- /dev/null +++ b/app/shop/action/myorder.php @@ -0,0 +1,25 @@ +isLogin(); + +$page = isset($_GET['page']) ? intval($_GET['page']) : '1'; + +$url = tsUrl('shop','myorder',array('page'=>'')); + +$lstart = $page*30-30; + +$strmyoder = $new['shop']->findAll('shop_order',"`userid`=".$userid,'orderid desc',null,$lstart.',30'); + +foreach($strmyoder as $key=>$item){ + $strmyoder[$key]['needpay'] = $strmyoder[$key]['pay']*$strmyoder[$key]['much']; + //卖家 + $selluser = aac ( 'user' )->getSimpleUser ( $strmyoder [$key]['selluserid'] ); + $strmyoder[$key]['sellusername']=$selluser['username']; +} + +$albumNum = $new['shop']->findCount('shop_order'); + +$pageUrl = pagination($albumNum, 30, $page, $url); + +include template ( "myorder" ); +?> \ No newline at end of file diff --git a/app/shop/action/order.php b/app/shop/action/order.php new file mode 100644 index 0000000..5cb7cd3 --- /dev/null +++ b/app/shop/action/order.php @@ -0,0 +1,34 @@ +isLogin(); + +$oderid = intval ( $_GET ['id'] ); + +$stroder = $new ['shop']->find ( 'shop_order', array ('orderid' => $oderid ) ); + +if($stroder=='') +{ + + tsNotice('NO!'); +} +if($userid!=$stroder['userid']&&$userid!=$stroder['selluserid']) +{ + tsNotice('NO'); + +} + +$needpay=$stroder['much']*$stroder['pay']; +$stroder['content'] = tsDecode($stroder['content']); + +$buyuser=aac ( 'user' )->getSimpleUser ( $stroder['userid'] ); +$selluser=aac ( 'user' )->getSimpleUser ( $stroder['selluserid'] ); + +//print_r($_GET); + +//$stroder['address'] = htmlentities($stroder['address'], ENT_NOQUOTES, "utf-8"); + +include template ( "order" ); + + + +?> \ No newline at end of file diff --git a/app/shop/action/sellout.php b/app/shop/action/sellout.php new file mode 100644 index 0000000..fcd0867 --- /dev/null +++ b/app/shop/action/sellout.php @@ -0,0 +1,25 @@ +isLogin(); + +$page = isset($_GET['page']) ? intval($_GET['page']) : '1'; + +$url = tsUrl('shop','myorder',array('page'=>'')); + +$lstart = $page*30-30; + +$strmyoder = $new['shop']->findAll('shop_order',"`selluserid`=".$userid,'orderid desc',null,$lstart.',30'); + +foreach($strmyoder as $key=>$item){ + $strmyoder[$key]['needpay'] = $strmyoder[$key]['pay']*$strmyoder[$key]['much']; + //买家 + $selluser = aac ( 'user' )->getSimpleUser ( $strmyoder [$key]['userid'] ); + $strmyoder[$key]['buyusername']=$selluser['username']; +} + +$albumNum = $new['shop']->findCount('shop_order'); + +$pageUrl = pagination($albumNum, 30, $page, $url); + +include template ( "sellout" ); +?> \ No newline at end of file diff --git a/app/shop/action/show.php b/app/shop/action/show.php new file mode 100644 index 0000000..8f1f83e --- /dev/null +++ b/app/shop/action/show.php @@ -0,0 +1,70 @@ +find ( 'shop', array ( + 'shopid' => $shopid +) ); + + +if ($strshop == '') { + header ( "HTTP/1.1 404 Not Found" ); + header ( "Status: 404 Not Found" ); + $title = '404'; + include pubTemplate ( "404" ); + exit (); +} + +//卖家 +$arrshopuser = aac ( 'user' )->getSimpleUser ( $strshop ['userid'] ); + +//是否关注 +if($TS_USER['userid'] != '' && $TS_USER['userid'] != $arrshopuser['userid']){ + $userid=$arrshopuser['userid']; + $followNum = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='".$TS_USER['userid']."' and userid_follow='$userid'"); + if($followNum > '0'){ + $arrshopuser['isfollow'] = true; + }else{ + $arrshopuser['isfollow'] = false; + } +}else{ + $arrshopuser['isfollow'] = false; +} + +// 是否审核 +if ($strshop ['isaudit'] == 1 && $TS_USER['isadmin']==0 && $TS_USER['userid']!=$strshop['userid']) { + tsNotice ( '内容审核中...' ); +} + +$strshop['content'] = tsDecode($strshop['content']); + + +// 获取评论 +$page = isset ( $_GET ['page'] ) ? intval ( $_GET ['page'] ) : 1; +$url = tsUrl ( 'shop', 'show', array ( + 'id' => $shopid, + 'page' => '' +) ); +$lstart = $page * 10 - 10; + +$arrComments = $new ['shop']->findAll ( 'shop_comment', array ( + 'shopid' => $shopid +), 'addtime desc', null, $lstart . ',10' ); + +foreach ( $arrComments as $key => $item ) { + $arrComment [] = $item; + $arrComment[$key]['content'] = tsDecode($item['content']); + $arrComment [$key] ['user'] = aac ( 'user' )->getSimpleUser ( $item ['userid'] ); +} + +$commentNum = $new ['shop']->findCount ( 'shop_comment', array ( + 'shopid' => $shopid +) ); + +$pageUrl = pagination ( $commentNum, 10, $page, $url ); + +// 标签 +//$strshop ['tags'] = aac ( 'tag' )->getObjTagByObjid ( 'shop', 'shopid', $strshop ['shopid'] ); +$title = $strshop['title']; +include template ( "show" ); \ No newline at end of file diff --git a/app/shop/class.shop.php b/app/shop/class.shop.php new file mode 100644 index 0000000..41210ee --- /dev/null +++ b/app/shop/class.shop.php @@ -0,0 +1,9 @@ + + + +
    +
    + + +
    +
    +
    + + + +
    + +
    + + +
    + +
    + + +
    + (支持jpg,png格式;大小640*400px) +
    + +
    +
    + + + + +
    + +
    + + +
    + +
    + +
    +
    + +
    +
    +
    + + + + +
    +
    + + +
    +
    + + +
    + + {if $TS_SITE['isauthcode']} +
    + + +
    + + 点击刷新验证码 + +
    + + +
    + {/if} + + + + + + + + + +

    + +
    + + + + +
    +
    +
    + + + +
    +
    + + + + +{php doAction('tseditor')} +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/shop/html/buy.html b/app/shop/html/buy.html new file mode 100644 index 0000000..32dc048 --- /dev/null +++ b/app/shop/html/buy.html @@ -0,0 +1,135 @@ +{php include pubTemplate("header")} + +
    + + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + +
    商品价格数量
    + {$strshop[title]} + {$strshop[title]} + {$strshop[pay]}{if $strshop[pay_type] == '1'}积分{/if} + + - + + +
    + + + +
    应付总额:

    {$strshop[pay]}{if $strshop[pay_type] == '1'}积分{/if}

    + + + + + + + + + + + + + + + + + + + +
    收货信息
    +

    地址

    + +
    + + + +
    + +
    +
    + + + +
    + + +
    +
    + +{php include pubTemplate("footer")} + + + \ No newline at end of file diff --git a/app/shop/html/buyend.html b/app/shop/html/buyend.html new file mode 100644 index 0000000..4e7a3d7 --- /dev/null +++ b/app/shop/html/buyend.html @@ -0,0 +1,3 @@ +{php include pubTemplate("header")} + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/shop/html/edit.html b/app/shop/html/edit.html new file mode 100644 index 0000000..2cb29cc --- /dev/null +++ b/app/shop/html/edit.html @@ -0,0 +1,125 @@ +{php include pubTemplate("header")} + +
    + + +
    +
    + + +
    +
    +
    + + + +
    + +
    + + +
    + +
    + +
    + +
    +
    + (支持jpg,png格式;大小640*400px) +
    + +
    +
    + + + + +
    + +
    + + +
    + +
    + +
    {$stredit[content]}
    +
    + +
    +
    +
    + + + + +
    +
    + + +
    +
    + + +
    + + {if $TS_SITE['isauthcode']} +
    + + +
    + + 点击刷新验证码 + +
    + + +
    + {/if} + + + + + + + + + +

    + +
    + + + + +
    +
    +
    + + + +
    +
    + +
    + + +{php doAction('tseditor')} +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/shop/html/index.html b/app/shop/html/index.html new file mode 100644 index 0000000..7314904 --- /dev/null +++ b/app/shop/html/index.html @@ -0,0 +1,56 @@ +{php include pubTemplate("header")} + +
    + + + + + +
    + + +
    + + +
    +
    + + +
    +{loop $arrAlbum $key $item} +
    + + {$item[title]} + + +
    +
    {$item[title]}
    +
    价格:{$item[pay]} {if $item[pay_type] == '1'}积分{/if}
    +
    库存:{$item[stock]}
    + + +
    + +
    +{/loop} +
    +
    +
    {$pageUrl}
    + +
    +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/shop/html/myorder.html b/app/shop/html/myorder.html new file mode 100644 index 0000000..b321b9f --- /dev/null +++ b/app/shop/html/myorder.html @@ -0,0 +1,76 @@ +{php include pubTemplate("header")} + + +
    + + + +
    + +
    + +
    + + + + + + + + +{loop $strmyoder $key $item} + + + + + + + + + + + +{/loop} + + + +
    订单IDTitle卖家价格数量总额订单状态日期操作
    + {$item[orderid]} + + {$item[title]} + + {$item[sellusername]} + {$item[pay]}{if $item[pay_type] == '1'}积分{/if} + {$item[much]} + + {$item[needpay]}{if $item[pay_type] == '1'}积分{/if} + + {if $item[state] == '1'}交易完成{/if} + + {$item[addtime]} + + 查看 +
    + + +
    + + +
    + +
    + + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/shop/html/order.html b/app/shop/html/order.html new file mode 100644 index 0000000..0f78570 --- /dev/null +++ b/app/shop/html/order.html @@ -0,0 +1,111 @@ +{php include pubTemplate("header")} + +
    + + +
    +
    订单ID:{$stroder[orderid]}返回
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + +
    Title价格数量总额订单状态买家卖家日期
    + {$stroder[title]} + {$stroder[pay]}{if $stroder[pay_type] == '1'}积分{/if} + {$stroder[much]} + + {$needpay}{if $stroder[pay_type] == '1'}积分{/if} + + {if $stroder[state] == '1'}交易完成{/if} + + {$buyuser[username]} + + {$selluser[username]} + + {$stroder[addtime]} +
    + + + + + + + + + + + + + + +
    收货信息
    + {$stroder[address]} +
    + + + + + + + + + + + +
    反单
    + {$stroder[reorder]} +
    + + + + + + + + + + + +
    交易快照
    + {$stroder[content]} +
    + +
    + + + +
    + + +
    +
    + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/shop/html/sellout.html b/app/shop/html/sellout.html new file mode 100644 index 0000000..b7df462 --- /dev/null +++ b/app/shop/html/sellout.html @@ -0,0 +1,72 @@ +{php include pubTemplate("header")} + + +
    + + + +
    +
    + +
    + + + + + + +{loop $strmyoder $key $item} + + + + + + + + + + + +{/loop} + + + +
    订单IDTitle买家价格数量总额订单状态日期操作
    + {$item[orderid]} + + {$item[title]} + + {$item[buyusername]} + {$item[pay]}{if $item[pay_type] == '1'}积分{/if} + {$item[much]} + + {$item[needpay]}{if $item[pay_type] == '1'}积分{/if} + + {if $item[state] == '1'}交易完成{/if} + + {$item[addtime]} + + 查看 +
    + + +
    + + +
    + +
    + + + +
    +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/shop/html/show.html b/app/shop/html/show.html new file mode 100644 index 0000000..4dbd378 --- /dev/null +++ b/app/shop/html/show.html @@ -0,0 +1,287 @@ +{php include pubTemplate("header")} +
    + + +
    +
    + +
    + +
    + + {if $strshop['tags']} +
    + {loop $strshop[tags] $key $strshop} + {$strshop[tagname]} + {/loop} +
    +
    + {/if} + + +
    +
    +
    + + +
    + +
    + +
    +

    {$strshop[title]}

    +
    价格:{$strshop[pay]} {if $strshop[pay_type] == '1'}积分{/if}
    +
    库存:{$strshop[stock]}
    +
    + {if $strshop[type]==1}{/if} + +

    + {if $strshop[stock]!=0} + + {else} + + {/if} + +
    + +
    +
    + +

    +
    + + + +
    {php doAction('group_topic_footer')}
    + + + +
    + + + + + + +
    +
    +
    卖家信息
    +
    +
    +
    + {$arrshopuser[username]} +
    +
    + {$arrshopuser[username]} + +
    +
    + +
      + +
      +
      +
      +
      + +
      + +
      商品详细
      + {if $TS_USER[isadmin]==1 || $TS_USER['userid']==$strshop['userid']} + + {/if} +
      + + + {if $TS_APP['isshopvideo']} + + {if $arrVideo} +
      + {loop $arrVideo $key $strshop} +
      + {if $strshop['siteid']==1 || $strshop['siteid']==2 || $strshop['siteid']==3} + + {if $TS_USER['userid']==$strshop['userid'] || $TS_USER['isadmin']==1} + + {/if} + {/if} +
      + {/loop} + +
      + {/if} + + {if $TS_USER['userid']==$strshop['userid'] || $TS_USER['isadmin']==1} + + {/if} + + {/if} + + {php + doAction('gobad','content_top') + } + {$strshop[content]} + + {$tpUrl} + +
      {php doAction('gobad','468') + }
      +
      + + + + + + {if $TS_USER[isadmin]==1 || $TS_USER['userid']==$strshop['userid']} + + {/if} + + +
      +
      +
      +
      买家评论
      +
      + + {if $arrComment} +
      +
        + {loop $arrComment $key $strshop} +
      • +
        + {$strshop[user][username]} +
        +
        +

        + + {$strshop[user][username]} +

        +

        {$strshop[content]}

        +

        {php echo date('Y-m-d H:i:s',$strshop[addtime])}

        + {if $TS_USER[userid] == $strshop[userid] || + $TS_USER['isadmin']==1} +
        + 删除 +
        + {/if} +
        +
      • {/loop} +
      +
      +
      {$pageUrl}
      + {/if} + + +
      + {if intval($TS_USER[userid])==0} +
      + 登录 | 注册 +
      + {else} +
      + + +
      + +
      + + + +
      + + +
      + {if $TS_SITE['isauthcode']} + 验证码: + 点击刷新验证码 + {/if} + +
      + + +
      + + + + +
      + +
      + +
      + {/if} +
      + + +
      +
      + + + + +
      + + + +
      +
      +{php doAction('tseditor','mini')} +{php include pubTemplate("footer")} + \ No newline at end of file diff --git a/app/shop/js/extend.func.js b/app/shop/js/extend.func.js new file mode 100644 index 0000000..139597f --- /dev/null +++ b/app/shop/js/extend.func.js @@ -0,0 +1,2 @@ + + diff --git a/app/shop/skins/default/photo_album.png b/app/shop/skins/default/photo_album.png new file mode 100644 index 0000000..5c870b3 Binary files /dev/null and b/app/shop/skins/default/photo_album.png differ diff --git a/app/shop/skins/default/style.css b/app/shop/skins/default/style.css new file mode 100644 index 0000000..e69de29 diff --git a/app/showerro/about.php b/app/showerro/about.php new file mode 100644 index 0000000..d4a9adb --- /dev/null +++ b/app/showerro/about.php @@ -0,0 +1,17 @@ + 'showerro', + 'version' => '1.0', + 'desc' => 'showerro', + 'url' => 'https://lmve.net', + 'email' => '1337087466@qq.com', + 'author' => '无闻风', + 'author_url' => 'https://lmve.net', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '1', + 'ismy'=>'0', +); \ No newline at end of file diff --git a/app/showerro/action/index.php b/app/showerro/action/index.php new file mode 100644 index 0000000..f1f7715 --- /dev/null +++ b/app/showerro/action/index.php @@ -0,0 +1,15 @@ + + + + + +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      + +
      +

      + -404- +

      +
      + Back + +
      +
      +
      +
      +
      +
      + +
      +
      +
      +









      一起帮他们回家 + +
      + 数据来源:宝贝回家 +
      +

      +
      +
      +
        + +
      +
      +
      +
      +
      +
      + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/showerro/html/index.html b/app/showerro/html/index.html new file mode 100644 index 0000000..4e7a3d7 --- /dev/null +++ b/app/showerro/html/index.html @@ -0,0 +1,3 @@ +{php include pubTemplate("header")} + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/showerro/js/extend.func.js b/app/showerro/js/extend.func.js new file mode 100644 index 0000000..a80a19d --- /dev/null +++ b/app/showerro/js/extend.func.js @@ -0,0 +1,66 @@ +$(function() { + $.ajax({ + type: 'GET', + url: 'https://www.dnpw.org/cn/api404-gohome.do?time='+Date(), + dataType: 'json', + success: function(result) { + addBox(result); + addBox2(result) + } + }) +}); + + + + +function addBox(result) { + $.each(result, function(index, obj) { + + $('#babyinfo').append("

      " + obj['name'] + "(" + obj['sex'] + ")

      出生日期:" + obj['born'] + "

      走失时间:" + obj['dis_time'] + "

      走失地点:" + obj['dis_address'] + "

      相关详情:" + obj['detail'] + "

      查看详情… >>
      "); + + }) +} + + + + + + +function addBox2(result) { + $.each(result, function(index, obj) { + $('#showlist').append("
    • "); + }) +} + + + + + +$('#showlist').on('click', 'li', function() { + $(this).addClass('currents').siblings().removeClass('currents'); + $('.hideit').eq($(this).index()).addClass('current').siblings().removeClass('current'); +}); + + + + + +$(function() { + $.ajax({ + type: 'GET', + url: 'https://www.dnpw.org/cn/api-thank?you=' + document.domain + '&style=12', + + }) +}); + + + + +//BAIDU STAT +var _hmt = _hmt || []; +(function() { + var hm = document.createElement("script"); + hm.src = "https://hm.baidu.com/hm.js?bf329994f1e3ebf56f3712e11a46cb4a"; + var s = document.getElementsByTagName("script")[0]; + s.parentNode.insertBefore(hm, s); +})(); diff --git a/app/showerro/skins/default/playing.png b/app/showerro/skins/default/playing.png new file mode 100644 index 0000000..509eb44 Binary files /dev/null and b/app/showerro/skins/default/playing.png differ diff --git a/app/showerro/skins/default/style.css b/app/showerro/skins/default/style.css new file mode 100644 index 0000000..fcc8c60 --- /dev/null +++ b/app/showerro/skins/default/style.css @@ -0,0 +1,441 @@ +body { + font: 12px/1.5 PingFangSC-Regular,Helvetica,Arial,sans-serif; + background: #f1f1f1; + min-width: 920px; +} + +body, html { + height: 100%; +} + +html { + font-size: 100%; + -webkit-text-size-adjust: none; + -ms-text-size-adjust: none; + -webkit-tap-highlight-color: transparent; +} + +article, aside, blockquote, body, button, dd, div, dl, dt, footer, form, h1, h2, h3, h4, h5, h6, header, li, menu, nav, ol, p, ul { + margin: 0; + padding: 0; +} + +.hideit { + display: none +} + +.current { + display: inline-block; +} + +.dnpw-ftbtm-page, div#__nuxt { + position: relative; + box-sizing: border-box; + min-height: 100%; + padding-bottom: 117px; +} + +.dnpw-404-page .dnpw-404-top { + margin-bottom: -24px; + height: 489px; + _background: url(top-404-gradient.jpg) repeat-x; +} + +.dnpw-404-page .top-bg { + height: 100%; + background: url(top-404-bg-0.png) center 0 no-repeat; +} + +.dnpw-404-page .top-box { + width: 920px; + margin: 0 auto; +} +/* + +.dnpw-404-page .top-box:after, .dnpw-404-page .top-box:before { + content: " "; + display: table; + clear: both; +} +*/ +.dnpw-404-page .top-box-left { + float: left; + padding-left: 0px; + padding-top: 88px; +} + +.dnpw-404-page .flash-box { + position: relative; + width: 492px; + height: 500px; + background-color: #fff; + border-radius: 15px; + padding: 15px; + padding-top: 20px; +} + +.dnpw-404-page .loading-icon { + position: absolute; + top: 50%; + left: 50%; + margin-left: -20px; + margin-top: -20px; + width: 40px; + height: 40px; + background: url(loading-4040.gif); +} + +.iqp-player { + position: relative; + width: 100%; + height: 100%; + min-width: 230px; + overflow: hidden; + text-align: left; + white-space: normal; + color: #fff; + z-index: 0; + user-select: none; + outline: none; + -webkit-font-smoothing: antialiased; +} + +.dnpw-404-page .top-box-right { + overflow: hidden; +} + +.dnpw-404-page .dnpwslogo { + padding-top: 25px; + -padding-left: 245px; + text-align: right; +} + +.dnpw-404-page .content-box { + padding-top: 166px; + text-align: center; +} + +.dnpw-404-page .title-404 { + margin-bottom: 50px; + color: #333; + font-size: 27px; + width: 215px; + padding-left: 117px; +} + +.dnpw-404-page .btn-box { + font-size: 0; + padding-left: 50px; +} + +a, a:active, a:hover, a:link, a:visited { + text-decoration: none; + color: #ccc; +} + +.dnpw-404-page .btn-404.plain { + border-color: #fff; + background-color: transparent; + color: #fff; +} + +.dnpw-404-page .btn-404 { + display: inline-block; + margin: 0 12px; + width: 124px; + height: 34px; + line-height: 34px; + border: 1px solid #fff; + background-color: #fff; + color: #222; + font-size: 16px; + text-align: center; + border-radius: 18px; + transition: all .3s; +} + +.dnpw-404-page .btn-404:hover { + background: #aaa; + border: 1px solid #aaa; + color: white +} + +/* + +.dnpw-404-page .top-box:after, .dnpw-404-page .top-box:before { + content: " "; + display: table; + clear: both; +} + +*/ + +.child_avatar { + float: left; + width: 140px; + height: 188px; + margin-right: 15px; +} + +.child_info { + float: left; + width: 320px; + overflow: hidden; + font-size: 14px; +} + +.child_info .info_name { + margin-bottom: 10px; + font-size: 18px; +} + +.child_info p { + color: #555; + line-height: 27px; + border-top: 1px dashed #eee; +} + +.child_info .lh-s { + padding-top:5px; + line-height: 20px; +} + +.link_view { + display: block; + position: absolute; + top: 15px; + right: 30px; + height: 28px; + line-height: 30px; + font-size: 16px; +} + +.link_inner { + color: #555 +} + +.dnpw-mod-wrap { + position: relative; + margin: 30px 0; +} + +.dnpw-mod-header { + position: relative; + margin-bottom: 20px; + +} + +.dnpw-mod-header .dnpw-mod-title { + color: #222; + font-size: 0; + vertical-align: baseline; +} + +h1, h2, h3, h4, h5, h6 { + font-weight: 400; + font-size: 100%; +} +/* +.dnpw-mod-header .dnpw-mod-title:after, .dnpw-mod-header .dnpw-mod-title:before { + content: " "; + display: table; + clear: both; +} +*/ +.dnpw-mod-header .dnpw-mod-title .nolink-txt { + float: left; + color: #222; + cursor: default; +} + +.dnpw-main .dnpw-mod-header .dnpw-mod-title .dnpw-mod-text, .dnpw-1335 .dnpw-mod-header .dnpw-mod-title .dnpw-mod-text { + display: inline-block; + font-size: 24px; + padding-left: 30px; +} + +.dnpw-mod-header .dnpw-mod-title .dnpw-mod-text { + display: inline-block; + font-size: 26px; + line-height: 28px; +} + +.dnpw-mod-list { + text-align: center; +} + +/*------------*/ +.dnpw-page-turn { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + position: absolute; + right: 0; + top: 12px; + font-size: 0; +} + +.dnpw-page-turn .page-num { + display: inline-block; + margin-right: 10px; + margin-left: 10px; + font-size: 12px; + color: #ccc; +} + +.dnpw-404-page .dnpw-404-con { + width: 920px; + margin: 0 auto; + overflow: hidden; +} + +.dnpw-mod-list .dnpw-mod-ul { + width: 100%; + font-size: 0; + white-space: nowrap; +} + +ol, ul { + list-style: none; +} + +.dnpw-mod-list .dnpw-mod-li { + vertical-align: top; + display: inline-block; + margin: 0 15px; +} + +.dnpw-main .dnpw-mod-img.horizon, .dnpw-1335 .dnpw-mod-img.horizon { + width: 100px; +} + +.dnpw-mod-img.horizon { + width: 210px; +} + +.dnpw-mod-img .dnpw-mod-link, .dnpw-mod-img .dnpw-mod-link-wrap { + z-index: 1; + position: relative; + border-radius: 50%; +} + +.dnpw-main .dnpw-mod-img.horizon .dnpw-mod-link, .dnpw-1335 .dnpw-mod-img.horizon .dnpw-mod-link { + width: 100px; + height: 100px; +} + +.dnpw-mod-img.horizon .dnpw-mod-link { + width: 210px; + height: 118px; +} + +.dnpw-mod-img .dnpw-mod-link { + display: block; + overflow: hidden; +} + +.dnpw-mod-img .dnpw-mod-cover { + display: block; + width: 100%; + height: 100%; + transition: all .25s ease-in-out; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} + +.fadeOutIn-enter-active { + animation-duration: .3s; + animation-name: fadeOutIn; + animation-fill-mode: forwards; + animation-timing-function: cubic-bezier(0,0,.5,1); +} + +img { + border: none; + vertical-align: top; +} +/* +.dnpw-mod-img .nub-tl.nub-tlOne { + background-position: -50px 0; +} +*/ +.dnpw-mod-img .nub-tl { + position: absolute; + left: 26px; + top: 27px; + text-align: center; + width: 50px; + height: 50px; + line-height: 40px; + color: #fff; + font-size: 18px; + cursor: pointer; +} + +.currents .dnpw-mod-img .nub-tl { + background: url(playing.png) no-repeat 0 0; +} + +.dnpw-mod-img .title-wrap { + position: relative; + line-height: 1; + padding: 6px 10px; +} + +.dnpw-main .dnpw-mod-img .title-wrap .main, .dnpw-1335 .dnpw-mod-img .title-wrap .main { + height: 22px; + line-height: 22px; + font-size: 14px; +} + +.dnpw-mod-img .title-wrap .main { + line-height: 23px; + height: 23px; + font-size: 15px; + vertical-align: baseline; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.dnpw-mod-img .title-wrap .link-txt { + display: block; + overflow: hidden; + text-overflow: ellipsis; + color: #222; +} + +.dnpw-main .dnpw-mod-img .title-wrap .sub, .dnpw-1335 .dnpw-mod-img .title-wrap .sub { + height: 20px; + line-height: 20px; + font-size: 12px; +} + +.dnpw-mod-img .title-wrap .sub { + line-height: 22px; + font-size: 14px; + color: #999; + margin-top: 2px; + height: 22px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.dnpw-mod-img .title-wrap .dnpw-svgicon-hot { + margin-right: 4px; + font-size: 12px; + vertical-align: top; +} + +.dnpw-svgicon { + display: inline-block; + vertical-align: -1px; + font-family: iconfont!important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + diff --git a/app/system/about.php b/app/system/about.php new file mode 100644 index 0000000..8337ddc --- /dev/null +++ b/app/system/about.php @@ -0,0 +1,17 @@ + '系统管理', + 'version' => '1.2', + 'desc' => '管理所有APP', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '0', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '0', + 'ismy'=>'0', +); \ No newline at end of file diff --git a/app/system/action/anti.php b/app/system/action/anti.php new file mode 100644 index 0000000..49550e1 --- /dev/null +++ b/app/system/action/anti.php @@ -0,0 +1,360 @@ +findAll('anti_word',null,'id desc'); + + include template('anti_word'); + break; + + case "worddo": + + $word = tsTrim($_POST['word']); + + if($word){ + + $isWord = $new['system']->findCount('anti_word',array( + 'word'=>$word, + )); + + if($isWord == 0){ + $new['system']->create('anti_word',array( + 'word'=>$word, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + //生成缓存 + $arrWords = $new['system']->findAll('anti_word'); + foreach($arrWords as $key=>$item){ + $arrWord[] = $item['word']; + } + + $strWord = ''; + $count = 1; + if(is_array($arrWord)){ + foreach ($arrWord as $item) { + if ($count==1) { + $strWord .= $item; + } else { + $strWord .= '|'.$item; + } + $count++; + } + } + + fileWrite('system_anti_word.php','data',$strWord); + $tsMySqlCache->set('system_anti_word',$strWord); + + + } + + qiMsg('敏感词添加成功!'); + + }else{ + + qiMsg('敏感词不能为空!'); + + } + + break; + + case "worddelall": + + $db->query("TRUNCATE ".dbprefix."anti_word"); + + //生成缓存 + $arrWords = $new['system']->findAll('anti_word'); + foreach($arrWords as $key=>$item){ + $arrWord[] = $item['word']; + } + + $strWord = ''; + $count = 1; + if(is_array($arrWord)){ + foreach ($arrWord as $item) { + if ($count==1) { + $strWord .= $item; + } else { + $strWord .= '|'.$item; + } + $count++; + } + } + + fileWrite('system_anti_word.php','data',$strWord); + $tsMySqlCache->set('system_anti_word',$strWord); + + qiMsg('删除成功!'); + + break; + + case "worddel": + $id = tsIntval($_GET['id']); + $new['system']->delete('anti_word',array( + 'id'=>$id, + )); + + //生成缓存 + $arrWords = $new['system']->findAll('anti_word'); + foreach($arrWords as $key=>$item){ + $arrWord[] = $item['word']; + } + + $strWord = ''; + $count = 1; + if(is_array($arrWord)){ + foreach ($arrWord as $item) { + if ($count==1) { + $strWord .= $item; + } else { + $strWord .= '|'.$item; + } + $count++; + } + } + + fileWrite('system_anti_word.php','data',$strWord); + $tsMySqlCache->set('system_anti_word',$strWord); + + qiMsg('删除成功!'); + break; + + case "wordadd": + + include template('anti_wordadd'); + break; + + case "wordadddo": + + $word = tsTrim($_POST['word']); + if($word==''){ + qiMsg('敏感词必须填写!'); + } + $arrWord = explode(PHP_EOL,$word); + foreach($arrWord as $key=>$item){ + $word = $item; + $isWord = $new['system']->findCount('anti_word',array( + 'word'=>$word, + )); + if($isWord == 0){ + $new['system']->create('anti_word',array( + 'word'=>$word, + 'addtime'=>date('Y-m-d H:i:s'), + )); + } + } + + //生成缓存 + $arrWords = $new['system']->findAll('anti_word'); + foreach($arrWords as $key=>$item){ + $arrWord2[] = $item['word']; + } + + $strWord = ''; + $count = 1; + if(is_array($arrWord2)){ + foreach ($arrWord2 as $item) { + if ($count==1) { + $strWord .= $item; + } else { + $strWord .= '|'.$item; + } + $count++; + } + } + + fileWrite('system_anti_word.php','data',$strWord); + $tsMySqlCache->set('system_anti_word',$strWord); + + header('Location: '.SITE_URL.'index.php?app=system&ac=anti&ts=word'); + exit(); + + break; + + //垃圾IP + case "ip": + + $arrIp = $new['system']->findAll('anti_ip',null,'addtime desc'); + + include template('anti_ip'); + break; + + case "ipdo": + + $ip = tsTrim($_POST['ip']); + if($ip){ + + $isIp = $new['system']->findCount('anti_ip',array( + 'ip'=>$ip, + )); + + if($isIp==0){ + + $new['system']->create('anti_ip',array( + 'ip'=>$ip, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + //生成缓存 + $arrIps = $new['system']->findAll('anti_ip'); + foreach($arrIps as $key=>$item){ + $arrIp[] = $item['ip']; + } + fileWrite('system_anti_ip.php','data',$arrIp); + $tsMySqlCache->set('system_anti_ip',$arrIp); + + } + + qiMsg('垃圾IP添加成功!'); + + }else{ + + qiMsg('垃圾IP不能为空!'); + + } + + break; + + case "ipdel": + + $id = tsIntval($_GET['id']); + $new['system']->delete('anti_ip',array( + 'id'=>$id, + )); + + //生成缓存 + $arrIps = $new['system']->findAll('anti_ip'); + foreach($arrIps as $key=>$item){ + $arrIp[] = $item['ip']; + } + fileWrite('system_anti_ip.php','data',$arrIp); + $tsMySqlCache->set('system_anti_ip',$arrIp); + + qiMsg('删除成功!'); + + break; + + //云词 + case "cloud": + + include template('anti_cloud'); + break; + + + #内容举报 + case "report": + + $page = tsIntval($_GET['page'],1); + $url = SITE_URL.'index.php?app=system&ac=anti&ts=report&page='; + $lstart = $page*20-20; + $arrReport = $new['system']->findAll('anti_report',null,'addtime desc',null,$lstart.',20'); + $reportNum = $new['system']->findCount('anti_report'); + $pageUrl = pagination($reportNum, 20, $page, $url); + + include template('anti_report'); + break; + #内容举报删除 + case "reportdelete": + + $reportid = tsIntval($_GET['reportid']); + + $new['system']->delete('anti_report',array( + 'reportid'=>$reportid, + )); + + qiMsg('删除成功!'); + break; + + + case "email": + + $page = tsIntval($_GET['page'],1); + $url = SITE_URL.'index.php?app=system&ac=anti&ts=email&page='; + $lstart = $page*100-100; + $arrEmail = $new['system']->findAll('anti_email',null,'addtime desc',null,$lstart.',100'); + $emailNum = $new['system']->findCount('anti_email'); + $pageUrl = pagination($emailNum, 100, $page, $url); + + include template('anti_email'); + break; + + case "email_add": + + $email = tsTrim($_POST['email']); + if($email){ + + $new['system']->replace('anti_email',array( + 'email'=>$email, + ),array( + 'email'=>$email, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + qiMsg('Email添加成功!'); + + }else{ + + qiMsg('Email不能为空!'); + + } + + break; + + case "email_del": + + $id = tsIntval($_GET['id']); + $new['system']->delete('anti_email',array( + 'id'=>$id, + )); + + qiMsg('删除成功!'); + + break; + + case "phone": + + $arrPhone = $new['system']->findAll('anti_phone',null,'addtime desc'); + + include template('anti_phone'); + break; + + case "phone_add": + + $phone = tsTrim($_POST['phone']); + if($phone){ + + $new['system']->replace('anti_phone',array( + 'phone'=>$phone, + ),array( + 'phone'=>$phone, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + qiMsg('Phone添加成功!'); + + }else{ + + qiMsg('Phone不能为空!'); + + } + + break; + + case "phone_del": + + $id = tsIntval($_GET['id']); + $new['system']->delete('anti_phone',array( + 'id'=>$id, + )); + + qiMsg('删除成功!'); + + break; + + +} \ No newline at end of file diff --git a/app/system/action/apps.php b/app/system/action/apps.php new file mode 100644 index 0000000..4c005b4 --- /dev/null +++ b/app/system/action/apps.php @@ -0,0 +1,244 @@ +$item){ + if(is_file('app/'.$item.'/about.php')){ + + $arrApps[$key]['name'] = $item; + + $arrApps[$key]['about'] = require_once 'app/'.$item.'/about.php'; + + if($arrAppNav[$item]){ + $arrApps[$key]['about']['name'] = $arrAppNav[$item]; + } + + if(is_file('app/'.$item.'/icon.png')){ + $arrApps[$key]['icon'] = SITE_URL.'app/'.$item.'/icon.png'; + }else{ + $arrApps[$key]['icon'] = SITE_URL.'public/images/app.png'; + } + + } + + + + } + + foreach($arrApps as $item){ + $arrApp[] = $item; + } + + $title = 'APP管理'; + + include template("apps"); + break; + + //安装APP + /* + case "install": + $appname = tsTrim($_GET['appname']); + + $appAbout = require_once 'app/'.$appname.'/about.php'; + + $isinstall = $appAbout['isinstall']; + $issql = $appAbout['issql']; + $issystem = $appAbout['issystem']; + + + if($isinstall == '0'){ + if($issql == '1'){ + //安装数据库 + $sql = file_get_contents('app/'.$appname.'/sql/install.sql'); + $sql = str_replace('ts_',dbprefix,$sql); + $array_sql = preg_split("/;[\r\n]/", $sql); + + foreach($array_sql as $sql){ + $sql = tsTrim($sql); + if ($sql){ + if (strstr($sql, 'CREATE TABLE')){ + preg_match('/CREATE TABLE ([^ ]*)/', $sql, $matches); + $ret = $db->query($sql); + } else { + $ret = $db->query($sql); + } + } + } + + } + //更新about.php文件 + $appAbout['isinstall'] = '1'; + AppFileWrite($appAbout,$appname,'about.php'); + + echo '1'; + + }elseif($isinstall == '1'){ + + if($issql == '1'){ + //卸载数据库 + $sql = file_get_contents('app/'.$appname.'/sql/uninstall.sql'); + $sql = str_replace('ts_',dbprefix,$sql); + $array_sql = preg_split("/;[\r\n]/", $sql); + + foreach($array_sql as $sql){ + $sql = tsTrim($sql); + if ($sql){ + $ret = $db->query($sql); + } + } + } + + $appAbout['isinstall'] = '0'; + AppFileWrite($appAbout,$appname,'about.php'); + + echo '2'; + + }else{ + echo '3'; + } + + break; + */ + //导航 + case "appnav": + $appkey = $_POST['appkey']; + $appname = $_POST['appname']; + + $arrNav = include 'data/system_appnav.php'; + + if(is_array($arrNav)){ + $arrNav[$appkey] = $appname; + }else{ + $arrNav = array( + $appkey=>$appname, + ); + } + + foreach($arrNav as $key=>$item){ + + if(!is_dir('app/'.$key)){ + unset($arrNav[$key]); + } + } + + fileWrite('system_appnav.php','data',$arrNav); + $GLOBALS['tsMySqlCache']->set('system_appnav',$arrNav); + + echo '1'; + + break; + + //取消导航 + case "unappnav": + + $appkey = $_POST['appkey']; + + $arrNav = include 'data/system_appnav.php'; + + unset($arrNav[$appkey]); + + fileWrite('system_appnav.php','data',$arrNav); + $GLOBALS['tsMySqlCache']->set('system_appnav',$arrNav); + + echo '1'; + + break; + + //我的社区导航 + case "mynav": + $appkey = tsTrim($_POST['appkey']); + $appname = tsTrim($_POST['appname']); + + $arrMyNav = include 'data/system_mynav.php'; + + if(is_array($arrMyNav)){ + $arrMyNav[$appkey] = $appname; + }else{ + $arrMyNav = array( + $appkey=>$appname, + ); + } + + foreach($arrMyNav as $key=>$item){ + if(!is_dir('app/'.$key)){ + unset($arrMyNav[$key]); + } + } + + fileWrite('system_mynav.php','data',$arrMyNav); + $GLOBALS['tsMySqlCache']->set('system_mynav',$arrMyNav); + + echo '1'; + break; + + case "unmynav": + $appkey = tsTrim($_POST['appkey']); + $arrMyNav = include 'data/system_mynav.php'; + unset($arrMyNav[$appkey]); + fileWrite('system_mynav.php','data',$arrMyNav); + $GLOBALS['tsMySqlCache']->set('system_mynav',$arrMyNav); + echo '1'; + break; + + case "applist": + + $arrAppNav = include 'data/system_appnav.php'; + + include template("apps_applist"); + break; + + case "applistdo": + + $arrAppNav = include 'data/system_appnav.php'; + + $jsondata = stripslashes($_POST['jsondata']); + + $arrJson = json_decode($jsondata,true); + + foreach($arrJson as $key=>$item){ + $arrNav[$item['id']] = $arrAppNav[$item['id']]; + } + + //print_r($arrNav); + + + fileWrite('system_appnav.php','data',$arrNav); + $GLOBALS['tsMySqlCache']->set('system_appnav',$arrNav); + + + break; + + case "mylist": + + $arrMyNav = include 'data/system_mynav.php'; + + + include template("apps_mylist"); + break; + + + case "mylistdo": + + $arrMyNav = include 'data/system_mynav.php'; + + $jsondata = stripslashes($_POST['jsondata']); + + $arrJson = json_decode($jsondata,true); + + foreach($arrJson as $key=>$item){ + $arrNav[$item['id']] = $arrMyNav[$item['id']]; + } + + fileWrite('system_mynav.php','data',$arrNav); + $GLOBALS['tsMySqlCache']->set('system_mynav',$arrNav); + + break; + +} \ No newline at end of file diff --git a/app/system/action/cache.php b/app/system/action/cache.php new file mode 100644 index 0000000..cade307 --- /dev/null +++ b/app/system/action/cache.php @@ -0,0 +1,45 @@ + tsTrim($_POST['site_title']), + 'site_subtitle' => tsTrim($_POST['site_subtitle']), + 'site_key' => tsTrim($_POST['site_key']), + 'site_desc' => tsTrim($_POST['site_desc']), + 'site_url' => tsTrim($_POST['site_url']), + 'site_email' => tsTrim($_POST['site_email']), + 'site_icp' => tsTrim($_POST['site_icp']), + 'isface' => tsIntval($_POST['isface']), + 'isinvite'=> tsIntval($_POST['isinvite']), + 'isgzip' => tsIntval($_POST['isgzip']), + 'timezone' => $_POST['timezone'], + 'isverify'=>tsIntval($_POST['isverify']), + ); + + foreach ($arrData as $key => $val){ + + $new['system']->update('system_options',array( + 'optionname'=>$key, + ),array( + 'optionvalue'=>$val, + )); + + } + + $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); + + qiMsg("系统选项更新成功,并重置了缓存文件^_^"); + + break; +} \ No newline at end of file diff --git a/app/system/action/editor.php b/app/system/action/editor.php new file mode 100644 index 0000000..1a3c795 --- /dev/null +++ b/app/system/action/editor.php @@ -0,0 +1,44 @@ +findAll('editor',null,'addtime desc',null,$lstart.',20'); + + $editorNum = $new['system']->findCount('editor'); + $pageUrl = pagination($editorNum, 20, $page, $url); + + include template('editor_list'); + + break; + + case "delete": + + $id = tsIntval($_GET['id']); + + $strEditor = $new['system']->find('editor',array( + 'id'=>$id, + )); + + if($strEditor['url']){ + if($GLOBALS['TS_SITE']['file_upload_type']==1){ + deleteAliOssFile('uploadfile/editor/'.$strEditor['url']); + }else{ + unlink('uploadfile/editor/'.$strEditor['url']); + } + } + + $new['system']->delete('editor',array( + 'id'=>$id, + )); + + qiMsg('删除成功!'); + + break; + +} \ No newline at end of file diff --git a/app/system/action/index.php b/app/system/action/index.php new file mode 100644 index 0000000..cc7ffd1 --- /dev/null +++ b/app/system/action/index.php @@ -0,0 +1,5 @@ +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; +} \ No newline at end of file diff --git a/app/system/action/logo.php b/app/system/action/logo.php new file mode 100644 index 0000000..20a743a --- /dev/null +++ b/app/system/action/logo.php @@ -0,0 +1,45 @@ +delete('system_options',array( + 'optionname'=>'logo', + )); + $new['system']->create('system_options',array( + 'optionname'=>'logo', + 'optionvalue'=>$name.'?v='.time(), + )); + + $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); + + echo SITE_URL.$dest.'?v='.rand(); + +} \ No newline at end of file diff --git a/app/system/action/logs.php b/app/system/action/logs.php new file mode 100644 index 0000000..ddbd75f --- /dev/null +++ b/app/system/action/logs.php @@ -0,0 +1,52 @@ +findAll('logs',null,'addtime desc',null,$lstart.',20'); + + $logsNum = $new['system']->findCount('logs'); + $pageUrl = pagination($logsNum, 20, $page, $url); + + include template('logs_list'); + + break; + + case "show": + + $logid = tsIntval($_GET['logid']); + + $strLog = $new['system']->find('logs',array( + 'logid'=>$logid, + )); + + include template('logs_show'); + + break; + + case "delete": + + $logid = tsIntval($_GET['logid']); + + $new['system']->delete('logs',array( + 'logid'=>$logid, + )); + + qiMsg('删除成功!'); + + break; + + case "clean": + + $db->query("TRUNCATE `".dbprefix."logs`;"); + + qiMsg('操作成功!'); + + break; + +} \ No newline at end of file diff --git a/app/system/action/main.php b/app/system/action/main.php new file mode 100644 index 0000000..4e6d905 --- /dev/null +++ b/app/system/action/main.php @@ -0,0 +1,24 @@ + $_SERVER['SERVER_SOFTWARE'], + 'phpos' => PHP_OS, + 'phpversion' => PHP_VERSION, + 'mysql' => $db->getMysqlVersion(), + 'os' =>$os[0] .''.$os[1].' '.$os[3], + 'gd'=>$gd, + 'upload' =>'表单允许 (post_max_size) '.ini_get('post_max_size').',上传总大小 (upload_max_filesize) '.ini_get('upload_max_filesize'), + 'memory'=> 'memory_limit '.ini_get('memory_limit'), +); + +//获取域名 +#$theAuthUrl = GetUrlToDomain($_SERVER['HTTP_HOST']); + +include template("main"); \ No newline at end of file diff --git a/app/system/action/options.php b/app/system/action/options.php new file mode 100644 index 0000000..721c604 --- /dev/null +++ b/app/system/action/options.php @@ -0,0 +1,93 @@ +findAll('system_options'); + + foreach($arrOptions as $item){ + $strOption[$item['optionname']] = stripslashes($item['optionvalue']); + } + + //时区和语言 + $arrTime = getArrTimezone(); + + $arrTheme = tsScanDir('theme'); + + include template("options"); + + break; + + //保存配置 + + case "do": + + $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 = tsTrim($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; + +} \ No newline at end of file diff --git a/app/system/action/phpinfo.php b/app/system/action/phpinfo.php new file mode 100644 index 0000000..ad5a67b --- /dev/null +++ b/app/system/action/phpinfo.php @@ -0,0 +1,10 @@ +$item){ + $arrAppsAbout[$item] = fileRead('app/'.$item.'/about.php'); + } + + + //print_r($arrAppsAbout); + + + $apps = tsFilter($_GET['apps']); + + $hook = tsTrim($_GET['hook']); + + + $arrPlugins = tsScanDir('plugins/'.$apps); + + foreach($arrPlugins as $key=>$item){ + if(is_file('plugins/'.$apps.'/'.$item.'/about.php')){ + $arrPlugin1[$key]['name'] = $item; + $arrPlugin1[$key]['about'] = require_once 'plugins/'.$apps.'/'.$item.'/about.php'; + } + } + + if($arrPlugin1 && $hook){ + foreach($arrPlugin1 as $key=>$item){ + if($item['about']['hook']==$hook){ + $arrPlugin[] = $item; + } + } + }else{ + $arrPlugin = $arrPlugin1; + } + + $app_plugins = fileRead('data/'.$apps.'_plugins.php'); + + if($app_plugins==''){ + $app_plugins = $tsMySqlCache->get($apps.'_plugins'); + } + + include template("plugin_list"); + break; + + //插件停启用 + case "do": + + $apps = tsFilter($_GET['apps']); + + $isused = tsIntval($_GET['isused']); + $pname = tsFilter($_GET['pname']); + + $app_plugins = fileRead('data/'.$apps.'_plugins.php'); + if($app_plugins==''){ + $app_plugins = $tsMySqlCache->get($apps.'_plugins'); + } + + + //0停用1启用 + if($isused == '0'){ + + $pkey = array_search($pname,$app_plugins); + unset($app_plugins[$pkey]); + + fileWrite($apps.'_plugins.php','data',$app_plugins); + $tsMySqlCache->set($apps.'_plugins',$app_plugins); + + qiMsg("插件停用成功!"); + + }elseif($isused == '1'){ + + $pkey = array_search($pname,$app_plugins); + unset($app_plugins[$pkey]); + + array_push($app_plugins,$pname); + + if(file_exists('plugins/'.$apps.'/'.$pname.'/install.sql')){ + $sql=file_get_contents('plugins/'.$apps.'/'.$pname.'/install.sql'); + $sql=str_replace('ts_',''.dbprefix.'',$sql); + $ret=$db->query($sql); + if($ret=='1') + { + fileWrite($apps.'_plugins.php','data',$app_plugins); + $tsMySqlCache->set($apps.'_plugins',$app_plugins); + $msg='插件启用成功!'; + }else{ + $msg=$ret; + } + }else{ + fileWrite($apps.'_plugins.php','data',$app_plugins); + $tsMySqlCache->set($apps.'_plugins',$app_plugins); + $msg='插件启用成功!'; + } + + qiMsg($msg); + + } + break; + + //删除插件 + case "delete": + $apps = tsUrlCheck($_GET['apps']); + $pname = tsUrlCheck($_GET['pname']); + + delDir('plugins/'.$apps.'/'.$pname); + + qiMsg('删除成功!'); + break; +} \ No newline at end of file diff --git a/app/system/action/redis.php b/app/system/action/redis.php new file mode 100644 index 0000000..7e51227 --- /dev/null +++ b/app/system/action/redis.php @@ -0,0 +1,16 @@ +connect($TS_CF['redis']['host'], $TS_CF['redis']['port']); +//检测是否连接成功 +echo "Server is running: " . $redis->ping(); +// 输出结果 Server is running: +PONG \ No newline at end of file diff --git a/app/system/action/spam.php b/app/system/action/spam.php new file mode 100644 index 0000000..56d9a50 --- /dev/null +++ b/app/system/action/spam.php @@ -0,0 +1,61 @@ +$item){ + + $isword = $new['system']->findCount('anti_word',array( + 'word'=>$item, + )); + + if($isword==0){ + $new['system']->create('anti_word',array( + 'word'=>$item, + 'addtime'=>date('Y-m-d H:i:s'), + )); + } + + } + + //生成缓存 + $arrWords = $new['system']->findAll('anti_word'); + foreach($arrWords as $key=>$item){ + $arrWord[] = $item['word']; + } + + $strWord = ''; + $count = 1; + if(is_array($arrWord)){ + foreach ($arrWord as $item) { + if ($count==1) { + $strWord .= $item; + } else { + $strWord .= '|'.$item; + } + $count++; + } + } + + fileWrite('system_anti_word.php','data',$strWord); + $tsMySqlCache->set('system_anti_word',$strWord); + + + header('Location: '.SITE_URL.'index.php?app=system&ac=anti&ts=word'); + + break; + +} \ No newline at end of file diff --git a/app/system/action/sql.php b/app/system/action/sql.php new file mode 100644 index 0000000..2aa29d6 --- /dev/null +++ b/app/system/action/sql.php @@ -0,0 +1,6 @@ +';#opendir + if(function_exists('readdir')==false) $msg .= 'readdir函数不可用
      ';#readdir + if(function_exists('copy')==false) $msg .= 'copy函数不可用
      ';#copy + + #检查php必要扩展 + if(extension_loaded('Fileinfo')==false) $msg .= 'Fileinfo扩展不可用
      ';#Fileinfo + + #检测upgrade目录是否可写 + if(abcefile('upgrade')) $msg .= 'upgrade目录不可写
      '; + + + echo $msg; + + + break; + + //手动升级检测 + case "hand": + + $upid = tsIntval($_GET['upid']); + + include template('update_hand'); + break; + + + //第一步检测可写权限 + case "one": + + include template('update_one'); + break; + + //第二步,升级数据库 + case "two": + + include template('update_two'); + break; + + case "twodo": + + $upsql = tsTrim($_POST['upsql']); + + if($upsql){ + + $arrSql = explode('--------------------',$upsql); + foreach($arrSql as $item){ + $item = tsTrim($item); + if ($item){ + $db->query($item); + } + } + + //执行成功 + echo '1';exit; + + }else{ + + //无SQL可执行 + echo '0';exit; + + } + + //echo '1';exit; + + break; + + //第三部,升级系统文件 + case "three": + + include template('update_three'); + break; + + case "threedo": + + $upversion = tsTrim($_GET['upversion']); + + if($upversion==''){ + getJson('版本号有问题',1,0); + } + + $filezip = $upversion.'.zip'; + + //先删除旧的zip升级文件 + unlink('upgrade/'.$filezip); + delDir('upgrade/'.$upversion); + + //拼接出要下载的远程文件 + $upfile = 'https://www.thinksaas.cn/upgrade/'.$filezip; + + //第一步:多线程下载zip压缩文件 + $urls=array( + $upfile, + $upfile, + $upfile, + ); + $save_to='upgrade/'; + + $mh=curl_multi_init(); + foreach($urls as $i=>$url){ + //$g=$save_to.basename($url); + $g = $save_to.$filezip; + if(!is_file($g)){ + $conn[$i]=curl_init($url); + $fp[$i]=fopen($g,"w"); + curl_setopt($conn[$i],CURLOPT_USERAGENT,"Mozilla/4.0(compatible; MSIE 7.0; Windows NT 6.0)"); + curl_setopt($conn[$i],CURLOPT_FILE,$fp[$i]); + curl_setopt($conn[$i],CURLOPT_HEADER ,0); + curl_setopt($conn[$i],CURLOPT_CONNECTTIMEOUT,60); + curl_multi_add_handle($mh,$conn[$i]); + } + } + do{ + $n=curl_multi_exec($mh,$active); + }while($active); + foreach($urls as $i=>$url){ + curl_multi_remove_handle($mh,$conn[$i]); + curl_close($conn[$i]); + fclose($fp[$i]); + } + curl_multi_close($mh); + + chmod('upgrade/'.$filezip,0755); + + //第二步:下载完之后开始解压覆盖原有文件 + include 'thinksaas/pclzip.lib.php'; + $archive = new PclZip('upgrade/'.$filezip); + if ($archive->extract(PCLZIP_OPT_PATH, 'upgrade/'.$upversion,PCLZIP_OPT_REPLACE_NEWER) == 0) { + getJson('升级包解压失败',1,0); + + }else{ + unlink('upgrade/'.$filezip); + } + + //直接循环覆盖吧 + file_list('upgrade/'.$upversion); + + //删除目录 + delDir('upgrade/'.$upversion); + + getJson('升级成功',1,1); + break; +} \ No newline at end of file diff --git a/app/system/class.system.php b/app/system/class.system.php new file mode 100644 index 0000000..bc260aa --- /dev/null +++ b/app/system/class.system.php @@ -0,0 +1,187 @@ +findAll('anti_word'); + foreach($arrWords as $key=>$item){ + $arrWord[] = $item['word']; + } + + $strWord = ''; + $count = 1; + if(is_array($arrWord)){ + foreach ($arrWord as $item) { + if ($count==1) { + $strWord .= $item; + } else { + $strWord .= '|'.$item; + } + $count++; + } + + //第一过滤层,大致的扫一下 + if($text){ + preg_match("/$strWord/i",$text, $matche1); + if(!empty($matche1[0])){ + //tsNotice('提示:内容中存在被禁止使用的词汇:'.$matche1[0]); + if($re==1){ + return false;exit; + }else{ + getJson('非法操作',$js,0); + } + + } + } + + //第二过滤层 + preg_match("/$strWord/i",t($text), $matche2); + if(!empty($matche2[0])){ + //tsNotice('内容中存在被禁止使用的词汇:'.$matche2[0]); + if($re==1){ + return false;exit; + }else{ + getJson('非法操作',$js,0); + } + } + + //第三过滤层,滤中文中的特殊字符 + $text3 = @preg_replace("/[^\x{4e00}-\x{9fa5}]/iu",'',$text); + preg_match("/$strWord/i",t($text3), $matche3); + if(!empty($matche3[0])){ + //tsNotice('内容中存在被禁止使用的词汇:'.$matche3[0]); + if($re==1){ + return false;exit; + }else{ + getJson('非法操作',$js,0); + } + } + + //第四过滤层,过滤QQ号,电话,妈的,老子就不信搞不死你 + $text4 = @preg_replace("/[^\d]/iu",'',$text); + preg_match("/$strWord/i",t($text4), $matche4); + if(!empty($matche4[0])){ + //tsNotice('内容中存在被禁止使用的词汇:'.$matche4[0]); + if($re==1){ + return false;exit; + }else{ + getJson('非法操作',$js,0); + } + } + + } + + return true;exit; + + } + + //过滤用户ID + function antiUser(){ + $arrUsers = $this->findAll('anti_user'); + foreach($arrUsers as $key=>$item){ + $arrUser[] = $item['userid']; + } + return $arrUser; + } + + //过滤用户ip + function antiIp(){ + $arrIps = $this->findAll('anti_ip'); + foreach($arrIps as $key=>$item){ + $arrIp[] = $item['ip']; + } + return $arrIp; + } + + //APP OPTION 配置APP文件缓存 + function appOption($app,$option){ + //先清空数据 + $db->query("TRUNCATE TABLE `".dbprefix.$app."_options`"); + + foreach($option as $key=>$item){ + + $optionname = $key; + $optionvalue = tsTrim($item); + + $this->create($app.'_options',array( + + 'optionname'=>$optionname, + 'optionvalue'=>$optionvalue, + + )); + + } + + $arrOptions = $this->findAll($app.'_options',null,null,'optionname,optionvalue'); + foreach($arrOptions as $item){ + $arrOption[$item['optionname']] = $item['optionvalue']; + } + + fileWrite($app.'_options.php','data',$arrOption); + $tsMySqlCache->set($app.'_options',$arrOption); + } + + + function searchDir($path,&$data){ + if(is_dir($path)){ + $dp=dir($path); + while($file=$dp->read()){ + if($file!='.'&& $file!='..'){ + $this->searchDir($path.'/'.$file,$data); + } + } + $dp->close(); + } + if(is_file($path)){ + $data[]=$path; + } + } + + function getfile($dir){ + $data=array(); + $this->searchDir($dir,$data); + return $data; + } + + /** + * 发布内容开放时间 + */ + public function pubTime(){ + if($GLOBALS['TS_SITE']['pubtime']){ + $arrHour = explode('|',$GLOBALS['TS_SITE']['pubtime']); + $hour = date('H'); + if(in_array($hour,$arrHour)){ + return true; + }else{ + return false; + } + }else{ + return true; + } + } + +} \ No newline at end of file diff --git a/app/system/config.php b/app/system/config.php new file mode 100644 index 0000000..e317d39 --- /dev/null +++ b/app/system/config.php @@ -0,0 +1,6 @@ + + + + + +{$title} - {$TS_SITE['site_title']} + + + + + + + + + + + +
      + + +
      + +
      +欢迎您, {$TS_USER[username]} + 回前台 + 退出 +
      + + + + + +
      + +
      + + + +
      + +
      + + diff --git a/app/system/html/anti_cloud.html b/app/system/html/anti_cloud.html new file mode 100644 index 0000000..e382f9c --- /dev/null +++ b/app/system/html/anti_cloud.html @@ -0,0 +1,48 @@ +{php include pubTemplate("header_admin")} + + +
      +{template anti_menu} + + +
      + +
      远程提交敏感词语
      +

      如果你发现有敏感词语,请通过下面输入远程提交给ThinkSAAS,我们将建立强大的敏感词云存储库。

      + + + + + + + + +
      敏感词: + + + + +
      其他操作:一键更新云敏感词库到本地>>
      + +
      + + +
      + + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/anti_email.html b/app/system/html/anti_email.html new file mode 100644 index 0000000..695078e --- /dev/null +++ b/app/system/html/anti_email.html @@ -0,0 +1,37 @@ +{php include pubTemplate("header_admin")} + +
      +{template anti_menu} + + +
      +
      +Email: 添加后Email不可以再注册 +
      +
      + +
      {$pageUrl}
      + +
      + + + + + + +{loop $arrEmail $key $item} + + + + +{/loop} + +
      Email添加时间操作
      {$item['email']}{$item['addtime']} 删除
      + +
      + +
      {$pageUrl}
      + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/anti_ip.html b/app/system/html/anti_ip.html new file mode 100644 index 0000000..91bf6a7 --- /dev/null +++ b/app/system/html/anti_ip.html @@ -0,0 +1,33 @@ +{php include pubTemplate("header_admin")} + + +
      +{template anti_menu} + + +
      +
      +IP: 添加后IP用户不可以再访问 +
      +
      + + +
      + + + + + + +{loop $arrIp $key $item} + +{/loop} + +
      IP添加时间操作
      {$item['ip']}{$item['addtime']} 删除
      + +
      + + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/anti_menu.html b/app/system/html/anti_menu.html new file mode 100644 index 0000000..d3e9275 --- /dev/null +++ b/app/system/html/anti_menu.html @@ -0,0 +1,29 @@ + + +
      \ No newline at end of file diff --git a/app/system/html/anti_phone.html b/app/system/html/anti_phone.html new file mode 100644 index 0000000..2e341e2 --- /dev/null +++ b/app/system/html/anti_phone.html @@ -0,0 +1,35 @@ +{php include pubTemplate("header_admin")} + +
      +{template anti_menu} + + +
      +
      +手机号: 添加后Phone不可以再注册 +
      +
      + + +
      + + + + + + +{loop $arrPhone $key $item} + + + + +{/loop} + +
      Phone添加时间操作
      {$item['phone']}{$item['addtime']} 删除
      + +
      + + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/anti_report.html b/app/system/html/anti_report.html new file mode 100644 index 0000000..718fba2 --- /dev/null +++ b/app/system/html/anti_report.html @@ -0,0 +1,30 @@ +{php include pubTemplate("header_admin")} + + +
      + {template anti_menu} + + +
      + + + + + + + + {loop $arrReport $key $item} + + {/loop} + + + + +
      ID举报链接举报内容时间操作
      {$item['reportid']}{php echo tsTitle($item['url'])}{php echo tsTitle($item['content'])}{$item['addtime']}删除
      + +
      + + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/anti_word.html b/app/system/html/anti_word.html new file mode 100644 index 0000000..d63ff23 --- /dev/null +++ b/app/system/html/anti_word.html @@ -0,0 +1,43 @@ +{php include pubTemplate("header_admin")} + + +
      +{template anti_menu} + + +
      +
      + 敏感词: + 一键删除所有敏感词 + + + + 批量添加敏感词 + +
      +
      + + + +
      + + + + + + +{loop $arrWord $key $item} + +{/loop} + + + + +
      ID敏感词 请至少保留一个敏感词添加时间操作
      {$item['id']}{$item['word']}{$item['addtime']} 删除
      + +
      + + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/anti_wordadd.html b/app/system/html/anti_wordadd.html new file mode 100644 index 0000000..012b5fc --- /dev/null +++ b/app/system/html/anti_wordadd.html @@ -0,0 +1,24 @@ +{php include pubTemplate("header_admin")} + + +
      +{template anti_menu} + + +
      + +
      + + +
      + +
      + +
      + +
      + + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/apps.html b/app/system/html/apps.html new file mode 100644 index 0000000..07e183a --- /dev/null +++ b/app/system/html/apps.html @@ -0,0 +1,127 @@ +{php include pubTemplate("header_admin")} + + + + + +
      + + {template apps_menu} + + + + + + + + + + + + + + + +{loop $arrApp $keys $item} + + + + + + + + + + + + + + + +{/loop} + + + +
      应用名称版本介绍作者管理顶部导航我的社区导航
      + + {$item['about']['name']}({$item['name']}) +{$item['about']['version']} +{$item['about']['desc']}{$item['about']['author']} +{if $item['about']['isoption'] == '1' && $item['about']['isinstall']=='1'} + 管理 + {/if} + + + +{if $item['about']['isappnav'] == '1' && $TS_SITE['appnav'][$item['name']] == ''} + 开启 + {/if} + +{if $item['about']['isappnav'] == '1' && $TS_SITE['appnav'][$item['name']] != ''} + 取消 + {/if} + + + + + + {if $item[about]['ismy'] == '1' && $TS_SITE['mynav'][$item['name']] == ''} + 开启 + {/if} + + {if $item['about']['ismy'] == '1' && $TS_SITE['mynav'][$item['name']] != ''} + 取消 + {/if} + +
      + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/apps_applist.html b/app/system/html/apps_applist.html new file mode 100644 index 0000000..eeceb35 --- /dev/null +++ b/app/system/html/apps_applist.html @@ -0,0 +1,153 @@ +{php include pubTemplate("header_admin")} + + + + + +
      + + {template apps_menu} + + +
      上下拖动排序
      + + +
      +
      +
        + {loop $arrAppNav $key $item} +
      1. +
        {$item}
        +
      2. + {/loop} +
      +
      +
      + + + + + + +
      + + + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/apps_menu.html b/app/system/html/apps_menu.html new file mode 100644 index 0000000..2fb0a52 --- /dev/null +++ b/app/system/html/apps_menu.html @@ -0,0 +1,8 @@ + +
      \ No newline at end of file diff --git a/app/system/html/apps_mylist.html b/app/system/html/apps_mylist.html new file mode 100644 index 0000000..b8a6dd0 --- /dev/null +++ b/app/system/html/apps_mylist.html @@ -0,0 +1,154 @@ +{php include pubTemplate("header_admin")} + + + + + +
      + + {template apps_menu} + + +
      上下拖动排序
      + + +
      +
      +
        + {loop $arrMyNav $key $item} +
      1. +
        {$item}
        +
      2. + {/loop} +
      +
      +
      + + + + + + +
      + + + + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/cache.html b/app/system/html/cache.html new file mode 100644 index 0000000..68546f5 --- /dev/null +++ b/app/system/html/cache.html @@ -0,0 +1,20 @@ +{php include pubTemplate("header_admin")} + +
      +{template menu} + + + + + + + + + + + + +
      全站:清理全站缓存
      模板:清理模板缓存
      小组头像:清理小组头像缓存
      用户头像:清理用户头像缓存
      + +
      +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/editor_list.html b/app/system/html/editor_list.html new file mode 100644 index 0000000..0856a39 --- /dev/null +++ b/app/system/html/editor_list.html @@ -0,0 +1,53 @@ +{php include pubTemplate("header_admin")} + +
      + {template anti_menu} + + +
      {$pageUrl}
      + +
      + + + + + + + + + + + + + + + {loop $arrEditor $key $item} + + + + + + + + + + {/loop} + +
      IDUserIDtypetitleaddtime操作
      {$item['id']}{$item['userid']}{$item['type']}{$item['title']} + + {if $item['type']=='photo'} + + {else} + uploadfile/editor/{$item['url']} + {/if} + + {php echo date('Y-m-d H:i:s',$item['addtime'])} 删除
      + +
      + +
      {$pageUrl}
      + + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/logs_list.html b/app/system/html/logs_list.html new file mode 100644 index 0000000..b386c67 --- /dev/null +++ b/app/system/html/logs_list.html @@ -0,0 +1,72 @@ +{php include pubTemplate("header_admin")} + +
      + {template anti_menu} + + + + + +
      {$pageUrl}
      + +
      + + + + + + + + + + + + + + + + + {loop $arrLogs $key $item} + + + + + + + + + + + + + + + + {/loop} + +
      IDptablepkeypiduseridtitlestatusaddtime操作
      {$item['logid']}{$item['ptable']}{$item['pkey']}{$item['pid']}{$item['userid']}{php echo tsTitle($item['title'])} + {if $item['status']==1} + 修改 + {elseif $item['status']==2} + 删除 + {else} + 添加 + {/if} + + {php echo date('Y-m-d H:i:s',$item['addtime'])} + + 详情 | + 删除 + +
      + +
      + +
      {$pageUrl}
      + + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/logs_show.html b/app/system/html/logs_show.html new file mode 100644 index 0000000..a2630cf --- /dev/null +++ b/app/system/html/logs_show.html @@ -0,0 +1,31 @@ +{php include pubTemplate("header_admin")} + +
      + {template anti_menu} + + + + + +
      + + + + + + + + + + + +
      logid{$strLog['logid']}
      ptable{$strLog['ptable']}
      pkey{$strLog['pkey']}
      pid{$strLog['pid']}
      userid{$strLog['userid']}
      status{$strLog['status']}
      addtime{php echo date('Y-m-d H:i:s',$strLog['addtime'])}
      title{php echo tsTitle($strLog['title'])}
      content{php echo tsDecode($strLog['content'])}
      + +
      + + + + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/main.html b/app/system/html/main.html new file mode 100644 index 0000000..20a1bde --- /dev/null +++ b/app/system/html/main.html @@ -0,0 +1,134 @@ +{php include pubTemplate("header_admin")} + + + + + +
      + + +
      + +
      + +
      +
      目录权限
      +
      + + + + + + + + + +
      cache目录:{if iswriteable('cache')==0}不可写(请设置为可写777权限){else}可写{/if}
      data目录:{if iswriteable('data')==0}不可写(请设置为可写777权限){else}可写{/if}
      tslogs目录:{if iswriteable('tslogs')==0}不可写(请设置为可写777权限){else}可写{/if}
      upgrade目录:{if iswriteable('upgrade')==0}不可写(请设置为可写777权限){else}可写{/if}
      uploadfile目录:{if iswriteable('uploadfile')==0}不可写(请设置为可写777权限){else}可写{/if}
      +
      +
      + + +
      +
      + + +
      +
      软件信息
      +
      + + + + + + + + +
      程序版本:{$TS_CF['info']['name']} {$TS_CF['info']['version']}
      联系方式:QQ:{$TS_CF['info']['qq']} 微信:{$TS_CF['info']['weixin']}
      官方网址:{$TS_CF['info']['url']}
      官方社区:https://demo.thinksaas.cn/
      域名授权:
      +
      +
      + +
      +
      + +
      +
      服务器信息
      +
      + + + + + + + + + + + + + +
      服务器软件:{$systemInfo[server]}
      操作系统:{$systemInfo[phpos]}
      PHP版本:{$systemInfo[phpversion]}
      MySQL版本:{$systemInfo[mysql]}
      物理路径:$_SERVER[DOCUMENT_ROOT]
      php附件上传限制:{$systemInfo['upload']}
      php内存限制:{$systemInfo['memory']}
      php图像处理:{$systemInfo['gd']}
      语言:{$_SERVER[HTTP_ACCEPT_LANGUAGE]}
      gzip压缩:{if $_SERVER[HTTP_ACCEPT_ENCODING]}{$_SERVER[HTTP_ACCEPT_ENCODING]}{else}不支持{/if}
      +
      +
      + +
      +
      + +
      +
      ThinkSAAS消息
      +
      + + + + +
      +
      +
      + +
      + +
      + + + + +
      +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/menu.html b/app/system/html/menu.html new file mode 100644 index 0000000..22ad4e6 --- /dev/null +++ b/app/system/html/menu.html @@ -0,0 +1,13 @@ + + +
      \ No newline at end of file diff --git a/app/system/html/options.html b/app/system/html/options.html new file mode 100644 index 0000000..8017e4b --- /dev/null +++ b/app/system/html/options.html @@ -0,0 +1,403 @@ +{php include pubTemplate("header_admin")} + + + + + +
      +{template menu} +
      + +
      常规选项
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      网站标题:
      副标题: (例如:又一个ThinkSAAS社区小组)
      关键词: (关键词有助于SEO)
      网站说明: (用简洁的文字描述本站点。)
      站点地址(URL):(必须以http://开头,以/结尾。如果采用相对路径,请只填写/)
      固定地址:(例如:http://www.thinksaas.cn/,必须以/结尾,主要用于采用固定链接的URL)
      网站密钥: 重新生成 (非常重要,切勿泄漏)
      网站Logo: + +(支持png,gif,jpg格式,宽度285px高度60px)
      电子邮件 :
      ICP备案号 : (京ICP备09050100号)
      是否上传头像 : + 不需要 + 需要 +
      用户注册 : + 开放注册 + 邀请注册 + 关闭注册 +
      注册方式 : + Email邮箱 + 手机号 + Email邮箱+手机号 + (手机号注册需要先安装手机号注册功能) +
      是否开启短信登录: + 不开启 + 开启 +
      是否验证Email : + 不验证Email + 验证Email + + (当开启Email注册的时候才会验证email) + +
      是否验证手机号 : + + 不验证手机号 + 验证手机号 + + (手机号验证后同时可以使用手机号登录网站,注册方式中使用手机号注册的自动验证) + +
      登录是否跳转 :不跳转 跳转到我的社区
      是否开启验证码 :不开启 开启
      是否token验证 :
      是否开启公众平台登录: + +
      + 否 + (请先获取微信公众号所需要的参数,点击去获取) +
      + + +
      + +
      +
      AppID:
      +
      +
      + +
      +
      AppSecret:
      +
      +
      + +
      + + +
      是否开启人机验证 : + +
      + 否 + (请先获取人机验证所需要的参数,点击去获取) +
      + + +
      + +
      +
      VID:
      +
      +
      + +
      +
      KEY:
      +
      +
      + +
      + + +
      时区: + +
      + + + +
      内容设定
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      用户访问内容权限: + 不需要登录 + 需要登录 +
      用户发布内容权限: + 注册用户 + 仅Email验证用户 + 仅手机注册用户 + 仅手工认证用户 + 仅管理员 +
      是否开启匿名发布内容: + 不开启 + 开启 +
      用户发布内容时间 :
      (24小时制,以|分割。留空为不限制)
      发布内容间隔时间 : (0不限制;例如1分钟=60秒,30分钟就是30*60=1800秒;1小时3600秒)
      用户修改内容权限 :允许 不允许 (管理员除外)
      用户删除内容权限 :允许 不允许 (管理员除外)
      内容敏感词处理方式 :拦截发布 替换成*** (管理员除外)
      + + +
      系统主题
      + + + + + + + + + +
      选择主题: + +
      +
        +{loop $arrTheme $key $item} +
      • + +
        + {$item} +
      • +{/loop} +
      +
      + +
      + + +
      链接形式
      + + + + + + + + + + + + + + +
      形式1: index.php?app=group&ac=show&id=1
      形式2: index.php/group/show/id-1
      形式3: group-show-id-1.html
      形式4: group/show/id-1
      形式5: group/show/1
      形式6: group/show/id/1
      形式7: group/show/1/
      + + +
      默认支持Apache环境的rewrite,如果是nginx环境,请点击查看 ThinkSAAS社区URL重写规则之Nginx篇
      + + +
      其他选项
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      文件存储方式:
      【重要:用户上传数据后切勿来回切换存储方式,后果自负!如本地存储数据需要上云存储,请联系ThinkSAAS官方指导处理!】
      + + + 本地存储 + 阿里云(对象存储OSS) + + +
      + +
      + +
      + 使用阿里云(对象云存储OSS),需要购买阿里云对象存储,点击去购买,并获取以下参数。 +
      + +
      +
      AccessKey ID:
      +
      + +
      + +
      +
      AccessKey Secret:
      +
      +
      + + +
      +
      Bucket 名称:
      +
      +
      例如:thinksaas
      +
      + +
      +
      Endpoint(地域节点):
      +
      +
      例如:https://oss-cn-beijing.aliyuncs.com
      +
      + +
      +
      Bucket 域名:
      +
      +
      例如:https://thinksaas.oss-cn-beijing.aliyuncs.com
      +
      + + +
      + + +
      图片上传大小:M (请填写数字,例如2)
      图片上传格式:(请以英文逗号分割,例如:jpg,gif,png)
      是否开启正文图片检测: + + + 不开启 + 开启 + +
      图片处理组件: + + gd + imagick (服务器和php环境必须支持imagick扩展) + +
      附件上传大小:M (请填写数字,例如2)
      附件上传格式:(请以英文逗号分割,例如:zip,rar,doc,txt,ppt)
      用户每日获得积分上限: 积分(设置每日获得积分上限后,用户当天的内容动作不再获得积分奖励。)
      + + +
      +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/plugin_list.html b/app/system/html/plugin_list.html new file mode 100644 index 0000000..7346ec4 --- /dev/null +++ b/app/system/html/plugin_list.html @@ -0,0 +1,76 @@ +{php include pubTemplate("header_admin")} + +
      + + +
      + +
      +
      + + + + {if $arrAppsAbout[$apps]['hook']} + +
      + + 全部 + + {loop $arrAppsAbout[$apps]['hook'] $key $item} + {$item} + {/loop} + +
      + + {/if} + + + + + + + + + + + + + + + +{loop $arrPlugin $key $item} + + + + + + + +{/loop} + +
      名称版本介绍作者操作
      {$item['about']['name']} ({$item['name']}){$item['about']['version']}{$item['about']['desc']}{$item['about']['author']} + +{if in_array($item['name'],$app_plugins)} + 停用 + {else} + 启用 + {/if} + +{if $item['about']['isedit']=='1' && in_array($item['name'],$app_plugins)} + 编辑 + {/if} + + + +
      + +
      +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/spam.html b/app/system/html/spam.html new file mode 100644 index 0000000..2adc6b4 --- /dev/null +++ b/app/system/html/spam.html @@ -0,0 +1,83 @@ +{php include pubTemplate("header_admin")} + +
      + +

      反垃圾设置

      +

      针对日益猖獗的垃圾广告和垃圾内容,ThinkSAAS成立反垃圾广告和内容联盟,自启用之日起就将和垃圾广告和内容战斗到底。

      + + + + + + + + + + + + + + + + + + + +
      禁止用户: +禁止用户会同时禁止用户登录和禁止用户IP登录 +
      +操作方法:
      +用户管理->停用 +
      +进入用户管理>> +
      清空用户数据: + +清空垃圾用户所发的所有垃圾内容 +
      +操作方法:
      +用户管理->清空数据 +
      +进入用户管理>> +
      垃圾词过滤: + +通过开启《敏感词语过滤插件 (wast_word)》来过滤和杜绝垃圾广告和内容 +
      +操作方法:
      +插件管理->敏感词语过滤插件 (wast_word)->开启 +
      进入插件管理>> | 更新云垃圾词库>> +
      开启验证码: +通过开启发帖验证码,评论回复验证码来限制垃圾用户创造垃圾内容 +
      + +

      远程提交垃圾词语

      +

      如果你发现有垃圾词语,请通过下面输入远程提交给ThinkSAAS,我们将建立强大的垃圾词云存储库。

      + + + + +
      垃圾词: + + + + +
      + +
      + + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/sql.html b/app/system/html/sql.html new file mode 100644 index 0000000..d3f62a2 --- /dev/null +++ b/app/system/html/sql.html @@ -0,0 +1,17 @@ +{php include pubTemplate("header_admin")} + +
      +{template menu} + +
      +

      1、出于对数据库安全的考虑,ThinkSAAS将不直接通过后台对数据库进行任何的操作。

      +

      2、ThinkSAAS推荐你使用 免费的mysql管理工具 来管理你的数据库。 + + 点击去查看下载 + +

      + +
      + +
      +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/test.html b/app/system/html/test.html new file mode 100644 index 0000000..05e935b --- /dev/null +++ b/app/system/html/test.html @@ -0,0 +1,31 @@ +{php include pubTemplate("header_admin")} + +
      + {template anti_menu} + +
      +
      + + + + + + + + + + + + + +
      选择文件 + +
      + + +
      +
      + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/update.html b/app/system/html/update.html new file mode 100644 index 0000000..12bcf9c --- /dev/null +++ b/app/system/html/update.html @@ -0,0 +1,28 @@ +{php include pubTemplate("header_admin")} +
      +
      + +
      + +
      + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/update_hand.html b/app/system/html/update_hand.html new file mode 100644 index 0000000..ff26cf4 --- /dev/null +++ b/app/system/html/update_hand.html @@ -0,0 +1,45 @@ +{php include pubTemplate("header_admin")} + +
      + + + +
      +

      手动升级:检测系统基本权限

      +
      + + + + + + + + +
      + + +
      + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/update_one.html b/app/system/html/update_one.html new file mode 100644 index 0000000..0a26b22 --- /dev/null +++ b/app/system/html/update_one.html @@ -0,0 +1,47 @@ +{php include pubTemplate("header_admin")} + +
      + + + +
      +

      第一步:检测系统基本权限

      +
      + + + + + + + + +
      + + +
      + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/update_three.html b/app/system/html/update_three.html new file mode 100644 index 0000000..a885722 --- /dev/null +++ b/app/system/html/update_three.html @@ -0,0 +1,44 @@ +{php include pubTemplate("header_admin")} + +
      + + + +
      +

      第三步:升级系统文件

      + +
      + + + + + +
      + + +
      + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/html/update_two.html b/app/system/html/update_two.html new file mode 100644 index 0000000..11d7b93 --- /dev/null +++ b/app/system/html/update_two.html @@ -0,0 +1,42 @@ +{php include pubTemplate("header_admin")} + +
      + + + +
      +

      第二步:升级数据库

      + +
      + + + +
      + + +
      + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/system/js/admin.js b/app/system/js/admin.js new file mode 100644 index 0000000..e69de29 diff --git a/app/system/js/extend.func.js b/app/system/js/extend.func.js new file mode 100644 index 0000000..e69de29 diff --git a/app/system/skin/loading.gif b/app/system/skin/loading.gif new file mode 100644 index 0000000..6a56815 Binary files /dev/null and b/app/system/skin/loading.gif differ diff --git a/app/system/skin/logo.png b/app/system/skin/logo.png new file mode 100644 index 0000000..a7ab143 Binary files /dev/null and b/app/system/skin/logo.png differ diff --git a/app/system/skin/style.css b/app/system/skin/style.css new file mode 100644 index 0000000..7da543c --- /dev/null +++ b/app/system/skin/style.css @@ -0,0 +1,79 @@ +/**框架CSS**/ +body{ margin:0; padding:0; font-family:Verdana, sans-serif, 宋体;font-size:14px;color:#555555;background:#FFFFFF;} + + + +.c9{color:#999999;} + +.fs12{font-size: 12px;} +.fs14{font-size: 14px;} +.fs16{font-size: 16px;} + + + +/*导航*/ +.tabnav { + padding:15px 0px 15px 0px; + overflow:hidden; + margin-bottom:20px; + position: fixed; + width: 100%; + background: #FFFFFF; + z-index:100000; + +} + +.tabnav h6{ + margin-bottom: 15px; + font-weight: bold; +} + +.tabnav ul { + list-style: none; + margin:0; + padding:0; + width: 100%; + overflow: hidden; + border-bottom:1px solid #3A81C0; +} +.tabnav ul li { + list-style: none; + border:solid 1px #3A81C0; + float:left; + margin-right:5px; + padding:0px 10px; + height:30px; + line-height: 30px; + font-size:14px; + border-bottom:none; +} + +.tabnav a {color: #3A81C0;} + +.tabnav .select { +background:#3A81C0; +} +.tabnav .select a { +color:#FFFFFF; +font-weight:bold; +} + + +/*中部*/ +.midder{margin:0 auto;padding:0px 10px 10px 10px;overflow:hidden;background:#FFFFFF;} + + + +/*theme*/ +.theme{overflow:hidden;} +.theme ul{overflow:hidden;} +.theme ul li{height:120px;float:left;padding:5px;overflow:hidden;} + + +/**/ +.update{float:left;width:100%;} +.update h1{font-size:18px;} +.update .uptitle{font-weight: bold;} +.update .uplog{font-size:14px;background:#F8F8F8;padding:20px;border:solid 1px #EEEEEE;border-radius: 4px 4px 4px 4px;} +.update .uptime{padding:10px;font-size: 12px;} + diff --git a/app/system/skins/default/loading.gif b/app/system/skins/default/loading.gif new file mode 100644 index 0000000..6a56815 Binary files /dev/null and b/app/system/skins/default/loading.gif differ diff --git a/app/system/skins/default/logo.png b/app/system/skins/default/logo.png new file mode 100644 index 0000000..a7ab143 Binary files /dev/null and b/app/system/skins/default/logo.png differ diff --git a/app/system/skins/default/style.css b/app/system/skins/default/style.css new file mode 100644 index 0000000..3cb5093 --- /dev/null +++ b/app/system/skins/default/style.css @@ -0,0 +1,62 @@ +/**框架CSS**/ +body{ margin:0; padding:0; font-family:Verdana, sans-serif, 宋体;font-size:14px;color:#555555;background:#FFFFFF;} + + + +.c9{color:#999999;} + +.fs12{font-size: 12px;} + + + +/*导航*/ +.tabnav { +padding:0px; +overflow:hidden; +border-bottom:1px solid #3A81C0; +margin-bottom:20px; +} +.tabnav ul { + list-style: none; +margin:0; +padding:0; +} +.tabnav ul li { + list-style: none; +border:solid 1px #3A81C0; +float:left; +margin-right:5px; +padding:5px 10px; +font-size:14px; +border-bottom:none; +} + +.tabnav a {color: #3A81C0;} + +.tabnav .select { +background:#3A81C0; +} +.tabnav .select a { +color:#FFFFFF; +font-weight:bold; +} + + +/*中部*/ +.midder{margin:0 auto;padding:10px;overflow:hidden;background:#FFFFFF;} + + + +/*theme*/ +.theme{overflow:hidden;} +.theme ul{overflow:hidden;} +.theme ul li{height:120px;float:left;padding:5px;overflow:hidden;} + + +/**/ +.update{float:left;width:100%;} +.update h1{font-size:18px;} +.update .uptitle{font-weight: bold;} +.update .uplog{font-size:14px;background:#F8F8F8;padding:20px;border:solid 1px #EEEEEE;border-radius: 4px 4px 4px 4px;} +.update .uptime{padding:10px;font-size: 12px;} + diff --git a/app/tag/about.php b/app/tag/about.php new file mode 100644 index 0000000..6d93ba7 --- /dev/null +++ b/app/tag/about.php @@ -0,0 +1,17 @@ + '标签', + 'version' => '1.2', + 'desc' => '标签', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '0', + 'ismy'=>'0' +); \ No newline at end of file diff --git a/app/tag/action/add.php b/app/tag/action/add.php new file mode 100644 index 0000000..1d81cbf --- /dev/null +++ b/app/tag/action/add.php @@ -0,0 +1,25 @@ +addTag($objname,$idname,$objid,$tags); + + tsNotice('标签添加成功!'); + + break; +} \ No newline at end of file diff --git a/app/tag/action/add_ajax.php b/app/tag/action/add_ajax.php new file mode 100644 index 0000000..4bac41d --- /dev/null +++ b/app/tag/action/add_ajax.php @@ -0,0 +1,25 @@ +addTag($objname,$idname,$objid,$tags); + + echo ""; + + break; +} \ No newline at end of file diff --git a/app/tag/action/admin.php b/app/tag/action/admin.php new file mode 100644 index 0000000..b04d6eb --- /dev/null +++ b/app/tag/action/admin.php @@ -0,0 +1,10 @@ +isTag($tag)==true) qiMsg('标签已存在,无需添加!'); + + $new['tag']->create('tag',array( + 'tagname'=>$tag, + 'uptime'=>time(), + )); + + header('Location: '.SITE_URL.'index.php?app=tag&ac=admin&mg=list'); + + break; + + //审核 + case "isaudit": + $tagid = tsIntval($_GET['tagid']); + $isaudit = tsIntval($_GET['isaudit']); + + $db->query("update ".dbprefix."tag set `isaudit`='$isaudit' where tagid = '$tagid'"); + + qiMsg("设置成功!"); + + break; + + //删除 + case "del": + $tagid = tsIntval($_GET['tagid']); + $page = tsIntval($_GET['page']); + + $new['tag']->delete('tag',array('tagid'=>$tagid)); + $new['tag']->delete('tag_article_index',array('tagid'=>$tagid)); + $new['tag']->delete('tag_bang_index',array('tagid'=>$tagid)); + $new['tag']->delete('tag_group_index',array('tagid'=>$tagid)); + $new['tag']->delete('tag_photo_index',array('tagid'=>$tagid)); + $new['tag']->delete('tag_study_index',array('tagid'=>$tagid)); + $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 = tsIntval($_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; +} \ No newline at end of file diff --git a/app/tag/action/admin/list.php b/app/tag/action/admin/list.php new file mode 100644 index 0000000..998dfb3 --- /dev/null +++ b/app/tag/action/admin/list.php @@ -0,0 +1,18 @@ +fetch_all_assoc("select * from ".dbprefix."tag order by uptime desc limit $sLimit,10"); + +$tagNum = $db->once_num_rows("select * from ".dbprefix."tag"); + +$pageUrl = pagination($tagNum, 10, $page, $url); + +include template("admin/list"); \ No newline at end of file diff --git a/app/tag/action/admin/options.php b/app/tag/action/admin/options.php new file mode 100644 index 0000000..175843b --- /dev/null +++ b/app/tag/action/admin/options.php @@ -0,0 +1,19 @@ +findCount('tag',array( + 'tagname'=>$tagname, + )); + + if($tagcount == '0'){ + + $tagid = $this->create('tag',array( + 'tagname'=>$tagname, + 'isaudit'=>$isaudit, + 'uptime'=>$uptime, + )); + + $tagIndexCount = $this->findCount('tag_'.$objname.'_index',array( + $idname=>$objid, + 'tagid'=>$tagid, + )); + + if($tagIndexCount == '0'){ + + $this->create("tag_".$objname."_index",array( + $idname=>$objid, + 'tagid'=>$tagid, + )); + + } + + $tagIdCount = $this->findCount("tag_".$objname."_index",array( + 'tagid'=>$tagid, + )); + + $count_obj = "count_".$objname; + + $this->update('tag',array( + 'tagid'=>$tagid, + ),array( + $count_obj=>$tagIdCount, + )); + + }else{ + + $tagData = $this->find('tag',array( + 'tagname'=>$tagname, + )); + + $tagIndexCount = $this->findCount("tag_".$objname."_index",array( + $idname=>$objid, + 'tagid'=>$tagData['tagid'], + )); + + if($tagIndexCount == '0'){ + + $this->create("tag_".$objname."_index",array( + + $idname=>$objid, + 'tagid'=>$tagData['tagid'], + + )); + + } + + $tagIdCount = $this->findCount("tag_".$objname."_index",array( + 'tagid'=>$tagData['tagid'], + )); + + $count_obj = "count_".$objname; + + $this->update('tag',array( + 'tagid'=>$tagData['tagid'], + ),array( + $count_obj=>$tagIdCount, + 'uptime'=>$uptime, + )); + + } + + } + } + } + } + + //通过topic获取tag + function getObjTagByObjid($objname,$idname,$objid){ + + $arrTagIndex = $this->findAll("tag_".$objname."_index",array( + $idname=>$objid, + )); + + $arrTag = array(); + + if($arrTagIndex){ + foreach($arrTagIndex as $item){ + $arrTagId[] = $item['tagid']; + } + + $tagids = arr2str($arrTagId); + + $arrTag = $this->findAll('tag',"`tagid` in ($tagids) and `isaudit`=0"); + } + + return $arrTag; + + } + + //通过tagid获得tagname + function getOneTag($tagid){ + + $strTag = $this->find('tag',array( + 'tagid'=>$tagid, + )); + + if($strTag=='') ts404(); + + if($strTag['isaduit']==1) tsNotice('标签审核中...'); + + return $strTag; + } + + //通过tagname获取tag + function getTagByName($tagname){ + $strTag = $this->find('tag',array( + 'tagname'=>$tagname, + )); + if($strTag=='') ts404(); + if($strTag['isaudit']==1) tsNotice('标签审核中...'); + return $strTag; + } + + //统计标签 + function countObjTag($objname,$tagid){ + $countObj = $this->findCount("tag_".$objname."_index",array( + 'tagid'=>$tagid, + )); + $this->update('tag',array( + 'tagid'=>$tagid, + ),array( + 'count_'.$objname=>$countObj, + )); + + } + + //删除项目ID所有标签 + function delIndextag($objname,$idname,$objid){ + $this->delete("tag_".$objname."_index",array( + $idname=>$objid, + )); + return true; + } + + //tag是否存在 + public function isTag($tagname){ + $countTag = $this->findCount('tag',array( + 'tagname'=>$tagname, + )); + if($countTag>0){ + return true; + }else{ + return false; + } + } + + +} \ No newline at end of file diff --git a/app/tag/config.php b/app/tag/config.php new file mode 100644 index 0000000..8f87a8e --- /dev/null +++ b/app/tag/config.php @@ -0,0 +1,4 @@ + + +{php include template("admin/menu");} + +
      + +
      {$pageUrl}
      + + + + + + + + + + + + + + {loop $arrTags $key $item} + + {/loop} + + + + + + +
      ID标签名字创建时间操作
      {$item[tagid]}{$item[tagname]}{php echo date('Y-m-d H:i:s',$item[uptime])} + + [优化] + + [取消审核][审核] [删除]
      + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/tag/html/admin/menu.html b/app/tag/html/admin/menu.html new file mode 100644 index 0000000..1fc1487 --- /dev/null +++ b/app/tag/html/admin/menu.html @@ -0,0 +1,10 @@ + +
      +
      标签管理
      + +
      + +
      \ No newline at end of file diff --git a/app/tag/html/admin/options.html b/app/tag/html/admin/options.html new file mode 100644 index 0000000..2523f33 --- /dev/null +++ b/app/tag/html/admin/options.html @@ -0,0 +1,30 @@ +{php include pubTemplate("header_admin")} + +
      +{php include template("admin/menu");} + + + + +
      + + + + + + + + + + + +
      APP名称:
      APP介绍:
      APP关键词:
      标签是否审核显示:不审核 审核
      + +
      +
      + + + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/topic/about.php b/app/topic/about.php new file mode 100644 index 0000000..4b50ee2 --- /dev/null +++ b/app/topic/about.php @@ -0,0 +1,17 @@ + '话题', + 'version' => '1.2', + 'desc' => '话题,帖子', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '1', + 'ismy'=>'1' +); \ No newline at end of file diff --git a/app/topic/action/add.php b/app/topic/action/add.php new file mode 100644 index 0000000..60ed4e1 --- /dev/null +++ b/app/topic/action/add.php @@ -0,0 +1,337 @@ +isLogin (); + +//判断用户是否存在 +if(aac('user')->isUser($userid)==false) tsNotice('不好意思,用户不存在!'); + +//判断发布者状态 +if(aac('user')->isPublisher()==false) tsNotice('不好意思,你还没有权限发布内容!'); + +//发布时间限制 +if(aac('system')->pubTime()==false) tsNotice('不好意思,当前时间不允许发布内容!'); + +//发布时间间隔限制 +if($TS_SITE['timeblank']){ + $lastTopic = $new['topic']->find('topic',array( + 'userid'=>$userid, + ),'topicid,addtime','addtime desc'); + if($lastTopic){ + if((time()-$lastTopic['addtime'])<$TS_SITE['timeblank']){ + tsNotice('不好意思,您的内容发送频率过高!请等等再发布!'); + } + } +} + +//发布内容扣除积分限制 +$strScoreOption = $new['topic']->find('user_score',array( + 'app'=>'topic', + 'action'=>'add', + 'ts'=>'do', +)); +if($strScoreOption && $strScoreOption['status']==1){ + #用户积分数 + $strUserScore = $new['topic']->find('user_info',array( + 'userid'=>$userid, + ),'count_score'); + if($strUserScore['count_score']<$strScoreOption['score']){ + tsNotice('不好意思,您的积分不足!'); + } +} + + +$groupid = tsIntval($_GET ['groupid']); + +// 小组数目 +$groupNum = $new ['topic']->findCount ( 'group', array ( + 'groupid' => $groupid +) ); + +if ($groupNum == 0) { + header ( "Location: " . SITE_URL ); + exit (); +} + +// 小组会员 +$isGroupUser = $new ['topic']->findCount ( 'group_user', array ( + 'userid' => $userid, + 'groupid' => $groupid +) ); + +//小组信息 +$strGroup = $new ['topic']->find ( 'group', array ( + 'groupid' => $groupid +)); +$strGroup ['groupname'] = tsTitle( $strGroup ['groupname'] ); +$strGroup ['groupdesc'] = tsTitle( $strGroup ['groupdesc'] ); + +if ($strGroup ['isaudit'] == 1) { + tsNotice ( '小组还未审核通过,不允许发帖!' ); +} + +// 允许小组成员发帖 +if ($strGroup ['ispost'] == 0 && $isGroupUser == 0 && $userid != $strGroup ['userid']) { + tsNotice ( "本小组只允许小组成员发贴,请加入小组后再发帖!" ); +} +// 不允许小组成员发帖 +if ($strGroup ['ispost'] == 1 && $userid != $strGroup ['userid']) { + tsNotice ( "本小组只允许小组组长发帖!" ); +} + +switch ($ts) { + + // 发布帖子 + case "" : + + // 帖子类型 + $arrGroupType = $new ['topic']->findAll ( 'topic_type', array ( + 'groupid' => $strGroup ['groupid'] + ) ); + + #加载草稿箱 + $strDraft = $new['topic']->find('draft',array( + 'userid'=>$userid, + 'types'=>'topic', + )); + + $title = '发布帖子'; + // 包含模版 + include template ( "add" ); + + break; + + // 执行发布帖子 + case "do" : + + #验证码验证 + $authcode = strtolower ( $_POST ['authcode'] ); + if ($TS_SITE['isauthcode']) { + if ($authcode != $_SESSION ['verify']) { + tsNotice ( "验证码输入有误,请重新输入!" ); + } + } + + #人机验证 + $vaptcha_token = tsTrim($_POST ['vaptcha_token']); + $vaptcha_server = tsTrim($_POST['vaptcha_server']); + if ($TS_SITE['is_vaptcha']) { + $strVt = vaptcha($vaptcha_token,0,$vaptcha_server); + if($strVt['success']==0) { + tsNotice('人机验证未通过!'); + } + } + + $title = tsTrim( $_POST ['title'] ); + + $content = tsClean( $_POST ['content'] ); + $content2 = emptyText($_POST ['content']); + + $typeid = tsIntval ( $_POST ['typeid'] ); + $tag = $_POST ['tag']; + + $score = tsIntval($_POST ['score']);#积分 + + + //匿名用户 + $isniming = tsIntval($_POST['isniming']); + if($TS_SITE['isniming']==1 && $isniming==1) $userid = aac('user')->getNimingId(); + + + // 判断一下Title是否重复 + $isTitle = $new ['topic']->findCount ( 'topic', array ( + 'title' => $title + ) ); + + if ($isTitle > 0) { + tsNotice ( '有重复标题出现哦^_^' ); + } + + if ($TS_USER ['isadmin'] == 0) { + $title = antiWord ( $title ); + $content = antiWord ( $content ); + $tag = antiWord ( $tag ); + } + + $iscomment = tsIntval ( $_POST ['iscomment'] ); + $iscommentshow = tsIntval ( $_POST ['iscommentshow'] ); + + // 帖子是否需要审核 + if ($strGroup ['ispostaudit'] == 1) { + $isaudit = 1; + } else { + $isaudit = 0; + } + + #应用后台设置发帖是否需要审核,只针对普通用户 + if($TS_APP['isaudit']==1 && $TS_USER['isadmin']==0){ + $isaudit = 1; + } + + + if ($title == '' || $content2 == '' || $content=='') { + tsNotice ( '没有任何内容是不允许你通过滴^_^' ); + } + + if($score<0){ + tsNotice ( '积分填写有误!' ); + } + + /** + * ****************** + */ + // 防止用户发布重复内容,调出用户上一次发表的内容 + $strPreTopic = $new ['topic']->find ( 'topic', array ( + 'userid' => $userid + ), 'topicid,title,addtime', 'addtime desc' ); + + // print_r($strPreTopic);exit; + + + // 发帖间隔时间 + /* + $IntervalTime = time () - $strPreTopic ['addtime']; + // if($strPreTopic && $IntervalTime<3600){ + if ($strPreTopic) { + similar_text ( $strPreTopic ['title'], $title, $percent ); + if ($percent >= 90) { + $new ['topic']->update ( 'topic', array ( + 'topicid' => $strPreTopic ['topicid'] + ), array ( + 'isaudit' => 1 + ) ); + $isaudit = 1; + } + } + */ + + + + /** + * ***************** + */ + + $gaiyao = cututf8(t(tsDecode($content)),0,100); + + + $topicid = $new ['topic']->create ( 'topic', array ( + 'groupid' => $groupid, + 'typeid' => $typeid, + 'userid' => $userid, + 'title' => $title, + 'content' => $content, + 'gaiyao'=>$gaiyao, + 'score'=>$score, + 'iscomment' => $iscomment, + 'iscommentshow' => $iscommentshow, + 'isaudit' => $isaudit, + 'addtime' => time (), + 'uptime' => time () + ) ); + + + #清空草稿箱 + $new['topic']->delete('draft',array( + 'userid'=>$userid, + 'types'=>'topic', + )); + + + // 统计用户发帖数 + $countUserTopic = $new ['topic']->findCount ( 'topic', array ( + 'userid' => $userid + ) ); + + $new ['topic']->update ( 'user_info', array ( + 'userid' => $userid + ), array ( + 'count_topic' => $countUserTopic + ) ); + + // 处理@用户名 + /* + if (preg_match_all ( '/@/', $content, $at )) { + preg_match_all ( "/@(.+?)([\s|:]|$)/is", $content, $matches ); + + $unames = $matches [1]; + + $ns = "'" . implode ( "','", $unames ) . "'"; + + $csql = "username IN($ns)"; + + if ($unames) { + + $query = $db->fetch_all_assoc ( "select userid,username from " . dbprefix . "user_info where $csql" ); + + foreach ( $query as $v ) { + $content = str_replace ( '@' . $v ['username'] . '', '[@' . $v ['username'] . ':' . $v ['userid'] . ']', $content ); + $msg_content = '我在帖子中提到了你
      去看看:' . tsUrl ( 'group', 'topic', array ( + 'id' => $topicid + ) ); + aac ( 'message' )->sendmsg ( $userid, $v ['userid'], $msg_content ); + } + $new ['topic']->update ( 'topic', array ( + 'topicid' => $topicid + ), array ( + 'content' => $content + ) ); + } + } + */ + + // 统计帖子类型 + if ($typeid) { + $topicTypeNum = $new ['topic']->findCount ( 'topic', array ( + 'typeid' => $typeid + ) ); + + $new ['topic']->update ( 'topic_type', array ( + 'typeid' => $typeid + ), array ( + 'count_topic' => $topicTypeNum + ) ); + } + // 处理标签 + aac ( 'tag' )->addTag ( 'topic', 'topicid', $topicid, $tag ); + + // 统计需要审核的帖子 + $count_topic_audit = $new ['topic']->findCount ( 'topic', array ( + 'groupid' => $groupid, + 'isaudit' => '1' + ) ); + + // 统计小组下帖子数并更新 + $count_topic = $new ['topic']->findCount ( 'topic', array ( + 'groupid' => $groupid + ) ); + + // 统计今天发布帖子数 + $today_start = strtotime ( date ( 'Y-m-d 00:00:00' ) ); + $today_end = strtotime ( date ( 'Y-m-d 23:59:59' ) ); + + $count_topic_today = $new ['topic']->findCount ( 'topic', "`groupid`='$groupid' and `addtime`>'$today_start' and `addtime`<'$today_end'" ); + + $new ['topic']->update ( 'group', array ( + 'groupid' => $groupid + ), array ( + 'count_topic' => $count_topic, + 'count_topic_audit' => $count_topic_audit, + 'count_topic_today' => $count_topic_today, + 'uptime' => time () + ) ); + + // 对积分进行处理 + aac ( 'user' )->doScore ( $TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'], $TS_URL['ts'] ); + + #用户记录 + aac('pubs')->addLogs('topic','topicid',$topicid,$userid,$title,$content,0); + + + header ( "Location: " . tsUrl('topic', 'show', array ('id' => $topicid))); + break; +} diff --git a/app/topic/action/admin.php b/app/topic/action/admin.php new file mode 100644 index 0000000..3f99995 --- /dev/null +++ b/app/topic/action/admin.php @@ -0,0 +1,9 @@ +findAll('user_group',null,'ugid asc'); + + + + + include template('admin/permissions'); + + break; + + case "do": + + /** + * 权限参数说明,app,action必须,其他参数可选 + * app-action-ts + * app-action-mg-ts 当action=admin + * app-action-api-ts 当action=api + */ + + $ugid = tsIntval($_POST['ugid']); + + $arrOption = $_POST['option']; + + aac('pubs')->upAppPermissions($ugid,'topic',$arrOption); + + qiMsg('操作成功!'); + + + break; + +} \ No newline at end of file diff --git a/app/topic/action/admin/topic.php b/app/topic/action/admin/topic.php new file mode 100644 index 0000000..520d744 --- /dev/null +++ b/app/topic/action/admin/topic.php @@ -0,0 +1,232 @@ +1, + ); + } + + if($istop==1){ + $where = array( + 'istop'=>1, + ); + } + + + if($topicid){ + $where = array( + 'topicid'=>$topicid, + ); + } + + if($kw){ + $where = "`title` like '%$kw%'"; + } + + $arrTopic = $new['topic']->findAll('topic',$where,'addtime desc',null,$lstart.',10'); + + $topicNum = $new['topic']->findCount('topic',$where); + + $pageUrl = pagination($topicNum, 10, $page, $url); + + include template("admin/topic_list"); + + break; + + /** + * 删除帖子 + */ + case "delete": + $topicid = tsIntval($_GET['topicid']); + $strTopic = $new['topic']->getOneTopic($topicid); + + #用户记录 + aac('pubs')->addLogs('topic','topicid',$topicid,$TS_USER['userid'],$strTopic['title'],$strTopic['content'],2); + + $new['topic']->deleteTopic($strTopic); + qiMsg('删除成功'); + break; + + //帖子审核 + case "isaudit": + + $topicid = tsIntval($_GET['topicid']); + + $strTopic = $new['topic']->find('topic',array( + 'topicid'=>$topicid, + )); + + if($strTopic['isaudit']==0){ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'isaudit'=>1, + )); + } + + if($strTopic['isaudit']==1){ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'isaudit'=>0, + )); + } + + qiMsg('操作成功!'); + + break; + + + //推荐 + case "isrecommend": + + $topicid = tsIntval($_GET['topicid']); + + $strTopic = $new['topic']->find('topic',array( + 'topicid'=>$topicid, + )); + + if($strTopic['isrecommend']==0){ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'isrecommend'=>1, + )); + } + + if($strTopic['isrecommend']==1){ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'isrecommend'=>0, + )); + } + + qiMsg('操作成功!'); + + break; + + //置顶 + case "istop": + + $topicid = tsIntval($_GET['topicid']); + + $strTopic = $new['topic']->find('topic',array( + 'topicid'=>$topicid, + )); + + if($strTopic['istop']==0){ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'istop'=>1, + )); + } + + if($strTopic['istop']==1){ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'istop'=>0, + )); + } + + qiMsg('操作成功!'); + + break; + + + + //删除的帖子 + case "deletetopic": + + $page = tsIntval($_GET['page'],1); + $url = SITE_URL.'index.php?app=topic&ac=admin&mg=topic&ts=deletetopic&page='; + $lstart = $page*10-10; + + $arrTopic = $new['topic']->findAll('topic',array('isdelete'=>'1'),'addtime desc',null,$lstart.',10'); + + $topicNum = $new['topic']->findCount('topic',array( + 'isdelete'=>'1', + )); + + $pageUrl = pagination($topicNum, 10, $page, $url); + + include template("admin/topic_delete"); + + break; + + //编辑的帖子 + case "edittopic": + + $page = tsIntval($_GET['page'],1); + $url = SITE_URL.'index.php?app=topic&ac=admin&mg=topic&ts=edittopic&page='; + $lstart = $page*10-10; + + $arrTopic = $new['topic']->findAll('topic_edit',null,'addtime desc',null,$lstart.',10'); + + $topicNum = $new['topic']->findCount('topic_edit'); + + $pageUrl = pagination($topicNum, 10, $page, $url); + + include template("admin/topic_edit"); + + break; + + //执行更新帖子 + case "update": + + $topicid = tsIntval($_GET['topicid']); + + $strTopic = $new['topic']->find('topic_edit',array( + 'topicid'=>$topicid, + )); + + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'title'=>$strTopic['title'], + 'content'=>$strTopic['content'], + )); + + $new['topic']->update('topic_edit',array( + 'topicid'=>$topicid, + ),array( + 'isupdate'=>1, + )); + + qiMsg('更新成功!'); + + break; + + //查看单独某个修改的帖子 + case "editview": + $topicid = tsIntval($_GET['topicid']); + + $strTopic = $new['topic']->find('topic_edit',array( + 'topicid'=>$topicid, + )); + + include template('admin/topic_edit_view'); + break; + +} \ No newline at end of file diff --git a/app/topic/action/ajax.php b/app/topic/action/ajax.php new file mode 100644 index 0000000..64d5840 --- /dev/null +++ b/app/topic/action/ajax.php @@ -0,0 +1,204 @@ +find('topic',array( + 'topicid'=>$topicid, + )); + + if($strTopic['isaudit']==0){ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'isaudit'=>1, + )); + + echo 0;exit; + + } + + if($strTopic['isaudit']==1){ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'isaudit'=>0, + )); + + echo 1;exit; + + } + + break; + + //帖子推荐 + case "isrecommend": + + $userid = aac('user')->isLogin(); + + $js = tsIntval($_GET['js']); + + $topicid = tsIntval($_POST['topicid']); + + if($TS_USER['isadmin']==1 && $topicid){ + + $strTopic = $new['topic']->find('topic',array( + 'topicid'=>$topicid, + )); + + if($strTopic['isrecommend']==1){ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'isrecommend'=>0, + )); + + getJson('取消推荐成功!',$js); + + } + + if($strTopic['isrecommend']==0){ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'isrecommend'=>1, + )); + + getJson('推荐成功!',$js); + + } + + + }else{ + + getJson('非法操作',$js); + + } + + break; + + + /** + * 帖子加标注 + */ + case "book": + + $userid = aac('user')->isLogin(); + $topicid = tsIntval($_POST['topicid']); + $book = tsTrim($_POST['book']); + + //if($topicid==0 || $book==''){ + if($topicid==0){ + echo 0;exit; + } + + $strTopic = $new['topic']->find('topic',array( + 'topicid'=>$topicid, + ),'userid'); + + if($strTopic['userid']!=$userid && $TS_USER['isadmin']==0){ + echo 0;exit; + } + + if($TS_USER['isadmin']==1){ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'label'=>$book, + )); + }else{ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + 'userid'=>$userid, + ),array( + 'label'=>$book, + )); + } + + echo 1;exit; + + break; + + + //置顶帖子 + case "topic_istop": + + $userid = aac('user')->isLogin(); + + $topicid = tsIntval($_GET['topicid']); + + $strTopic = $new['topic']->find('topic',array( + 'topicid'=>$topicid, + )); + + $istop = $strTopic['istop']; + + $istop == 0 ? $istop = 1 : $istop = 0; + + $strGroup = $new['topic']->find('group',array( + 'groupid'=>$strTopic['groupid'], + )); + + if($userid==$strGroup['userid'] || $TS_USER['isadmin']==1){ + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'istop'=>$istop, + )); + + + tsNotice("操作成功!"); + + + }else{ + tsNotice("非法操作!"); + } + + break; + + + + + + //精华帖子 + case "isposts": + + $userid = aac('user')->isLogin(); + + $topicid = tsIntval($_GET['topicid']); + + if($userid == 0 || $topicid == 0) tsNotice("非法操作"); + + $strTopic = $db->once_fetch_assoc("select userid,groupid,title,isposts from ".dbprefix."topic where topicid='$topicid'"); + + $strGroup = $db->once_fetch_assoc("select userid from ".dbprefix."group where groupid='".$strTopic['groupid']."'"); + + if($userid == $strGroup['userid'] || tsIntval($TS_USER['isadmin']) == 1){ + if($strTopic['isposts']==0){ + $db->query("update ".dbprefix."topic set `isposts`='1' where `topicid`='$topicid'"); + + //msg start + $msg_userid = '0'; + $msg_touserid = $strTopic['userid']; + $msg_content = '恭喜,你的帖子:《'.$strTopic['title'].'》被评为精华帖啦^_^ '; + $msg_tourl = tsUrl('topic','show',array('id'=>$topicid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + //msg end + + }else{ + $db->query("update ".dbprefix."topic set `isposts`='0' where `topicid`='$topicid'"); + } + + tsNotice("操作成功!"); + }else{ + tsNotice("非法操作!"); + } + + break; + +} \ No newline at end of file diff --git a/app/topic/action/api.php b/app/topic/action/api.php new file mode 100644 index 0000000..0608b65 --- /dev/null +++ b/app/topic/action/api.php @@ -0,0 +1,9 @@ + +----------------------------------------------- +Topic Http Api List +URL:https://demo.thinksaas.cn +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +'; \ No newline at end of file diff --git a/app/topic/action/delete.php b/app/topic/action/delete.php new file mode 100644 index 0000000..a2741a9 --- /dev/null +++ b/app/topic/action/delete.php @@ -0,0 +1,42 @@ +isLogin(); + +//普通用户不允许删除内容 +if($TS_SITE['isallowdelete'] && $TS_USER ['isadmin'] == 0) tsNotice('系统不允许用户删除内容,请联系管理员删除!'); + +$topicid = tsIntval($_GET['topicid']); +$strTopic = $new['topic']->getOneTopic($topicid); +$strGroup = aac('group')->getOneGroup($strTopic['groupid']); +$strGroupUser = $new['topic']->find('group_user',array( + 'userid'=>$userid, + 'groupid'=>$groupid, +)); + +//系统管理员删除 +if($TS_USER['isadmin'] == '1'){ + + #用户记录 + aac('pubs')->addLogs('topic','topicid',$topicid,$userid,$strTopic['title'],$strTopic['content'],2); + + $new['topic']->deleteTopic($strTopic); + tsNotice('帖子删除成功!','点击返回小组首页',tsUrl('group')); +} + +//其他人员删除 +if($userid == $strTopic['userid'] || $userid == $strGroup['userid'] || $strGroupUser['isadmin']=='1'){ + + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'isdelete'=>1, + )); + + //处理积分 + aac('user')->doScore($TS_URL['app'],$TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'],$TS_URL['ts'],$strTopic['userid']); + + tsNotice('你的删除帖子申请已经提交!'); + +} \ No newline at end of file diff --git a/app/topic/action/edit.php b/app/topic/action/edit.php new file mode 100644 index 0000000..bdc557d --- /dev/null +++ b/app/topic/action/edit.php @@ -0,0 +1,164 @@ +isLogin(); + +//普通不用不允许编辑内容 +if($TS_SITE['isallowedit'] && $TS_USER ['isadmin'] == 0) tsNotice('系统不允许用户编辑内容,请联系管理员编辑!'); + +switch($ts){ + + //编辑帖子 + case "": + $topicid = tsIntval($_GET['topicid']); + + if($topicid == 0){ + header("Location: ".SITE_URL); + exit; + } + + $topicNum = $new['topic']->findCount('topic',array( + 'topicid'=>$topicid, + )); + + if($topicNum==0){ + header("Location: ".SITE_URL); + exit; + } + + $strTopic = $new['topic']->find('topic',array( + 'topicid'=>$topicid, + )); + + $strTopic['title'] = tsTitle($strTopic['title']); + //$strTopic['content'] = tsDecode($strTopic['content']); //为有效防止xss攻击,如果前端通过textarea标签加载的编辑器,请注释掉本行;如果编辑器有其他的加载方式,请视情况解除本行注释。 + + $strGroup = $new['topic']->find('group',array( + 'groupid'=>$strTopic['groupid'], + )); + + $strGroupUser = $new['topic']->find('group_user',array( + 'userid'=>$userid, + 'groupid'=>$strTopic['groupid'], + )); + + //print_r($strGroupUser);exit; + + if($strTopic['userid'] == $userid || $strGroup['userid']==$userid || $TS_USER['isadmin']==1 || $strGroupUser['isadmin']==1){ + $arrGroupType = $new['topic']->findAll('topic_type',array( + 'groupid'=>$strGroup['groupid'], + )); + + //找出TAG + $arrTags = aac('tag')->getObjTagByObjid('topic', 'topicid', $topicid); + foreach($arrTags as $key=>$item){ + $arrTag[] = $item['tagname']; + } + $strTopic['tag'] = arr2str($arrTag); + + $title = '编辑帖子'; + include template("edit"); + + }else{ + + header("Location: ".SITE_URL); + exit; + + } + break; + + //编辑帖子执行 + case "do": + + + $authcode = strtolower ( $_POST ['authcode'] ); + + if ($TS_SITE['isauthcode']) { + if ($authcode != $_SESSION ['verify']) { + tsNotice ( "验证码输入有误,请重新输入!" ); + } + } + + $topicid = tsIntval($_POST['topicid']); + $typeid = tsIntval($_POST['typeid']); + + $title = tsTrim($_POST['title']); + + //echo br2nl($_POST['content']);exit; + + $content = tsClean($_POST['content']); + $content2 = emptyText($_POST['content']); + + $score = tsIntval($_POST ['score']);#积分 + + $iscomment = tsIntval($_POST['iscomment']); + $iscommentshow = tsIntval($_POST['iscommentshow']); + + if($topicid == '' || $title=='' || $content2=='' || $content=='') tsNotice("都不能为空的哦!"); + + if($score<0){ + tsNotice ( '积分填写有误!' ); + } + + if($TS_USER['isadmin']==0){ + + //过滤内容开始 + $title = antiWord($title); + $content = antiWord($content); + //过滤内容结束 + + } + + $strTopic = $new['topic']->find('topic',array( + 'topicid'=>$topicid, + )); + + $strGroup = $new['topic']->find('group',array( + 'groupid'=>$strTopic['groupid'], + )); + + $strGroupUser = $new['topic']->find('group_user',array( + 'userid'=>$userid, + 'groupid'=>$strTopic['groupid'], + )); + + if($strTopic['userid']==$userid || $strGroup['userid']==$userid || $TS_USER['isadmin']==1 || $strGroupUser['isadmin']==1){ + + $gaiyao = cututf8(t(tsDecode($content)),0,100); + + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'typeid' => $typeid, + 'title'=>$title, + 'content'=>$content, + 'gaiyao'=>$gaiyao, + 'score'=>$score, + 'iscomment' => $iscomment, + 'iscommentshow' => $iscommentshow, + )); + + + + //处理标签 + $tag = tsTrim($_POST['tag']); + if($tag){ + aac('tag')->delIndextag('topic','topicid',$topicid); + aac('tag') -> addTag('topic', 'topicid', $topicid, $tag); + } + + + #用户记录 + aac('pubs')->addLogs('topic','topicid',$topicid,$userid,$title,$content,1); + + + header("Location: ".tsUrl('topic','show',array('id'=>$topicid))); + + }else{ + header("Location: ".SITE_URL); + exit; + } + break; + +} \ No newline at end of file diff --git a/app/topic/action/group.php b/app/topic/action/group.php new file mode 100644 index 0000000..fe76a9f --- /dev/null +++ b/app/topic/action/group.php @@ -0,0 +1,20 @@ +isLogin (); + +$arrGroupUser = $new['topic']->findAll('group_user',array( + 'userid'=>$userid, +)); + +if($arrGroupUser==''){ + tsNotice('请加入小组后再发帖!','点击去加入小组',tsUrl('group')); +} + +foreach($arrGroupUser as $key=>$item){ + $arrGroup[$key] = aac('group')->getOneGroup($item['groupid']); +} + +$title = '选择发帖小组'; + +include template('group'); \ No newline at end of file diff --git a/app/topic/action/index.php b/app/topic/action/index.php new file mode 100644 index 0000000..9a2aea5 --- /dev/null +++ b/app/topic/action/index.php @@ -0,0 +1,41 @@ + '') ); +$lstart = $page * 20 - 20; + +$arrTopic = $new['topic']->findAll('topic',array( + 'isaudit'=>0, +),'istop desc,uptime desc','topicid,ptable,pkey,pid,pjson,userid,groupid,title,gaiyao,score,label,count_comment,count_view,iscommentshow,istop,uptime',$lstart.',20'); + +foreach($arrTopic as $key=>$item){ + $arrTopic[$key]['title']=tsTitle($item['title']); + $arrTopic[$key]['gaiyao']=tsTitle($item['gaiyao']); + $arrTopic[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + $arrTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']); + #应用扩展 + if($item['pjson']){ + $arrTopic[$key]['pjson'] = json_decode($item['pjson'],true); + } +} + +$topicNum = $new ['topic']->findCount ( 'topic', array ( + 'isaudit' => '0' +) ); + +$pageUrl = pagination ( $topicNum, 20, $page, $url ); + +#推荐话题 +$arrRecommendTopic = $new['topic']->findAll('topic',array( + 'isrecommend'=>1, + 'isaudit'=>0, +),'topicid desc','topicid,title',10); + +#热门话题 +$arrHotTopic = $new['topic']->findAll('topic',array( + 'isaudit'=>0, +),'count_comment desc','topicid,title',10); + +include template('index'); \ No newline at end of file diff --git a/app/topic/action/move.php b/app/topic/action/move.php new file mode 100644 index 0000000..b4a14b2 --- /dev/null +++ b/app/topic/action/move.php @@ -0,0 +1,98 @@ +isLogin(); + +switch($ts){ + + //移动帖子 + case "": + + $topicid = tsIntval($_GET['topicid']); + + if($topicid == 0) tsNotice("非法操作!"); + + $strTopic = $new['topic']->find('topic',array( + 'topicid'=>$topicid, + )); + + if($strTopic){ + + $strGroup = $new['topic']->find('group',array( + 'groupid'=>$strTopic['groupid'], + )); + + if($strTopic['userid']==$userid || $strGroup['userid']==$userid || $TS_USER['isadmin']==1){ + + + if($TS_USER['isadmin']==1){ + #如果是系统管理员,就调出所有的群组 + $arrGroup = $new['topic']->findAll('group',array( + 'isaudit'=>0 + ),'groupid desc','groupid,groupname'); + + }else{ + $arrGroups = $new['topic']->findAll('group_user',array( + 'userid'=>$strTopic['userid'], + )); + foreach($arrGroups as $item){ + if($item['groupid'] != $strGroup['groupid']){ + + $arrGroup[] = $new['topic']->find('group',array( + 'groupid'=>$item['groupid'], + )); + + } + + } + } + + + + $title = '移动帖子'; + include template("move"); + + }else{ + + tsNotice('非法操作!'); + + } + + + }else{ + + tsNotice('非法操作!'); + + } + + break; + + //执行移动 + case "do": + + $groupid = tsIntval($_POST['groupid']); + $topicid = tsIntval($_POST['topicid']); + + $strTopic = $new['topic']->find('topic',array( + 'topicid'=>$topicid, + )); + + if($strTopicid['userid']==$userid || $TS_USER['isadmin']==1){ + + $new['topic']->update('topic',array( + 'topicid'=>$topicid, + ),array( + 'groupid'=>$groupid, + 'typeid'=>'0', + )); + + + header("Location: ".tsUrl('topic','show',array('id'=>$topicid))); + }else{ + tsNotice('非法操作!'); + } + + break; + +} \ No newline at end of file diff --git a/app/topic/action/my.php b/app/topic/action/my.php new file mode 100644 index 0000000..0f8df1f --- /dev/null +++ b/app/topic/action/my.php @@ -0,0 +1,11 @@ +isLogin(); + $strUser = aac('user')->getOneUser($userid); + include_once 'app/' . $TS_URL['app'] . '/action/my/' . $TS_URL['my'] . '.php'; +} else { + qiMsg ( 'sorry:no index!' ); +} \ No newline at end of file diff --git a/app/topic/action/my/index.php b/app/topic/action/my/index.php new file mode 100644 index 0000000..4284208 --- /dev/null +++ b/app/topic/action/my/index.php @@ -0,0 +1,20 @@ +'index','page' => '' ) ); +$lstart = $page * 20 - 20; + +$arrTopic = $new['topic']->findAll('topic',array( + 'userid'=>$strUser['userid'], +),'addtime desc',null,$lstart.',20'); + +$topicNum = $new ['topic']->findCount ( 'topic', array ( + 'userid' => $strUser['userid'], +) ); + +$pageUrl = pagination ( $topicNum, 20, $page, $url ); + +$title = '我的帖子'; +include template('my/index'); \ No newline at end of file diff --git a/app/topic/action/score.php b/app/topic/action/score.php new file mode 100644 index 0000000..b173ab5 --- /dev/null +++ b/app/topic/action/score.php @@ -0,0 +1,63 @@ +find('topic',array( + 'topicid'=>$topicid, + ),'topicid,userid,score'); + + if($strTopic==''){ + getJson('帖子不存在!',1,0); + } + + if($strTopic['userid']==$userid){ + getJson('自己无需支付阅读自己的帖子!',1,0); + } + + $isTopicUser = $new['topic']->findCount('topic_user',array( + 'topicid'=>$topicid, + 'userid'=>$userid, + )); + + if($isTopicUser>0){ + getJson('你已经支付过,无需再次支付!',1,0); + } + + $strUserScore = $new['topic']->find('user_info',array( + 'userid'=>$userid, + ),'userid,count_score'); + + if($strUserScore['count_score']<$strTopic['score']){ + getJson('积分不足!',1,0); + } + + aac('user')->addScore($strTopic['userid'],'帖子收入'.$strTopic['topicid'],$strTopic['score'],1); + aac('user')->delScore($userid,'查看帖子'.$strTopic['topicid'],$strTopic['score']); + + $new['topic']->create('topic_user',array( + 'topicid'=>$topicid, + 'userid'=>$userid, + 'addtime'=>time(), + )); + + + getJson('积分支付成功!',1,2,tsUrl('topic','show',array('id'=>$topicid))); + + break; + +} \ No newline at end of file diff --git a/app/topic/action/show.php b/app/topic/action/show.php new file mode 100644 index 0000000..355d886 --- /dev/null +++ b/app/topic/action/show.php @@ -0,0 +1,182 @@ +find('topic',array( + 'topicid'=>$topicid, +)); + + +if($strTopic==''){ + header("HTTP/1.1 404 Not Found"); + header("Status: 404 Not Found"); + $title = '404'; + include pubTemplate("404"); + exit; +} + +#永久性跳转到其他项目 +if($strTopic['ptable'] && $strTopic['pid']){ + Header("HTTP/1.1 301 Moved Permanently"); + header('Location: '.getProjectUrl($strTopic['ptable'],$strTopic['pid'])); + exit(); +} + +//帖子审核 +if($strTopic['isaudit']==1 && $GLOBALS['TS_USER']['isadmin']==0){ + tsNotice('内容审核中......'); +} + + +//小组信息 +if($strTopic['groupid']){ + $strGroup = aac('group')->getOneGroup($strTopic['groupid']); + // 判断会员是否加入该小组 + $strGroupUser = array(); + if(tsIntval($TS_USER['userid'])){ + $strGroupUser = $new['topic']->find('group_user',array( + 'userid'=>tsIntval($TS_USER['userid']), + 'groupid'=>$strTopic['groupid'], + )); + } +} + +// 浏览方式 +if ($strGroup['isopen'] == '1' && $strGroupUser == '') { + $title = $strTopic['title']; + include template("topic_isopen");exit; +}elseif($strGroup['isopen'] == '1' && $strGroupUser && $TS_APP['ispayjoin']==1 && $strGroupUser['endtime']!='0000-00-00' && $strGroupUser['endtime']!='1970-01-01' && $strGroupUser['endtime'] $topicid)); + +$strTopic['content'] = tsDecode($strTopic['content'],$tp); + +//判断是否评论后显示帖子内容 +$isComment = $new['topic']->findCount('comment', array( + 'ptable'=>'topic', + 'pkey'=>'topicid', + 'pid' => $strTopic['topicid'], + 'userid' => tsIntval($TS_USER['userid']), +)); + +if($strTopic['iscommentshow']==1 && $isComment==0 && $strTopic['userid']!=tsIntval($TS_USER['userid'])){ + $strTopic['content'] = '
      你需要回复后才可以浏览帖子内容!
      '; +} + + +//编辑的数据 +if($strTopic['userid']==$TS_USER['userid']){ + + if($strTopic['isdelete']=='1'){ + tsNotice('你的帖子删除中...'); + } + +} + +// 帖子分类 +if ($strTopic['typeid'] != '0'){ + $strTopic['type'] = $new['topic']->find('topic_type', array( + 'typeid' => $strTopic['typeid'], + )); +} + + +$strTopic['content'] = @preg_replace("/\[@(.*)\:(.*)]/U","'$2'))." ' rel=\"face\" uid=\"$2\"'>@$1",$strTopic['content']); + + + +//处理通过小程序或者客户端发的图片 +$strTopic['photos'] = $new['topic']->getTopicPhoto($topicid); + + + +#应用扩展 +$strProject = $new['topic']->getProject($strTopic['ptable'],$strTopic['pkey'],$strTopic['pid']); +$strTopic['video'] = $strProject['video']; + + + +// 帖子标签 +$strTopic['tags'] = aac('tag')->getObjTagByObjid('topic', 'topicid', $topicid); +$strTopic['user'] = aac('user')->getSimpleUser($strTopic['userid']); + +//把标签作为关键词 +if($strTopic['tags']){ + foreach($strTopic['tags'] as $key=>$item){ + $arrTag[] = $item['tagname']; + } + $sitekey = arr2str($arrTag); +}else{ + $sitekey = $strTopic['title']; +} +//标题 +$title = $strTopic['title']; + + +// 评论列表开始 +$page = tsIntval($_GET['page'],1); +$url = tsUrl('topic', 'show', array('id' => $topicid, 'page' => '')); +$lstart = $page * 15-15; +$arrComment = aac('comment')->getCommentList('topic','topicid',$strTopic['topicid'],$page,$lstart,$strTopic['userid']); +$commentNum = aac('comment')->getCommentNum('topic','topicid',$strTopic['topicid']); +$pageUrl = pagination($commentNum, 15, $page, $url); +// 评论列表结束 + + +//7天内的热门帖子 +$arrHotTopic = $new['topic']->getHotTopic(7); + +//推荐帖子 +$arrRecommendTopic = $new['topic']->getRecommendTopic(); + + +//本组热门帖子 +$arrGroupHotTopic = $new['topic']->findAll('topic',array( + 'groupid'=>$strGroup['groupid'], + 'isaudit'=>0, +),'count_view desc','topicid,title',10); + +// 最新帖子 +$newTopic = $new['topic']->findAll('topic',array( + 'isaudit'=>'0', +),'addtime desc','topicid,title',10); + + + +//判断用户可阅读帖子:0可读1不可读 +$isread = 0; +if($strTopic['score']>0) $isread = 1; +if($TS_USER['userid'] && $strTopic['userid']==$TS_USER['userid']) $isread=0; +if($TS_USER['userid'] && $strTopic['userid']!=$TS_USER['userid'] && $strTopic['score']>0){ + $isTopicUser = $new['topic']->findCount('topic_user',array( + 'topicid'=>$topicid, + 'userid'=>$TS_USER['userid'], + )); + if($isTopicUser>0) $isread=0; +} +if($TS_USER['isadmin']==1) $isread=0; + + + + +$sitedesc = cututf8(t($strTopic['content']),0,100); + +$content = $strTopic['content']; +#钩子 +doAction('topic',$content); + +include template('show'); + +// 增加浏览次数 + +$new['topic']->update('topic', array( + 'topicid' => $strTopic['topicid'], +), array( + 'count_view' => $strTopic['count_view'] + 1, +)); \ No newline at end of file diff --git a/app/topic/action/tag.php b/app/topic/action/tag.php new file mode 100644 index 0000000..cd5383b --- /dev/null +++ b/app/topic/action/tag.php @@ -0,0 +1,59 @@ +getTagByName($name); + +$strTag['tagname'] = htmlspecialchars($strTag['tagname']); + +$page = tsIntval($_GET['page'],1); + +$url = tsUrl('group','tag',array('id'=>urlencode($name),'page'=>'')); + +$lstart = $page*30-30; + +$tagid = $strTag['tagid']; + +$arrTagId = $new['topic']->findAll('tag_topic_index',array( + 'tagid'=>$tagid, +),null,null,$lstart.',30'); + +foreach($arrTagId as $item){ + $strTopic = $new['topic']->find('topic',array( + 'topicid'=>$item['topicid'], + )); + if($strTopic==''){ + $new['topic']->delete('tag_topic_index',array( + 'topicid'=>$item['topicid'], + 'tagid'=>$item['tagid'], + )); + }else{ + $arrTopic[] = $strTopic; + } +} + + +aac('tag')->countObjTag('topic',$tagid); + +$topicNum = $new['topic']->findCount('tag_topic_index',array( + 'tagid'=>$tagid, +)); + +$pageUrl = pagination($topicNum, 30, $page, $url); + +foreach($arrTopic as $key=>$item){ + $arrTopic[$key]['title'] = htmlspecialchars($item['title']); + $arrTopic[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + $arrTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']); +} + +//热门tag +$arrTag = $new['topic']->findAll('tag',"`count_topic`>'0' and `isaudit`=0",'uptime desc',null,30); + +$sitekey = $strTag['tagname']; +$title = $strTag['tagname']; + +include template("tag"); \ No newline at end of file diff --git a/app/topic/action/tags.php b/app/topic/action/tags.php new file mode 100644 index 0000000..ee562f4 --- /dev/null +++ b/app/topic/action/tags.php @@ -0,0 +1,17 @@ +'')); + +$lstart = $page*200-200; + +$arrTag = $new['topic']->findAll('tag',"`count_topic`>'0' and `isaudit`=0",'uptime desc',null,$lstart.',200'); + +$tagNum = $new['topic']->findCount('tag',"`count_topic`>'0' and `isaudit`=0"); + +$pageUrl = pagination($tagNum, 200, $page, $url); + +$title = '标签'; +include template('tags'); \ No newline at end of file diff --git a/app/topic/class.topic.php b/app/topic/class.topic.php new file mode 100644 index 0000000..f840338 --- /dev/null +++ b/app/topic/class.topic.php @@ -0,0 +1,189 @@ +find('topic',array( + 'topicid'=>$topicid, + )); + return $strTopic; + } + + //是否存在帖子 + public function isTopic($topicid){ + $isTopic = $this->findCount('topic',array( + 'topicid'=>$topicid, + )); + if($isTopic > 0){ + return true; + }else{ + return false; + } + } + + /** + * 删除帖子 + * + * @param array $strTopic + * @return void + */ + public function deleteTopic($strTopic=array()){ + + $this->delete('topic',array('topicid'=>$strTopic['topicid'])); + $this->delete('tag_topic_index',array('topicid'=>$strTopic['topicid'])); + + + #删除评论ts_comment + aac('comment')->delComment('topic','topicid',$strTopic['topicid']); + + #删除点赞ts_love + aac('pubs')->delLove('topic','topicid',$strTopic['topicid']); + + + #删除图片ts_topic_photo + $arrPhoto = $this->findAll('topic_photo',array( + 'topicid'=>$strTopic['topicid'], + )); + + if($arrPhoto){ + foreach($arrPhoto as $key=>$item){ + unlink('uploadfile/group/topic/photo/'.$item['photo']); + tsDimg($item['photo'],'group/topic/photo','320','320',$item['path'],1); + tsDimg($item['photo'],'group/topic/photo','640','',$item['path']); + } + $this->delete('topic_photo',array('topicid'=>$strTopic['topicid'])); + } + + $this->countTopic($strTopic['groupid']); + + return true; + + } + + /* + * 统计小组里的话题并更新到小组 + */ + public function countTopic($groupid){ + $count_topic = $this->findCount('topic',array( + 'groupid'=>$groupid, + )); + + $this->update('group',array( + 'groupid'=>$groupid, + ),array( + 'count_topic'=>$count_topic, + )); + + } + + //热门帖子,1天,7天,30天 + public function getHotTopic($day){ + $startTime = time()-($day*3600*24); + + $endTime = time(); + + $arr = "`addtime`>'$startTime' and `count_view`>'0' and `addtime`<'$endTime' and `isaudit`='0'"; + + $arrTopic = $this->findAll('topic',$arr,'addtime desc','topicid,title,count_view,count_comment',10); + foreach($arrTopic as $key=>$item){ + $arrTopic[$key]['title']=tsTitle($item['title']); + } + + return $arrTopic; + + } + + //获取推荐的帖子(全部推荐和小组推荐) + public function getRecommendTopic($groupid=null,$num=20){ + if($groupid){ + $arr = array( + 'groupid'=>$groupid, + 'isrecommend'=>1, + 'isaudit'=>0, + ); + }else{ + $arr = array( + 'isrecommend'=>1, + 'isaudit'=>0, + ); + } + $arrTopic = $this->findAll('topic',$arr,'addtime desc','topicid,title',$num); + + foreach($arrTopic as $key=>$item){ + $arrTopic[$key]['title']=tsTitle($item['title']); + } + + return $arrTopic; + + } + + + /** + * 获取帖子图片,处理通过小程序或者客户端发的图片 + */ + public function getTopicPhoto($topicid,$num=null){ + $arrPhotos = $this->findAll('topic_photo',array( + 'topicid'=>$topicid, + ),'orderid asc',null,$num); + foreach($arrPhotos as $key=>$item){ + if($num){ + $arrPhoto[$key] = tsXimg($item['photo'],'group/topic/photo','320','320',$item['path'],1); + }else{ + $arrPhoto[$key] = tsXimg($item['photo'],'group/topic/photo','640','',$item['path']); + } + } + return $arrPhoto; + } + + + public function getProject($ptable,$pkey,$pid){ + if($ptable && $pkey && $pid){ + + $strProject = $this->find($ptable,array( + $pkey=>$pid, + )); + + if($ptable=='article'){ + ########文章######## + $strProject['title'] = tsTitle($strProject['title']); + $strProject['content'] = tsDecode($strProject['content']); + #处理正文样式和图片 + $strProject['content'] = mobileHtml($strProject['content']); + if($strProject['photo']){ + $strProject['photo'] = tsXimg($strProject['photo'],'article',640,360,$strProject['path'],'1'); + } + $topicInfo['article'] = $strProject; + + }elseif($ptable=='video'){ + ########视频######## + $topicInfo['video'] = SITE_URL.'uploadfile/video/'.$strProject['video']; + + } + + return $topicInfo; + + } + } + + +} \ No newline at end of file diff --git a/app/topic/config.php b/app/topic/config.php new file mode 100644 index 0000000..50e96f7 --- /dev/null +++ b/app/topic/config.php @@ -0,0 +1,6 @@ + + + + +
      +
      + + +
      +
      +
      + +
      + +
      + + +
      + + {if $arrGroupType} +
      + + + + +
      + {/if} + + +
      + +
      + +
      +
      + +
      + + +
      + +
      + + + 允许 不允许 + +
      + + +
      + + + 不需要 需要 + +
      + + +
      + + 积分 +
      + + + + {if $TS_SITE['isniming']==1} +
      + + 否 + (匿名发布后用户将无法对内容进行管理) +
      + {/if} + + + + + {if $TS_SITE['isauthcode']} +
      + + +
      + + 点击刷新验证码 + +
      + + +
      + {/if} + + + + {if $TS_SITE['is_vaptcha']} +
      + + +
      + +
      +
      +
      + + + + Vaptcha启动中... +
      +
      +
      + + + +
      + +
      + +
      + {/if} + + + + + + + + + + + 返回小组 + +

      + +
      + + +
      +
      +
      + + + +
      +
      + + + + + + + + +{php doAction('tseditor')} + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/topic/html/admin/menu.html b/app/topic/html/admin/menu.html new file mode 100644 index 0000000..1cfdb36 --- /dev/null +++ b/app/topic/html/admin/menu.html @@ -0,0 +1,18 @@ + + + +
      \ No newline at end of file diff --git a/app/topic/html/admin/options.html b/app/topic/html/admin/options.html new file mode 100644 index 0000000..1f27c46 --- /dev/null +++ b/app/topic/html/admin/options.html @@ -0,0 +1,29 @@ +{php include pubTemplate("header_admin")} + +
      + +{php include template("admin/menu");} + +
      + + + + + + + + + + + + + + + +
      APP名称:
      APP介绍:
      APP关键词:
      会员发布:允许 不允许
      是否审核:不审核 审核
      +
      +
      + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/topic/html/admin/permissions.html b/app/topic/html/admin/permissions.html new file mode 100644 index 0000000..e245ed7 --- /dev/null +++ b/app/topic/html/admin/permissions.html @@ -0,0 +1,130 @@ +{php include pubTemplate("header_admin")} + +
      + +{php include template("admin/menu");} + + + +
      + {loop $arrUg $key $item} + {$item['ugname']} + {/loop} +
      + + +
      + + +
      前台权限
      + + + + + + + + + + {if $ugid==1 || $ugid==2 || $ugid==3} + + + + + + + + + + + + + + + {/if} + + + + +
      查看帖子: + +
      发布帖子: + +
      修改帖子: + +
      删除帖子: + +
      + + + + {if $ugid==1 || $ugid==2} +
      后台权限
      + + + + + + + + + + + + +
      帖子配置: + +
      权限配置: + +
      + {/if} + + + +
      API权限
      + + + + + + + + + + + +
      查看帖子: + +
      + + + + + + +
      + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/topic/html/admin/topic_delete.html b/app/topic/html/admin/topic_delete.html new file mode 100644 index 0000000..e79e878 --- /dev/null +++ b/app/topic/html/admin/topic_delete.html @@ -0,0 +1,37 @@ +{php include pubTemplate("header_admin")} + + +
      + +{php include template("admin/menu");} + +
      {$pageUrl}
      + + + + + + + + + + +{loop $arrTopic $key $item} + + + + + + +{/loop} + +
      IDUserID标题时间操作
      {$item['topicid']}{$item['userid']} + + {$item['title']}{php echo date('Y-m-d H:i:s',$item['addtime'])} + +删除 + +
      + +
      +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/topic/html/admin/topic_edit.html b/app/topic/html/admin/topic_edit.html new file mode 100644 index 0000000..efa4ff4 --- /dev/null +++ b/app/topic/html/admin/topic_edit.html @@ -0,0 +1,45 @@ +{php include pubTemplate("header_admin")} + + +
      + +{php include template("admin/menu");} + +
      {$pageUrl}
      + + + + + + + + + + + + + + + + + + + + + {loop $arrTopic $key $item} + + + {/loop} + + + + + + + +
      ID标题时间状态操作
      {$item['topicid']}{$item['title']}{$item['addtime']}{if $item['isupdate']==1}已更新{else}未更新{/if} + 更新 +
      + +
      +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/topic/html/admin/topic_edit_view.html b/app/topic/html/admin/topic_edit_view.html new file mode 100644 index 0000000..56c9485 --- /dev/null +++ b/app/topic/html/admin/topic_edit_view.html @@ -0,0 +1,18 @@ +{php include pubTemplate("header_admin")} + + +
      + +{php include template("admin/menu");} + + + +
      +

      {$strTopic['title']}

      +
      {$strTopic['content']}
      +
      +
      {$strTopic['addtime']}
      +
      + +
      +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/topic/html/admin/topic_list.html b/app/topic/html/admin/topic_list.html new file mode 100644 index 0000000..bc9f5aa --- /dev/null +++ b/app/topic/html/admin/topic_list.html @@ -0,0 +1,119 @@ +{php include pubTemplate("header_admin")} + + +
      + +{php include template("admin/menu");} + +
      {$pageUrl}
      + + + +
      + + +
      + + + + + + + + + + + + + 全部 + 推荐 + 置顶 + + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + +{loop $arrTopic $key $item} + + + + + + + + + + + +{/loop} + + + +
      帖子ID用户ID圈子ID标题统计时间操作
      {$item['topicid']}{$item['userid']}{$item['groupid']}{tsTitle($item['title'])} + 浏览:{$item['count_view']}
      + 评论:{$item['count_comment']} +
      {php echo date('Y-m-d H:i:s',$item['addtime'])} + + + + + {if $item['isrecommend']==0} + 推荐 + {else} + 取消推荐 + {/if} + + + | + + +{if $item['isaudit']==0} +已审核 +{else} +未审核 +{/if} + + + | + + + + + {if $item['istop']==0} + 置顶 + {else} + 取消置顶 + {/if} + + + | 移动 + | 删除 + +
      + +
      +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/topic/html/edit.html b/app/topic/html/edit.html new file mode 100644 index 0000000..5101566 --- /dev/null +++ b/app/topic/html/edit.html @@ -0,0 +1,119 @@ +{php include pubTemplate("header")} +
      + + + + + +
      +
      + + +
      +
      +
      + + + +
      + + +
      + + +
      + +{if $arrGroupType} +
      + + + + +
      +{/if} + + +
      + + +
      + +
      + +
      + +
      + + +
      + +
      + + +允许 +不允许 + +
      + + +
      + + +不需要 +需要 + +
      + +
      + + 积分 +
      + +{if $TS_SITE['isauthcode']} +
      + + + + 点击刷新验证码 + +
      +{/if} + + + + + + + 返回 +

      + +
      + + + +
      +
      +
      + + +
      +
      + + + +
      +{php doAction('tseditor')} +{php include pubTemplate("footer")} diff --git a/app/topic/html/group.html b/app/topic/html/group.html new file mode 100644 index 0000000..0951b01 --- /dev/null +++ b/app/topic/html/group.html @@ -0,0 +1,42 @@ +{php include pubTemplate("header")} +
      + + + +
      +
      + +

      选择发帖小组

      +
      + +
      + + {loop $arrGroup $key $item} +
      + +
      {$item['groupname']}
      +
      + {/loop} + +
      + + + +
      +
      + + + + + + + +
      + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/topic/html/index.html b/app/topic/html/index.html new file mode 100644 index 0000000..a01fd77 --- /dev/null +++ b/app/topic/html/index.html @@ -0,0 +1,151 @@ +{php include pubTemplate("header")} + +
      + + + + + +
      +
      + +
      +
      最新话题
      +
      + + {if $arrTopic} + +
      +
        + {loop $arrTopic $key $item} +
      • +
        {$item['user']['username']}
        + +
        +
        + + {if $item['label']}{tsTitle($item['label'])}{/if} + + {$item['title']} + + {if $item['istop']=='1'} + [置顶] + {/if} + +
        + + {if $item['group']['isopen']==0 && $item['score']==0 && $item['iscommentshow']==0} +
        + {$item['gaiyao']} +
        + + + {if $item['ptable']=='' && $item['pjson']} +
        + {loop $item['pjson'] $pkey $pitem} + + {/loop} +
        + {/if} + + + {if $item['ptable']=='video' && $item['pjson']['siteid']==0} +
        + {if $item['pjson']['photo']} + + {else} + + {/if} +
        + {/if} + + {/if} + + +
        +
        + {$item['user']['username']} + {php echo getTime($item['uptime'],time())} + 发表于 + [{$item['group']['groupname']}] +
        +
        +
        {$item['count_comment']}
        +
        {$item['count_view']}
        +
        +
        + + + +
        + +
        +
      • + {/loop} +
      +
      + + +
      {$pageUrl}
      + + + {else} + +
      暂无话题
      + + {/if} + +
      + +
      + +
      +
      + + + +
      +
      推荐话题
      +
      + +
      +
      + + +
      +
      热门话题
      +
      + +
      +
      + + + + {php doAction('gobad','300')} + + +
      +
      + + + +
      + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/topic/html/move.html b/app/topic/html/move.html new file mode 100644 index 0000000..c8bc6d7 --- /dev/null +++ b/app/topic/html/move.html @@ -0,0 +1,52 @@ +{php include pubTemplate("header")} + +
      + + +
      +
      +
      + +
      +
      +

      移动帖子:{tsTitle($strTopic['title'])}

      +
      + + {if $arrGroup} +
      + +
      + + +
      + + + + + + + + 返回 +
      + {else} +
      + 没有可以移动的小组! 返回 +
      + {/if} + +
      +
      + +
      +
      +
      + + + +
      + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/topic/html/my/index.html b/app/topic/html/my/index.html new file mode 100644 index 0000000..546bbfd --- /dev/null +++ b/app/topic/html/my/index.html @@ -0,0 +1,62 @@ +{php include pubTemplate("header")} +
      + + + +
      + + +
      + +
      + + {php include pubTemplate("my")} + +
      + +
      +
      + + + +
      +
      我发布的帖子
      +
      + + + + + + + + + + + {loop $arrTopic $key $item} + + + + {/loop} + +
      发布时间标题浏览/评论操作
      {php echo date('Y-m-d',$item['addtime'])}{php echo tsTitle($item['title'])}{$item['count_view']}/{$item['count_comment']}修改
      + + + + +
      +
      + + + + + + + +
      +
      + + + + +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/topic/html/show.html b/app/topic/html/show.html new file mode 100644 index 0000000..9fba7da --- /dev/null +++ b/app/topic/html/show.html @@ -0,0 +1,289 @@ +{php include pubTemplate("header")} + +
      + + + + +
      + +
      + + + +
      +
      + + +

      {if $strTopic['label']}{tsTitle($strTopic['label'])}{/if}{if $strTopic['typeid'] !='0'}[{$strTopic['type']['typename']}]{/if}{$strTopic['title']}

      + + +
      + + +
      + + +
      + + {$strTopic['user']['username']} + +
      +
      + +
      {php echo date('Y-m-d H:i:s',$strTopic['addtime'])}
      +
      + + +
      + + + +
      + +
      {$strTopic['count_comment']}
      +
      {$strTopic['count_view']}
      + +
      +
      + + + + + +
      + {loop $strTopic[tags] $key $item} + {$item['tagname']} + {/loop} +
      + + + {if $page == '1'} +
      + + + {if $isread==1} +
      查看帖子需要支付 {$strTopic['score']}积分 支付
      + {else} + + +
      + {$strTopic['content']} + + + {if $strTopic['photos']} + {loop $strTopic['photos'] $key $item} +

      {$strTopic['title']}

      + {/loop} + {/if} + + + + {if $strTopic['video']} +

      + +

      + {/if} + + + {$tpUrl} +
      + + + + {/if} +
      + {/if} + + + + +
      {php doAction('topic_footer')}
      + +
      {php doAction('gobad','468')}
      + + + + {if $TS_USER['userid'] == $strTopic['userid'] || $TS_USER['userid']==$strGroup['userid'] || $strGroupUser['isadmin']=='1' || $TS_USER['isadmin']=='1'} + + {/if} + + +
      +
      + + + +
      +
      评论{if $strTopic['count_comment']} ({$strTopic['count_comment']}){/if}
      +
      + + + + + + {php include pubTemplate("comment")} + + + + + +
      + + {if $strTopic[iscomment] == 1} +
      此内容暂不接受评论!
      + {else} + + + + {if tsIntval($TS_USER[userid])==0} +
      + 登录 | 注册 +
      + {else} + +
      +
      + +
      +
      +
      + {if $TS_SITE['isauthcode']} + + 点击刷新验证码 + {/if} +
      +
      +
      是否公开:公开 不公开
      +
      +
      + + + + + +
      +
      +
      + {/if} + + + + {/if} +
      + +
      +
      + +
      + +
      + + + {php doAction('gobad','topic_right_top')} + + + +
      +
      最新帖子
      +
      + +
      +
      + + + +
      +
      热门帖子
      +
      + +
      + +
      + + + +
      + + {php doAction('gobad','300')} +
      + +
      +
      + + + + + +{php doAction('tseditor','mini')} +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/topic/html/tag.html b/app/topic/html/tag.html new file mode 100644 index 0000000..65f1317 --- /dev/null +++ b/app/topic/html/tag.html @@ -0,0 +1,90 @@ +{php include pubTemplate("header")} + +
      + + + + + +
      + +
      +
      +
      +

      {$strTag[tagname]}

      +
      +
      + + + +
      +
      {$strTag[tagname]}相关的帖子
      +
      +
      + +
      + +
      {$pageUrl}
      +
      + +
      + + +
      + +
      + +
      +
      热门标签
      +
      + {loop $arrTag $key $item} + {$item['tagname']} + {/loop} + +
      +
      + +
      + + {php doAction('gobad','300')} + +
      +
      +
      + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/topic/html/tags.html b/app/topic/html/tags.html new file mode 100644 index 0000000..61b7c50 --- /dev/null +++ b/app/topic/html/tags.html @@ -0,0 +1,36 @@ +{php include pubTemplate("header")} + +
      + + + + + + +
      +
      全部标签
      +
      + +
      + {loop $arrTag $key $item} + {$item[tagname]} + {/loop} + +
      + +
      {$pageUrl}
      +
      +
      + + + +
      + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/topic/html/topic_isopen.html b/app/topic/html/topic_isopen.html new file mode 100644 index 0000000..2b3b6be --- /dev/null +++ b/app/topic/html/topic_isopen.html @@ -0,0 +1,42 @@ +{php include pubTemplate("header")} + +
      + + + + + + + +
      +
      + + + +
      + + 本小组帖子只有小组成员才可以浏览^_^ + + {if $strGroup['joinway']==3} + 需要支付{$strGroup['price']}金币加入小组 + {else} + 加入小组 + {/if} +
      + + + +
      +
      + + + +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/topic/html/topic_xuqi.html b/app/topic/html/topic_xuqi.html new file mode 100644 index 0000000..eb37e10 --- /dev/null +++ b/app/topic/html/topic_xuqi.html @@ -0,0 +1,35 @@ +{php include pubTemplate("header")} + +
      + + + + + + + +
      +
      + + + +
      + 你的组费已经到期,请联系组长续期!续期后才可以访问帖子内容。 +
      + + + +
      +
      + + + +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/topic/js/extend.func.js b/app/topic/js/extend.func.js new file mode 100644 index 0000000..aeab450 --- /dev/null +++ b/app/topic/js/extend.func.js @@ -0,0 +1,50 @@ +//向下加载更多帖子 +function loadTopic(userid,page){ + var num = parseInt(page)+1; + $("#viewmore").html(''); + $.get(siteUrl+'index.php?app=topic&ac=ajax&ts=topic',{'userid':userid,'page':page},function(rs){ + if(rs==''){ + $("#viewmore").html('没有可以加载的内容啦...'); + }else{ + $("#before").before(rs); + $("#viewmore").html('查看更多内容......'); + } + }) +} + +//帖子审核 +function topicAudit(topicid,token){ + $.post(siteUrl+'index.php?app=topic&ac=ajax&ts=topicaudit',{'topicid':topicid,'token':token},function(rs){ + if(rs==0){ + + window.location.reload(); + return false; + }else if(rs==1){ + + window.location.reload(); + return false; + + }else if(rs==2){ + + tsNotice('非法操作!'); + + } + }) +} + +//标注 +function toBook(topicid){ + var book = $('#book-text').val(); + //if(topicid && book){ + if(topicid){ + $.post(siteUrl+'index.php?app=topic&ac=ajax&ts=book',{'topicid':topicid,'book':book},function (rs) { + if(rs==1){ + window.location.reload() + }else{ + //$('#book-alert').html('标注不能为空'); + } + }) + }else{ + //$('#book-alert').html('标注不能为空'); + } +} \ No newline at end of file diff --git a/app/topic/skin/style.css b/app/topic/skin/style.css new file mode 100644 index 0000000..e3f47f6 --- /dev/null +++ b/app/topic/skin/style.css @@ -0,0 +1,75 @@ +/*帖子列表*/ +.topic_list{overflow:hidden;} +.topic_list ul, .topic_list ul li{list-style: none;margin:0;padding:0;} +.topic_list ul{overflow:hidden;} +.topic_list ul li{overflow:hidden;padding:15px 0;display: block;border-bottom: 1px dashed #999999;} + +.topic_list ul li .other{background: none repeat scroll 0 0 #F8F8F8; + border-left: 3px solid #EEEEEE; + margin-left: 38px; + margin-top: 5px; + padding: 5px;} +.topic_list ul li .other p{margin:0px;padding:5px 0;} + +.topic_list .userimg{float:left;width:38px;overflow:hidden;} + +.topic_list .topic_title{margin-left:40px;overflow:hidden;} + +.topic_list .topic_title .title a{font-size:18px;font-weight: bold;} + +.topic_list .topic_title .gaiyao{color:#999999;} + +.topic_list .topic_title .photo{} +.topic_list .topic_title .photo img{max-width: 25%;margin-right: 10px;} + +.topic_list .topic_info{overflow: hidden;font-size:12px;color:#999999;} + +.rank { + background: none repeat scroll 0 0 #BBBBBB; + height: 15px; + line-height: 15px; + margin: 0 0 0 5px; + padding: 0 3px; + border-radius:5px 5px 5px 5px; +} + + + + +/*内容页*/ +.topic-content{width: 100%;overflow:hidden;} + +.topic-content .user-face{float: left;height: 48px;overflow: hidden;width: 48px;} + +.topic-content .topic-doc { + margin-bottom: 30px; + overflow: hidden; + margin-left:60px; +} +.topic-content .topic-doc .author { + height: auto; + margin: 0; + margin-bottom: 1px; + color: #666666; + background:#f4f4ec; + padding:5px; + font-size:12px; +} + +.topic-content img{max-width:100%;} +.topic-content .topic-view{font-size:16px;line-height:30px;overflow: hidden;word-wrap: break-word;word-break: normal;} + +.topic-content .topic-view a{color:#49a5de} + +.topic-content .topic-view p{font-size:16px;} + +.topic-content .topic-view table{border:#CCCCCC 1px solid;} +.topic-content .topic-view table td{ border:1px #CCCCCC solid; border-right:none; border-top:none;} + + +.btool{ + border-top: 1px solid #EEEEEE; + font-size: 12px; + padding: 10px 10px 0 10px; + text-align: right;} +.btool a{margin-left:10px;padding:0px;color:#999999} \ No newline at end of file diff --git a/app/user/about.php b/app/user/about.php new file mode 100644 index 0000000..0de3586 --- /dev/null +++ b/app/user/about.php @@ -0,0 +1,17 @@ + '用户', + 'version' => '1.2', + 'desc' => '用户中心,积分,头衔', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '1', + 'ismy'=>'0', +); \ No newline at end of file diff --git a/app/user/action/admin.php b/app/user/action/admin.php new file mode 100644 index 0000000..009cd9e --- /dev/null +++ b/app/user/action/admin.php @@ -0,0 +1,10 @@ +findAll('user_group',null,'ugid asc'); + + include template('admin/group_list'); + break; + + //创建用户组 + case "add": + + $ugname = tsTrim($_POST['ugname']); + $uginfo = tsTrim($_POST['uginfo']); + + if($ugname && $uginfo){ + $new['user']->create('user_group',array( + 'ugname'=>$ugname, + 'uginfo'=>$uginfo, + )); + } + + header('Location: '.SITE_URL.'index.php?app=user&ac=admin&mg=group&ts=list'); + + break; + + case "edit": + + $ugid = tsIntval($_POST['ugid']); + $ugname = tsTrim($_POST['ugname']); + $uginfo = tsTrim($_POST['uginfo']); + + if(in_array($ugid,array(1,2,3,4))) qiMsg('非法操作!'); + + $new['user']->update('user_group',array( + 'ugid'=>$ugid, + ),array( + 'ugname'=>$ugname, + 'uginfo'=>$uginfo, + )); + + header('Location: '.SITE_URL.'index.php?app=user&ac=admin&mg=group&ts=list'); + + break; + + //删除用户组 + case "delete": + $ugid = tsIntval($_GET['ugid']); + + if(in_array($ugid,array(1,2,3,4))){ + qiMsg('非法操作!'); + } + + $new['user']->delete('user_group',array( + 'ugid'=>$ugid, + )); + + #降为普通用户 + $new['user']->update('user_info',array( + 'ugid'=>$ugid, + ),array( + 'ugid'=>3, + )); + + header('Location: '.SITE_URL.'index.php?app=user&ac=admin&mg=group&ts=list'); + + break; + +} \ No newline at end of file diff --git a/app/user/action/admin/guestbook.php b/app/user/action/admin/guestbook.php new file mode 100644 index 0000000..9eef5c3 --- /dev/null +++ b/app/user/action/admin/guestbook.php @@ -0,0 +1,35 @@ +findAll('user_gb',null,'addtime desc',null,$lstart.',20'); + + $guestNum = $new['user']->findCount('user_gb'); + + $pageUrl = pagination($guestNum, 20, $page, $url); + + include template('admin/guestbook_list'); + + break; + + case "delete": + + $guestid = tsIntval($_GET['guestid']); + $page = tsIntval($_GET['page']); + + $new['user']->delete('user_gb',array( + 'id'=>$guestid, + )); + + header('Location: '.SITE_URL.'index.php?app=user&ac=admin&mg=guestbook&ts=list&page='.$page); + + break; + +} \ No newline at end of file diff --git a/app/user/action/admin/options.php b/app/user/action/admin/options.php new file mode 100644 index 0000000..2bfa72b --- /dev/null +++ b/app/user/action/admin/options.php @@ -0,0 +1,28 @@ +findAll('user_group',null,'ugid asc'); + + + + + include template('admin/permissions'); + + break; + + case "do": + + /** + * 权限参数说明,app,action必须,其他参数可选 + * app-action-ts + * app-action-mg-ts 当action=admin + * app-action-api-ts 当action=api + */ + + $ugid = tsIntval($_POST['ugid']); + + $arrOption = $_POST['option']; + + aac('pubs')->upAppPermissions($ugid,'user',$arrOption); + + qiMsg('操作成功!'); + + + break; + +} \ No newline at end of file diff --git a/app/user/action/admin/role.php b/app/user/action/admin/role.php new file mode 100644 index 0000000..618c538 --- /dev/null +++ b/app/user/action/admin/role.php @@ -0,0 +1,49 @@ +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 = tsTrim($item); + $score_start = tsTrim($arrScoreStart[$key]); + $score_end = tsTrim($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; + +} \ No newline at end of file diff --git a/app/user/action/admin/score.php b/app/user/action/admin/score.php new file mode 100644 index 0000000..4bcd363 --- /dev/null +++ b/app/user/action/admin/score.php @@ -0,0 +1,123 @@ +findAll('user_score'); + + include template('admin/score_list'); + break; + + case "adddo": + + $scorekey = tsTrim($_POST['scorekey']); + $scorename = tsTrim($_POST['scorename']); + $score = tsIntval($_POST['score']); + + $app = tsTrim($_POST['app']); + $action = tsTrim($_POST['action']); + $mg = tsTrim($_POST['mg']); + $api = tsTrim($_POST['api']); + $ts = tsTrim($_POST['ts']); + $status = tsIntval($_POST['status']); + + $new['user']->create('user_score',array( + 'scorekey'=>$scorekey, + 'scorename'=>$scorename, + 'score'=>$score, + 'app'=>$app, + 'action'=>$action, + 'mg'=>$mg, + 'api'=>$api, + 'ts'=>$ts, + 'status'=>$status, + )); + + header('Location: '.SITE_URL.'index.php?app=user&ac=admin&mg=score&ts=list'); + + break; + + case "editdo": + + $scoreid = tsIntval($_POST['scoreid']); + $score = tsIntval($_POST['score']); + $app = tsTrim($_POST['app']); + $action = tsTrim($_POST['action']); + $mg = tsTrim($_POST['mg']); + $api = tsTrim($_POST['api']); + $ts = tsTrim($_POST['ts']); + $status = tsIntval($_POST['status']); + + $new['user']->update('user_score',array( + 'scoreid'=>$scoreid, + ),array( + 'score'=>$score, + 'app'=>$app, + 'action'=>$action, + 'mg'=>$mg, + 'api'=>$api, + '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 = tsIntval($_POST['userid']); + $score = tsIntval($_POST['score']); + $status = tsIntval($_POST['status']); + $scorename = tsTrim($_POST['scorename']); + + if($userid && $score && $scorename){ + + $return = false; + + if($status==1){ + //减积分 + $return = $new['user']->delScore($userid,$scorename,$score); + $jiajian = '减去'; + }else{ + //加积分 + $return = $new['user']->addScore($userid,$scorename,$score,1); + $jiajian = '增加'; + } + + if($return==true){ + //发送系统消息 + $msg_userid = '0'; + $msg_touserid = $userid; + $msg_content = $scorename.$jiajian.$score.'积分'; + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content); + } + + qiMsg('操作成功!'); + }else{ + qiMsg('操作失败!'); + } + + break; + + case "delete": + $scoreid = tsIntval($_GET['scoreid']); + + $new['user']->delete('user_score',array( + 'scoreid'=>$scoreid, + )); + + qiMsg('删除成功!'); + + break; + +} \ No newline at end of file diff --git a/app/user/action/admin/user.php b/app/user/action/admin/user.php new file mode 100644 index 0000000..2f6f784 --- /dev/null +++ b/app/user/action/admin/user.php @@ -0,0 +1,403 @@ + 0 && $username==''){ + $arrData = array('userid'=>$userid); + }elseif($userid==0 && $username != ''){ + $arrData = array('username'=>$username); + }elseif($userid>0 && $username != ''){ + $arrData = array('userid'=>$userid,'username'=>$username); + } + + $lstart = $page*20-20; + + $url = SITE_URL.'index.php?app=user&ac=admin&mg=user&ts=list&userid='.$userid.'&username='.$username.'&page='; + + $arrAllUser = $new['user']->findAll('user_info',$arrData,'userid desc',null,$lstart.',20'); + + $userNum = $new['user']->findCount('user_info'); + + $pageUrl = pagination($userNum, 20, $page, $url); + + + #用户组 + $arrUg = $new['user']->findAll('user_group',"`ugid`!=4",'ugid asc'); + foreach($arrUg as $key=>$item){ + $arrUg1[$item['ugid']] = $item['ugname']; + } + + + include template("admin/user_list"); + + break; + + //用户编辑 + case "edit": + $userid = $_GET['userid']; + $strUser = $new['user']->getOneUser($userid); + + include template("admin/user_edit"); + break; + + //用户查看 + case "view": + $userid = $_GET['userid']; + + $strUser = $new['user']->getOneUser($userid); + + include template("admin/user_view"); + break; + + //用户停用启用 + case "isenable": + + $userid = tsIntval($_GET['userid']); + + if($userid==1) qiMsg('无法停用该用户!'); + + $page = tsIntval($_GET['page']); + + $strUser = $new['user']->find('user_info',array( + 'userid'=>$userid, + )); + + if($strUser['isadmin']==1) qiMsg('管理员不能停用!'); + + //禁用 + if($strUser['isenable']==0){ + + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'isenable'=>1, + )); + + //封用户Id + $isuser = $new['user']->findCount('anti_user',array( + 'userid'=>$userid, + )); + if($isuser==0){ + $new['user']->create('anti_user',array( + 'userid'=>$userid, + 'addtime'=>date('Y-m-d H:i:s'), + )); + } + + //封IP + $isip = $new['user']->findCount('anti_ip',array( + 'ip'=>$strUser['ip'] + )); + if($isip==0 && $strUser['ip']){ + $new['user']->create('anti_ip',array( + 'ip'=>$strUser['ip'], + 'addtime'=>date('Y-m-d H:i:s'), + )); + } + + } + + + //启用 + if($strUser['isenable']==1){ + + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'isenable'=>0, + )); + + $new['user']->delete('anti_user',array( + 'userid'=>$userid, + )); + $new['user']->delete('anti_ip',array( + 'ip'=>$strUser['ip'], + )); + } + + #qiMsg('操作成功!'); + + header('Location: '.SITE_URL.'index.php?app=user&ac=admin&mg=user&ts=list&page='.$page); + + break; + + //修改密码 + case "pwd": + + $userid = tsIntval($_GET['userid']); + + $strUser = $new['user']->find('user',array( + 'userid'=>$userid, + )); + + include template('admin/user_pwd'); + break; + + //执行修改密码 + case "pwddo": + + $userid = tsIntval($_POST['userid']); + + $pwd = tsTrim($_POST['pwd']); + + if($pwd == '') qiMsg('密码不能为空!'); + + $strUser = $new['user']->find('user',array( + 'userid'=>$userid, + )); + + $salt = md5(rand()); + + $new['user']->update('user',array( + 'userid'=>$userid, + ),array( + 'pwd'=>md5($salt.$pwd), + 'salt'=>$salt, + )); + + qiMsg('密码修改成功:'.$pwd); + + break; + + //清空用户数据 + case "deldata": + $userid = tsIntval($_GET['userid']); + + if($userid==1) qiMsg('该用户数据无法清空!'); + + aac('user')->toEmpty($userid); + qiMsg('清空数据成功!'); + + break; + + //管理员 + case "admin": + + $userid = tsIntval($_GET['userid']); + + if($userid==1) qiMsg('该用户无法取消管理员!'); + + $strUser = $new['user']->find('user_info',array( + 'userid'=>$userid, + )); + + if($strUser['isadmin']==1){ + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'isadmin'=>'0', + 'isverify'=>'0', + 'isverifyphone'=>'0', + 'isrenzheng'=>'0', + )); + }elseif($strUser['isadmin']==0){ + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'isadmin'=>'1',//系统管理员 + 'isverify'=>'1',//Email验证 + 'isverifyphone'=>'1',//手机号验证 + 'isrenzheng'=>'1',//人工认证 + )); + } + + qiMsg('操作成功!'); + + break; + + //清空全部被禁用的用户数据并保存垃圾Email + case "clean": + + $arrUser = $new['user']->findAll('user_info',array( + 'isenable'=>1, + )); + foreach($arrUser as $key=>$item){ + //执行删除用户数据 + aac('user')->toEmpty($item['userid']); + } + + qiMsg('垃圾用户清空完毕!'); + + break; + + case "face": + $userid = tsIntval($_GET['userid']); + + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'path'=>'', + 'face'=>'', + )); + + qiMsg('操作成功!'); + + break; + + //是否手工认证 + case "isrenzheng": + $userid = tsIntval($_GET['userid']); + + if($userid==1) qiMsg('该用户无法操作!'); + + $strUser = $new['user']->find('user_info',array( + 'userid'=>$userid, + )); + + + //开通认证 + if($strUser['isrenzheng']==0){ + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'isrenzheng'=>1, + )); + + + //发系统消息 + $msg_userid = '0'; + $msg_touserid = $userid; + $msg_content = '恭喜你,系统已经通过你的个人信息认证!'; + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content); + + + } + + + //取消认证 + if($strUser['isrenzheng']==1){ + + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'isrenzheng'=>0, + )); + + //发系统消息 + $msg_userid = '0'; + $msg_touserid = $userid; + $msg_content = '很抱歉,系统取消了你的个人信息认证!'; + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content); + + } + + qiMsg('操作成功!'); + break; + + case "isverify": + + $userid = tsIntval($_GET['userid']); + $strUser = $new['user']->find('user_info',array( + 'userid'=>$userid, + )); + + if($strUser['isverify']==0){ + $isverify = 1; + }else{ + $isverify = 0; + } + + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'isverify'=>$isverify, + )); + + qiMsg('操作成功!'); + + break; + + case "isverifyphone": + + $userid = tsIntval($_GET['userid']); + $strUser = $new['user']->find('user_info',array( + 'userid'=>$userid, + )); + + if($strUser['isverifyphone']==0){ + $isverifyphone = 1; + }else{ + $isverifyphone = 0; + } + + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'isverifyphone'=>$isverifyphone, + )); + + qiMsg('操作成功!'); + + break; + + case "ugid": + + $userid = tsIntval($_POST['userid']); + $ugid = tsIntval($_POST['ugid']); + + if($userid==1) $ugid=1; + + if($ugid==4) qiMsg('非法操作!'); + + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'ugid'=>$ugid, + )); + + break; + + case "add": + + include template('admin/user_add'); + break; + + case "adddo": + + $email = tsTrim($_POST['email']); + $username = tsTrim($_POST['username']); + $pwd = tsTrim($_POST['pwd']); + + if($email=='' || $username=='' || $pwd==''){ + qiMsg('信息输入不完整'); + } + + #判断Email是否存在 + $isEmail = $new['user']->findCount('user',array( + 'email'=>$email, + )); + + if($isEmail > 0){ + qiMsg('账号已经注册'); + } + + if(count_string_len($username) < 4 || count_string_len($username) > 20){ + qiMsg('姓名长度必须在4和20之间'); + } + + #判断用户名是否存在 + $isUserName = $new['user']->findCount('user_info',array( + 'username'=>$username, + )); + + if($isUserName > 0){ + qiMsg('用户名已经存在,请换个用户名!'); + } + + $new['user']->register($email,$username,$pwd,$fuserid,$invitecode,1); + + header('Location: '.SITE_URL.'index.php?app=user&ac=admin&mg=user&ts=list'); + + break; + + } \ No newline at end of file diff --git a/app/user/action/anti.php b/app/user/action/anti.php new file mode 100644 index 0000000..ab385cc --- /dev/null +++ b/app/user/action/anti.php @@ -0,0 +1,20 @@ +antiUser(); + if($tsSystemAntiUser){ + if(in_array($userid,$tsSystemAntiUser)){ + aac('user')->logout(); + } + } + + echo 1; + +}else{ + echo 0; +} \ No newline at end of file diff --git a/app/user/action/api.php b/app/user/action/api.php new file mode 100644 index 0000000..0608b65 --- /dev/null +++ b/app/user/action/api.php @@ -0,0 +1,9 @@ + +----------------------------------------------- +User Http Api List +URL:https://demo.thinksaas.cn +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +'; \ No newline at end of file diff --git a/app/user/action/article.php b/app/user/action/article.php new file mode 100644 index 0000000..e818440 --- /dev/null +++ b/app/user/action/article.php @@ -0,0 +1,29 @@ +$strUser['userid'],'page' => '' ) ); +$lstart = $page * 20 - 20; + +$arrArticle = $new ['user']->findAll ( 'article', array ( + 'userid' => $strUser['userid'], +), 'addtime desc','articleid,userid,cateid,title,gaiyao,score,path,photo,count_comment,count_love,count_view,addtime', $lstart . ',20' ); + +foreach($arrArticle as $key=>$item){ + $arrArticle [$key]['title'] = tsTitle($item['title']); + $arrArticle [$key]['gaiyao'] = tsTitle($item['gaiyao']); + $arrArticle [$key] ['cate'] = $new ['user']->find( 'article_cate', array ( + 'cateid' => $item ['cateid'] + ) ); +} + +$articleNum = $new ['user']->findCount ( 'article', array ( + 'userid' => $strUser['userid'], +) ); + +$pageUrl = pagination ( $articleNum, 20, $page, $url ); + +$title = $strUser['username'].'的文章'; +include template('article'); \ No newline at end of file diff --git a/app/user/action/collect.php b/app/user/action/collect.php new file mode 100644 index 0000000..70502e5 --- /dev/null +++ b/app/user/action/collect.php @@ -0,0 +1,24 @@ +$strUser['userid'],'page'=>'')); +$lstart = $page*30-30; + +$arrTopicLists = $new['user']->findAll('group_topic_collect',array( + 'userid'=>$strUser['userid'], +),'addtime desc',null,$lstart.',30'); + +foreach($arrTopicLists as $key=>$item){ + $arrTopicList[] = aac('group')->getOneTopic($item['topicid']); +} + +$topicNum = $new['user']->findCount('group_topic_collect',array( + 'userid'=>$strUser['userid'], +)); +$pageUrl = pagination($topicNum, 30, $page, $url); + +$title = $strUser['username'].'的喜欢'; +include template('collect'); \ No newline at end of file diff --git a/app/user/action/comment.php b/app/user/action/comment.php new file mode 100644 index 0000000..3a07fd1 --- /dev/null +++ b/app/user/action/comment.php @@ -0,0 +1,33 @@ +$strUser['userid'],'page'=>'')); +$lstart = $page*20-20; + +$arrComments = $new['user']->findAll('group_topic_comment',array( + 'userid'=>$strUser['userid'], +),'addtime desc',null,$lstart.',20'); + +foreach($arrComments as $key=>$item){ + $arrComment[] = $item; + $arrComment[$key]['topic']=aac('group')->getOneTopic($item['topicid']); +} + +$commentNum = $new['user']->findCount('group_topic_comment',array( + 'userid'=>$strUser['userid'], +)); + +$pageUrl = pagination($commentNum, 20, $page, $url); + +$title = $strUser['username'].'的评论'; + +//SEO +$sitekey = ''; +$sitedesc = ''; + + + +include template('comment'); \ No newline at end of file diff --git a/app/user/action/follow.php b/app/user/action/follow.php new file mode 100644 index 0000000..9810622 --- /dev/null +++ b/app/user/action/follow.php @@ -0,0 +1,123 @@ +$strUser['userid'],'page'=>'')); + $lstart = $page*80-80; + + //关注的用户 + $arrUsers = $new['user']->findAll('user_follow',array( + 'userid'=>$strUser['userid'], + ),'addtime desc',null,$lstart.',80'); + + $userNum = $new['user']->findCount('user_follow',array( + 'userid'=>$strUser['userid'], + )); + $pageUrl = pagination($userNum, 80, $page, $url); + + if(is_array($arrUsers)){ + foreach($arrUsers as $item){ + $arrUser[] = $new['user']->getSimpleUser($item['touserid']); + } + } + + $title = $strUser['username'].'关注的人'; + include template("follow"); + + break; + + //关注执行 + case "do": + + $userid = tsIntval($TS_USER['userid']); + $touserid = tsIntval($_POST['userid']); + + + if($userid == 0){ + echo json_encode(array( + 'status'=>0, + 'msg'=>'你还没有登录!', + )); + exit; + } + + if($userid == $touserid){ + echo json_encode(array( + 'status'=>0, + 'msg'=>'自己不能关注自己哦', + )); + exit; + } + + $isFollow = $new['user']->findCount('user_follow',array( + 'userid'=>$userid, + 'touserid'=>$touserid, + )); + + if($isFollow>0){ + + echo json_encode(array( + 'status'=>1, + 'msg'=>'你已经关注此用户!', + )); + exit; + + } + + $new['user']->create('user_follow',array( + 'userid'=>$userid, + 'touserid'=>$touserid, + )); + + //统计用户关注数和粉丝数 + $new['user']->countFollowFans($userid); + $new['user']->countFollowFans($touserid); + + + #发个消息 + + + echo json_encode(array( + 'status'=>2, + 'msg'=>'关注成功!', + )); + exit; + + break; + + //取消关注 + case "un": + + $userid = tsIntval($TS_USER['userid']); + $touserid = tsIntval($_POST['userid']); + + + if($userid == 0){ + echo json_encode(array( + 'status'=>0, + 'msg'=>'你还没有登录!', + )); + exit; + } + + $new['user']->delete('user_follow',array( + 'userid'=>$userid, + 'touserid'=>$touserid, + )); + + //统计用户关注数和粉丝数 + $new['user']->countFollowFans($userid); + $new['user']->countFollowFans($touserid); + + echo json_encode(array( + 'status'=>1, + 'msg'=>'解除关注成功', + )); + exit; + + break; + +} \ No newline at end of file diff --git a/app/user/action/followed.php b/app/user/action/followed.php new file mode 100644 index 0000000..5bc4407 --- /dev/null +++ b/app/user/action/followed.php @@ -0,0 +1,27 @@ +$strUser['userid'],'page'=>'')); +$lstart = $page*80-80; + +//跟随他的用户 +$arrUsers = $new['user']->findAll('user_follow',array( + 'touserid'=>$strUser['userid'], +),'addtime desc',null,$lstart.',80'); + +$userNum = $new['user']->findCount('user_follow',array( + 'touserid'=>$strUser['userid'], +)); +$pageUrl = pagination($userNum, 80, $page, $url); + +if(is_array($arrUsers)){ + foreach($arrUsers as $item){ + $arrUser[$key] = $new['user']->getSimpleUser($item['userid']); + } +} + +$title = $strUser['username'].'的粉丝'; +include template('followed'); \ No newline at end of file diff --git a/app/user/action/forgetpwd.php b/app/user/action/forgetpwd.php new file mode 100644 index 0000000..a2fee92 --- /dev/null +++ b/app/user/action/forgetpwd.php @@ -0,0 +1,143 @@ +find('user',array( + 'email'=>$email, + )); + + if($strUser==''){ + getJson("Email邮箱不存在,你可能还没有注册^_^",$js); + } + + + if ($authcode != $_SESSION['verify']) { + getJson('图片验证码输入有误,请重新输入!', $js); + } + + + #验证手机验证码 + if(aac('pubs')->verifyEmailCode($email,$emailcode)==false){ + getJson('Email验证码输入有误',$js); + } + + $salt = md5(rand()); + + $new['user']->update('user',array( + 'userid'=>$strUser['userid'], + ),array( + 'pwd'=>md5($salt.$pwd), + 'salt'=>$salt, + )); + + + $new['user']->update('user_info',array( + 'userid'=>$strUser['userid'], + ),array( + 'email'=>$strUser['email'], + 'isverify'=>'1', + )); + + $_SESSION['tsuser']['isverify']=1; + + getJson('密码修改成功!',$js,2,tsUrl('user','login')); + + break; + + /** + * 通过手机号找回密码 + */ + case "phone": + + $title = '找回登陆密码'; + include template("forgetpwd_phone"); + + break; + + //执行登录 + case "do": + + $js = tsIntval($_GET['js']); + + + $email = tsTrim($_POST['email']); + + if(valid_email($email)==false){ + getJson('Email输入不正确',$js); + } + + $emailNum = $new['user']->findCount('user',array( + 'email'=>$email, + )); + + if($email==''){ + getJson('Email输入不能为空^_^',$js); + }elseif($emailNum == '0'){ + getJson("Email不存在,你可能还没有注册^_^",$js); + }else{ + + //加密 + $resetpwd = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36); + + $new['user']->update('user',array( + 'email'=>$email, + ),array( + 'resetpwd'=>$resetpwd, + )); + + //发送邮件 + $subject = $TS_SITE['site_title'].'会员密码找回'; + + $content = '您的登陆信息:
      Email:'.$email.'
      重设密码链接:
      '.$TS_SITE['site_url'].'index.php?app=user&ac=resetpwd&mail='.$email.'&set='.$resetpwd.''; + + $result = aac('mail')->postMail($email,$subject,$content); + + if($result == '0'){ + getJson('找回密码所需信息不完整^_^',$js); + }elseif($result == '1'){ + getJson('系统已经向你的邮箱发送了邮件,请尽快查收^_^',$js); + } + + } + + break; + +} \ No newline at end of file diff --git a/app/user/action/group.php b/app/user/action/group.php new file mode 100644 index 0000000..a171d81 --- /dev/null +++ b/app/user/action/group.php @@ -0,0 +1,17 @@ +findAll('group_user',array( + 'userid'=>$strUser['userid'], +),null,'groupid'); + + +foreach($arrGroupsList as $key=>$item){ + $arrGroupList[] = aac('group')->getOneGroup($item['groupid']); +} + + +$title = $strUser['username'].'的小组'; +include template('group'); \ No newline at end of file diff --git a/app/user/action/guestbook.php b/app/user/action/guestbook.php new file mode 100644 index 0000000..4f377b4 --- /dev/null +++ b/app/user/action/guestbook.php @@ -0,0 +1,130 @@ +$strUser['userid'],'page'=>'')); + $lstart = $page*20-20; + + $arrGuestList = $new['user']->findAll('user_gb',array( + 'touserid'=>$strUser['userid'], + ),'addtime desc',null,$lstart.',20'); + + foreach($arrGuestList as $key=>$item){ + $arrGuestList[$key]['content'] = tsTitle($item['content']); + $arrGuestList[$key]['user']=$new['user']->getSimpleUser($item['userid']); + + $arrGuestList[$key]['reply'] = $new['user']->find('user_gb',array( + 'reid'=>$item['id'], + )); + if($arrGuestList[$key]['reply']){ + $arrGuestList[$key]['reply']['content'] = tsTitle($arrGuestList[$key]['reply']['content']); + } + } + + $guestNum = $new['user']->findCount('user_gb',array( + 'touserid'=>$strUser['userid'], + )); + + $pageUrl = pagination($guestNum, 20, $page, $url); + + $title = $strUser['username'].'的留言板'; + include template('guestbook'); + + break; + + case "do": + + $userid = $new['user']->isLogin(); + $touserid = tsIntval($_POST['touserid']); + $content = tsTrim($_POST['content']); + + if($content == ''){ + + tsNotice('留言内容不能为空!'); + + } + + $content = antiWord($content); + + $new['user']->create('user_gb',array( + 'userid'=>$userid, + 'touserid'=>$touserid, + 'content'=>$content, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + //发送系统消息 + $msg_userid = '0'; + $msg_touserid = $touserid; + $msg_content = '有人在你的留言板上留言了哦,快去看看吧'; + $msg_tourl = tsUrl('user','space',array('id'=>$touserid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + + #tsNotice('留言成功!'); + header('Location: '.tsUrl('user','guestbook',array('id'=>$touserid))); + exit; + + break; + + case "redo": + $userid = $new['user']->isLogin(); + $touserid = tsIntval($_POST['touserid']); + $reid = tsIntval($_POST['reid']); + $content = tsTrim($_POST['content']); + + $arrContent = explode('#',$content); + + $content = $arrContent['1']; + + if($content==''){ + tsNotice('留言不能为空!'); + } + + $content = antiWord($content); + + $new['user']->create('user_gb',array( + 'userid'=>$userid, + 'reid'=>$reid, + 'touserid'=>$touserid, + 'content'=>$content, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + //发送系统消息 + $msg_userid = '0'; + $msg_touserid = $touserid; + $msg_content = '有人在你的留言板上留言了哦,快去看看吧!'; + $msg_tourl = tsUrl('user','guestbook',array('id'=>$touserid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + tsNotice('回复成功!'); + break; + + //删除留言 + case "delete": + + $userid = $new['user']->isLogin(); + $gbid = tsIntval($_GET['gbid']); + + $strGuest = $new['user']->find('user_gb',array( + 'id'=>$gbid, + )); + + if($strGuest['touserid'] == $userid){ + + $new['user']->delete('user_gb',array( + 'id'=>$gbid, + )); + + } + + tsNotice('留言删除成功'); + + break; + +} \ No newline at end of file diff --git a/app/user/action/index.php b/app/user/action/index.php new file mode 100644 index 0000000..1a586c6 --- /dev/null +++ b/app/user/action/index.php @@ -0,0 +1,21 @@ +getScoreUser(10); + +//关注最多的用户 +$arrFollowUser = $new['user']->getFollowUser(10); + +//活跃会员 +$arrHotUser = $new['user']->getHotUser(10); + +//最新会员 +$arrNewUser = $new['user']->getNewUser(10); + +$title = '用户'; + +$sitekey = $TS_APP['appkey']; +$sitedesc = $TS_APP['appdesc']; + +include template('index'); \ No newline at end of file diff --git a/app/user/action/invite.php b/app/user/action/invite.php new file mode 100644 index 0000000..bd47ed2 --- /dev/null +++ b/app/user/action/invite.php @@ -0,0 +1,66 @@ +isLogin(); + +$strUser = $new['user']->find('user_info',array( + 'userid'=>$userid, +)); + +//邀请好友 +switch($ts){ + case "": + + //计算是否还有邀请码 + $codeNum = $new['user']->findCount('user_invites',array( + 'userid'=>$userid, + 'isused'=>0, + )); + + $arrCode = $new['user']->findAll('user_invites',array( + 'userid'=>$userid, + 'isused'=>0, + )); + + + + #邀请的用户 + $arrInviteUser = $new['user']->findAll('user_info',array( + 'fuserid'=>$userid, + ),'addtime desc','userid,username'); + + + $title = '邀请码'; + include template("invite"); + + break; + + //取邀请码 + case "code": + + //计算是否还有邀请码 + $codeNum = $new['user']->findCount('user_invites',array( + 'userid'=>$userid, + 'isused'=>0, + )); + + if($codeNum == 0 && $TS_USER['isadmin']==1){ + + //当数据库中没码的时间生成10个码 + for($i=1;$i<=10;$i++){ + + $new['user']->create('user_invites',array( + 'userid'=>$userid, + 'invitecode'=>random(18).$userid, + 'addtime'=>time(), + )); + + } + + } + + header('Location: '.tsUrl('user','invite')); + + break; +} \ No newline at end of file diff --git a/app/user/action/login.php b/app/user/action/login.php new file mode 100644 index 0000000..cffe90b --- /dev/null +++ b/app/user/action/login.php @@ -0,0 +1,134 @@ + 0) { + header('Location: '.SITE_URL);exit; +} + +#微信公众号授权 +if(isWeixin()==true && $TS_SITE['is_weixin']==1){ + $config = [ + 'app_id' => $TS_SITE['weixin_appid'], + 'oauth' => [ + 'scopes' => ['snsapi_userinfo'], + 'callback' => SITE_URL.'index.php?app=user&ac=wxlogin', + ], + ]; + $app = Factory::officialAccount($config); + $oauth = $app->oauth; + $oauth->redirect()->send(); + exit(); +} + +//程序主体 +switch($ts){ + case "": + + + //记录上次访问地址 + $jump = $_SERVER['HTTP_REFERER']; + + $title = '登录'; + include template("login"); + break; + + //执行登录 + case "do": + + //用于JS提交验证 + $js = tsIntval($_GET['js']); + + $ad = tsIntval($_POST['ad']); + + /*禁止以下IP用户登陆或注册*/ + /* + $arrIp = aac('system')->antiIp(); + if(in_array(getIp(),$arrIp)){ + getJson('你的IP已被锁定,暂无法登录!',$js); + } + */ + + $jump = tsTrim($_POST['jump']); + + $email = tsTrim($_POST['email']); + + $pwd = tsTrim($_POST['pwd']); + + $cktime = tsIntval($_POST['cktime']); + + + #人机验证 + $vaptcha_token = tsTrim($_POST ['vaptcha_token']); + $vaptcha_server = tsTrim($_POST ['vaptcha_server']); + if ($TS_SITE['is_vaptcha'] && $ad==0) { + $strVt = vaptcha($vaptcha_token,0,$vaptcha_server); + if($strVt['success']==0) { + getJson('人机验证未通过!',$js); + } + } + + + if($email=='' || $pwd=='') getJson('账号和密码都不能为空!',$js); + + #先判断是否是Email + if(valid_email($email)==true){ + + $strUser = $new['user']->find('user',array( + 'email'=>$email, + )); + + //if($strUser == '') getJson('Email不存在,你可能还没有注册!',$js); + if($strUser == '') getJson('账号/密码输入有误!',$js); + + }else{ + + #判断是否是手机号 + if(isPhone($email)==true){ + + $strUser = $new['user']->find('user',array( + 'phone'=>$email, + )); + + #if($strUser == '') getJson('手机号不存在,你可能还没有注册!',$js); + if($strUser == '') getJson('账号/密码输入有误!',$js); + + }else{ + #getJson('账号不存在,你可能还没有注册!',$js); + getJson('账号/密码输入有误!',$js); + } + + } + + if(md5($strUser['salt'].$pwd)!==$strUser['pwd']) { + #getJson('密码错误!',$js); + getJson('账号/密码输入有误!',$js); + } + + $new['user']->login($strUser['userid']); + + //对积分进行处理 + aac('user')->doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'], $TS_URL['ts'],0,1); + + if($ad==1){ + getJson('登录成功!',$js,2,SITE_URL.'index.php?app=system'); + } + + //跳转 + if($jump != ''){ + getJson('登录成功!',$js,2,$jump); + }else{ + + //登陆是否跳转到我的社区 + if($TS_SITE['istomy']){ + getJson('登录成功!',$js,2,tsUrl('my')); + }else{ + getJson('登录成功!',$js,2,SITE_URL); + } + + } + + break; + +} \ No newline at end of file diff --git a/app/user/action/logout.php b/app/user/action/logout.php new file mode 100644 index 0000000..909f6fe --- /dev/null +++ b/app/user/action/logout.php @@ -0,0 +1,7 @@ +logout(); +//header('Location: '.tsUrl('user','login')); +header('Location: '.SITE_URL); +exit; \ No newline at end of file diff --git a/app/user/action/message.php b/app/user/action/message.php new file mode 100644 index 0000000..d893945 --- /dev/null +++ b/app/user/action/message.php @@ -0,0 +1,89 @@ +isLogin(); + +switch($ts){ + //发送消息页面 + case "add": + + $touserid = tsIntval($_GET['touserid']); + + if($userid == $touserid || !$touserid) { + tsNotice("Sorry!自己不能给自己发送消息的!& 对方为空!"); + } + + #互为粉丝的2个人才可以发送消息 + $isFollow = $new['user']->findCount('user_follow',array( + 'userid'=>$userid, + 'touserid'=>$touserid, + )); + + $isFollow2 = $new['user']->findCount('user_follow',array( + 'userid'=>$touserid, + 'touserid'=>$userid, + )); + + if(($isFollow && $isFollow2) || $TS_USER['isadmin']==1){ + + $strUser = $new['user']->getSimpleUser($userid); + + $strTouser = $new['user']->getSimpleUser($touserid); + + if(!$strTouser) tsNotice("Sorry!对方不存在!"); + $title = "发送短消息"; + include template("message_add"); + + }else{ + + tsNotice("互相关注的2个人才可以互相发送私信!"); + + } + + break; + + case "do": + + $js = tsIntval($_GET['js']); + + $msg_userid = $userid; + $msg_touserid = tsIntval($_POST['touserid']); + + if($msg_userid == $msg_touserid || !$msg_touserid) { + getJson("Sorry!自己不能给自己发送消息的!& 对方为空!",$js,0); + } + + #互为粉丝的2个人才可以发送消息 + $isFollow = $new['user']->findCount('user_follow',array( + 'userid'=>$msg_userid, + 'touserid'=>$msg_touserid, + )); + + $isFollow2 = $new['user']->findCount('user_follow',array( + 'userid'=>$msg_touserid, + 'touserid'=>$msg_userid, + )); + + if(($isFollow && $isFollow2) || $TS_USER['isadmin']==1){ + + $msg_content = tsTrim($_POST['content']); + + if($msg_content==''){ + getJson('消息内容不能为空!',$js,0); + } + + $msg_content = antiWord($msg_content); + + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content); + + getJson('消息发送成功',$js,1); + + }else{ + + getJson("互相关注的2个人才可以互相发送私信!",$js,0); + + } + + break; +} \ No newline at end of file diff --git a/app/user/action/my.php b/app/user/action/my.php new file mode 100644 index 0000000..a082e40 --- /dev/null +++ b/app/user/action/my.php @@ -0,0 +1,10 @@ +isLogin(); + +$strUser = aac('user')->getOneUser($userid); \ No newline at end of file diff --git a/app/user/action/my/index.php b/app/user/action/my/index.php new file mode 100644 index 0000000..82c213b --- /dev/null +++ b/app/user/action/my/index.php @@ -0,0 +1,6 @@ + 0) { + header('Location: '.SITE_URL);exit; + } + + #如果网站只采用Email注册,就跳转到Email注册 + if($TS_SITE['regtype']==0){ + header('Location: '.tsUrl('user','register'));exit; + } + + //邀请用户ID + $fuserid = tsIntval($_GET['fuserid']); + + $title = '手机号注册'; + + include template("phone"); + + break; + + + case "do": + + //用于JS提交验证 + $js = tsIntval($_GET['js']); + + $phone = tsTrim($_POST['email']); + $pwd = tsTrim($_POST['pwd']); + $repwd = tsTrim($_POST['repwd']); + $username = t($_POST['username']); + + $fuserid = tsIntval($_POST['fuserid']); + + $authcode = strtolower($_POST['authcode']); + + $phonecode = tsTrim($_POST['phonecode']); + + + /*禁止以下IP用户登陆或注册*/ + $arrIp = aac('system')->antiIp(); + if(in_array(getIp(),$arrIp)){ + getJson('你的IP已被锁定,暂无法登录!',$js); + } + + + //是否开启邀请注册 + if($TS_SITE['isinvite']=='1'){ + + $invitecode = tsTrim($_POST['invitecode']); + if($invitecode == '') getJson('邀请码不能为空!',$js); + + $codeNum = $new['user']->findCount('user_invites',array( + 'invitecode'=>$invitecode, + 'isused'=>0, + )); + + if($codeNum == 0) getJson('邀请码已经被使用,请更换其他邀请码!',$js); + + } + + if($phone=='' || $pwd=='' || $repwd=='' || $username=='' || $phonecode==''){ + + getJson('所有必选项都不能为空!',$js); + + } + + if(isPhone($phone)==false) getJson('手机号输入有误!',$js); + + #验证手机验证码 + if(aac('pubs')->verifyPhoneCode($phone,$phonecode)==false){ + getJson('手机验证码输入有误',$js); + } + + #手机号是否存在 + $isPhone = $new['user']->findCount('user',array( + 'phone'=>$phone, + )); + + if($isPhone > 0){ + getJson('手机号已经存在',$js); + } + + if($pwd != $repwd){ + getJson('两次输入密码不正确!',$js); + } + + + if(count_string_len($username) < 4 || count_string_len($username) > 20){ + getJson('姓名长度必须在4和20之间',$js); + } + + #用户名是否存在 + $isUserName = $new['user']->findCount('user_info',array( + 'username'=>$username, + ),'userid'); + + if($isUserName > 0){ + getJson('用户名已经存在,请换个用户名!',$js); + } + + + #验证码 + if ($authcode != $_SESSION['verify']) { + getJson('验证码输入有误,请重新输入!', $js); + } + + $salt = md5(rand()); + + $userid = $new['user']->create('user',array( + 'pwd'=>md5($salt.$pwd), + 'salt'=>$salt, + 'email'=>$phone, + 'phone'=>$phone, + )); + + //插入用户信息 + $new['user']->create('user_info',array( + 'userid' => $userid, + 'fuserid' => $fuserid, + 'username' => $username, + 'email' => $phone, + 'phone' => $phone, + 'ip' => getIp(), + 'comefrom'=>'9', + 'isverifyphone'=>1, + 'addtime' => time(), + 'uptime' => time(), + )); + + //默认加入小组 + $isGroup = $new['user']->find('user_options',array( + 'optionname'=>'isgroup', + )); + + if($isGroup['optionvalue']){ + $arrGroup = explode(',',$isGroup['optionvalue']); + + if($arrGroup){ + foreach($arrGroup as $key=>$item){ + $groupUserNum = $new['user']->findCount('group_user',array( + 'userid'=>$userid, + 'groupid'=>$item, + )); + + if($groupUserNum == 0){ + $new['user']->create('group_user',array( + 'userid'=>$userid, + 'groupid'=>$item, + 'addtime'=>time(), + )); + + //统计更新 + $count_user = $new['user']->findCount('group_user',array( + 'groupid'=>$item, + )); + + $new['user']->update('group',array( + 'groupid'=>$item, + ),array( + 'count_user'=>$count_user, + )); + + } + } + } + } + + //用户信息 + $userData = $new['user']->find('user_info',array( + 'userid'=>$userid, + ),'userid,username,email,path,face,isadmin,signin,isverify,isverifyphone,uptime'); + + //用户session信息 + $_SESSION['tsuser'] = $userData; + + //发送消息 + aac('message')->sendmsg(0,$userid,'亲爱的 '.$username.' :您成功加入了 '.$TS_SITE['site_title'].'。在遵守本站的规定的同时,享受您的愉快之旅吧!'); + + //注销邀请码并将关注邀请用户 + if($TS_SITE['isinvite']=='1'){ + + //邀请码信息 + $strInviteCode = $new['user']->find('user_invites',array( + 'invitecode'=>$invitecode, + )); + + $new['user']->create('user_follow',array( + 'userid'=>$userid, + 'touserid'=>$strInviteCode['userid'], + )); + + //注销 + $new['user']->update('user_invites',array( + 'invitecode'=>$invitecode, + ),array( + 'isused'=>'1', + )); + } + + //对积分进行处理 + aac('user')->doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'], $TS_URL['ts']); + + //跳转 + getJson('登录成功!',$js,2,SITE_URL); + + break; + + + //验证手机号 + case "verify": + + $userid = aac('user')->isLogin(); + + $strUser = $new['user']->getOneUser($userid); + + $title = '验证手机号'; + include template("phone_verify"); + + break; + + + case "verifydo": + + $js = tsIntval($_GET['js']); + + $userid = aac('user')->isLogin(); + + $phone = tsTrim($_POST['phone']); + + $authcode = strtolower($_POST['authcode']); + $phonecode = tsTrim($_POST['phonecode']); + + if($phone == '' || $authcode=='' || $phonecode==''){ + getJson('所有输入项都不能为空',$js); + } + + if(isPhone($phone)==false){ + getJson('手机号输入有误!',$js); + } + + if ($authcode != $_SESSION['verify']) { + getJson('图片验证码输入有误,请重新输入!', $js); + } + + #验证手机验证码 + if(aac('pubs')->verifyPhoneCode($phone,$phonecode)==false){ + getJson('手机验证码输入有误',$js); + } + + + $strUserInfo = $new['user']->find('user_info',array( + 'userid'=>$userid, + ),'phone'); + + if($strUserInfo['phone']!=$phone){ + + #判断手机号是否存在 + $isPhone = $new['user']->findCount('user',array( + 'phone'=>$phone, + )); + + if($isPhone){ + getJson('手机号已存在!请更换其他手机号!',$js); + } + + //getJson('手机号有误!',$js); + } + + #更新手机号 + $new['user']->update('user',array( + 'userid'=>$userid, + ),array( + 'phone'=>$phone, + )); + + #更新手机号和手机验证状态 + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'phone'=>$phone, + 'isverifyphone'=>'1', + )); + + $_SESSION['tsuser']['isverifyphone']=1; + + getJson('手机号验证成功!',$js,2,SITE_URL); + + break; + + + //如果手机号不对,可以修改手机号 + case "setphone": + + $userid = aac('user')->isLogin(); + + $phone = tsTrim($_POST['phone']); + + if($phone==''){ + tsNotice('手机号不能为空!'); + } + + if(isPhone($phone)==false){ + tsNotice('手机号输入有误!'); + } + + $isPhone = $new['user']->findCount('user',array( + 'phone'=>$phone, + )); + + if($isPhone>0){ + tsNotice('手机号已经存在,请更换其他手机号!'); + } + + $new['user']->update('user',array( + 'userid'=>$userid, + ),array( + 'phone'=>$phone, + )); + + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'phone'=>$phone, + )); + + + tsNotice('手机号修改成功!'); + + break; + + + //修改成新手机号 + case "editphone": + + $js = tsIntval($_GET['js']); + + $userid = aac('user')->isLogin(); + + $phone = tsTrim($_POST['phone']); + + $authcode = strtolower($_POST['authcode']); + $phonecode = tsTrim($_POST['phonecode']); + + if($phone == '' || $authcode=='' || $phonecode==''){ + getJson('所有输入项都不能为空',$js); + } + + if(isPhone($phone)==false){ + getJson('手机号输入有误!',$js); + } + + if ($authcode != $_SESSION['verify']) { + getJson('图片验证码输入有误,请重新输入!', $js); + } + + #验证手机验证码 + if(aac('pubs')->verifyPhoneCode($phone,$phonecode)==false){ + getJson('手机验证码输入有误',$js); + } + + + $isPhone = $new['user']->findCount('user',array( + 'phone'=>$phone, + )); + + if($isPhone>0){ + getJson('手机号已经存在,请更换其他手机号!',$js); + } + + + $new['user']->update('user',array( + 'userid'=>$userid, + ),array( + 'phone'=>$phone, + )); + + + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'phone'=>$phone, + 'isverifyphone'=>'1', + )); + + $_SESSION['tsuser']['isverifyphone']=1; + + getJson('手机号修改成功!',$js,2,tsUrl('my','setting',array('ts'=>'email'))); + + break; + + + /** + * 通过手机号重置密码 + */ + case "resetpwd": + + $js = tsIntval($_GET['js']); + + + $phone = tsTrim($_POST['phone']); + $pwd = tsTrim($_POST['pwd']); + $authcode = strtolower($_POST['authcode']); + $phonecode = tsTrim($_POST['phonecode']); + + if($phone == '' || $pwd=='' || $authcode=='' || $phonecode==''){ + getJson('所有输入项都不能为空',$js); + } + + if(isPhone($phone)==false){ + getJson('手机号输入不正确',$js); + } + + $strUser = $new['user']->find('user',array( + 'phone'=>$phone, + )); + + if($strUser==''){ + getJson("手机号不存在,你可能还没有注册^_^",$js); + } + + + if ($authcode != $_SESSION['verify']) { + getJson('图片验证码输入有误,请重新输入!', $js); + } + + + #验证手机验证码 + if(aac('pubs')->verifyPhoneCode($phone,$phonecode)==false){ + getJson('手机验证码输入有误',$js); + } + + $salt = md5(rand()); + + $new['user']->update('user',array( + 'userid'=>$strUser['userid'], + ),array( + 'pwd'=>md5($salt.$pwd), + 'salt'=>$salt, + )); + + + $new['user']->update('user_info',array( + 'userid'=>$strUser['userid'], + ),array( + 'phone'=>$strUser['phone'], + 'isverifyphone'=>'1', + )); + + $_SESSION['tsuser']['isverifyphone']=1; + + getJson('密码修改成功!',$js,2,tsUrl('user','login')); + + break; + + +} \ No newline at end of file diff --git a/app/user/action/plogin.php b/app/user/action/plogin.php new file mode 100644 index 0000000..3aac206 --- /dev/null +++ b/app/user/action/plogin.php @@ -0,0 +1,63 @@ + 0) { + header('Location: '.SITE_URL);exit; +} + +switch($ts){ + case "": + + $title = '手机验证码登录'; + include template("plogin"); + break; + + case "do": + + $js = tsIntval($_GET['js']); + $phone = tsTrim($_POST['email']); + $authcode = strtolower($_POST['authcode']); + $phonecode = tsTrim($_POST['phonecode']); + + if($phone=='' || $phonecode==''){ + getJson('所有输入项都不能为空!',$js); + } + + if(isPhone($phone)==false) getJson('手机号输入有误!',$js); + + #验证手机验证码 + if(aac('pubs')->verifyPhoneCode($phone,$phonecode)==false){ + getJson('手机验证码输入有误!',$js); + } + + #手机号是否存在 + $strUser = $new['user']->find('user',array( + 'phone'=>$phone, + )); + + if($strUser){ + + $new['user']->login($strUser['userid'],$phone); + + getJson('登录成功!',$js,2,SITE_URL); + + + }else{ + + $new['user']->register($phone); + + } + + //跳转 + getJson('登录成功!',$js,2,SITE_URL); + + break; + +} \ No newline at end of file diff --git a/app/user/action/plugin.php b/app/user/action/plugin.php new file mode 100644 index 0000000..8f32f6a --- /dev/null +++ b/app/user/action/plugin.php @@ -0,0 +1,13 @@ + 0) { + header('Location: '.SITE_URL);exit; +} + +if($TS_SITE['isinvite']==2){ + tsNotice('暂不开放用户注册!'); +} + +#微信公众号授权 +if(isWeixin()==true && $TS_SITE['is_weixin']==1){ + $config = [ + 'app_id' => $TS_SITE['weixin_appid'], + 'oauth' => [ + 'scopes' => ['snsapi_userinfo'], + 'callback' => SITE_URL.'index.php?app=user&ac=wxlogin', + ], + ]; + $app = Factory::officialAccount($config); + $oauth = $app->oauth; + $oauth->redirect()->send(); + exit(); +} + +//用户注册 +switch($ts){ + case "": + + #如果网站只采用手机号注册,就跳转到手机号注册 + if($TS_SITE['regtype']==1){ + header('Location: '.tsUrl('user','phone'));exit; + } + + //邀请用户ID + $fuserid = tsIntval($_GET['fuserid']); + if($fuserid){ + $strFuser = $new['user']->getSimpleUser($fuserid); + } + + $title = '注册'; + + include template("register"); + break; + + case "do": + + //用于JS提交验证 + $js = tsIntval($_GET['js']); + + $email = tsTrim($_POST['email']); + $pwd = tsTrim($_POST['pwd']); + $repwd = tsTrim($_POST['repwd']); + $username = t($_POST['username']); + + $fuserid = tsIntval($_POST['fuserid']); + + $authcode = strtolower(tsTrim($_POST['authcode'])); + + + + #人机验证 + $vaptcha_token = tsTrim($_POST['vaptcha_token']); + $vaptcha_server = tsTrim($_POST['vaptcha_server']); + if ($TS_SITE['is_vaptcha']) { + $strVt = vaptcha($vaptcha_token,0,$vaptcha_server); + if($strVt['success']==0) { + getJson('人机验证未通过!',$js); + } + } + + //检测垃圾Email后缀 + $arrEmail = explode('@',$email); + + $emails = array( + 'chacuo.net', + 'mail.ru', + 'yandex.ru', + 'yandex.com', + '027168.net', + '027168.com', + ); + + if(in_array($arrEmail[1],$emails)){ + getJson('禁止该邮箱注册!',$js); + } + + + /*禁止以下IP用户登陆或注册*/ + /* + $arrIp = aac('system')->antiIp(); + if(in_array(getIp(),$arrIp)){ + getJson('你的IP已被锁定,暂无法登录!',$js); + } + */ + + //是否开启邀请注册 + if($TS_SITE['isinvite']=='1'){ + + $invitecode = tsTrim($_POST['invitecode']); + + if($invitecode == '') getJson('邀请码不能为空!',$js); + + $codeNum = $new['user']->findCount('user_invites',array( + 'invitecode'=>$invitecode, + 'isused'=>0, + )); + + if($codeNum == 0) getJson('邀请码已经被使用/或者不存在,请更换其他邀请码!',$js); + + } + + if($email=='' || $pwd=='' || $repwd=='' || $username==''){ + getJson('所有必选项都不能为空!',$js); + } + + if(valid_email($email) == false){ + getJson('Email邮箱输入有误',$js); + } + + #Email过滤 + $is_anti_email = $new['user']->find('anti_email',array( + 'email'=>$email, + )); + if($is_anti_email>0){ + getJson('非法操作!',$js); + } + + + #验证Email验证码 + if($TS_SITE['isverify']){ + $emailcode = tsTrim($_POST['emailcode']); + if(aac('pubs')->verifyEmailCode($email,$emailcode)==false){ + getJson('Email验证码输入有误',$js); + } + } + + #判断Email是否存在 + $isEmail = $new['user']->findCount('user',array( + 'email'=>$email, + )); + + if($isEmail > 0){ + getJson('Email已经注册',$js); + } + + if($pwd != $repwd){ + getJson('两次输入密码不正确!',$js); + } + + if(count_string_len($username) < 4 || count_string_len($username) > 20){ + getJson('姓名长度必须在4和20之间',$js); + } + + #用户名敏感词 + $username = antiWord ($username,1); + $username = str_replace('.','',$username); + + #判断用户名是否存在 + $isUserName = $new['user']->findCount('user_info',array( + 'username'=>$username, + )); + + if($isUserName > 0){ + getJson('用户名已经存在,请换个用户名!',$js); + } + + if($TS_SITE['isauthcode']){ + if ($authcode != $_SESSION['verify']) { + getJson('验证码输入有误,请重新输入!', $js); + } + } + + + $new['user']->register($email,$username,$pwd,$fuserid,$invitecode); + + + //对积分进行处理 + aac('user')->doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'], $TS_URL['ts']); + + //跳转 + getJson('登录成功!',$js,2,SITE_URL); + + + break; + +} \ No newline at end of file diff --git a/app/user/action/resetpwd.php b/app/user/action/resetpwd.php new file mode 100644 index 0000000..cd421d2 --- /dev/null +++ b/app/user/action/resetpwd.php @@ -0,0 +1,81 @@ +findCount('user',array( + 'email'=>$email, + 'resetpwd'=>$resetpwd, + )); + + if($email=='' || $resetpwd==''){ + tsNotice("你应该去火星生活啦!"); + }elseif($userNum == 0){ + tsNotice("你应该去火星生活啦!"); + }else{ + + $title = '重设密码'; + include template("resetpwd"); + + } + + break; + + + case "do": + + $js = tsIntval($_GET['js']); + + $email = tsTrim($_POST['email']); + $pwd = tsTrim($_POST['pwd']); + $repwd = tsTrim($_POST['repwd']); + + $resetpwd = tsTrim($_POST['resetpwd']); + + + + if($email=='' || $pwd=='' || $repwd=='' || $resetpwd==''){ + getJson("所有输入项都不能为空!",$js); + } + + if(valid_email($email)==false){ + getJson('Email输入不正确',$js); + } + + $userNum = $new['user']->findCount('user',array( + 'email'=>$email, + 'resetpwd'=>$resetpwd, + )); + + if($userNum == '0'){ + getJson("你应该去火星生活啦!",$js); + } + + $salt = md5(rand()); + + $new['user']->update('user',array( + 'email'=>$email, + ),array( + 'pwd'=>md5($salt.$pwd), + 'salt'=>$salt, + 'resetpwd'=>'', + )); + + + getJson("密码修改成功^_^",$js); + + + + break; + +} diff --git a/app/user/action/role.php b/app/user/action/role.php new file mode 100644 index 0000000..52e4e89 --- /dev/null +++ b/app/user/action/role.php @@ -0,0 +1,7 @@ +findAll('user_role'); + +$title = '角色'; +include template('role'); \ No newline at end of file diff --git a/app/user/action/signin.php b/app/user/action/signin.php new file mode 100644 index 0000000..9a24c74 --- /dev/null +++ b/app/user/action/signin.php @@ -0,0 +1,39 @@ +signin()){ + echo 1;exit; + }else{ + echo 0;exit; + } + break; + + + case "ajax": + + $strSign = $new['user']->find('sign',array( + 'userid'=>$userid, + 'addtime'=>date('Y-m-d'), + )); + + $strScore = $new['user']->find('user_score',array( + 'app'=>'user', + 'action'=>'signin', + 'mg'=>'', + 'ts'=>'', + )); + + include template('signin_ajax'); + break; + +} \ No newline at end of file diff --git a/app/user/action/space.php b/app/user/action/space.php new file mode 100644 index 0000000..4c463fc --- /dev/null +++ b/app/user/action/space.php @@ -0,0 +1,30 @@ +findAll('group_user',array( + 'userid'=>$userid, +)); + +if(is_array($arrGroupUser)){ + foreach($arrGroupUser as $key=>$item){ + $arrGroup[] = aac('group')->getOneGroup($item['groupid']); + } +} + + +//留言 +$arrGuest = $new['user']->findAll('user_gb',array( + 'touserid'=>$strUser['userid'], +),'addtime desc',null,10); + +foreach($arrGuest as $key=>$item){ + $arrGuest[$key]['content'] = tsDecode($item['content']); + $arrGuest[$key]['user']=$new['user']->getSimpleUser($item['userid']); +} + +$title = $strUser['username']; +include template("space"); diff --git a/app/user/action/system.php b/app/user/action/system.php new file mode 100644 index 0000000..c1329ae --- /dev/null +++ b/app/user/action/system.php @@ -0,0 +1,5 @@ +$strUser['userid'],'page'=>'')); +$lstart = $page*30-30; + +$arrTopic = $new['user']->findAll('topic',array( + 'userid'=>$strUser['userid'], +),'addtime desc',null,$lstart.',30'); + +$topicNum = $new['user']->findCount('topic',array( + 'userid'=>$strUser['userid'], +)); +$pageUrl = pagination($topicNum, 30, $page, $url); + +$title = $strUser['username'].'的帖子'; +include template('topic'); \ No newline at end of file diff --git a/app/user/action/userinfo.php b/app/user/action/userinfo.php new file mode 100644 index 0000000..75020e6 --- /dev/null +++ b/app/user/action/userinfo.php @@ -0,0 +1,36 @@ +isUser($userid)==false){ + + header("HTTP/1.1 404 Not Found"); + header("Status: 404 Not Found"); + $title = '404'; + include pubTemplate("404"); + exit; + +} + +$strUser = $new['user']->getOneUser($userid); + +//是否关注 +if($TS_USER['userid'] != '' && $TS_USER['userid'] != $strUser['userid']){ + $followNum = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='".$TS_USER['userid']."' and touserid='$userid'"); + if($followNum > '0'){ + $strUser['isfollow'] = true; + }else{ + $strUser['isfollow'] = false; + } +}else{ + $strUser['isfollow'] = false; +} + +//他关注的用户 +$followUsers = $db->fetch_all_assoc("select touserid from ".dbprefix."user_follow where userid='$userid' order by addtime desc limit 12"); + +if(is_array($followUsers)){ + foreach($followUsers as $item){ + $arrFollowUser[] = $new['user']->getSimpleUser($item['touserid']); + } +} \ No newline at end of file diff --git a/app/user/action/verify.php b/app/user/action/verify.php new file mode 100644 index 0000000..0c0443d --- /dev/null +++ b/app/user/action/verify.php @@ -0,0 +1,189 @@ +isLogin(); + + $strUser = $new['user']->getOneUser($userid); + + $title = '用户验证'; + include template('verify'); + break; + + //发送验证 + case "post": + + $userid = aac('user')->isLogin(); + + $strUser = $new['user']->find('user_info',array( + 'userid'=>$userid, + )); + if($strUser['verifycode']==''){ + $verifycode = random(11); + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'verifycode'=>$verifycode, + )); + }else{ + $verifycode = $strUser['verifycode']; + } + + $email = $strUser['email']; + + //发送邮件 + $subject = $TS_SITE['site_title'].'会员真实性验证'; + $content = '尊敬的'.$strUser['username'].',
      请点击以下链接进行会员验证:'.$TS_SITE['link_url'].'index.php?app=user&ac=verify&ts=do&email='.$email.'&verifycode='.$verifycode.''; + + $result = aac('mail')->postMail($email,$subject,$content); + + if($result == '0'){ + tsNotice("验证失败,可能是你的Email邮箱错误哦^_^"); + }elseif($result == '1'){ + tsNotice("系统已经向你的邮箱发送了验证邮件,请尽快查收^_^"); + } + break; + + //接收验证 + case "do": + $email = tsFilter($_GET['email']); + $verifycode = tsFilter($_GET['verifycode']); + + $verify = $new['user']->findCount('user_info',array( + 'email'=>$email, + 'verifycode'=>$verifycode, + )); + + if($verify > 0){ + + $new['user']->update('user_info',array( + 'email'=>$email, + ),array( + 'isverify'=>'1', + )); + + $_SESSION['tsuser']['isverify']=1; + + tsNotice("Email验证成功!",'点击回首页!',SITE_URL); + }else{ + tsNotice("Email验证失败!"); + } + + break; + + //修改Email + case "setemail": + + $userid = aac('user')->isLogin(); + + + $strUser = $new['user']->getOneUser($userid); + + $email = tsTrim($_POST['email']); + + if($email=='') tsNotice('Email不能为空!'); + + if(valid_email($email) == false) tsNotice('Email输入有误!'); + + if($email != $strUser['email']){ + $emailNum = $new['user']->findCount('user',array( + 'email'=>$email, + )); + + if($emailNum > 0) tsNotice("Email帐号已经存在,请换个其他Email帐号!"); + + //更新Email + $new['user']->update('user',array( + 'userid'=>$strUser['userid'], + ),array( + 'email'=>$email, + )); + + //修改信息并将用户设为未验证状态 + $new['user']->update('user_info',array( + 'userid'=>$strUser['userid'], + ),array( + 'email'=>$email, + 'isverify'=>'0', + )); + + tsNotice('Email帐号修改成功,请返回重新验证!'); + + }else{ + tsNotice('新Email帐号不能和旧Email帐号一样!'); + } + + break; + + //必须上传头像 + case "face": + + $userid = aac('user')->isLogin(); + + $strUser = $new['user']->getOneUser($userid); + + $_SESSION['tsuser']['face'] = $strUser['face']; + + $title = '上传头像'; + include template('verify_face'); + break; + + case "facedo": + + $userid = aac('user')->isLogin(); + + if($_FILES['picfile']){ + + //上传 + $arrUpload = tsUpload($_FILES['picfile'],$userid,'user',array('jpg','gif','png','jpeg')); + + if($arrUpload){ + + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'path'=>$arrUpload['path'], + 'face'=>$arrUpload['url'], + 'uptime'=>time(), + )); + + #本地图片验证 + if($TS_SITE['file_upload_type']=='0' || $TS_SITE['file_upload_type']==''){ + $filesize=abs(filesize('uploadfile/user/'.$arrUpload['url'])); + if($filesize<=0){ + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'path'=>'', + 'face'=>'', + )); + tsNotice('上传头像失败!请联系网站管理员处理!'); + }elseif($filesize>1048576){ + #限制头像图片1M以内 + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'path'=>'', + 'face'=>'', + )); + tsNotice('请选择1M以内的头像图片'); + } + } + + tsDimg($arrUpload['url'],'user','120','120',$arrUpload['path']); + + header('Location: '.tsUrl('user','verify',array('ts'=>'face'))); + + + }else{ + tsNotice('头像修改失败'); + } + + } + + break; +} \ No newline at end of file diff --git a/app/user/action/wxlogin.php b/app/user/action/wxlogin.php new file mode 100644 index 0000000..58e7377 --- /dev/null +++ b/app/user/action/wxlogin.php @@ -0,0 +1,181 @@ + $TS_SITE['weixin_appid'], + 'secret' => $TS_SITE['weixin_appsecret'], +]; + +$app = Factory::officialAccount($config); +$oauth = $app->oauth; + +// 获取 OAuth 授权结果用户信息 +$user = $oauth->user(); + +// $user 可以用的方法: +// $user->getId(); // 对应微信的 OPENID +// $user->getNickname(); // 对应微信的 nickname +// $user->getName(); // 对应微信的 nickname +// $user->getAvatar(); // 头像网址 +// $user->getOriginal(); // 原始API返回的结果 +// $user->getToken(); // access_token, 比如用于地址共享时使用 + +if($user->getToken() && $user->getId()){ + + $openid = $user->getId(); + + $access_token = $user->getToken(); + + $strOpen = $new['user']->find('user_open',array( + 'sitename'=>'weixin', + 'openid'=>$openid, + )); + + //10天更换一次access_token + if(time()-10*86400>$strOpen['uptime']){ + $new['user']->update('user_open',array( + 'sitename'=>'weixin', + 'openid'=>$openid, + ),array( + 'access_token'=>$access_token, + 'uptime'=>time(), + )); + } + + + if($strOpen['userid']){ + + + /* + $userid = $strOpen['userid']; + $username = $user->getNickname(); + $userface = $user->getAvatar(); + + + //更新用户头像 + if($userface!='' && $userface!='/0'){ + //1000个图片一个目录 + $menu2=intval($userid/1000); + $menu1=intval($menu2/1000); + $menu = $menu1.'/'.$menu2; + $photo = $userid.'.jpg'; + $photos = $menu.'/'.$photo; + $dir = 'uploadfile/user/'.$menu; + $dfile = $dir.'/'.$photo; + createFolders($dir); + if(!is_file($dfile)){ + $img = file_get_contents($userface); + file_put_contents($dfile,$img); + }; + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'path'=>$menu, + 'face'=>$photos, + )); + } + */ + + //更新登录时间 + $new['user']->update('user_info',array( + 'userid'=>$strOpen['userid'], + ),array( + //'username'=>$username, + 'ip'=>getIp(), //更新登录ip + 'uptime'=>time(), //更新登录时间 + )); + + + //用户session信息 + $sessionData = $new['user']->sessionData($strOpen['userid']); + $_SESSION['tsuser'] = $sessionData; + + if($_COOKIE['wx_jump']){ + header("Location: ".$_COOKIE['wx_jump']); + }else{ + header("Location: ".SITE_URL); + } + + exit; + + }else{ + + + $salt = md5(rand()); + + $pwd = random(5,0); + + $userid = $new['user']->create('user',array( + 'pwd'=>md5($salt.$pwd), + 'salt'=>$salt, + 'email'=>$openid, + 'phone'=>$openid, + )); + + $username = $user->getNickname(); + $userface = $user->getAvatar(); + + //插入ts_user_info + $new['user']->create('user_info',array( + 'userid' => $userid, + 'username' => $username, + 'email' => $openid, + 'phone' => $openid, + 'ip' => getIp(), + 'addtime' => time(), + 'uptime' => time(), + )); + + //插入ts_user_open + $new['user']->create('user_open',array( + 'userid'=>$userid, + 'sitename'=>'weixin', + 'openid' => $openid, + 'access_token'=>$access_token, + 'uptime'=>time(), + )); + + //更新用户头像 + if($userface!='' && $userface!='/0'){ + //1000个图片一个目录 + $menu2=intval($userid/1000); + $menu1=intval($menu2/1000); + $menu = $menu1.'/'.$menu2; + $photo = $userid.'.jpg'; + $photos = $menu.'/'.$photo; + $dir = 'uploadfile/user/'.$menu; + $dfile = $dir.'/'.$photo; + createFolders($dir); + if(!is_file($dfile)){ + $img = file_get_contents($userface); + file_put_contents($dfile,$img); + }; + $new['user']->update('user_info',array( + 'userid'=>$userid, + ),array( + 'path'=>$menu, + 'face'=>$photos, + )); + } + + //发送系统消息(恭喜注册成功) + $msg_userid = '0'; + $msg_touserid = $userid; + $msg_content = '亲爱的微信用户 '.$username.' :您成功加入了 ' + .$TS_SITE['site_title'].'在遵守本站的规定的同时,享受您的愉快之旅吧!'; + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content); + + //用户session信息 + $sessionData = $new['user']->sessionData($userid); + $_SESSION['tsuser'] = $sessionData; + + if($_COOKIE['wx_jump']){ + header("Location: ".$_COOKIE['wx_jump']); + }else{ + header("Location: ".SITE_URL); + } + exit; + } +} \ No newline at end of file diff --git a/app/user/class.user.php b/app/user/class.user.php new file mode 100644 index 0000000..4fba9f5 --- /dev/null +++ b/app/user/class.user.php @@ -0,0 +1,828 @@ +find('user_info',array( + 'userid'=>$userid, + ),'userid,ugid,username,email,path,face,isadmin,signin,isverify,isverifyphone,uptime'); + + return array( + 'userid' => $strUserInfo['userid'], + 'ugid' => $strUserInfo['ugid'], + 'username' => $strUserInfo['username'], + 'email' => $strUserInfo['email'], + 'face'=>$this->getUserFace($strUserInfo), + 'isadmin' => $strUserInfo['isadmin'], + 'signin' =>$strUserInfo['signin'], + 'isverify'=>$strUserInfo['isverify'], + 'isverifyphone'=>$strUserInfo['isverifyphone'], + 'uptime' => $strUserInfo['uptime'], + ); + + } + + + /** + * 用户登录 + * + * @param [type] $userid + * @param string $phone + * @return void + */ + public function login($userid,$phone=''){ + + $this->update('user_info',array( + 'userid'=>$userid, + ),array( + 'uptime'=>time(), + )); + + #清空验证码 + if($phone){ + $this->update('phone_code',array( + 'phone'=>$phone, + ),array( + 'code'=>'', + )); + } + + //用户session信息 + $sessionData = $this->sessionData($userid); + + $_SESSION['tsuser'] = $sessionData; + + //更新登录时间,用作自动登录 + $autologin = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36); + $this->update('user_info',array( + 'userid'=>$userid, + ),array( + 'ip'=>getIp(), //更新登录ip + 'autologin'=>$autologin, + 'uptime'=>time(), //更新登录时间 + )); + + //记住登录Cookie,根据用户Email和最后登录时间 + setcookie("ts_email", $sessionData['email'], time()+2592000,'/'); + setcookie("ts_autologin", $autologin, time()+2592000,'/'); + + } + + /** + * 用户注册 + * + * @param [type] $email + * @param string $username + * @param string $pwd + * @param integer $fuserid + * @return void + */ + public function register($email,$username='',$pwd='',$fuserid=0,$invitecode='',$islogin=0){ + + $salt = md5(rand()); + + if($pwd=='') $pwd = random(6); + + $userid = $this->create('user',array( + 'pwd'=>md5($salt.$pwd), + 'salt'=>$salt, + 'email'=>$email, + 'phone'=>$email, + )); + + if($username=='') $username = 'TS'.$userid; + + #Email验证 + $isverify = 0; + if(valid_email($email)==true && $GLOBALS['TS_SITE']['isverify']){ + $isverify = 1; + #清空Email验证码 + $this->update('email_code',array( + 'email'=>$email, + ),array( + 'code'=>'', + )); + } + + #手机验证 + $isverifyphone = 0; + if(isPhone($email)==true){ + $isverifyphone = 1; + #清空手机验证码 + $this->update('phone_code',array( + 'phone'=>$email, + ),array( + 'code'=>'', + )); + } + + //插入用户信息 + $this->create('user_info',array( + 'userid' => $userid, + 'fuserid' => intval($fuserid), + 'ugid' => 3, + 'username' => $username, + 'email' => $email, + 'phone' => $email, + 'ip' => getIp(), + 'isverify'=>$isverify, + 'isverifyphone'=>$isverifyphone, + 'addtime' => time(), + 'uptime' => time(), + )); + + //默认加入小组 + if($GLOBALS['TS_APP']['isgroup']){ + $arrGroup = explode(',',$GLOBALS['TS_APP']['isgroup']); + if($arrGroup){ + foreach($arrGroup as $key=>$item){ + $groupUserNum = $this->findCount('group_user',array( + 'userid'=>$userid, + 'groupid'=>$item, + )); + if($groupUserNum == 0){ + $this->create('group_user',array( + 'userid'=>$userid, + 'groupid'=>$item, + 'addtime'=>time(), + )); + //统计更新 + $count_user = $this->findCount('group_user',array( + 'groupid'=>$item, + )); + + $this->update('group',array( + 'groupid'=>$item, + ),array( + 'count_user'=>$count_user, + )); + } + } + } + } + + + if($islogin==0){ + + //用户session信息 + $sessionData = $this->sessionData($userid); + + //用户session信息 + $_SESSION['tsuser'] = $sessionData; + } + + + //发送消息 + aac('message')->sendmsg(0,$userid,'亲爱的 '.$username.' :您成功加入了 '.$GLOBALS['TS_SITE']['site_title'].'。在遵守本站的规定的同时,享受您的愉快之旅吧!'); + + //注销邀请码并将关注邀请用户 + if($GLOBALS['TS_SITE']['isinvite']=='1' && $invitecode){ + + //邀请码信息 + $strInviteCode = $this->find('user_invites',array( + 'invitecode'=>$invitecode, + )); + + $this->create('user_follow',array( + 'userid'=>$userid, + 'touserid'=>$strInviteCode['userid'], + )); + + //注销 + $this->update('user_invites',array( + 'invitecode'=>$invitecode, + ),array( + 'isused'=>'1', + )); + } + + + return $userid; + + } + + + /** + * 获取用户头像 + * @param $strUser + * @return string + */ + function getUserFace($strUser){ + if($strUser['face']){ + $strFace = tsXimg($strUser['face'],'user',120,120,$strUser['path'],1); + + if($GLOBALS['TS_SITE']['file_upload_type']==1){ + $strFace .= '&v='.$strUser['uptime']; + }else{ + $strFace .= '?v='.$strUser['uptime']; + } + + }else{ + $strFace = SITE_URL.'public/images/user_large.jpg'; + } + return $strFace; + } + + /** + * 获取最新会员 + */ + function getNewUser($num){ + $arrUser = $this->findAll('user_info',null,'addtime desc','userid,username,face,path,addtime,uptime',$num); + foreach($arrUser as $key=>$item){ + $arrUser[$key]['face'] = $this->getUserFace($item); + } + return $arrUser; + } + + //获取活跃会员 + public function getHotUser($num){ + $arrUser = $this->findAll('user_info',null,'uptime desc','userid,username,face,path,addtime,uptime',$num); + foreach($arrUser as $key=>$item){ + $arrUser[$key]['face'] = $this->getUserFace($item); + } + return $arrUser; + } + + //最多关注的用户 + public function getFollowUser($num){ + $arrUser = $this->findAll('user_info',null,'count_followed desc','userid,username,face,path,count_followed,addtime,uptime',$num); + foreach($arrUser as $key=>$item){ + $arrUser[$key]['face'] = $this->getUserFace($item); + } + return $arrUser; + } + + //最多积分的用户 + public function getScoreUser($num){ + $arrUser = $this->findAll('user_info',null,'count_score desc','userid,username,face,path,count_score,addtime,uptime',$num); + foreach($arrUser as $key=>$item){ + $arrUser[$key]['face'] = $this->getUserFace($item); + } + return $arrUser; + } + + #获取简单的用户信息 + function getSimpleUser($userid){ + $strUser = $this->find('user_info',array( + 'userid'=>$userid, + ),'userid,username,face,path,signed,allscore,uptime'); + if($strUser){ + $strUser['face'] = $this->getUserFace($strUser); + $strUser['signed'] = tsTitle($strUser['signed']); + $strUser['rolename'] = $this->getRole($strUser['allscore']); + return $strUser; + }else{ + return ''; + } + } + + //获取一个用户的信息 + function getOneUser($userid){ + + $strUser = $this->find('user_info',array( + 'userid'=>$userid, + )); + + if($strUser){ + + $strUser['username'] = tsTitle($strUser['username']); + $strUser['email'] = tsTitle($strUser['email']); + $strUser['phone'] = tsTitle($strUser['phone']); + $strUser['province'] = tsTitle($strUser['province']); + $strUser['city'] = tsTitle($strUser['city']); + $strUser['signed'] = tsTitle($strUser['signed']); + $strUser['about'] = tsTitle($strUser['about']); + $strUser['address'] = tsTitle($strUser['address']); + + $strUser['face'] = $this->getUserFace($strUser); + + $strUser['rolename'] = $this->getRole($strUser['allscore']); + + }else{ + $strUser = ''; + } + + return $strUser; + } + + //用户是否存在 + public function isUser($userid){ + + $isUser = $this->findCount('user',array('userid'=>$userid)); + + if($isUser == 0){ + return false; + }else{ + return true; + } + + } + + + /** + * @param int $js + * @param string $userkey + * @return int + */ + public function isLogin($js=0, $userkey=''){ + + $userid = tsIntval($_SESSION['tsuser']['userid']); + + if($js && $userid==0 && $userkey==''){ + getJson('你还没有登录',$js); + } + + #通过userkey返回userid + if($js && $userid==0 && $userkey){ + $userid = $this->getUserIdByUserKey($userkey); + return $userid; + } + + if($userid>0){ + if($this->isUser($userid)){ + return $userid; + }else{ + header("Location: ".tsUrl('user','login')); + exit; + } + }else{ + header("Location: ".tsUrl('user','login')); + exit; + } + } + + + + //根据用户积分获取用户角色 + public function getRole($score){ + global $tsMySqlCache; + $arrRole = fileRead('data/user_role.php'); + + if($arrRole==''){ + $arrRole = $tsMySqlCache->get('user_role'); + } + + foreach($arrRole as $key=>$item){ + if($score > $item['score_start'] && $score <= $item['score_end'] || $score > $item['score_start'] && $item['score_end']==0 || $score >=0 && $score <= $item['score_end']){ + return $item['rolename']; + } + } + } + + /** + * 增加积分 + * $userid 用户ID + * $scorename 积分名字 + * $score 积分 + * @issx 上线限制0限制1不限制 + */ + public function addScore($userid,$scorename,$score,$issx=0){ + if($userid && $scorename && $score){ + + + #计算当天已经获得的积分 + $starttime = strtotime(date('Y-m-d 00:00:01')); + $endtime = strtotime(date('Y-m-d 23:59:59')); + $strDayScore = $this->db->once_fetch_assoc("select SUM(score) as dayscore from ".dbprefix."user_score_log where `userid`='$userid' and `status`='0' and `addtime`>='$starttime' and `addtime`<='$endtime'"); + + #用户每日获得积分上限 + if($strDayScore['dayscore']<$GLOBALS['TS_SITE']['dayscoretop'] || $issx==1){ + + //添加积分记录 + $this->create('user_score_log',array( + 'userid'=>$userid, + 'scorename'=>$scorename, + 'score'=>$score, + 'status'=>0, + 'addtime'=>time(), + )); + + //计算总积分 + $strUser = $this->find('user_info',array( + 'userid'=>$userid, + )); + + $strAllScore = $this->db->once_fetch_assoc("select SUM(score) as allscore from ".dbprefix."user_score_log where `userid`='$userid' and `status`='0'"); + + $this->update('user_info',array( + 'userid'=>$userid, + ),array( + 'allscore'=>$strAllScore['allscore'], + 'count_score'=>$strUser['count_score']+$score, + )); + + + } + + + } + } + + /* + * 减去积分 + */ + public function delScore($userid,$scorename,$score){ + if($userid && $scorename && $score){ + + //计算总积分 + $strUser = $this->find('user_info',array( + 'userid'=>$userid, + )); + + if($strUser['count_score']>=$score){ + + //添加积分记录 + $this->create('user_score_log',array( + 'userid'=>$userid, + 'scorename'=>$scorename, + 'score'=>$score, + 'status'=>1, + 'addtime'=>time(), + )); + + $this->update('user_info',array( + 'userid'=>$userid, + ),array( + 'count_score'=>$strUser['count_score']-$score, + )); + + return true; + + }else{ + + return false; + + } + + + } + } + + /** + * 处理积分 + * + * @param [type] $app + * @param [type] $ac + * @param string $mg 指向后台管理文件(用于后台操作得积分处理) + * @param string $api 指向API接口文件(用于API接口得积分处理) + * @param string $ts + * @param integer $uid 指定用户ID + * @param integer $isday 是否一天只给一次积分,默认0否1是 + * @return void + */ + function doScore($app,$ac,$mg='',$api='',$ts='',$uid=0,$isday=0){ + $userid = tsIntval($_SESSION['tsuser']['userid']); + if($uid) $userid=$uid; + $strScore = $this->find('user_score',array( + 'app'=>$app, + 'action'=>$ac, + 'mg'=>$mg, + 'api'=>$api, + 'ts'=>$ts, + )); + + if($strScore && $userid){ + if($strScore['status']=='0'){ + if($isday==1){ + //获取最新得一条积分记录 + $strScoreLog = $this->find('user_score_log',array( + 'userid'=>$userid, + 'scorename'=>$strScore['scorename'], + ),null,'addtime desc'); + if(($strScoreLog && date('Y-m-d H:i:s',$strScoreLog['addtime'])addScore($userid,$strScore['scorename'],$strScore['score']); + } + }else{ + //0加积分 + $this->addScore($userid,$strScore['scorename'],$strScore['score']); + } + }elseif($strScore['status']=='1'){ + //1减积分 + $this->delScore($userid,$strScore['scorename'],$strScore['score']); + } + } + } + + //删除用户一切数据 + function toEmpty($userid){ + + $strUser = $this->find('user_info',array( + 'userid'=>$userid, + ),'userid,email,phone,face'); + + #禁用用户Email账号 + $this->replace('anti_email',array( + 'email'=>$strUser['email'], + ),array( + 'email'=>$strUser['email'], + 'addtime'=>date('Y-m-d H:i:s'), + )); + + #禁用用户手机号 + $this->replace('anti_phone',array( + 'phone'=>$strUser['phone'], + ),array( + 'phone'=>$strUser['phone'], + 'addtime'=>date('Y-m-d H:i:s'), + )); + + #用户头像 + if($strUser['face']){ + + if($GLOBALS['TS_SITE']['file_upload_type']==1){ + deleteAliOssFile('uploadfile/user/'.$strUser['face']); + }else{ + unlink('uploadfile/user/'.$strUser['photo']); + tsDimg($strUser['face'],'user','120','120',$strUser['path']); + } + + } + + #用户相关数据 + $this->delete('user',array('userid'=>$userid)); + $this->delete('user_info',array('userid'=>$userid)); + $this->delete('user_follow',array('userid'=>$userid)); + $this->delete('user_follow',array('touserid'=>$userid)); + $this->delete('user_gb',array('userid'=>$userid)); + $this->delete('user_gb',array('touserid'=>$userid)); + $this->delete('user_open',array('userid'=>$userid)); + $this->delete('user_score_log',array('userid'=>$userid)); + + #文章 + $arrArticle = $this->findAll('article',array( + 'userid'=>$userid, + )); + foreach($arrArticle as $key=>$item){ + aac('article')->deleteArticle($item); + } + $this->delete('article_user',array('userid'=>$userid)); + + #草稿箱 + $this->delete('draft',array('userid'=>$userid)); + + #编辑器上传的文件 + $arrEditor = $this->findAll('editor',array( + 'userid'=>$userid, + )); + foreach($arrEditor as $key=>$item){ + unlink('uploadfile/editor/'.$item['url']); + } + $this->delete('editor',array('userid'=>$userid)); + + #小组 + $this->delete('topic',array('userid'=>$userid)); + $this->delete('group_user',array('userid'=>$userid)); + + //attach + $this->delete('attach',array('userid'=>$userid)); + $this->delete('attach_album',array('userid'=>$userid)); + + //message + $this->delete('message',array('userid'=>$userid)); + $this->delete('message',array('touserid'=>$userid)); + + //photo + $this->delete('photo',array('userid'=>$userid)); + $this->delete('photo_album',array('userid'=>$userid)); + + //tag + $this->delete('tag_user_index',array('userid'=>$userid)); + + //weibo + $this->delete('weibo',array('userid'=>$userid)); + + //活动ts_event + $this->delete('event',array('userid'=>$userid)); + $this->delete('event_user',array('userid'=>$userid)); + + //问答ts_ask + $this->delete('ask',array('userid'=>$userid)); + $this->delete('ask_comment',array('userid'=>$userid)); + $this->delete('ask_comment_op',array('userid'=>$userid)); + + #删除评论ts_comment + $this->delete('comment',array('userid'=>$userid)); + #删除点赞ts_love + $this->delete('love',array('userid'=>$userid)); + + } + + + //销毁前台session退出登陆 + function logout(){ + unset($_SESSION['tsuser']); + session_destroy(); + setcookie("ts_email", '', time()+3600,'/'); + setcookie("ts_autologin", '', time()+3600,'/'); + } + + //用户签到 + function signin(){ + + $userid = tsIntval($GLOBALS['TS_USER']['userid']); + + $zuotian = date('Y-m-d',strtotime("-1 day")); + + $jintian = date('Y-m-d'); + + + $zuotianSign = $this->find('sign',array( + 'userid'=>$userid, + 'addtime'=>$zuotian, + )); + + $jintianSign = $this->find('sign',array( + 'userid'=>$userid, + 'addtime'=>$jintian, + )); + + if($jintianSign==''){ + + if($zuotianSign==''){ + $this->create('sign',array( + 'userid'=>$userid, + 'num'=>1, + 'addtime'=>$jintian, + )); + }else{ + + $this->create('sign',array( + 'userid'=>$userid, + 'num'=>$zuotianSign['num']+1, + 'addtime'=>$jintian, + )); + + } + + //加积分 + $this->doScore('user','signin'); + + return true; + + }else{ + return false; + } + } + + + /* + * 判断是否允许用户发布内容 + */ + public function isPublisher(){ + $publisher = $GLOBALS['TS_SITE']['publisher']; + $userid = tsIntval($GLOBALS['TS_USER']['userid']); + + if($publisher){ + + $ispublisher = $this->findCount('user_info',array( + 'userid'=>$userid, + $publisher=>1, + )); + + if($ispublisher){ + return true; + }else{ + return false; + } + + }else{ + return true; + } + + } + + + /** + * 通过 userid 获取 userkey + * @param $userid + * @return bool|string + */ + public function getUserKeyByUserId($userid){ + include 'thinksaas/class.crypt.php'; + $crypt= new crypt(); + return $crypt->encrypt($userid,$GLOBALS['TS_SITE']['site_pkey']); + } + + /** + * 通过userkey获取userid + * @param $userkey + */ + public function getUserIdByUserKey($userkey){ + include 'thinksaas/class.crypt.php'; + $crypt= new crypt(); + $userid = $crypt->decrypt($userkey,$GLOBALS['TS_SITE']['site_pkey']); + + $isUser = $this->findCount('user',array( + 'userid'=>$userid, + )); + + if($isUser == 0){ + + echo json_encode(array( + + 'status'=> 0, + 'msg'=> '非法操作', + 'data'=> '', + + )); + exit; + + }else{ + + return $userid; + + } + } + + /** + * 统计用户关注数和粉丝数 + * + * @param [type] $userid + * @return void + */ + public function countFollowFans($userid){ + + //关注数 + $count_follow = $this->findCount('user_follow',array( + 'userid'=>$userid, + )); + + //粉丝数 + $count_followed = $this->findCount('user_follow',array( + 'touserid'=>$userid, + )); + + $this->update('user_info',array( + 'userid'=>$userid, + ),array( + 'count_follow'=>$count_follow, + 'count_followed'=>$count_followed, + )); + + } + + /** + * 获取匿名用户ID + * + * @return void + */ + public function getNimingId(){ + $email = 'null@null.com'; + $strUser = $this->find('user',array( + 'email'=>$email, + )); + if($strUser){ + $userid = $strUser['userid']; + }else{ + $salt = md5(rand()); + $pwd = random(6); + $userid = $this->create('user',array( + 'pwd'=>md5($salt.$pwd), + 'salt'=>$salt, + 'email'=>$email, + 'phone'=>$email, + )); + //插入用户信息 + $this->create('user_info',array( + 'userid' => $userid, + 'fuserid' => 0, + 'ugid' => 3, + 'username' => '匿名用户', + 'email' => $email, + 'phone' => $email, + 'ip' => getIp(), + 'isverify'=>1, + 'isverifyphone'=>1, + 'addtime' => time(), + 'uptime' => time(), + )); + } + return $userid; + } + + + + //析构函数 + public function __destruct(){ + + } + +} \ No newline at end of file diff --git a/app/user/config.php b/app/user/config.php new file mode 100644 index 0000000..59127e3 --- /dev/null +++ b/app/user/config.php @@ -0,0 +1,19 @@ + + \ No newline at end of file diff --git a/app/user/html/admin/group_list.html b/app/user/html/admin/group_list.html new file mode 100644 index 0000000..94fb01c --- /dev/null +++ b/app/user/html/admin/group_list.html @@ -0,0 +1,73 @@ +{php include pubTemplate("header_admin")} +
      + {php include template("admin/menu");} + + +
      +
      + + +
      + +
      + + + + + + + + + + + + + + + + + + + + + {loop $arrGroup $key $item} + + + + {if !in_array($item['ugid'],array(1,2,3,4))} + + + + + + + + + {else} + + + + + + + + {/if} + + + + {/loop} + + + + + + +
      UGID组名介绍操作
      {$item['ugid']} + + + 删除 +
      {$item['ugid']}{tsTitle($item['ugname'])}{tsTitle($item['uginfo'])} + +
      +
      +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/user/html/admin/guestbook_list.html b/app/user/html/admin/guestbook_list.html new file mode 100644 index 0000000..d6769a0 --- /dev/null +++ b/app/user/html/admin/guestbook_list.html @@ -0,0 +1,29 @@ +{php include pubTemplate("header_admin")} +
      + {php include template("admin/menu");} +
      {$pageUrl}
      + + + + + + + + + + + + + + {loop $arrGuestbook $key $item} + + {/loop} + + + + + + +
      iduseridtouseridcontentaddtime操作
      {$item['id']}{$item['userid']}{$item['touserid']}{php echo tsTitle($item['content'])}{$item['addtime']}删除
      +
      +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/user/html/admin/menu.html b/app/user/html/admin/menu.html new file mode 100644 index 0000000..357ade8 --- /dev/null +++ b/app/user/html/admin/menu.html @@ -0,0 +1,33 @@ + +
      +
      用户管理
      + +
      + +
      \ No newline at end of file diff --git a/app/user/html/admin/options.html b/app/user/html/admin/options.html new file mode 100644 index 0000000..c0105e2 --- /dev/null +++ b/app/user/html/admin/options.html @@ -0,0 +1,30 @@ +{php include pubTemplate("header_admin")} + +
      + +{php include template("admin/menu");} + +
      + + + + + + + + + + + + + + + + + + +
      APP名称:
      APP介绍:
      APP关键词:
      APP是否启用:启用 关闭
      默认加入小组 : (输入小组的ID,不是小组名称,多个请用,号分开,如1,2,3)
      禁止注册用户名 : (禁止用户注册的用户名,多个用|分割)
      +
      +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/user/html/admin/permissions.html b/app/user/html/admin/permissions.html new file mode 100644 index 0000000..46e2676 --- /dev/null +++ b/app/user/html/admin/permissions.html @@ -0,0 +1,177 @@ +{php include pubTemplate("header_admin")} + +
      + +{php include template("admin/menu");} + + + +
      + {loop $arrUg $key $item} + {$item['ugname']} + {/loop} +
      + + +
      + + +
      前台权限
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {if $ugid==1 || $ugid==2 || $ugid==3} + + + + + {/if} + + + + +
      查看用户空间: + +
      查看用户帖子: + +
      查看用户小组: + +
      查看用户文章: + +
      查看用户粉丝: + +
      查看用户关注: + +
      查看用户留言: + +
      发布留言: + +
      + + + + {if $ugid==1 || $ugid==2} +
      后台权限
      + + + + + + + + + + + + +
      文章配置: + +
      权限配置: + +
      + {/if} + + + +
      API权限
      + + + + + + + + + + + +
      查看用户: + +
      + + + + + + +
      + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/user/html/admin/role_list.html b/app/user/html/admin/role_list.html new file mode 100644 index 0000000..fbfdca3 --- /dev/null +++ b/app/user/html/admin/role_list.html @@ -0,0 +1,36 @@ +{php include pubTemplate("header_admin")} + + + +
      + {php include template("admin/menu");} +
      + + + + + + + + + + + {loop $arrRole $key $item} + + {/loop} + + + + + + + + +
      角色名称起始积分结束积分
      点击增加角色(说明:如需删除某一项,请将要删除的某项清空提交即可。)
      +
      +
      +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/user/html/admin/score_list.html b/app/user/html/admin/score_list.html new file mode 100644 index 0000000..ca4bee9 --- /dev/null +++ b/app/user/html/admin/score_list.html @@ -0,0 +1,89 @@ +{php include pubTemplate("header_admin")} +
      + {php include template("admin/menu");} +
      + + + + + + + + + + + + + + + + + + + + + + + + + + {loop $arrScore $key $item} + + + + + + + + + + + + + + + {/loop} + + + + + + + +
      积分名称key分数对应app对应action对应mg对应api对应ts状态设置
      {$item['scorename']}{$item['scorekey']} + + + | + 删除 +
      +
      +
      +
      添加积分节点
      +
      + + + + + + + + + + + +
      积分名称:
      积分KEY:
      积分:
      对应APP:
      对应ACTION:
      对应MG:
      对应API:
      对应TS:
      状态:加积分 减积分
      +
      +
      +
      +
      积分使用帮助
      +

      1、在需要使用积分的php代码处加:

      + + aac('user')->doScore({php echo '$app'},{php echo '$ac'},{php echo '$mg'},{php echo '$api'},{php echo '$ts'},{php echo '$uid'}) + +

      以上代码具体使用方式请看app/user/class.user.php中doScore方法

      +

      2、根据对应的app,action,mg,api,ts,uid变量配置好积分

      +
      +
      {php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/user/html/admin/score_send.html b/app/user/html/admin/score_send.html new file mode 100644 index 0000000..ed3e1bb --- /dev/null +++ b/app/user/html/admin/score_send.html @@ -0,0 +1,19 @@ +{php include pubTemplate("header_admin")} +
      + {php include template("admin/menu");} +
      +
      + + + + + + +
      用户ID:
      积分数:
      状态: + 加 + (减去的积分不可以大于用户剩余积分,否则减分操作不成功) +
      积分说明:
      +
      +
      +
      +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/user/html/admin/user_add.html b/app/user/html/admin/user_add.html new file mode 100644 index 0000000..47900d2 --- /dev/null +++ b/app/user/html/admin/user_add.html @@ -0,0 +1,66 @@ +{php include pubTemplate("header_admin")} +
      + +{php include template("admin/menu");} + + + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      账号(Email/手机号): + +
      用户名: + + + +
      密码: + + + +
      + +
      +
      + + +
      + + + + +
      + + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/user/html/admin/user_list.html b/app/user/html/admin/user_list.html new file mode 100644 index 0000000..ed6b89f --- /dev/null +++ b/app/user/html/admin/user_list.html @@ -0,0 +1,157 @@ +{php include pubTemplate("header_admin")} +
      + +{php include template("admin/menu");} + +
      +
      + + + + +UID: 用户名: + +一键删除被停用用户 + + +
      + +
      + +
      {$pageUrl}
      + + + + + + + + + + + + + + + + + + + + + + + + + + {loop $arrAllUser $key $item} + + + + + + + + + + + + + + + + + + + + {/loop} + + + + + + + + + +
      UID邀请ID用户组Email手机号姓名注册时间登录IP来自操作
      {$item[userid]}{$item[fuserid]} + + + + + + {$item[email]} + + + {if $TS_USER['userid']==1 && $item['userid']!=1} +
      + {if $item['isverify']==1} + 已验证 [取消] + {else} + 未验证 [验证] + {/if} +
      + {/if} + +
      + + {$item['phone']} + + {if $TS_USER['userid']==1 && $item['userid']!=1} +
      + {if $item['isverifyphone']==1} + 已验证 [取消] + {else} + 未验证 [验证] + {/if} +
      + {/if} + +
      {$item[username]}{php echo date('Y-m-d H:i:s',$item[addtime])}{$item['ip']}{$item['comefrom']} + + + {if $item[isrenzheng]=='0'}[手工认证]{else}[取消认证]{/if} + + + [明细] + + {if $item['isadmin']==0} + + {if $item[isenable]=='0'}[停用]{else}[启用]{/if} + {/if} + + {if $item['userid']!=1} + [修改密码] + [清除头像] + {/if} + + {if $TS_USER['userid']==1 && $item['userid']!=1} + [删除] + + {if $item['isadmin']==0} + [设为管理员] + {elseif $item['isadmin']==1} + [取消管理员] + {/if} + + {/if} + +
      + +
      + + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/user/html/admin/user_pwd.html b/app/user/html/admin/user_pwd.html new file mode 100644 index 0000000..d49f7ef --- /dev/null +++ b/app/user/html/admin/user_pwd.html @@ -0,0 +1,20 @@ +{php include pubTemplate("header_admin")} + +
      + +{php include template("admin/menu");} + +
      + + + + +
      Email:{$strUser['email']}
      密码:
      + + +
      + + + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/user/html/admin/user_view.html b/app/user/html/admin/user_view.html new file mode 100644 index 0000000..677531e --- /dev/null +++ b/app/user/html/admin/user_view.html @@ -0,0 +1,35 @@ +{php include pubTemplate("header_admin")} + +
      + +{php include template("admin/menu");} + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      字段信息
      用户名:{$strUser['username']}
      登录账号:{$strUser['email']}
      手机号:{if isPhone($strUser['phone'])}{$strUser['phone']}{else}无{/if}
      签名:{$strUser['signed']}
      博客:{$strUser['blog']}
      关于:{$strUser['about']}
      注册日期:{php echo date('Y-m-d H:i:s',$strUser['addtime'])}
      上次访问:{php echo date('Y-m-d H:i:s',$strUser['uptime'])}
      上次访问 IP: {$strUser['ip']}
      积分: {$strUser['count_score']}
      + + + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/user/html/area.html b/app/user/html/area.html new file mode 100644 index 0000000..9f25bba --- /dev/null +++ b/app/user/html/area.html @@ -0,0 +1,3 @@ +{loop $arrArea $key $item} + +{/loop} \ No newline at end of file diff --git a/app/user/html/article.html b/app/user/html/article.html new file mode 100644 index 0000000..1e79f9a --- /dev/null +++ b/app/user/html/article.html @@ -0,0 +1,123 @@ +{php include pubTemplate("header")} + +
      + + + {template menu} + +
      + +
      + + + + + + + + {loop $arrArticle $key $item} + +
      +
      + + + {if $item['photo']} +
      + +
      + + + +
      +
      + + + +
      {$item[user][username]} 发表于 {$item[addtime]}
      + +
      {if $item['gaiyao']}{tsTitle($item['gaiyao'])}{else}暂无概要{/if} (查看全文)
      + + + + + +
      + + +
      + + {$item['count_view']} + {$item['count_comment']} + + +
      + +
      + + + + + + + +
      + +
      + + + {else} + + + +
      {$item['user']['username']} 发表于 {$item['addtime']}
      + + {if $item['score']==0} +
      {if $item['gaiyao']}{$item['gaiyao']}{else}暂无概要{/if} (查看全文)
      + {/if} + + + + +
      + + +
      + {$item['count_view']} + {$item['count_comment']} +
      + +
      + + + + {/if} + +
      +
      + + {/loop} + + +
      {$pageUrl}
      + + + + + + + + + +
      + +
      + {template userinfo} +
      + +
      +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/city.html b/app/user/html/city.html new file mode 100644 index 0000000..d21929b --- /dev/null +++ b/app/user/html/city.html @@ -0,0 +1,3 @@ +{loop $arrCity $key $item} + +{/loop} \ No newline at end of file diff --git a/app/user/html/collect.html b/app/user/html/collect.html new file mode 100644 index 0000000..43830dd --- /dev/null +++ b/app/user/html/collect.html @@ -0,0 +1,31 @@ +{php include pubTemplate("header")} + +
      + +
      +

      {$strUser['username']}

      +
      +
      +{template menu} + +
      +
      + +
      + +
      +
      {$pageUrl}
      +
      +
      + +
      +{template userinfo} +
      + +
      +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/comment.html b/app/user/html/comment.html new file mode 100644 index 0000000..b56cf4f --- /dev/null +++ b/app/user/html/comment.html @@ -0,0 +1,35 @@ +{php include pubTemplate("header")} + +
      + +
      +

      {$strUser['username']}

      +
      +
      +{template menu} + +
      + + + +
      +
      {$pageUrl}
      + + +
      +
      + +
      +{template userinfo} +
      + +
      +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/follow.html b/app/user/html/follow.html new file mode 100644 index 0000000..98d012f --- /dev/null +++ b/app/user/html/follow.html @@ -0,0 +1,50 @@ +{php include pubTemplate("header")} + +
      + + + {template menu} + + +
      + +
      + +
      + + +
      + + +{if $arrUser} + +
      + +{loop $arrUser $key $item} +
      + {$item['username']} +
      +
      {$item[username]}
      +{/loop} +
      + +
      +
      {$pageUrl}
      + + {else} + +
      还没有关注任何人
      + + {/if} + +
      +
      +
      + +
      +{template userinfo} +
      + +
      +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/followed.html b/app/user/html/followed.html new file mode 100644 index 0000000..87aece5 --- /dev/null +++ b/app/user/html/followed.html @@ -0,0 +1,52 @@ +{php include pubTemplate("header")} + +
      + + + {template menu} + + +
      + +
      + + + +
      +
      + + {if $arrUser} + +
      + +{loop $arrUser $key $item} +
      + {$item['username']} +
      +
      {$item[username]}
      +{/loop} + +
      + +
      +
      {$pageUrl}
      + + + {else} + +
      还没有任何粉丝
      + + {/if} + +
      +
      +
      + +
      +{template userinfo} +
      + + +
      +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/forgetpwd.html b/app/user/html/forgetpwd.html new file mode 100644 index 0000000..499fbf5 --- /dev/null +++ b/app/user/html/forgetpwd.html @@ -0,0 +1,163 @@ +{php include pubTemplate("header")} +
      + + + +
      +
      +
      + + + +
      +
      + + + + + + + + + + +
      + +
      + + +
      + + +
      + +
      + + 点击刷新验证码 +
      +
      + + +
      + +
      + + +
      +
      获取验证码后请登录邮箱查看验证码
      +
      + + + + +
      + + +
      + + +
      + + +
      + + + + + + + + + + + +
      +
      + + + + + + + + + +
      +
      +
      + + + +
      + + + + + + + + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/forgetpwd_phone.html b/app/user/html/forgetpwd_phone.html new file mode 100644 index 0000000..e3862db --- /dev/null +++ b/app/user/html/forgetpwd_phone.html @@ -0,0 +1,156 @@ +{php include pubTemplate("header")} +
      + + + +
      +
      +
      + + + +
      +
      + + + + + + + + + + + +
      + +
      + + +
      + +
      + +
      + + 点击刷新验证码 +
      +
      + +
      + +
      + + +
      +
      + + +
      + + +
      + + +
      + + +
      + + + + + + + + +
      +
      + + + + + + + + + +
      +
      +
      + + + +
      + + + + + + + + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/group.html b/app/user/html/group.html new file mode 100644 index 0000000..4736ff3 --- /dev/null +++ b/app/user/html/group.html @@ -0,0 +1,42 @@ +{php include pubTemplate("header")} + +
      + + + {template menu} + +
      +
      + + +
      +
      + + +{loop $arrGroupList $key $item} +
      +
      + +{$item[groupname]} + + + + +
      +
      +{$item[groupname]} {$item[count_user]}人加入 +

      {php echo t($item[groupdesc])}

      +
      +
      +{/loop} +
      +
      +
      + +
      +{template userinfo} +
      + +
      +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/guestbook.html b/app/user/html/guestbook.html new file mode 100644 index 0000000..638c1e0 --- /dev/null +++ b/app/user/html/guestbook.html @@ -0,0 +1,102 @@ +{php include pubTemplate("header")} + +
      + + {template menu} + +
      +
      + + +
      +
      + + + + {if tsIntval($TS_USER['userid']) >0 && tsIntval($TS_USER['userid']) != $strUser['userid']} +
      + +
      + + + + + +
      + +
      + + + + +
      + {/if} +
      + + + + + + {if $arrGuestList} +
      +
        + + {loop $arrGuestList $key $item} +
      • + + + +
        +

        {$item['user']['username']} {$item['addtime']}

        +
        {$item['content']}
        + {if $item['reply']} +
        回复:{$item['reply']['content']}
        + {/if} + + +

        + + {if tsIntval($TS_USER['userid']) == $strUser['userid']} + 回复 + 删除 + {/if} +

        + + +
        +
      • + {/loop} +
      +
      + +
      +
      {$pageUrl}
      + + {else} +
      暂无留言!
      + {/if} + +
      +
      +
      + +
      + {template userinfo} +
      + +
      +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/index.html b/app/user/html/index.html new file mode 100644 index 0000000..b4018c9 --- /dev/null +++ b/app/user/html/index.html @@ -0,0 +1,112 @@ +{php include pubTemplate("header")} + +
      + + + + + +
      +
      + +
      + +
      +
      用户积分榜积分
      +
        + {loop $arrScoreUser $key $item} + {if $key<='2'} +
      • +

        {$item['count_score']} + {$item['username']}

      • + {elseif $key >= '3'} +
      • {php echo $key+1}{$item['count_score']} + {$item['username']}
      • + {/if} + {/loop} +
      +
      + +
      + +
      +
      + + +
      + +
      +
      用户关注榜关注数
      +
        + {loop $arrFollowUser $key $item} + {if $key<='2'} +
      • +

        {$item['count_followed']} + {$item['username']}

      • + {elseif $key >= '3'} +
      • {php echo $key+1}{$item['count_followed']} + {$item['username']}
      • + {/if} + {/loop} +
      +
      + +
      + + +
      +
      + + +
      +
      +
      活跃用户时间
      +
        + {loop $arrHotUser $key $item} + {if $key<='2'} +
      • +

        {php echo getTime($item[uptime],time())} + {$item['username']}

      • + {elseif $key >= '3'} +
      • {php echo $key+1}{php echo getTime($item[uptime],time())} + {$item['username']}
      • + {/if} + {/loop} +
      +
      +
      + + +
      +
      + + +
      +
      +
      新用户时间
      +
        + {loop $arrNewUser $key $item} + {if $key<='2'} +
      • +

        {php echo getTime($item[addtime],time())} + {$item['username']}

      • + {elseif $key >= '3'} +
      • {php echo $key+1}{php echo getTime($item[addtime],time())} + {$item['username']}
      • + {/if} + {/loop} +
      +
      +
      + + +
      +
      + + + + + +
      + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/invite.html b/app/user/html/invite.html new file mode 100644 index 0000000..f6b6f1d --- /dev/null +++ b/app/user/html/invite.html @@ -0,0 +1,58 @@ +{php include pubTemplate("header")} + +
      + +
      + +
      {$TS_SITE[site_title]}邀请码
      + +
      +
      物质匮乏,一码难求,今日您仅剩下 {$codeNum} 个邀请码
      + +{if $codeNum=='0'} + +{else} + +
      + +{loop $arrCode $key $item} +
      {$item['invitecode']}
      +{/loop} + +
      + +{/if} + + +
      + + + + + + + + + + + {loop $arrInviteUser $key $item} + + + + + + {/loop} + + + +
      用户ID用户名加入时间
      {$item['userid']}{$item['username']}{php echo date('Y-m-d H:i:s',$item['addtime'])}
      + + +
      + + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/login.html b/app/user/html/login.html new file mode 100644 index 0000000..8c906f4 --- /dev/null +++ b/app/user/html/login.html @@ -0,0 +1,183 @@ +{php include pubTemplate("header")} + +
      + + +
      +
      +
      + + + + +
      +
      + + + +
      +
      用户登录
      + + + {if $TS_SITE['isplogin']==1} + + {/if} + + + +
      + +
      + + +
      +
      + + + + +
      +
      + + + + +
      +
      + +
      + +
      + +
      + + +
      + + + + + + + + +
      +
      + + +

      还没有注册? | 忘记密码?

      + + +
      + {php doAction('user_login_footer')} +
      + + + + +
      +
      + + + + + + +
      +
      +
      + + + + +
      + + + + + + + + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/menu.html b/app/user/html/menu.html new file mode 100644 index 0000000..121e5bb --- /dev/null +++ b/app/user/html/menu.html @@ -0,0 +1,93 @@ + + + +
      +
      + + + +
      +
      + + +
      + {$strUser[username]} +
      + +

      {$strUser['username']} {if $strUser['isverify']==1}通过Email认证{else}未通过Email认证{/if} + + {if $strUser['isrenzheng']==1} + 通过人工认证 + {else} + 未通过人工认证 + {/if}

      + + +
      + {if $strUser['signed']}{$strUser['signed']}{else}懒的都不写签名{/if} +
      + + + +
      +
      + + + +
      +
      + + +
      + {if $strUser[userid] != $TS_USER[userid]} + {if $strUser[isfollow]} + 取消关注 + {else} + 关注 + {/if} + + + {if $TS_USER} + 发消息 + {/if} + + + {/if} +
      + + +
      +
      + + + + +
      + 关于 + 帖子 + 小组 + 文章 + + 粉丝 + 关注 + + 留言 + +
      + + + + + +
      +
      + + + + diff --git a/app/user/html/message_add.html b/app/user/html/message_add.html new file mode 100644 index 0000000..bb351f3 --- /dev/null +++ b/app/user/html/message_add.html @@ -0,0 +1,75 @@ +{php include pubTemplate("header")} + + +
      + + + +
      +
      发送短消息
      +
      + + + +
      +
      +
      + + + + +
      + +
      + +
      +
      + {$strTouser[username]} {$strTouser['username']} +
      + +
      +
      + + +
      + +
      + + + +
      +
      + + +
      +
      + + + + + + + + 返回 + +
      +
      +
      + + + + + +
      +
      +
      + + + +
      +
      + + +
      + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/phone.html b/app/user/html/phone.html new file mode 100644 index 0000000..bb24706 --- /dev/null +++ b/app/user/html/phone.html @@ -0,0 +1,208 @@ +{php include pubTemplate("header")} + +
      + +
      +
      +
      + + + + + +
      +
      + + + + + + {if $TS_APP[isregister]=='2'} +

      系统升级中,暂时关闭用户注册!

      +

      返回首页

      + {else} + + + +
      + + {if $TS_SITE['isinvite']=='1'} +
      + + +
      + {/if} + +
      + + +
      + +
      + + + + +
      + +
      + + +
      + +
      + + +
      + + + + +
      + + + +
      +
      + +
      +
      + + 点击刷新验证码 + + 点击刷新验证码 + +
      +
      + + + + + +
      + + +
      + + + +
      + + +
      + + + +
      + + + + +
      + + + + + +
      + + +
      + +
      + {php doAction('user_login_footer')} +
      + + {/if} + + + +
      +
      + + + + + + + + +
      + +
      +
      + + +
      + + + + + + + + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/phone_verify.html b/app/user/html/phone_verify.html new file mode 100644 index 0000000..85a3536 --- /dev/null +++ b/app/user/html/phone_verify.html @@ -0,0 +1,160 @@ +{php include pubTemplate("header")} + +
      + +
      + +
      +
      + + + +
      +
      + + + + {if tsIntval($strUser['isverifyphone'])==0 && tsIntval($TS_SITE['isverifyphone'])==1} +
      提示:你必须通过手机号验证才可以正常使用本社区
      + {/if} + {if $strUser['isverifyphone']==1} +
      + 您已经通过手机号验证!现在可以随便点点看看我们的社区! +
      + + {else} + + + +
      +
      + + +
      + +
      + +
      + +
      + + +
      +
      +
      + + 点击刷新验证码 + + 点击刷新验证码 + +
      +
      + +
      + +
      + + +
      +
      +
      +
      + +
      + + (手机号验证通过后下次可以使用手机号登录社区) + +
      + + + + + {/if} + + +
      +
      + + + +
      +
      +
      + +
      + + + + + + + + + + + + +{php include pubTemplate("footer")} diff --git a/app/user/html/plogin.html b/app/user/html/plogin.html new file mode 100644 index 0000000..39285c8 --- /dev/null +++ b/app/user/html/plogin.html @@ -0,0 +1,155 @@ +{php include pubTemplate("header")} + +
      + + +
      +
      +
      + + + + +
      +
      + + + +
      +
      短信登录
      + +
      + +
      + + +
      +
      + + + + +
      + +
      + + + +
      +
      + +
      +
      + + 点击刷新验证码 + +
      +
      + + +
      + +
      + + +
      +
      + +
      +
      + +
      +
      + +
      + + +
      + + + + + + + +
      +
      + + + +
      +
      + + + + + + +
      +
      +
      + + + + +
      + + + + + + + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/register.html b/app/user/html/register.html new file mode 100644 index 0000000..d3d349a --- /dev/null +++ b/app/user/html/register.html @@ -0,0 +1,260 @@ +{php include pubTemplate("header")} + +
      + +
      +
      +
      + + + + + +
      +
      + + + {if $strFuser} +
      +
      + +
      + +
      +
      您好!我是 {$strFuser['username']}
      +
      我正在邀请您加入 {$TS_SITE['site_title']} ,欢迎来和我一起交流!
      +
      + +
      + +
      + + {/if} + + + + + + + + + + + {if $TS_APP[isregister]=='2'} +

      系统升级中,暂时关闭用户注册!

      +

      返回首页

      + {else} + + + +
      + + {if $TS_SITE['isinvite']=='1'} +
      + + +
      + {/if} + +
      + + +
      + +
      + + + + +
      + +
      + + +
      + +
      + + +
      + + + + {if $TS_SITE['is_vaptcha']} +
      + + +
      + +
      +
      +
      + + + + Vaptcha启动中... +
      +
      +
      + + + +
      + +
      + +
      + {/if} + + + + {if $TS_SITE['isauthcode']} +
      + +
      +
      + +
      + +
      +
      + {/if} + + + {if $TS_SITE['isverify']} +
      + +
      + + +
      +
      获取验证码后请登录邮箱查看验证码
      +
      + {/if} + + + + +
      + + + + + +
      + + +
      + +
      + {php doAction('user_login_footer')} +
      + + {/if} + + + +
      +
      + + + + + + + + +
      + +
      +
      + + +
      + + + + + + + + + + + + + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/resetpwd.html b/app/user/html/resetpwd.html new file mode 100644 index 0000000..a36e025 --- /dev/null +++ b/app/user/html/resetpwd.html @@ -0,0 +1,80 @@ +{php include pubTemplate("header")} + +
      + +
      + + + +
      +
      +
      + + + + +
      +
      + + + + + + +
      + + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      + + + +
      + + +
      + + + +
      +
      + + + + + + + + + + +
      +
      +
      + + + + +
      + + +
      + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/role.html b/app/user/html/role.html new file mode 100644 index 0000000..07ae7b4 --- /dev/null +++ b/app/user/html/role.html @@ -0,0 +1,39 @@ +{php include pubTemplate("header")} + +
      + + + +
      +
      + + + + + + + + + + + +{loop $arrRole $key $item} + +{/loop} + + +
      角色名称开始积分结束积分权限
      {$item['rolename']}{$item['score_start']}{$item['score_end']}即将开放
      + + +
      +
      + +
      + +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/signin_ajax.html b/app/user/html/signin_ajax.html new file mode 100644 index 0000000..70385a1 --- /dev/null +++ b/app/user/html/signin_ajax.html @@ -0,0 +1,9 @@ +{if $strSign} +
      已连续签到
      +
      +
      {$strSign['num']}
      +
      + +
      明日签到可领{$strScore['score']}积分
      +
      连续签到有更多惊喜哦
      +{/if} \ No newline at end of file diff --git a/app/user/html/space.html b/app/user/html/space.html new file mode 100644 index 0000000..fbe229e --- /dev/null +++ b/app/user/html/space.html @@ -0,0 +1,50 @@ +{php include pubTemplate("header")} + +
      + + + + + + + {template menu} + + + +
      + +
      + + + +
      +
      + + +
      +
      UID:
      {$strUser['userid']}
      +
      性别:
      {$strUser['sex']}
      +
      自我介绍:
      {if $strUser['about']}{$strUser['about']}{else}还没有介绍{/if}
      +
      关注:
      {$strUser['count_follow']} 人
      +
      粉丝:
      {$strUser['count_followed']} 人
      +
      积分:
      {$strUser['count_score']}
      +
      + + + + +
      +
      + + + + +
      + +
      + {template userinfo} +
      + +
      +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/system.html b/app/user/html/system.html new file mode 100644 index 0000000..4276d66 --- /dev/null +++ b/app/user/html/system.html @@ -0,0 +1,117 @@ + + + + + + + + + + + + + 系统管理登录 + + + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      + + +
      + ThinkSAAS后台登录 +
      + +
      管理后台登录
      + +
      +
      + +
      +
      + + + + +
      +
      + + + + +
      + +
      + + + + + + + +
      + Copyright (C) {$TS_CF['info']['year']}-{php echo date('Y')} {$TS_CF['info']['name']} {$TS_CF['info']['version']} +
      + +
      +
      + +
      +
      +
      +
      +
      +
      + + + + + + + + + + \ No newline at end of file diff --git a/app/user/html/topic.html b/app/user/html/topic.html new file mode 100644 index 0000000..9b2fba0 --- /dev/null +++ b/app/user/html/topic.html @@ -0,0 +1,45 @@ +{php include pubTemplate("header")} + +
      + + + {template menu} + +
      + +
      + + + +
      + +
      + + +
      + +
      + +
      +
      {$pageUrl}
      +
      +
      +
      + +
      +{template userinfo} +
      + +
      +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/user/html/userinfo.html b/app/user/html/userinfo.html new file mode 100644 index 0000000..d8f99d4 --- /dev/null +++ b/app/user/html/userinfo.html @@ -0,0 +1,2 @@ + +{php doAction('gobad','300')} \ No newline at end of file diff --git a/app/user/html/verify.html b/app/user/html/verify.html new file mode 100644 index 0000000..d459919 --- /dev/null +++ b/app/user/html/verify.html @@ -0,0 +1,64 @@ +{php include pubTemplate("header")} + +
      + +
      + +
      +
      + + + +
      +
      + + + + {if tsIntval($strUser['isverify'])==0 && tsIntval($TS_SITE['isverify'])==1} +
      提示:你必须通过Email验证才可以正常使用本社区
      + {/if} + {if $strUser['isverify']==1} +
      + 您已经通过Email验证!现在可以随便点点看看我们的社区! +
      + + {else} + + + +
      +
      + + +
      + + 点击发送验证 + +
      + + +
      + + +
      + + + + +
      + + {/if} + + +
      +
      + + + +
      +
      +
      + +
      + +{php include pubTemplate("footer")} diff --git a/app/user/html/verify_face.html b/app/user/html/verify_face.html new file mode 100644 index 0000000..f6fff2d --- /dev/null +++ b/app/user/html/verify_face.html @@ -0,0 +1,75 @@ +{php include pubTemplate("header")} +
      + +
      + +
      +
      + + + +
      +
      + + + + {if $strUser['face']=='' && tsIntval($TS_SITE['isface'])==1} +
      提示:你必须上传头像才可以正常使用本社区
      + {/if} + + {if $strUser['path']} +
      + 您已经上传头像!现在可以随便点点看看我们的社区! +
      + {else} + + + + + +
      + + +
      + + +

      {$strUser['username']}

      + +
      + +
      + +
      + +
      + +
      提示:请选择1M以内的头像图片
      + + +
      + +
      + +
      + +
      + + + + {/if} + + + + +
      +
      + + + +
      +
      +
      + +
      + +{php include pubTemplate("footer")} diff --git a/app/user/js/admin.js b/app/user/js/admin.js new file mode 100644 index 0000000..e69de29 diff --git a/app/user/js/extend.func.js b/app/user/js/extend.func.js new file mode 100644 index 0000000..51a9d4e --- /dev/null +++ b/app/user/js/extend.func.js @@ -0,0 +1,9 @@ +/*显示隐藏回复*/ +function reguest(userid,reid,username) +{ + $("#reguest").toggle('fast'); + $("#reguest textarea").val('@'+username+'#'); + $("#reguest #touserid").val(userid); + $("#reguest #reid").val(reid); + $("#reguest textarea").focus(); +} \ No newline at end of file diff --git a/app/user/skin/style.css b/app/user/skin/style.css new file mode 100644 index 0000000..05ee461 --- /dev/null +++ b/app/user/skin/style.css @@ -0,0 +1,486 @@ +.verify_email{width:500px;margin:0 auto;} +.verify_email h3{font-weight:bold;} + +.verify_face{width:500px;margin:0 auto;} +.verify_face h3{font-weight:bold;} + + +.invitecode{width:600px;margin:0 auto;} +.invitecode ul{} +.invitecode ul li{float:left;width:300px;font-size:14px;padding:10px 0;} + +/**框架CSS**/ + +.uinput{width:200px;padding: 3px 0 3px 0;font-size: 14px;} + +.utext{width:300px;height:50;border-color: #999999 #E1E1E1 #E1E1E1 #999999;border-style: solid;border-width: 1px; padding: 3px 0 3px 0;font-size: 14px;} + +.utable{} +.utable th{text-align:right;height:40px;} +.utable td{} +.blockquote { + line-height: 1.3; + margin: 0 0 10px; + padding: 5px 8px; +} + + +/*table olt*/ +.olt { + margin-bottom: 3px; + padding: 0; + width: 100%; + border: medium none; + border-collapse: collapse; + margin: 0; + border-spacing: 0; +} +.olt td { + border-bottom: 1px dashed #DDDDDD; + padding: 3px 3px 3px 0; +} +/*右侧会员列表*/ +.obu { + display: inline; + float: left; + margin: 0 0 10px; + width: 70px; +} +.obu dt { + height: 50px; + line-height: 16px; + margin: 0; + overflow: hidden; + text-align: center; +} +.obu dd { + margin: 0; + height: 30px; + overflow: hidden; + text-align: center; +} +.pl { + color: #666666; + font: 12px/150% Arial; + padding:10px 0; +} + +.pl2 { + color: #666666; + font: 14px/150% Arial; +} + +.mr5 { + margin-right: 5px; +} + +.color_gray, .color-gray { + color: #666666; +} + +.fright { + float: right; +} + + +/*邀请 by QiuJun*/ +.invites{} +.invites h2{font-size:14px;font-weight:bold;margin:20px 0 20px 0;color:#555555} +.invites p{line-height:25px;color:#999999;margin:0;} + +/*链接按钮*/ +.subab{ + background: #66873E; + color: #FFFFFF; + cursor: pointer; + padding: 10px 20px; + font-size:16px; + +} + + + +/*table olt*/ +.olt { + margin-bottom: 3px; + padding: 0; + width: 100%; + border: medium none; + border-collapse: collapse; + margin: 0; + border-spacing: 0; +} +.olt td { + border-bottom: 1px dashed #DDDDDD; + padding: 3px 3px 3px 0; +} + + + + +/*2011-06-20*/ +/*个人主页左侧*/ +#db-usr-profile { + height: 58px; + left: 0; + margin-bottom: 2em; + position: relative; + top: 0; + width: 100%; +} +#db-usr-profile .pic { + float: left; + margin-right: 12px; +} +#db-usr-profile .info { + float: left; + padding-top: 2px; +} +#db-usr-profile h1 { + padding: 0 0 4px; +} +#db-usr-profile .info ul li { + display: inline; + margin-right: 1em; +} +#review { + margin-bottom: 27px; +} +/*个人主页右侧*/ +#profile .userface { + float: left; + margin: 1px 10px 8px 0; +} + +fieldset, img { + border: 0 none; +} +.user-info { + color: #666666; +} +.user-opt { + clear: both; + padding: 8px 0; +} + +.user-group { + color: #666666; + display: none; + margin: 0 0 10px; +} + +.user-cs { + background: url("icon-ok.png") no-repeat scroll left center transparent; + display: inline-block; + padding: 0 0 0 15px; +} +.user-rs { + margin: 0 0 0 15px; +} + +.user-group-arrow { + background: url("icon-arrow-down-b.png") no-repeat scroll center center transparent; + border: 1px solid #FFFFFF; + cursor: pointer; + display: inline-block; + height: 17px; + margin: 0 0 0 -2px; + position: relative; + top: 5px; + width: 17px; +} + +.user-opt .user-group-arrow { + border-color: #FFF6EE; +} + +.a-btn, .a-btn-add, .a-btn-add-light, .a-btn-opt { + border-radius: 3px 3px 3px 3px; + display: inline-block; + height: 20px; + line-height: 20px; + overflow: hidden; +} +.a-btn:link, .a-btn:active, .a-btn:hover, .a-btn:visited, .a-btn-opt:link, .a-btn-opt:active, .a-btn-opt:hover, .a-btn-opt:visited { + background: none repeat scroll 0 0 #FFF3E7; + border: 1px solid #E7D7CA; + color: #797979; + outline: 0 none; + padding: 0 10px; +} + +.more-opt { + display: inline-block; +} +#divac { + clear: both; +} +.sep-line { + border-bottom: 1px solid #F5E9DB; + clear: both; + font-size: 0; + height: 0; + margin: 5px; + overflow: hidden; +} +.user-intro { + color: #666666; + overflow: hidden; + word-wrap: break-word; +} +.mbt { + clear: both; + margin: 0; + padding: 0; +} +.mbtrmini { + background: url("listdot.gif") no-repeat scroll 0 8px transparent; + border-bottom: 1px dashed #DDDDDD; + padding: 4px 0 4px 12px; +} +.quote { + background: url("quotel.gif") no-repeat scroll left 4px transparent; + margin: 8px 0 0 26px; + overflow: hidden; + padding: 0 24px 5px 15px; + width: auto; + word-wrap: break-word; +} +.quote span.inq { + background: url("quoter.gif") no-repeat scroll right bottom transparent; + color: #333333; + display: inline-block; + padding-right: 15px; +} +.indentrec { + color: #333333; + line-height: 1.6em; + margin-left: 24px; +} +#event { + margin-bottom: 10px; +} +.evt_short { + float: left; + margin-bottom: 10px; + width: 100%; +} +.actfromfri { + line-height: 1.6em; + padding: 0.6em 0; +} +.evt_short li { + line-height: 1.6em; +} +#group { + width: 100%; +} +/*小组*/ +.ob { + float: left; + margin: 0 0 10px; + text-align: center; + width: 70px; +} +.ob dt { + height: 50px; + margin: 0; + overflow: hidden; + text-align: center; +} +.ob dd { + height: 30px; + margin: 0; + overflow: hidden; + text-align: center; +} +.ob span { + white-space: nowrap; +} + +.mbtr { + border-bottom: 1px solid #EEEEEE; + margin: 5px 0; + min-height: 55px; + overflow: hidden; + padding: 5px 0; +} + +.bs li { + border-bottom: 1px dashed #DDDDDD; + margin: 0; + overflow: hidden; + padding: 4px 0; +} + +.spacetopic{} +.spacetopic table{} +.spacetopic tr td{border-bottom:dashed 1px #DDDDDD;padding:5px 0;} + + + +/*动态*/ +.mbtl { + float: left; + margin: 8px 7px 0 0; + padding: 0; + width: 55px; +} +.mbtr { + border-bottom: 1px solid #EEEEEE; + margin: 5px 0; + min-height: 55px; + overflow: hidden; + padding: 5px 0; +} +.pl { + color: #666666; + line-height: 1.5; +} +.broadsmr { + color: #999999; + padding: 5px 24px; +} +.indentrec { + color: #333333; + line-height: 1.6em; + margin-left: 24px; +} + +.quote { + background: url("http://t.douban.com/pics/quotel.gif") no-repeat scroll left 4px transparent; + margin: 8px 0 0 26px; + overflow: hidden; + padding: 0 24px 5px 15px; + width: auto; + word-wrap: break-word; +} +.quote .inq { + background: url("http://t.douban.com/pics/quoter.gif") no-repeat scroll right bottom transparent; + color: #333333; + display: inline-block; + padding-right: 15px; +} + +.broadimg { + border: 1px solid #DDDDDD; + float: right; + margin-left: 14px; +} + +.clearfix:after { + clear: both; + content: "."; + display: block; + height: 0; + visibility: hidden; +} + +.indentrec { + color: #333333; + line-height: 1.6em; + margin-left: 24px; +} +.timeline-album { + float: left; + margin: 8px 12px 8px 0; +} + +/*留言*/ +.guest{} +.guest img{float:left;width:50px;} +.guest form{margin-left:60px;} + +.glist{} +.glist ul, .glist ul li{list-style: none;margin:0;padding: 0;} +.glist ul{} +.glist ul li{border-bottom: 1px solid #EEEEEE;overflow: hidden;padding: 10px 0;} +.glist ul li img{float:left;} +.glist ul li .content{margin-left:60px;line-height:25px;} +.glist ul li .content p{padding:0px;margin:0;} + +/*小组列表*/ +.sub-item{ + border-bottom: 1px dashed #AAAAAA; + float: left; + margin: 0 2px 15px 0; + overflow: hidden; + width: 49%; + padding-bottom: 15px; +} +.sub-item .pic { + float: left; + display: table-cell; + vertical-align: top; + width: 48px; + overflow: hidden; +} +.sub-item .info { + color: #666666; + vertical-align: top; + word-wrap: break-word; + line-height:20px; + margin-left:60px; +} +.sub-item .pic img { + height: 48px; + width: 48px; +} +.sub-item p { + margin: 0; + height:60px;; + width:220px; + overflow:hidden; + +} + +/*帖子列表*/ +.topic{} +.topic li{line-height:30px;} + + +/*排行榜页面*/ +.top10{} +.top10 dl{overflow: hidden;} +.top10 dl dd{margin-bottom:15px;margin-left: 0;} +.top10 dl dd .title{background:none repeat scroll 0 0 #F5F5F5;border:1px solid #EEEEEE;margin:0 8px;padding:10px;position:relative;} + +.top10 dl dd .title span{float:right;color:#999999;position:absolute;right:10px;} + +.top10 dl dd ul, .top10 dl dd ul li{list-style: none;padding:0;margin:0;} + +.top10 dl dd ul{border-top:1px solid #F5F5F5;margin:0 8px;background:#FFFFFF;} +.top10 dl dd ul li{border-color:#EEEEEE;border-style:solid;border-width:0 1px 1px;margin-bottom:0;padding:10px;clear:both;line-height:20px;word-wrap:break-word;overflow:hidden;} + +.top10 .avatar {float:left;margin-right:10px;} +.top10 .avatar img {height:36px;width:36px;} + + +.top10 li em {color:#999999;float:right;margin-left:8px;} + +.top10 li span {float:left;font-size:10px;height:14px;line-height:14px;margin:4px 8px 0 0;text-align:center;width:16px;} +.top10 li p{height:48px;margin:0;padding:0;} + +/*注册、登陆表格*/ +.subform{} +.subform th{font-size:14px;} +.subform input[type="text"], .subform input[type="email"], .subform input[type="password"]{height:30px;line-height:30px;font-size:14px;width:200px;} + + + + + + +.user_space_userinfo{overflow: hidden;} +.user_space_userinfo .photo{width:90px;float:left;} +.user_space_userinfo .info{margin-left:100px;} +.user_space_userinfo .info .sex{} +.user_space_userinfo .info .city{} +.user_space_userinfo .info .about{} + + +.user_space_right_follow{overflow: hidden} +.user_space_right_follow ul, .user_space_right_follow ul li{list-style: none;margin:0;padding:0;} +.user_space_right_follow ul{} +.user_space_right_follow ul .br{border-right:solid 1px #ddd;} +.user_space_right_follow ul li{float:left;padding:10px 20px;text-align:center} \ No newline at end of file diff --git a/app/user/skins/default/style.css b/app/user/skins/default/style.css new file mode 100644 index 0000000..05ee461 --- /dev/null +++ b/app/user/skins/default/style.css @@ -0,0 +1,486 @@ +.verify_email{width:500px;margin:0 auto;} +.verify_email h3{font-weight:bold;} + +.verify_face{width:500px;margin:0 auto;} +.verify_face h3{font-weight:bold;} + + +.invitecode{width:600px;margin:0 auto;} +.invitecode ul{} +.invitecode ul li{float:left;width:300px;font-size:14px;padding:10px 0;} + +/**框架CSS**/ + +.uinput{width:200px;padding: 3px 0 3px 0;font-size: 14px;} + +.utext{width:300px;height:50;border-color: #999999 #E1E1E1 #E1E1E1 #999999;border-style: solid;border-width: 1px; padding: 3px 0 3px 0;font-size: 14px;} + +.utable{} +.utable th{text-align:right;height:40px;} +.utable td{} +.blockquote { + line-height: 1.3; + margin: 0 0 10px; + padding: 5px 8px; +} + + +/*table olt*/ +.olt { + margin-bottom: 3px; + padding: 0; + width: 100%; + border: medium none; + border-collapse: collapse; + margin: 0; + border-spacing: 0; +} +.olt td { + border-bottom: 1px dashed #DDDDDD; + padding: 3px 3px 3px 0; +} +/*右侧会员列表*/ +.obu { + display: inline; + float: left; + margin: 0 0 10px; + width: 70px; +} +.obu dt { + height: 50px; + line-height: 16px; + margin: 0; + overflow: hidden; + text-align: center; +} +.obu dd { + margin: 0; + height: 30px; + overflow: hidden; + text-align: center; +} +.pl { + color: #666666; + font: 12px/150% Arial; + padding:10px 0; +} + +.pl2 { + color: #666666; + font: 14px/150% Arial; +} + +.mr5 { + margin-right: 5px; +} + +.color_gray, .color-gray { + color: #666666; +} + +.fright { + float: right; +} + + +/*邀请 by QiuJun*/ +.invites{} +.invites h2{font-size:14px;font-weight:bold;margin:20px 0 20px 0;color:#555555} +.invites p{line-height:25px;color:#999999;margin:0;} + +/*链接按钮*/ +.subab{ + background: #66873E; + color: #FFFFFF; + cursor: pointer; + padding: 10px 20px; + font-size:16px; + +} + + + +/*table olt*/ +.olt { + margin-bottom: 3px; + padding: 0; + width: 100%; + border: medium none; + border-collapse: collapse; + margin: 0; + border-spacing: 0; +} +.olt td { + border-bottom: 1px dashed #DDDDDD; + padding: 3px 3px 3px 0; +} + + + + +/*2011-06-20*/ +/*个人主页左侧*/ +#db-usr-profile { + height: 58px; + left: 0; + margin-bottom: 2em; + position: relative; + top: 0; + width: 100%; +} +#db-usr-profile .pic { + float: left; + margin-right: 12px; +} +#db-usr-profile .info { + float: left; + padding-top: 2px; +} +#db-usr-profile h1 { + padding: 0 0 4px; +} +#db-usr-profile .info ul li { + display: inline; + margin-right: 1em; +} +#review { + margin-bottom: 27px; +} +/*个人主页右侧*/ +#profile .userface { + float: left; + margin: 1px 10px 8px 0; +} + +fieldset, img { + border: 0 none; +} +.user-info { + color: #666666; +} +.user-opt { + clear: both; + padding: 8px 0; +} + +.user-group { + color: #666666; + display: none; + margin: 0 0 10px; +} + +.user-cs { + background: url("icon-ok.png") no-repeat scroll left center transparent; + display: inline-block; + padding: 0 0 0 15px; +} +.user-rs { + margin: 0 0 0 15px; +} + +.user-group-arrow { + background: url("icon-arrow-down-b.png") no-repeat scroll center center transparent; + border: 1px solid #FFFFFF; + cursor: pointer; + display: inline-block; + height: 17px; + margin: 0 0 0 -2px; + position: relative; + top: 5px; + width: 17px; +} + +.user-opt .user-group-arrow { + border-color: #FFF6EE; +} + +.a-btn, .a-btn-add, .a-btn-add-light, .a-btn-opt { + border-radius: 3px 3px 3px 3px; + display: inline-block; + height: 20px; + line-height: 20px; + overflow: hidden; +} +.a-btn:link, .a-btn:active, .a-btn:hover, .a-btn:visited, .a-btn-opt:link, .a-btn-opt:active, .a-btn-opt:hover, .a-btn-opt:visited { + background: none repeat scroll 0 0 #FFF3E7; + border: 1px solid #E7D7CA; + color: #797979; + outline: 0 none; + padding: 0 10px; +} + +.more-opt { + display: inline-block; +} +#divac { + clear: both; +} +.sep-line { + border-bottom: 1px solid #F5E9DB; + clear: both; + font-size: 0; + height: 0; + margin: 5px; + overflow: hidden; +} +.user-intro { + color: #666666; + overflow: hidden; + word-wrap: break-word; +} +.mbt { + clear: both; + margin: 0; + padding: 0; +} +.mbtrmini { + background: url("listdot.gif") no-repeat scroll 0 8px transparent; + border-bottom: 1px dashed #DDDDDD; + padding: 4px 0 4px 12px; +} +.quote { + background: url("quotel.gif") no-repeat scroll left 4px transparent; + margin: 8px 0 0 26px; + overflow: hidden; + padding: 0 24px 5px 15px; + width: auto; + word-wrap: break-word; +} +.quote span.inq { + background: url("quoter.gif") no-repeat scroll right bottom transparent; + color: #333333; + display: inline-block; + padding-right: 15px; +} +.indentrec { + color: #333333; + line-height: 1.6em; + margin-left: 24px; +} +#event { + margin-bottom: 10px; +} +.evt_short { + float: left; + margin-bottom: 10px; + width: 100%; +} +.actfromfri { + line-height: 1.6em; + padding: 0.6em 0; +} +.evt_short li { + line-height: 1.6em; +} +#group { + width: 100%; +} +/*小组*/ +.ob { + float: left; + margin: 0 0 10px; + text-align: center; + width: 70px; +} +.ob dt { + height: 50px; + margin: 0; + overflow: hidden; + text-align: center; +} +.ob dd { + height: 30px; + margin: 0; + overflow: hidden; + text-align: center; +} +.ob span { + white-space: nowrap; +} + +.mbtr { + border-bottom: 1px solid #EEEEEE; + margin: 5px 0; + min-height: 55px; + overflow: hidden; + padding: 5px 0; +} + +.bs li { + border-bottom: 1px dashed #DDDDDD; + margin: 0; + overflow: hidden; + padding: 4px 0; +} + +.spacetopic{} +.spacetopic table{} +.spacetopic tr td{border-bottom:dashed 1px #DDDDDD;padding:5px 0;} + + + +/*动态*/ +.mbtl { + float: left; + margin: 8px 7px 0 0; + padding: 0; + width: 55px; +} +.mbtr { + border-bottom: 1px solid #EEEEEE; + margin: 5px 0; + min-height: 55px; + overflow: hidden; + padding: 5px 0; +} +.pl { + color: #666666; + line-height: 1.5; +} +.broadsmr { + color: #999999; + padding: 5px 24px; +} +.indentrec { + color: #333333; + line-height: 1.6em; + margin-left: 24px; +} + +.quote { + background: url("http://t.douban.com/pics/quotel.gif") no-repeat scroll left 4px transparent; + margin: 8px 0 0 26px; + overflow: hidden; + padding: 0 24px 5px 15px; + width: auto; + word-wrap: break-word; +} +.quote .inq { + background: url("http://t.douban.com/pics/quoter.gif") no-repeat scroll right bottom transparent; + color: #333333; + display: inline-block; + padding-right: 15px; +} + +.broadimg { + border: 1px solid #DDDDDD; + float: right; + margin-left: 14px; +} + +.clearfix:after { + clear: both; + content: "."; + display: block; + height: 0; + visibility: hidden; +} + +.indentrec { + color: #333333; + line-height: 1.6em; + margin-left: 24px; +} +.timeline-album { + float: left; + margin: 8px 12px 8px 0; +} + +/*留言*/ +.guest{} +.guest img{float:left;width:50px;} +.guest form{margin-left:60px;} + +.glist{} +.glist ul, .glist ul li{list-style: none;margin:0;padding: 0;} +.glist ul{} +.glist ul li{border-bottom: 1px solid #EEEEEE;overflow: hidden;padding: 10px 0;} +.glist ul li img{float:left;} +.glist ul li .content{margin-left:60px;line-height:25px;} +.glist ul li .content p{padding:0px;margin:0;} + +/*小组列表*/ +.sub-item{ + border-bottom: 1px dashed #AAAAAA; + float: left; + margin: 0 2px 15px 0; + overflow: hidden; + width: 49%; + padding-bottom: 15px; +} +.sub-item .pic { + float: left; + display: table-cell; + vertical-align: top; + width: 48px; + overflow: hidden; +} +.sub-item .info { + color: #666666; + vertical-align: top; + word-wrap: break-word; + line-height:20px; + margin-left:60px; +} +.sub-item .pic img { + height: 48px; + width: 48px; +} +.sub-item p { + margin: 0; + height:60px;; + width:220px; + overflow:hidden; + +} + +/*帖子列表*/ +.topic{} +.topic li{line-height:30px;} + + +/*排行榜页面*/ +.top10{} +.top10 dl{overflow: hidden;} +.top10 dl dd{margin-bottom:15px;margin-left: 0;} +.top10 dl dd .title{background:none repeat scroll 0 0 #F5F5F5;border:1px solid #EEEEEE;margin:0 8px;padding:10px;position:relative;} + +.top10 dl dd .title span{float:right;color:#999999;position:absolute;right:10px;} + +.top10 dl dd ul, .top10 dl dd ul li{list-style: none;padding:0;margin:0;} + +.top10 dl dd ul{border-top:1px solid #F5F5F5;margin:0 8px;background:#FFFFFF;} +.top10 dl dd ul li{border-color:#EEEEEE;border-style:solid;border-width:0 1px 1px;margin-bottom:0;padding:10px;clear:both;line-height:20px;word-wrap:break-word;overflow:hidden;} + +.top10 .avatar {float:left;margin-right:10px;} +.top10 .avatar img {height:36px;width:36px;} + + +.top10 li em {color:#999999;float:right;margin-left:8px;} + +.top10 li span {float:left;font-size:10px;height:14px;line-height:14px;margin:4px 8px 0 0;text-align:center;width:16px;} +.top10 li p{height:48px;margin:0;padding:0;} + +/*注册、登陆表格*/ +.subform{} +.subform th{font-size:14px;} +.subform input[type="text"], .subform input[type="email"], .subform input[type="password"]{height:30px;line-height:30px;font-size:14px;width:200px;} + + + + + + +.user_space_userinfo{overflow: hidden;} +.user_space_userinfo .photo{width:90px;float:left;} +.user_space_userinfo .info{margin-left:100px;} +.user_space_userinfo .info .sex{} +.user_space_userinfo .info .city{} +.user_space_userinfo .info .about{} + + +.user_space_right_follow{overflow: hidden} +.user_space_right_follow ul, .user_space_right_follow ul li{list-style: none;margin:0;padding:0;} +.user_space_right_follow ul{} +.user_space_right_follow ul .br{border-right:solid 1px #ddd;} +.user_space_right_follow ul li{float:left;padding:10px 20px;text-align:center} \ No newline at end of file diff --git a/app/weibo/about.php b/app/weibo/about.php new file mode 100644 index 0000000..78f4c91 --- /dev/null +++ b/app/weibo/about.php @@ -0,0 +1,17 @@ + '唠叨', + 'version' => '1.2', + 'desc' => '唠叨,微博,一句话', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isoption' => '1', + 'isinstall' => '1', + 'issql' => '1', + 'issystem' => '1', + 'isappnav' => '1', + 'ismy'=>'1', +); \ No newline at end of file diff --git a/app/weibo/action.weibo.php b/app/weibo/action.weibo.php new file mode 100644 index 0000000..17e5407 --- /dev/null +++ b/app/weibo/action.weibo.php @@ -0,0 +1,377 @@ +'')); + + $lstart = $page*20-20; + + $arrWeibo = $this->findAll('weibo',array( + 'isaudit'=>0, + ),'uptime desc',null,$lstart.',20'); + foreach($arrWeibo as $key=>$item){ + $arrWeibo[$key]['user'] = aac('user')->getOneUser($item['userid']); + $arrWeibo[$key]['content'] = tsTitle($item['content']); + } + + + $weiboNum = $this->findCount('weibo',array( + 'isaudit'=>0, + )); + + $pageUrl = pagination($weiboNum, 20, $page, $url); + + + #热门唠叨 + $arrHotWeibo = $this->findAll('weibo',null,'count_comment desc',null,10); + + foreach($arrHotWeibo as $key=>$item){ + $arrHotWeibo[$key]['content'] = tsTitle($item['content']); + $arrHotWeibo[$key]['user'] = aac('user')->getOneUser($item['userid']); + } + + + $title = '过去'; + include template('index'); + } + + /* + * 发布唠叨 + */ + public function add(){ + + $js = intval($_GET['js']); + + $userid = aac('user')->isLogin(1); + + //判断用户是否存在 + if(aac('user')->isUser($userid)==false) getJson('不好意思,用户不存在!',$js); + + //判断发布者状态 + if(aac('user')->isPublisher()==false) getJson('你还不能发布内容,检查邮箱是否认证。',$js,1,tsUrl('user','verify')); + + //发布时间限制 + if(aac('system')->pubTime()==false) getJson('不好意思,当前时间不允许发布内容!',$js); + + $content = trim($_POST['content']); + + if($content == '') { + getJson('内容不能为空',$js); + } + + $isaudit = 0; + + if($GLOBALS['TS_USER']['isadmin']==0){ + //过滤内容开始 + aac('system')->antiWord($content,$js); + //过滤内容结束 + } + + $weiboid = $this->create('weibo',array( + 'userid'=>$userid, + 'locationid'=>aac('user')->getLocationId($userid), + 'content'=>$content, + 'isaudit'=>$isaudit, + 'addtime'=>date('Y-m-d H:i:s'), + 'uptime'=>date('Y-m-d H:i:s'), + )); + + getJson('发布成功!',$js,2,tsurl('weibo','show',array('id'=>$weiboid))); + + } + + /* + *展示唠叨内容 + */ + public function show(){ + $weiboid = intval($_GET['id']); + + $strWeibo = $this->getOneWeibo($weiboid); + + if($weiboid==0 || $strWeibo==''){ + ts404(); + } + + if($strWeibo['isaudit']==1){ + tsNotice('内容审核中...'); + } + + //comment + $page = isset($_GET['page']) ? intval($_GET['page']) : '1'; + $url = tsUrl('weibo','show',array('id'=>$weiboid,'page'=>'')); + $lstart = $page*20-20; + + $arrComment = $this->findAll('weibo_comment',array( + 'weiboid'=>$weiboid, + ),'addtime desc',null,$lstart.',20'); + + foreach($arrComment as $key=>$item){ + $arrComment[$key]['content'] = tsTitle($item['content']); + $arrComment[$key]['user']=aac('user')->getOneUser($item['userid']); + } + + $commentNum = $this->findCount('weibo_comment',array( + 'weiboid'=>$weiboid, + )); + + $pageUrl = pagination($commentNum, 20, $page, $url); + + + + //他的更多唠叨 + $arrWeibo = $this->findAll('weibo',array( + 'userid'=>$strWeibo['userid'], + ),'addtime desc',null,20); + + $weiboNum = $this->findCount('weibo',array( + 'userid'=>$strWeibo['userid'], + )); + + if($weiboNum<20){ + + $num = 20-$weiboNum; + $userid = $strWeibo['userid']; + $arrNewWeibo = $this->findAll('weibo',"`userid`!='$userid'",'addtime desc',null,$num); + + $arrWeibo = array_merge($arrWeibo, $arrNewWeibo); + + } + + foreach($arrWeibo as $key=>$item){ + $arrWeibo[$key]['content'] = tsTitle($item['content']); + } + + + if($strWeibo['content']==''){ + $title = $strWeibo['user']['username'].'的过去('.$strWeibo['weiboid'].')'; + }else{ + $title = cututf8($strWeibo['content'],0,100,false); + } + + include template('show'); + } + + + /* + * 发布唠叨图片 + */ + public function photo(){ + + $userid = intval($GLOBALS['TS_USER']['userid']); + + if($userid==0){ + echo 0;exit;//请登录 + } + + + $content = tsClean($_POST['content']); + + if($GLOBALS['TS_USER']['isadmin']==0){ + //过滤内容开始 + aac('system')->antiWord($content); + //过滤内容结束 + } + + $weiboid = $this->create('weibo',array( + 'userid'=>$userid, + 'content'=>$content, + 'isaudit'=>0, + 'addtime'=>date('Y-m-d H:i:s'), + 'uptime'=>date('Y-m-d H:i:s'), + )); + + // 上传图片开始 + $arrUpload = tsUpload ( $_FILES ['filedata'], $weiboid, 'weibo', array ('jpg','gif','png','jpeg' ) ); + if ($arrUpload) { + $this->update ( 'weibo', array ( + 'weiboid' => $weiboid + ), array ( + 'path' => $arrUpload ['path'], + 'photo' => $arrUpload ['url'] + ) ); + + echo 3;exit; + + }else{ + + echo 2;exit; + + } + } + + /* + * 回复唠叨,添加评论 + */ + public function addcomment(){ + + //用户是否登录 + $userid = aac('user')->isLogin(); + + //判断发布者状态 + if(aac('user')->isPublisher()==false) tsNotice('你还不能发布内容,检查邮箱是否认证。'); + + //发布时间限制 + if(aac('system')->pubTime()==false) tsNotice('不好意思,当前时间不允许发布内容!'); + + $weiboid = intval($_POST['weiboid']); + $touserid = intval($_POST['touserid']); + $content = trim($_POST['content']); + + if($content == ''){ + tsNotice('内容不能为空'); + } + + if($GLOBALS['TS_USER']['isadmin']==0){ + //过滤内容开始 + aac('system')->antiWord($content); + //过滤内容结束 + } + + $commentid = $this->create('weibo_comment',array( + 'userid'=>$userid, + 'touserid'=>$touserid, + 'weiboid'=>$weiboid, + 'content'=>$content, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + //计算评论总数 + $commentNum = $this->findCount('weibo_comment',array( + 'weiboid'=>$weiboid, + )); + + $this->update('weibo',array( + 'weiboid'=>$weiboid, + ),array( + 'count_comment'=>$commentNum, + )); + + $strWeibo = $this->find('weibo',array( + 'weiboid'=>$weiboid, + )); + + if($strWeibo['userid'] != $userid){ + $msg_userid = '0'; + $msg_touserid = $strWeibo['userid']; + $msg_content = '你的微博新增一条回复,快去看看给个回复吧^_^'; + $msg_tourl = tsUrl('weibo','show',array('id'=>$weiboid)); + aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl); + } + + tsHeaderUrl(tsUrl('weibo','show',array('id'=>$weiboid))); + } + + /* + * 删除评论 + */ + public function deletecomment(){ + $userid = aac('user')->isLogin(); + + $commentid = intval($_GET['commentid']); + + $strComment = $this->find('weibo_comment',array( + 'commentid'=>$commentid, + )); + + if($GLOBALS['TS_USER']['isadmin']==1 || $strComment['userid']==$userid){ + + + $this->delete('weibo_comment',array('commentid'=>$commentid)); + + //统计 + $count_comment = $this->findCount('weibo_comment',array( + 'weiboid'=>$strComment['weiboid'], + )); + + $this->update('weibo',array( + 'weiboid'=>$strComment['weiboid'], + ),array( + 'count_comment'=>$count_comment, + )); + + tsHeaderUrl(tsUrl('weibo','show',array('id'=>$strComment['weiboid']))); + + + }else{ + tsNotice('非法操作!'); + } + } + + /* + * 删除唠叨 + */ + public function deleteweibo(){ + $userid = aac('user')->isLogin(); + + $weiboid = intval($_GET['weiboid']); + + $strWeibo = $this->find('weibo',array( + 'weiboid'=>$weiboid, + )); + + if($userid == $strWeibo['userid'] || $GLOBALS['TS_USER']['isadmin']==1){ + $this->delete('weibo',array( + 'weiboid'=>$weiboid, + )); + + $this->delete('weibo_comment',array( + 'weiboid'=>$weiboid, + )); + + //删除图片 + if($strWeibo['photo']){ + unlink('uploadfile/weibo/'.$strWeibo['photo']); + } + + tsHeaderUrl(tsUrl('weibo')); + + }else{ + tsNotice('非法操作!'); + } + } + + /* + * 后台管理入口 + * */ + public function admin(){ + + if($GLOBALS['TS_USER']['isadmin']==1){ + include 'app/'.$GLOBALS['TS_URL']['app'].'/admin.'.$GLOBALS['TS_URL']['app'].'.php'; + $appAdmin = $GLOBALS['TS_URL']['app'].'Admin'; + $newAdmin = new $appAdmin($GLOBALS['db']); + #$newAdmin->$GLOBALS['TS_URL']['mg'](); + + $amg = $GLOBALS['TS_URL']['mg']; + $newAdmin->$amg(); + + }else{ + ts404(); + } + } + + /* + * 我的社区入口 + * */ + public function my(){ + if($GLOBALS['TS_USER']){ + include 'app/'.$GLOBALS['TS_URL']['app'].'/my.'.$GLOBALS['TS_URL']['app'].'.php'; + $appMy = $GLOBALS['TS_URL']['app'].'My'; + $newMy = new $appMy($GLOBALS['db']); + $myFun = $GLOBALS['TS_URL']['my']; + $newMy->$myFun(); + }else{ + ts404(); + } + } + +} diff --git a/app/weibo/action/add.php b/app/weibo/action/add.php new file mode 100644 index 0000000..e4a3e24 --- /dev/null +++ b/app/weibo/action/add.php @@ -0,0 +1,76 @@ +isLogin(1); + + //判断用户是否存在 + if(aac('user')->isUser($userid)==false) getJson('不好意思,用户不存在!',$js); + + //判断发布者状态 + if(aac('user')->isPublisher()==false) getJson('不好意思,你还没有权限发布内容!',$js); + + //发布时间限制 + if(aac('system')->pubTime()==false) getJson('不好意思,当前时间不允许发布内容!',$js); + + if ($TS_APP['allowpost'] == 0 && $TS_USER['isadmin'] == 0) { + getJson('应用设置不允许会员发布唠叨!',$js); + } + + $title = tsTrim($_POST['title']); + + + //匿名用户 + $isniming = tsIntval($_POST['isniming']); + if($TS_SITE['isniming']==1 && $isniming==1) $userid = aac('user')->getNimingId(); + + + if($title == '') { + getJson('内容不能为空',$js); + } + + //1审核后显示0不审核 + $isaudit = 0; + if ($TS_APP['isaudit'] == 1 && $TS_USER['isadmin']==0) $isaudit = 1; + + if($GLOBALS['TS_USER']['isadmin']==0){ + //过滤内容开始 + $title = antiWord($title); + //过滤内容结束 + } + + $weiboid = $new['weibo']->create('weibo',array( + 'userid'=>$userid, + 'title'=>$title, + 'isaudit'=>$isaudit, + 'addtime'=>date('Y-m-d H:i:s'), + )); + + #绑定图片 + $new['weibo']->update('weibo_photo',array( + 'userid'=>$userid, + 'weiboid'=>0, + ),array( + 'weiboid'=>$weiboid, + )); + + $daytime = date('Y-m-d 00:00:01'); + $count_weibo = $new['weibo']->findCount('weibo',"`userid`='$userid' and `addtime`>'$daytime'"); + + #每日前三条给积分 + if($count_weibo<4){ + aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'], $TS_URL['ts']); + } + + #用户记录 + aac('pubs')->addLogs('weibo','weiboid',$weiboid,$userid,$title,$title,0); + + getJson('发布成功!',$js,2,tsurl('weibo','show',array('id'=>$weiboid))); + + break; + +} \ No newline at end of file diff --git a/app/weibo/action/admin.php b/app/weibo/action/admin.php new file mode 100644 index 0000000..3f99995 --- /dev/null +++ b/app/weibo/action/admin.php @@ -0,0 +1,9 @@ +findAll('user_group',null,'ugid asc'); + + + + + include template('admin/permissions'); + + break; + + case "do": + + /** + * 权限参数说明,app,action必须,其他参数可选 + * app-action-ts + * app-action-mg-ts 当action=admin + * app-action-api-ts 当action=api + */ + + $ugid = tsIntval($_POST['ugid']); + + $arrOption = $_POST['option']; + + aac('pubs')->upAppPermissions($ugid,'weibo',$arrOption); + + qiMsg('操作成功!'); + + + break; + +} \ No newline at end of file diff --git a/app/weibo/action/admin/weibo.php b/app/weibo/action/admin/weibo.php new file mode 100644 index 0000000..949c85b --- /dev/null +++ b/app/weibo/action/admin/weibo.php @@ -0,0 +1,70 @@ +findAll('weibo',null,'addtime desc',null,$lstart.',20'); + foreach($arrWeibo as $key=>$item){ + $arrWeibo[$key]['title'] = tsTitle($item['title']); + $arrWeibo[$key]['photo'] = $new['weibo']->findAll('weibo_photo',array( + 'weiboid'=>$item['weiboid'], + )); + } + + $weiboNum = $new['weibo']->findCount('weibo'); + $pageUrl = pagination($weiboNum, 20, $page, $url); + + include template("admin/weibo_list"); + + break; + + + case "isaudit": + + $weiboid = tsIntval($_GET['weiboid']); + + $strWeibo = $new['weibo']->find('weibo',array( + 'weiboid'=>$weiboid, + )); + + if($strWeibo['isaudit'] == 0){ + + $new['weibo']->update('weibo',array( + 'weiboid'=>$weiboid, + ),array( + 'isaudit'=>1, + )); + + } + + if($strWeibo['isaudit'] == 1){ + + $new['weibo']->update('weibo',array( + 'weiboid'=>$weiboid, + ),array( + 'isaudit'=>0, + )); + + } + + qiMsg('操作成功!'); + + break; + + + case "delete": + + $weiboid=tsIntval($_GET['weiboid']); + + $new['weibo']->deleteWeibo($weiboid); + + qiMsg('删除成功!'); + + break; + +} \ No newline at end of file diff --git a/app/weibo/action/api.php b/app/weibo/action/api.php new file mode 100644 index 0000000..0608b65 --- /dev/null +++ b/app/weibo/action/api.php @@ -0,0 +1,9 @@ + +----------------------------------------------- +Weibo Http Api List +URL:https://demo.thinksaas.cn +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +----------------------------------------------- +'; \ No newline at end of file diff --git a/app/weibo/action/delete.php b/app/weibo/action/delete.php new file mode 100644 index 0000000..f35a435 --- /dev/null +++ b/app/weibo/action/delete.php @@ -0,0 +1,23 @@ +isLogin(); + +$weiboid = tsIntval($_GET['weiboid']); + +$strWeibo = $new['weibo']->find('weibo',array( + 'weiboid'=>$weiboid, +)); + +if($userid == $strWeibo['userid'] || $GLOBALS['TS_USER']['isadmin']==1){ + + $new['weibo']->deleteWeibo($weiboid); + + #用户记录 + aac('pubs')->addLogs('weibo','weiboid',$weiboid,$userid,$strWeibo['title'],$strWeibo['title'],2); + + tsNotice('删除成功!','点击返回唠叨首页',tsUrl('weibo')); + +}else{ + tsNotice('非法操作!'); +} \ No newline at end of file diff --git a/app/weibo/action/index.php b/app/weibo/action/index.php new file mode 100644 index 0000000..6325ba1 --- /dev/null +++ b/app/weibo/action/index.php @@ -0,0 +1,36 @@ +'')); + +$lstart = $page*20-20; + +$arrWeibo = $new['weibo']->findAll('weibo',array( + 'isaudit'=>0, +),'addtime desc',null,$lstart.',20'); +foreach($arrWeibo as $key=>$item){ + $arrWeibo[$key]['user'] = aac('user')->getOneUser($item['userid']); + $arrWeibo[$key]['title'] = tsTitle($item['title']); + $arrWeibo[$key]['photo'] = $new['weibo']->getWeiboPhoto($item['weiboid'],4); +} + +$weiboNum = $new['weibo']->findCount('weibo',array( + 'isaudit'=>0, +)); + +$pageUrl = pagination($weiboNum, 20, $page, $url); + +#热门唠叨 +$arrHotWeibo = $new['weibo']->findAll('weibo',null,'count_comment desc',null,10); + +foreach($arrHotWeibo as $key=>$item){ + $arrHotWeibo[$key]['title'] = tsTitle($item['title']); + $arrHotWeibo[$key]['user'] = aac('user')->getOneUser($item['userid']); + $arrHotWeibo[$key]['photo'] = $new['weibo']->getWeiboPhoto($item['weiboid'],4); +} + + +$title = '唠叨'; +include template('index'); \ No newline at end of file diff --git a/app/weibo/action/my.php b/app/weibo/action/my.php new file mode 100644 index 0000000..0f8df1f --- /dev/null +++ b/app/weibo/action/my.php @@ -0,0 +1,11 @@ +isLogin(); + $strUser = aac('user')->getOneUser($userid); + include_once 'app/' . $TS_URL['app'] . '/action/my/' . $TS_URL['my'] . '.php'; +} else { + qiMsg ( 'sorry:no index!' ); +} \ No newline at end of file diff --git a/app/weibo/action/my/index.php b/app/weibo/action/my/index.php new file mode 100644 index 0000000..765def3 --- /dev/null +++ b/app/weibo/action/my/index.php @@ -0,0 +1,25 @@ +'index','page'=>'')); + +$lstart = $page*20-20; + +$arrWeibo = $new['weibo']->findAll('weibo',array( + 'userid'=>$strUser['userid'], +),'uptime desc',null,$lstart.',20'); + +foreach($arrWeibo as $key=>$item){ + $arrWeibo[$key]['title'] = tsTitle($item['title']); +} + +$weiboNum = $new['weibo']->findCount('weibo',array( + 'userid'=>$strUser['userid'], +)); + +$pageUrl = pagination($weiboNum, 20, $page, $url); + +$title = '我的唠叨'; +include template('my/index'); \ No newline at end of file diff --git a/app/weibo/action/photo.php b/app/weibo/action/photo.php new file mode 100644 index 0000000..02e2eab --- /dev/null +++ b/app/weibo/action/photo.php @@ -0,0 +1,62 @@ +isLogin(); + +switch($ts){ + + //图片上传 + case "upload": + + $photoid = $new['weibo']->create('weibo_photo',array( + 'userid'=>$userid, + 'addtime'=>time(), + )); + + // 上传图片开始 + $arrUpload = tsUpload ( $_FILES ['filedata'], $photoid, 'weibo/photo', array ('jpg','png','jpeg' ) ); + if ($arrUpload) { + $new['weibo']->update('weibo_photo', array( + 'photoid' => $photoid + ),array( + 'path' => $arrUpload ['path'], + 'photo' => $arrUpload ['url'] + )); + }else{ + $new['weibo']->delete('weibo_photo',array( + 'photoid'=>$photoid, + )); + } + + echo 11111; + + break; + + //未发布的图片列表 + case "list": + + $arrPhoto = $new['weibo']->findAll('weibo_photo',array( + 'userid'=>$userid, + 'weiboid'=>0, + )); + + include template('photo_list'); + + break; + + //删除未发布的图片 + case "delete": + + $photoid = tsIntval($_POST['photoid']); + + $strPhoto = $new['weibo']->find('weibo_photo',array( + 'photoid'=>$photoid, + 'userid'=>$userid, + )); + if($strPhoto){ + $new['weibo']->deletePhoto($strPhoto); + } + + break; + +} \ No newline at end of file diff --git a/app/weibo/action/show.php b/app/weibo/action/show.php new file mode 100644 index 0000000..e44b5a1 --- /dev/null +++ b/app/weibo/action/show.php @@ -0,0 +1,79 @@ +getOneWeibo($weiboid); + +if($strWeibo['isaudit']==1){ + tsNotice('内容审核中...'); +} + +#图片 +$arrPhoto = $new['weibo']->findAll('weibo_photo',array( + 'weiboid'=>$weiboid, +)); + +foreach($arrPhoto as $key=>$item){ + if($TS_SITE['file_upload_type']==1){ + #阿里云oss + $arrPhoto[$key]['photo_url'] = $TS_SITE['alioss_bucket_url'].'/uploadfile/weibo/photo/'.$item['photo']; + }else{ + #本地 + $arrPhoto[$key]['photo_url'] = SITE_URL.'uploadfile/weibo/photo/'.$item['photo']; + } +} + +#评论 +$page = tsIntval($_GET['page'],1); +$url = tsUrl('weibo','show',array('id'=>$weiboid,'page'=>'')); +$lstart = $page*15-15; +$arrComment = aac('comment')->getCommentList('weibo','weiboid',$strWeibo['weiboid'],$page,$lstart,$strWeibo['userid']); +$commentNum = aac('comment')->getCommentNum('weibo','weiboid',$strWeibo['weiboid']); +$pageUrl = pagination($commentNum, 15, $page, $url); + + + +//他的更多唠叨 +$arrWeibo = $new['weibo']->findAll('weibo',array( + 'userid'=>$strWeibo['userid'], +),'addtime desc',null,20); + +$weiboNum = $new['weibo']->findCount('weibo',array( + 'userid'=>$strWeibo['userid'], +)); + +if($weiboNum<20){ + + $num = 20-$weiboNum; + $userid = $strWeibo['userid']; + $arrNewWeibo = $new['weibo']->findAll('weibo',"`userid`!='$userid'",'addtime desc',null,$num); + + if($arrNewWeibo){ + $arrWeibo = array_merge($arrWeibo, $arrNewWeibo); + } + +} + +foreach($arrWeibo as $key=>$item){ + $arrWeibo[$key]['title'] = tsTitle($item['title']); +} + + +if($strWeibo['title']==''){ + $title = $strWeibo['user']['username'].'的唠叨('.$strWeibo['weiboid'].')'; +}else{ + $title = cututf8($strWeibo['title'],0,100,false); +} + + +#热门唠叨 +$arrHotWeibo = $new['weibo']->findAll('weibo',null,'count_comment desc',null,10); + +foreach($arrHotWeibo as $key=>$item){ + $arrHotWeibo[$key]['title'] = tsTitle($item['title']); + $arrHotWeibo[$key]['user'] = aac('user')->getOneUser($item['userid']); + $arrHotWeibo[$key]['photo'] = $new['weibo']->getWeiboPhoto($item['weiboid'],4); +} + + +include template('show'); \ No newline at end of file diff --git a/app/weibo/admin.weibo.php b/app/weibo/admin.weibo.php new file mode 100644 index 0000000..34c4047 --- /dev/null +++ b/app/weibo/admin.weibo.php @@ -0,0 +1,124 @@ +findAll('weibo_options'); + foreach($arrOptions as $item){ + $strOption[$item['optionname']] = stripslashes($item['optionvalue']); + } + include template("admin/options"); + } + + /* + * 保存配置 + */ + public function optionsdo(){ + //先清空数据 + $this->doSql("TRUNCATE TABLE `".dbprefix."weibo_options`"); + + foreach($_POST['option'] as $key=>$item){ + + $optionname = $key; + $optionvalue = trim($item); + + $this->create('weibo_options',array( + + 'optionname'=>$optionname, + 'optionvalue'=>$optionvalue, + + )); + + } + + $arrOptions = $this->findAll('weibo_options',null,null,'optionname,optionvalue'); + foreach($arrOptions as $item){ + $arrOption[$item['optionname']] = $item['optionvalue']; + } + + fileWrite('weibo_options.php','data',$arrOption); + $GLOBALS['tsMySqlCache']->set('weibo_options',$arrOption); + + qiMsg('修改成功!'); + } + + /* + * 唠叨列表 + * */ + public function weibolist(){ + $page = isset($_GET['page']) ? intval($_GET['page']) : 1; + $url = SITE_URL.'index.php?app=weibo&ac=admin&mg=weibolist&page='; + $lstart = $page*20-20; + $arrWeibo = $this->findAll('weibo',null,'addtime desc',null,$lstart.',20'); + foreach($arrWeibo as $key=>$item){ + $arrWeibo[$key]['content'] = tsTitle($item['content']); + } + + $weiboNum = $this->findCount('weibo'); + $pageUrl = pagination($weiboNum, 20, $page, $url); + + include template("admin/weibo_list"); + } + + /* + * 审核 + * */ + public function isaudit(){ + $weiboid = intval($_GET['weiboid']); + + $strWeibo = $this->find('weibo',array( + 'weiboid'=>$weiboid, + )); + + if($strWeibo['isaudit'] == 0){ + + $this->update('weibo',array( + 'weiboid'=>$weiboid, + ),array( + 'isaudit'=>1, + )); + + } + + if($strWeibo['isaudit'] == 1){ + + $this->update('weibo',array( + 'weiboid'=>$weiboid, + ),array( + 'isaudit'=>0, + )); + + } + + qiMsg('操作成功!'); + } + + /* + * 删除 + * */ + 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('删除成功!'); + } + + +} \ No newline at end of file diff --git a/app/weibo/class.weibo.php b/app/weibo/class.weibo.php new file mode 100644 index 0000000..0f1710e --- /dev/null +++ b/app/weibo/class.weibo.php @@ -0,0 +1,108 @@ +find('weibo',array( + 'weiboid'=>$weiboid, + )); + + if($strWeibo=='') ts404(); + + $strWeibo['user']=aac('user')->getSimpleUser($strWeibo['userid']); + $strWeibo['title'] = nl2br(tsTitle($strWeibo['title'])); + + return $strWeibo; + + } + + /** + * 获取微博图片 + */ + public function getWeiboPhoto($weiboid,$num=null){ + $arrPhotos = $this->findAll('weibo_photo',array( + 'weiboid'=>$weiboid, + ),'orderid asc',null,$num); + foreach($arrPhotos as $key=>$item){ + if($num){ + $arrPhoto[$key] = tsXimg($item['photo'],'weibo/photo','200','200',$item['path'],1); + }else{ + $arrPhoto[$key] = tsXimg($item['photo'],'weibo/photo','640','',$item['path']); + } + } + return $arrPhoto; + } + + /** + * 删除单个关联的图片 + * + * @param [type] $strPhoto + * @return void + */ + public function deletePhoto($strPhoto){ + if($strPhoto['photo']){ + if($GLOBALS['TS_SITE']['file_upload_type']==1){ + deleteAliOssFile('uploadfile/weibo/photo/'.$strPhoto['photo']); + }else{ + unlink('uploadfile/weibo/photo/'.$strPhoto['photo']); + tsDimg($strPhoto['photo'],'weibo/photo','320','320',$strPhoto['path']); + } + } + + $this->delete('weibo_photo',array( + 'photoid'=>$strPhoto['photoid'], + )); + + return true; + + } + + /** + * 删除微博 + * + * @param [type] $strWeibo + * @return void + */ + public function deleteWeibo($weiboid){ + #删除图片 + $arrPhoto = $this->findAll('weibo_photo',array( + 'weiboid'=>$weiboid, + )); + + foreach($arrPhoto as $key=>$item){ + $this->deletePhoto($item); + } + + #删除记录 + $this->delete('weibo',array( + 'weiboid'=>$weiboid, + )); + + #删除评论ts_comment + aac('comment')->delComment('weibo','weiboid',$weiboid); + + #删除点赞ts_love + aac('pubs')->delLove('weibo','weiboid',$weiboid); + + return true; + } + + + +} \ No newline at end of file diff --git a/app/weibo/config.php b/app/weibo/config.php new file mode 100644 index 0000000..5dedfe5 --- /dev/null +++ b/app/weibo/config.php @@ -0,0 +1,19 @@ + +
      唠叨管理
      + + +
      \ No newline at end of file diff --git a/app/weibo/html/admin/options.html b/app/weibo/html/admin/options.html new file mode 100644 index 0000000..05589b1 --- /dev/null +++ b/app/weibo/html/admin/options.html @@ -0,0 +1,35 @@ +{php include pubTemplate("header_admin")} + + +
      + +{php include template("admin/menu");} + + +
      + + + + + + + + + + + + + + + + + +
      APP名称:
      APP介绍:
      APP关键词:
      应用开启/关闭:开启 关闭 (关闭后应用无法访问)
      会员发布:不允许 允许
      是否审核:不审核 审核
      + +
      +
      + + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/weibo/html/admin/permissions.html b/app/weibo/html/admin/permissions.html new file mode 100644 index 0000000..6496b52 --- /dev/null +++ b/app/weibo/html/admin/permissions.html @@ -0,0 +1,121 @@ +{php include pubTemplate("header_admin")} + +
      + +{php include template("admin/menu");} + + + +
      + {loop $arrUg $key $item} + {$item['ugname']} + {/loop} +
      + + +
      + + +
      前台权限
      + + + + + + + + + + {if $ugid==1 || $ugid==2 || $ugid==3} + + + + + + + + + + + + {/if} + + + + +
      查看唠叨: + +
      发布唠叨: + +
      删除唠叨: + +
      + + + + {if $ugid==1 || $ugid==2} +
      后台权限
      + + + + + + + + + + + +
      唠叨配置: + +
      权限配置: + +
      + {/if} + + + +
      API权限
      + + + + + + + + + + + +
      查看唠叨: + +
      + + + + + + +
      + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/weibo/html/admin/weibo_list.html b/app/weibo/html/admin/weibo_list.html new file mode 100644 index 0000000..160658b --- /dev/null +++ b/app/weibo/html/admin/weibo_list.html @@ -0,0 +1,77 @@ +{php include pubTemplate("header_admin")} + + +
      + +{php include template("admin/menu");} + +
      {$pageUrl}
      + + + + + + + + + + + + + + + + + + + + + {loop $arrWeibo $key $item} + + + + + + + + + + + + {/loop} + + + + + + +
      IDUserID内容统计操作
      {$item['weiboid']}{$item['userid']}{$item['title']} + + {if $item['photo']} +
      + {loop $item['photo'] $pkey $pitem} + + {/loop} +
      + {/if} + +
      评论:{$item['count_comment']} + + + + {if $item['isaudit']==0} + [取消审核] + {else} + [审核] + {/if} + + + + [删除] + + +
      + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/app/weibo/html/ajax_list.html b/app/weibo/html/ajax_list.html new file mode 100644 index 0000000..11733c4 --- /dev/null +++ b/app/weibo/html/ajax_list.html @@ -0,0 +1,11 @@ +{loop $arrWeibo $key $item} +
    • +{$item['user']['username']} + +{$item['user']['username']}{$item['title']} +{php echo getTime(strtotime($item['addtime']),time())} ({$item['count_comment']}评) + + +
      +
    • +{/loop} \ No newline at end of file diff --git a/app/weibo/html/index.html b/app/weibo/html/index.html new file mode 100644 index 0000000..ae13f74 --- /dev/null +++ b/app/weibo/html/index.html @@ -0,0 +1,213 @@ +{php include pubTemplate("header")} + +{if $TS_USER['userid']} + + +{else} + +{/if} + +
      + + + + +
      + + +
      + + +
      + +
      +
      + + + + +
      + +
      + + + +
      + + + + + +
      + + + {if $TS_SITE['isniming']==1} + 匿名发布: + 否 + 是 + {/if} + + + +
      + +
      + +
      + +
      + +
      +
      + +
      + + + +
      + +
      + +
      + +
      +
      {$pageUrl}
      +
      + +
      + +
      +
      + + +
      + + +
      + +
      +
      热门唠叨
      +
      + +
      + +
      + +
      +
      + + + + + {php doAction('gobad','300')} + + +
      + + +
      +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/weibo/html/menu.html b/app/weibo/html/menu.html new file mode 100644 index 0000000..96afb48 --- /dev/null +++ b/app/weibo/html/menu.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/app/weibo/html/my/index.html b/app/weibo/html/my/index.html new file mode 100644 index 0000000..34310f8 --- /dev/null +++ b/app/weibo/html/my/index.html @@ -0,0 +1,108 @@ +{php include pubTemplate("header")} +
      + + +
      + + +
      +
      + + {php include pubTemplate("my")} + +
      +
      + +
      + + + + + +
      + +
      我的唠叨
      + +
      + + + + +
      +
      + +
      + + + + +
      +
      +
      + + +
      + + + + +
      + +
      + + + + + +
      {$pageUrl}
      + + + + + + +
      +
      + + + + + + + + + + + +
      + + +
      +
      +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/weibo/html/photo_list.html b/app/weibo/html/photo_list.html new file mode 100644 index 0000000..5d137cc --- /dev/null +++ b/app/weibo/html/photo_list.html @@ -0,0 +1,6 @@ +{loop $arrPhoto $key $item} +
      + + X +
      +{/loop} \ No newline at end of file diff --git a/app/weibo/html/show.html b/app/weibo/html/show.html new file mode 100644 index 0000000..66c953a --- /dev/null +++ b/app/weibo/html/show.html @@ -0,0 +1,183 @@ +{php include pubTemplate("header")} + + +
      + + + + + +
      + +
      + + +
      +
      + +
      +
        +
      • +{$strWeibo['user']['username']} +
      • +
      • +
        {$strWeibo['user']['username']} {$strWeibo['addtime']}
        +
        +{$strWeibo['title']} +
        + +{if $arrPhoto} +
        + {loop $arrPhoto $key $item} +

        + + + +

        + {/loop} +
        +{/if} + +
        +{if $GLOBALS['TS_USER']['isadmin'] == 1} + 删除 +{/if} +
        +
      • +
      +
      + + +
      +
      + + + + +
      +
      评论{if $strWeibo['count_comment']} ({$strWeibo['count_comment']}){/if}
      +
      + + + {php include pubTemplate("comment")} + +
      + + {if tsIntval($GLOBALS['TS_USER']['userid'])==0} +
      + 登录 | 注册 +
      + {else} + +
      +
      + +
      +
      +
      + {if $GLOBALS['TS_SITE']['isauthcode']} + + 点击刷新验证码 + {/if} +
      +
      +
      是否公开:公开 不公开
      +
      +
      + + + + + +
      +
      +
      + {/if} + +
      + +
      +
      + + + + + + +
      +
      更多{$strWeibo['user']['username']}的唠叨
      +
      + + +
      + +
      + +
      +
      + + +
      + + +
      + +
      +
      热门唠叨
      +
      + +
      + +
      + +
      +
      + + + +{php doAction('gobad','300')} + + +
      + +
      + +
      + +{php doAction('tseditor','mini')} +{php include pubTemplate("footer")} \ No newline at end of file diff --git a/app/weibo/js/extend.func.js b/app/weibo/js/extend.func.js new file mode 100644 index 0000000..e69de29 diff --git a/app/weibo/my.weibo.php b/app/weibo/my.weibo.php new file mode 100644 index 0000000..e39bcc7 --- /dev/null +++ b/app/weibo/my.weibo.php @@ -0,0 +1,37 @@ +getOneUser($GLOBALS['TS_USER']['userid']); + + $page = isset($_GET['page']) ? intval($_GET['page']) : '1'; + + $url = tsUrl('weibo','my',array('my'=>'index','page'=>'')); + + $lstart = $page*20-20; + + $arrWeibo = $this->findAll('weibo',array( + 'userid'=>$strUser['userid'], + ),'uptime desc',null,$lstart.',20'); + + foreach($arrWeibo as $key=>$item){ + $arrWeibo[$key]['content'] = tsTitle($item['content']); + } + + $weiboNum = $this->findCount('weibo',array( + 'userid'=>$strUser['userid'], + )); + + $pageUrl = pagination($weiboNum, 20, $page, $url); + + $title = '我的时光'; + include template('my/index'); + } + +} \ No newline at end of file diff --git a/app/weibo/skin/style.css b/app/weibo/skin/style.css new file mode 100644 index 0000000..8d0ee2f --- /dev/null +++ b/app/weibo/skin/style.css @@ -0,0 +1,77 @@ +.weibo_show ul{list-style:none;margin:0;padding: 0;} +.weibo_show ul li{list-style:none;} + + +.weibo_index_list{margin-top:20px;} +.weibo_index_list ul{list-style:none;margin:0;padding: 0;} +.weibo_index_list ul li{list-style:none;} + +.mbtl { + float: left; + margin: 0px 7px 0 0; + padding: 0; + width: 40px; +} +.mbtr { + margin: 0px 0 20px 0; + overflow: hidden; + padding: 10px;; + background:#f8f8f8; +} +.mbtr .author{} +.mbtr .author a{color:#555555;} +.mbtr .title{margin-top:10px;} +.mbtr .title a{color: #444444;font-size:22px;} +.mbtr .title{line-height:30px;color:#888} + + + +.weilist{} + +.weilist ul, .weilist ul li{list-style: none;margin:0;padding:0;} + +.weilist ul li { + border-bottom: 1px dashed #DDDDDD; + margin: 0 0 5px; + padding: 0 0 8px; + display: flex; +} +.weilist ul li .portrait { + padding-top: 3px; + width: 45px; +} +.weilist ul li .portrait img { + background: none repeat scroll 0 0 #FFFFFF; + height: 32px; + padding: 1px; + width: 32px; +} +.weilist ul li .body { + flex:1; + font-size: 9pt; + overflow: hidden; + +} +.weilist ul li .user a { + color: #6CABE1; +} + +.weilist ul li .log { + color: #666666; + word-break: break-all; +} +.weilist ul li .time { + color: #9A9A9A; + display: block; + margin: 5px 0 0; +} +.weilist ul li .time a { + color: #9A9A9A; + text-decoration: none; +} + + +.weibo-add-photo{display: flex;} +.weibo-add-photo .photo-box{width: 12%;position: relative;margin-right: 10px;} +.weibo-add-photo .photo-box img{width: 100%;border-radius: 10px;} +.weibo-add-photo .photo-box a{position: absolute;top:5px;right:5px;background-color: #FFFFFF;font-size: 10px;padding:0 3px;} diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..78065d8 --- /dev/null +++ b/composer.json @@ -0,0 +1,25 @@ +{ + "name": "thinksaas/3.44", + "description": "www.thinksaas.cn", + "minimum-stability": "stable", + "license": "proprietary", + "authors": [ + { + "name": "qiujun", + "email": "thinksaas@qq.com" + } + ], + "require": { + "phpmailer/phpmailer": "^6.5", + "intervention/image": "^2.5", + "qcloudsms/qcloudsms_php": "^0.1.4", + "alibabacloud/client": "^1.5", + "aliyuncs/oss-sdk-php": "^2.3", + "overtrue/wechat": "~4.0" + }, + "config": { + "allow-plugins": { + "easywechat-composer/easywechat-composer": true + } + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..6540d40 --- /dev/null +++ b/composer.lock @@ -0,0 +1,2670 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "47b5cd9b7b694dd17ea078ef1aa02ac1", + "packages": [ + { + "name": "adbario/php-dot-notation", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/adbario/php-dot-notation.git", + "reference": "eee4fc81296531e6aafba4c2bbccfc5adab1676e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/adbario/php-dot-notation/zipball/eee4fc81296531e6aafba4c2bbccfc5adab1676e", + "reference": "eee4fc81296531e6aafba4c2bbccfc5adab1676e", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-json": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.0|^5.0|^6.0", + "squizlabs/php_codesniffer": "^3.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Adbar\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Riku Särkinen", + "email": "riku@adbar.io" + } + ], + "description": "PHP dot notation access to arrays", + "homepage": "https://github.com/adbario/php-dot-notation", + "keywords": [ + "ArrayAccess", + "dotnotation" + ], + "support": { + "issues": "https://github.com/adbario/php-dot-notation/issues", + "source": "https://github.com/adbario/php-dot-notation/tree/2.x" + }, + "time": "2019-01-01T23:59:15+00:00" + }, + { + "name": "alibabacloud/client", + "version": "1.5.29", + "source": { + "type": "git", + "url": "https://github.com/aliyun/openapi-sdk-php-client.git", + "reference": "2d0137828ef5c44664dcb8cc90eac4f545dd3301" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/aliyun/openapi-sdk-php-client/zipball/2d0137828ef5c44664dcb8cc90eac4f545dd3301", + "reference": "2d0137828ef5c44664dcb8cc90eac4f545dd3301", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "adbario/php-dot-notation": "^2.2", + "clagiordano/weblibs-configmanager": "^1.0", + "danielstjules/stringy": "^3.1", + "ext-curl": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "ext-simplexml": "*", + "ext-xmlwriter": "*", + "guzzlehttp/guzzle": "^6.3|^7.0", + "mtdowling/jmespath.php": "^2.5", + "php": ">=5.5" + }, + "require-dev": { + "composer/composer": "^1.8", + "drupal/coder": "^8.3", + "ext-dom": "*", + "ext-pcre": "*", + "ext-sockets": "*", + "ext-spl": "*", + "league/climate": "^3.2.4", + "mikey179/vfsstream": "^1.6", + "monolog/monolog": "^1.24", + "phpunit/phpunit": "^5.7.27", + "psr/cache": "^1.0", + "symfony/dotenv": "^3.4", + "symfony/var-dumper": "^3.4" + }, + "suggest": { + "ext-sockets": "To use client-side monitoring" + }, + "type": "library", + "autoload": { + "psr-4": { + "AlibabaCloud\\Client\\": "src" + }, + "files": [ + "src/Functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Alibaba Cloud SDK", + "email": "sdk-team@alibabacloud.com", + "homepage": "http://www.alibabacloud.com" + } + ], + "description": "Alibaba Cloud Client for PHP - Use Alibaba Cloud in your PHP project", + "homepage": "https://www.alibabacloud.com/", + "keywords": [ + "alibaba", + "alibabacloud", + "aliyun", + "client", + "cloud", + "library", + "sdk", + "tool" + ], + "support": { + "issues": "https://github.com/aliyun/openapi-sdk-php-client/issues", + "source": "https://github.com/aliyun/openapi-sdk-php-client" + }, + "time": "2020-08-03T06:19:07+00:00" + }, + { + "name": "aliyuncs/oss-sdk-php", + "version": "v2.4.1", + "source": { + "type": "git", + "url": "https://github.com/aliyun/aliyun-oss-php-sdk.git", + "reference": "492866331b7bafaac09506cf42f351b7e9e63766" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/zipball/492866331b7bafaac09506cf42f351b7e9e63766", + "reference": "492866331b7bafaac09506cf42f351b7e9e63766", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "~1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "OSS\\": "src/OSS" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aliyuncs", + "homepage": "http://www.aliyun.com" + } + ], + "description": "Aliyun OSS SDK for PHP", + "homepage": "http://www.aliyun.com/product/oss/", + "support": { + "issues": "https://github.com/aliyun/aliyun-oss-php-sdk/issues", + "source": "https://github.com/aliyun/aliyun-oss-php-sdk/tree/v2.4.1" + }, + "time": "2020-09-29T06:23:57+00:00" + }, + { + "name": "clagiordano/weblibs-configmanager", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/clagiordano/weblibs-configmanager.git", + "reference": "ecf584f5b3a27929175ff0abdba52f0131bef795" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clagiordano/weblibs-configmanager/zipball/ecf584f5b3a27929175ff0abdba52f0131bef795", + "reference": "ecf584f5b3a27929175ff0abdba52f0131bef795", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.4" + }, + "require-dev": { + "clagiordano/phpunit-result-printer": "^1", + "phpunit/phpunit": "^4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "clagiordano\\weblibs\\configmanager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Claudio Giordano", + "email": "claudio.giordano@autistici.org", + "role": "Developer" + } + ], + "description": "weblibs-configmanager is a tool library for easily read and access to php config array file and direct read/write configuration file / object", + "keywords": [ + "clagiordano", + "configuration", + "manager", + "tool", + "weblibs" + ], + "support": { + "issues": "https://github.com/clagiordano/weblibs-configmanager/issues", + "source": "https://github.com/clagiordano/weblibs-configmanager/tree/v1.1.0" + }, + "time": "2020-07-20T20:39:25+00:00" + }, + { + "name": "danielstjules/stringy", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/danielstjules/Stringy.git", + "reference": "df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/danielstjules/Stringy/zipball/df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e", + "reference": "df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.4.0", + "symfony/polyfill-mbstring": "~1.1" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Stringy\\": "src/" + }, + "files": [ + "src/Create.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel St. Jules", + "email": "danielst.jules@gmail.com", + "homepage": "http://www.danielstjules.com" + } + ], + "description": "A string manipulation library with multibyte support", + "homepage": "https://github.com/danielstjules/Stringy", + "keywords": [ + "UTF", + "helpers", + "manipulation", + "methods", + "multibyte", + "string", + "utf-8", + "utility", + "utils" + ], + "support": { + "issues": "https://github.com/danielstjules/Stringy/issues", + "source": "https://github.com/danielstjules/Stringy" + }, + "time": "2017-06-12T01:10:27+00:00" + }, + { + "name": "easywechat-composer/easywechat-composer", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/mingyoung/easywechat-composer.git", + "reference": "93cfce1ec842b9a5b1b0791a52afd18b833f114a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mingyoung/easywechat-composer/zipball/93cfce1ec842b9a5b1b0791a52afd18b833f114a", + "reference": "93cfce1ec842b9a5b1b0791a52afd18b833f114a", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=7.0" + }, + "require-dev": { + "composer/composer": "^1.0 || ^2.0", + "phpunit/phpunit": "^6.5 || ^7.0" + }, + "type": "composer-plugin", + "extra": { + "class": "EasyWeChatComposer\\Plugin" + }, + "autoload": { + "psr-4": { + "EasyWeChatComposer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "张铭阳", + "email": "mingyoungcheung@gmail.com" + } + ], + "description": "The composer plugin for EasyWeChat", + "support": { + "issues": "https://github.com/mingyoung/easywechat-composer/issues", + "source": "https://github.com/mingyoung/easywechat-composer/tree/1.4.0" + }, + "time": "2020-07-23T11:06:47+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.4.5", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", + "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.9 || ^2.4", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-curl": "*", + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.4-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.4.5" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2022-06-20T22:16:13+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.9.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", + "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.9.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2022-06-20T21:43:03+00:00" + }, + { + "name": "intervention/image", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/Intervention/image.git", + "reference": "abbf18d5ab8367f96b3205ca3c89fb2fa598c69e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Intervention/image/zipball/abbf18d5ab8367f96b3205ca3c89fb2fa598c69e", + "reference": "abbf18d5ab8367f96b3205ca3c89fb2fa598c69e", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-fileinfo": "*", + "guzzlehttp/psr7": "~1.1", + "php": ">=5.4.0" + }, + "require-dev": { + "mockery/mockery": "~0.9.2", + "phpunit/phpunit": "^4.8 || ^5.7" + }, + "suggest": { + "ext-gd": "to use GD library based image processing.", + "ext-imagick": "to use Imagick based image processing.", + "intervention/imagecache": "Caching extension for the Intervention Image library" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + }, + "laravel": { + "providers": [ + "Intervention\\Image\\ImageServiceProvider" + ], + "aliases": { + "Image": "Intervention\\Image\\Facades\\Image" + } + } + }, + "autoload": { + "psr-4": { + "Intervention\\Image\\": "src/Intervention/Image" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oliver Vogel", + "email": "oliver@olivervogel.com", + "homepage": "http://olivervogel.com/" + } + ], + "description": "Image handling and manipulation library with support for Laravel integration", + "homepage": "http://image.intervention.io/", + "keywords": [ + "gd", + "image", + "imagick", + "laravel", + "thumbnail", + "watermark" + ], + "support": { + "issues": "https://github.com/Intervention/image/issues", + "source": "https://github.com/Intervention/image/tree/master" + }, + "time": "2019-11-02T09:15:47+00:00" + }, + { + "name": "monolog/monolog", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1cb1cde8e8dd0f70cc0fe51354a59acad9302084", + "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2", + "psr/log": "^1.0.1" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7", + "graylog2/gelf-php": "^1.4.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpspec/prophecy": "^1.6.1", + "phpstan/phpstan": "^0.12.59", + "phpunit/phpunit": "^8.5", + "predis/predis": "^1.1", + "rollbar/rollbar": "^1.3", + "ruflin/elastica": ">=0.90 <7.0.1", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.2.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2020-12-14T13:15:25+00:00" + }, + { + "name": "mtdowling/jmespath.php", + "version": "2.6.0", + "source": { + "type": "git", + "url": "https://github.com/jmespath/jmespath.php.git", + "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/42dae2cbd13154083ca6d70099692fef8ca84bfb", + "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^5.4 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.17" + }, + "require-dev": { + "composer/xdebug-handler": "^1.4", + "phpunit/phpunit": "^4.8.36 || ^7.5.15" + }, + "bin": [ + "bin/jp.php" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "JmesPath\\": "src/" + }, + "files": [ + "src/JmesPath.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Declaratively specify how to extract elements from a JSON document", + "keywords": [ + "json", + "jsonpath" + ], + "support": { + "issues": "https://github.com/jmespath/jmespath.php/issues", + "source": "https://github.com/jmespath/jmespath.php/tree/2.6.0" + }, + "time": "2020-07-31T21:01:56+00:00" + }, + { + "name": "overtrue/socialite", + "version": "2.0.23", + "source": { + "type": "git", + "url": "https://github.com/overtrue/socialite.git", + "reference": "0bc60597b589592243f074a4d9016aabd2e9cfb2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/overtrue/socialite/zipball/0bc60597b589592243f074a4d9016aabd2e9cfb2", + "reference": "0bc60597b589592243f074a4d9016aabd2e9cfb2", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-json": "*", + "guzzlehttp/guzzle": "^5.0|^6.0|^7.0", + "php": ">=5.6", + "symfony/http-foundation": "^2.7|^3.0|^4.0|^5.0" + }, + "require-dev": { + "mockery/mockery": "~1.2", + "phpunit/phpunit": "~6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Overtrue\\Socialite\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "overtrue", + "email": "anzhengchao@gmail.com" + } + ], + "description": "A collection of OAuth 2 packages that extracts from laravel/socialite.", + "keywords": [ + "login", + "oauth", + "qq", + "social", + "wechat", + "weibo" + ], + "support": { + "issues": "https://github.com/overtrue/socialite/issues", + "source": "https://github.com/overtrue/socialite/tree/2.0.23" + }, + "funding": [ + { + "url": "https://www.patreon.com/overtrue", + "type": "patreon" + } + ], + "time": "2020-12-14T03:30:08+00:00" + }, + { + "name": "overtrue/wechat", + "version": "4.4.0", + "source": { + "type": "git", + "url": "https://github.com/w7corp/easywechat.git", + "reference": "20bdd3fe8056ee9297692caf53bd131be8079ee6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/w7corp/easywechat/zipball/20bdd3fe8056ee9297692caf53bd131be8079ee6", + "reference": "20bdd3fe8056ee9297692caf53bd131be8079ee6", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "easywechat-composer/easywechat-composer": "^1.1", + "ext-fileinfo": "*", + "ext-openssl": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.2 || ^7.0", + "monolog/monolog": "^1.22 || ^2.0", + "overtrue/socialite": "~2.0", + "php": ">=7.2", + "pimple/pimple": "^3.0", + "psr/simple-cache": "^1.0", + "symfony/cache": "^3.3 || ^4.3 || ^5.0", + "symfony/event-dispatcher": "^4.3 || ^5.0", + "symfony/http-foundation": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "symfony/psr-http-message-bridge": "^0.3 || ^1.0 || ^2.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.15", + "mikey179/vfsstream": "^1.6", + "mockery/mockery": "^1.2.3", + "phpstan/phpstan": "^0.12.0", + "phpunit/phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "EasyWeChat\\": "src/" + }, + "files": [ + "src/Kernel/Support/Helpers.php", + "src/Kernel/Helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "overtrue", + "email": "anzhengchao@gmail.com" + } + ], + "description": "微信SDK", + "keywords": [ + "easywechat", + "sdk", + "wechat", + "weixin", + "weixin-sdk" + ], + "support": { + "issues": "https://github.com/w7corp/easywechat/issues", + "source": "https://github.com/w7corp/easywechat/tree/4.4.0" + }, + "funding": [ + { + "url": "https://www.easywechat.com/img/pay/wechat.jpg", + "type": "custom" + }, + { + "url": "https://github.com/overtrue", + "type": "github" + }, + { + "url": "https://www.patreon.com/overtrue", + "type": "patreon" + } + ], + "time": "2020-12-30T06:39:40+00:00" + }, + { + "name": "phpmailer/phpmailer", + "version": "v6.5.3", + "source": { + "type": "git", + "url": "https://github.com/PHPMailer/PHPMailer.git", + "reference": "baeb7cde6b60b1286912690ab0693c7789a31e71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/baeb7cde6b60b1286912690ab0693c7789a31e71", + "reference": "baeb7cde6b60b1286912690ab0693c7789a31e71", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", + "php": ">=5.5.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.2", + "php-parallel-lint/php-console-highlighter": "^0.5.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.6.0", + "yoast/phpunit-polyfills": "^1.0.0" + }, + "suggest": { + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-only" + ], + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "support": { + "issues": "https://github.com/PHPMailer/PHPMailer/issues", + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.3" + }, + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ], + "time": "2021-11-25T16:34:11+00:00" + }, + { + "name": "pimple/pimple", + "version": "v3.3.1", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "21e45061c3429b1e06233475cc0e1f6fc774d5b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/21e45061c3429b1e06233475cc0e1f6fc774d5b0", + "reference": "21e45061c3429b1e06233475cc0e1f6fc774d5b0", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Pimple": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Pimple, a simple Dependency Injection Container", + "homepage": "https://pimple.symfony.com", + "keywords": [ + "container", + "dependency injection" + ], + "support": { + "source": "https://github.com/silexphp/Pimple/tree/v3.3.1" + }, + "time": "2020-11-24T20:35:42+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.3" + }, + "time": "2020-03-23T09:12:05+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "qcloudsms/qcloudsms_php", + "version": "v0.1.4", + "source": { + "type": "git", + "url": "https://github.com/qcloudsms/qcloudsms_php.git", + "reference": "48822045772d343b93c3d505d8a187cd51153c5a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/qcloudsms/qcloudsms_php/zipball/48822045772d343b93c3d505d8a187cd51153c5a", + "reference": "48822045772d343b93c3d505d8a187cd51153c5a", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require-dev": { + "sami/sami": "dev-master" + }, + "type": "library", + "autoload": { + "psr-4": { + "Qcloud\\Sms\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "qcloud sms php sdk", + "keywords": [ + "php", + "qcloud", + "sdk", + "sms" + ], + "support": { + "issues": "https://github.com/qcloudsms/qcloudsms_php/issues", + "source": "https://github.com/qcloudsms/qcloudsms_php/tree/master" + }, + "time": "2018-09-19T07:19:17+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "symfony/cache", + "version": "v5.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "d6aed6c1bbf6f59e521f46437475a0ff4878d388" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/d6aed6c1bbf6f59e521f46437475a0ff4878d388", + "reference": "d6aed6c1bbf6f59e521f46437475a0ff4878d388", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "~1.0", + "psr/log": "^1.1", + "symfony/cache-contracts": "^1.1.7|^2", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "conflict": { + "doctrine/dbal": "<2.10", + "symfony/dependency-injection": "<4.4", + "symfony/http-kernel": "<4.4", + "symfony/var-dumper": "<4.4" + }, + "provide": { + "psr/cache-implementation": "1.0", + "psr/simple-cache-implementation": "1.0", + "symfony/cache-implementation": "1.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/cache": "^1.6", + "doctrine/dbal": "^2.10|^3.0", + "predis/predis": "^1.1", + "psr/simple-cache": "^1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/filesystem": "^4.4|^5.0", + "symfony/http-kernel": "^4.4|^5.0", + "symfony/messenger": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an extended PSR-6, PSR-16 (and tags) implementation", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "support": { + "source": "https://github.com/symfony/cache/tree/v5.2.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-27T11:24:50+00:00" + }, + { + "name": "symfony/cache-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "8034ca0b61d4dd967f3698aaa1da2507b631d0cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/8034ca0b61d4dd967f3698aaa1da2507b631d0cb", + "reference": "8034ca0b61d4dd967f3698aaa1da2507b631d0cb", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0" + }, + "suggest": { + "symfony/cache-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to caching", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/cache-contracts/tree/v2.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-07T11:33:47+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "4f9760f8074978ad82e2ce854dff79a71fe45367" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4f9760f8074978ad82e2ce854dff79a71fe45367", + "reference": "4f9760f8074978ad82e2ce854dff79a71fe45367", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/event-dispatcher-contracts": "^2", + "symfony/polyfill-php80": "^1.15" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/error-handler": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/http-foundation": "^4.4|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/stopwatch": "^4.4|^5.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v5.2.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-27T10:36:42+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ba7d54483095a198fa51781bc608d17e84dffa2", + "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.5", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-07T11:33:47+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v5.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "20c554c0f03f7cde5ce230ed248470cccbc34c36" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/20c554c0f03f7cde5ce230ed248470cccbc34c36", + "reference": "20c554c0f03f7cde5ce230ed248470cccbc34c36", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.15" + }, + "require-dev": { + "predis/predis": "~1.0", + "symfony/cache": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/mime": "^4.4|^5.0" + }, + "suggest": { + "symfony/mime": "To use the file extension guesser" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v5.2.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-03T04:42:09+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-05-24T11:49:31+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.22.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/psr-http-message-bridge", + "version": "v2.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/psr-http-message-bridge.git", + "reference": "51a21cb3ba3927d4b4bf8f25cc55763351af5f2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/51a21cb3ba3927d4b4bf8f25cc55763351af5f2e", + "reference": "51a21cb3ba3927d4b4bf8f25cc55763351af5f2e", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0", + "symfony/http-foundation": "^4.4 || ^5.0" + }, + "require-dev": { + "nyholm/psr7": "^1.1", + "symfony/phpunit-bridge": "^4.4 || ^5.0" + }, + "suggest": { + "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" + }, + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bridge\\PsrHttpMessage\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "PSR HTTP message bridge", + "homepage": "http://symfony.com", + "keywords": [ + "http", + "http-message", + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/symfony/psr-http-message-bridge/issues", + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-29T08:17:46+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/master" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-07T11:33:47+00:00" + }, + { + "name": "symfony/var-exporter", + "version": "v5.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "5aed4875ab514c8cb9b6ff4772baa25fa4c10307" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/5aed4875ab514c8cb9b6ff4772baa25fa4c10307", + "reference": "5aed4875ab514c8cb9b6ff4772baa25fa4c10307", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.15" + }, + "require-dev": { + "symfony/var-dumper": "^4.4.9|^5.0.9" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v5.2.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-27T10:01:46+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.3.0" +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..c749654 Binary files /dev/null and b/favicon.ico differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..72f7b77 --- /dev/null +++ b/index.html @@ -0,0 +1,24 @@ + + + + +恭喜,站点创建成功! + + + + + +
      +
      +
      +

      恭喜, 站点创建成功!

      +
      +

      站点创建成功,本页面由系统自动生成。

      +

    • 本页面在FTP根目录下的index.html
    • +

    • 您可以删除或覆盖本页面
    • +

    • FTP相关信息,请到宝塔后台查看
    • +

    • 我们为您提供了完善的数据备份功能,请到后台进行相关设置21
    • +
      +
      + + \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..b234055 --- /dev/null +++ b/index.php @@ -0,0 +1,57 @@ += 70000)) { + exit("ThinkSAAS运行环境要求PHP7或者更高PHP版本!请先升级PHP版本再运行ThinkSAAS程序!"); +} + +#定义一些路径 +define('THINKROOT', dirname(__FILE__)); +define('THINKAPP', THINKROOT . '/app'); +define('THINKDATA', THINKROOT . '/data'); +define('THINKSAAS', THINKROOT . '/thinksaas'); +define('THINKINSTALL', THINKROOT . '/install'); +define('THINKPLUGIN', THINKROOT . '/plugins'); +#核心配置文件 $TS_CF 系统配置变量 +$TS_CF = include THINKROOT . '/thinksaas/config.php'; +$TS_CF['info']['version'] = include 'upgrade/version.php';#版本信息 +#如果是调试模式,打开警告输出 +if ($TS_CF['debug']) { + error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); +} else { + error_reporting(0); +} +#php环境的某一些配置 +//ini_set("memory_limit","120M"); +ini_set('display_errors', 'on'); //正式环境关闭错误输出 +set_time_limit(0); +ini_set('session.cookie_path', '/'); + +//自定义本地session存储目录路径 +if ($TS_CF['sessionpath']) { + ini_set('session.save_path', THINKROOT . '\\cache\\sessions'); +} + +if($TS_CF['session']=='redis'){ + ini_set("session.save_handler","redis"); + ini_set("session.save_path",$TS_CF['redis']['tcp']); +} + +session_start(); + +#自动加载所需功能,支持composer +require_once THINKROOT . '/vendor/autoload.php'; +#装载ThinkSAAS核心 +include THINKSAAS.'/thinksaas.php'; +unset($GLOBALS['TS_APP']); +unset($GLOBALS['TS_URL']); \ No newline at end of file diff --git a/install/action/index.php b/install/action/index.php new file mode 100644 index 0000000..f2eb351 --- /dev/null +++ b/install/action/index.php @@ -0,0 +1,43 @@ + $host, + 'port' => $port, + 'user' => $user, + 'pwd' => $pwd, + 'name' => $name, + 'pre' => $pre +); + +// 网站信息 +$site_title = trim ( $_POST ['site_title'] ); +$site_subtitle = trim ( $_POST ['site_subtitle'] ); +$site_url = trim ( $_POST ['site_url'] ); +$site_pkey = trim ( $_POST ['site_pkey'] );#网站私钥 + +// 用户信息 +$email = trim ( $_POST ['email'] ); +$password = trim ( $_POST ['password'] ); +$username = trim ( $_POST ['username'] ); + +if (! preg_match ( "/^[\w_]+_$/", $pre )) + qiMsg ( "数据表前缀不符合(例如:ts_)" ); + +if ($site_title == '' || $site_subtitle == '' || $site_url == '') + qiMsg ( "网站信息不能为空!" ); + +if ($email == '' || $password == '' || $username == '') + qiMsg ( "用户信息不能为空!" ); + +if (valid_email ( $email ) == false) + qiMsg ( "Email输入有误!" ); + +include 'thinksaas/'.$select_sql.'.php'; + +$db = new MySql ( $arrdb ); + +$mysql_version = $db->getMysqlVersion(); + +if(substr($mysql_version, 0, 3)<5.5){ + qiMsg('MySQL数据库版本过低,请升级MySQL到5.4以上版本,建议5.5或者5.6'); +} + +include 'thinksaas/tsApp.php'; + +// MySQL数据库缓存 +include 'thinksaas/tsMySqlCache.php'; +$tsMySqlCache = new tsMySqlCache ( $db ); + +if ($db) { + + $sql = file_get_contents ( 'install/install.sql' ); + $sql = str_replace ( 'ts_', $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 ); + } + } + } + + // 存入管理员数据 + $salt = md5 ( rand () ); + + $userid = $db->query ( "insert into " . $pre . "user (`pwd` , `salt`,`email`,`phone`) values ('" . md5 ( $salt . $password ) . "', '$salt' ,'$email','$email');" ); + + $db->query ( "insert into " . $pre . "user_info (`userid`,`ugid`,`username`,`email`,`phone`,`isadmin`,`isverify`,`isverifyphone`,`isrenzheng`,`addtime`,`uptime`) values ('$userid',1,'$username','$email','$email','1','1','1','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'" ); + $db->query ( "update " . $pre . "system_options set `optionvalue`='$site_pkey' where `optionname`='site_pkey'" ); + + + $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 ); + $GLOBALS['tsMySqlCache']->set ( 'system_options', $arrOption ); + + + + //读取数据库cache表,并生成本地文件 + $arrCache = $db->fetch_all_assoc("select * from " . $pre . "cache"); + foreach($arrCache as $key=>$item){ + fileWrite ( $item['cachename'].'.php', 'data', $tsMySqlCache -> get($item['cachename']) ); + } + + + + // 生成配置文件 + $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 = " +.main{ + background: none repeat scroll 0 0 #FFFFFF; + border: 1px solid #DFDFDF; + border-radius: 11px 11px 11px 11px; + color: #333333; + font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; + margin: 2em auto; + padding: 1em 2em; + width: 700px; +} +p, li, dd, dt { + font-size: 12px; + line-height: 18px; + padding-bottom: 2px; +} +.step { + margin: 20px 0 15px; +} +.step, th { + padding: 0; + text-align: left; +} +.submit input, .button, .button-secondary { + -moz-box-sizing: content-box; + border: 1px solid #BBBBBB; + border-radius: 15px 15px 15px 15px; + color: #464646; + cursor: pointer; + font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; + font-size: 14px !important; + line-height: 16px; + padding: 6px 12px; + text-decoration: none; +} +.button:hover, .button-secondary:hover, .submit input:hover { + border-color: #666666; + color: #000000; +} +.button, .submit input, .button-secondary { + background:#F2F2F2; +} +.button:active, .submit input:active, .button-secondary:active { + background: #EEEEEE; +} + +.form-table { + border-collapse: collapse; + margin-top: 1em; + width: 100%; +} +.form-table td { + border-bottom: 8px solid #FFFFFF; + font-size: 12px; + margin-bottom: 9px; + padding: 10px; +} +.form-table th { + border-bottom: 8px solid #FFFFFF; + font-size: 13px; + padding: 16px 10px 10px; + text-align: left; + vertical-align: top; + width: 130px; +} +.form-table tr { + background: none repeat scroll 0 0 #F3F3F3; +} +.form-table code { + font-size: 18px; + line-height: 18px; +} +.form-table p { + font-size: 11px; + margin: 4px 0 0; +} +.form-table input { + font-size: 15px; + line-height: 20px; + padding: 2px; +} +.form-table th p { + font-weight: normal; +} +#error-page { + margin-top: 50px; +} +#error-page p { + font-size: 12px; + line-height: 18px; + margin: 25px 0 20px; +} +#error-page code, .code { + font-family: Consolas,Monaco,Courier,monospace; +} +#pass-strength-result { + background-color: #EEEEEE; + border-color: #DDDDDD !important; + border-style: solid; + border-width: 1px; + display: none; + margin: 5px 5px 5px 1px; + padding: 5px; + text-align: center; + width: 200px; +} +#pass-strength-result.bad { + background-color: #FFB78C; + border-color: #FF853C !important; +} +#pass-strength-result.good { + background-color: #FFEC8B; + border-color: #FFCC00 !important; +} +#pass-strength-result.short { + background-color: #FFA0A0; + border-color: #F04040 !important; +} +#pass-strength-result.strong { + background-color: #C3FF88; + border-color: #8DFF1C !important; +} +.message { + background-color: #FFFFE0; + border: 1px solid #E6DB55; + margin: 5px 0 15px; + padding: 0.3em 0.6em; +} + + + + +
      + +
      + +

      +

      数据库连接错误

      +

      您在 config.inc.php 文件中提供的数据库用户名和密码可能不正确,或者无法连接到 localhost 上数据库服务器,这意味着您的主机数据库服务器已停止工作。

      +
        +
      • 您确认您提供的用户名和密码正确么?
      • +
      • 您确认您提供的主机名正确么?
      • +
      • 您确认数据库服务器正常运行么?
      • +
      +

      如果您无法确定这些问题,请联系您的主机管理员。如果您仍需帮助,请访问 ThinkSAAS新社区

      +

      重试

      + + +
      + +
      + +{include file='footer.html'} + diff --git a/install/html/footer.html b/install/html/footer.html new file mode 100644 index 0000000..9d23fe8 --- /dev/null +++ b/install/html/footer.html @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/install/html/header.html b/install/html/header.html new file mode 100644 index 0000000..657298b --- /dev/null +++ b/install/html/header.html @@ -0,0 +1,21 @@ + + + + + +<?php echo $title; ?> + + + + + + + +
      +
      +
      ThinkSAAS安装程序
      +
      +ThinkSAAS 安装程序 +
      +
      +
      \ No newline at end of file diff --git a/install/html/index.html b/install/html/index.html new file mode 100644 index 0000000..bf548e6 --- /dev/null +++ b/install/html/index.html @@ -0,0 +1,170 @@ + + + + + +
      + +
      +
      + + + + + +

      欢迎使用 ThinkSAAS!在您开始使用前,ThinkSAAS 需要一些MySQL的数据库的信息。下列信息将会被问到,请作好准备。

      +
        +
      1. MySQL数据库(强烈要求采用mysql5.5或者以上的版本,建议采用mysql5.5/5.6/5.7)
      2. +
      3. 数据库名
      4. +
      5. 数据库用户用户名
      6. +
      7. 数据库用户密码
      8. +
      9. 数据库主机
      10. +
      11. 表名前缀(若您希望在一个数据表中安装多个 ThinkSAAS)
      12. +
      + + +

      大多数的互联网主机服务提供商都向您提供了数据库的信息。若您不知道这些信息,您需要先询问好,再进行安装。若您已准备好 …

      + + +

      1、PHP环境必要组件检测

      + + + + + + + + + + + + + + + + + + + + + +
      PHP组件检测结果
      dom *必须支持';}else{echo '不支持';}?>
      mbstring *必须支持';}else{echo '不支持';}?>
      gd *必须支持';}else{echo '不支持';}?>
      mysqli *必须支持';}else{echo '不支持';}?>
      openssl *必须支持';}else{echo '不支持';}?>
      session *必须支持';}else{echo '不支持';}?>
      SimpleXML *必须支持';}else{echo '不支持';}?>
      json *必须支持';}else{echo '不支持';}?>
      iconv *必须支持';}else{echo '不支持';}?>
      Fileinfo *必须支持';}else{echo '不支持';}?>
      curl *必须支持';}else{echo '不支持';}?>
      + + + + + + +

      2、检测必要目录可写权限

      + + + + + + + + + + + + + + + + + + + + + +
      目录权限检测结果
      cache + +
      data + +
      uploadfile + +
      tslogs + +
      upgrade + +
      + + + +

      请安装必须的PHP组件;请将不可写的目录设置为可写(777)权限。

      + + + + +

      设置完毕,点击刷新

      + + + +

      点击开始安装!

      + + + +
      +
      + +
      + + \ No newline at end of file diff --git a/install/html/next.html b/install/html/next.html new file mode 100644 index 0000000..1df0b6e --- /dev/null +++ b/install/html/next.html @@ -0,0 +1,262 @@ + + + + + +
      + +
      +
      + +
      +

      请在下方输入数据库相关信息。若您不清楚,请咨询主机提供商。

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      您希望 ThinkSAAS 使用哪个数据库运行?
      您的 MySQL 用户名
      ... 以及 MySQL 密码。
      通常情况下,应填写 localhost,若测试连接失败,请联系主机提供商咨询。
      默认3306
      若您希望在一个数据库中存放多个 ThinkSAAS 的数据,请修改本项以做区分。
      + +

      请在下面输入网站信息

      + + + + + + + + + + + + + + + + + + + + + + +
      也是你的网站名称
      用于首页副标题,紧跟网站标题之后
      正确填写,http://开头,/结尾 (如果是https开头,请手动改成https)
      + + + +

      请在下面输入管理员信息

      + + + + + + + + + + + + + + + + + + + + + + +
      你用来登录和最高管理的账户
      您的登录密码
      你的用户名
      + +

      选择数据库链接方式

      + + + + + + + + + +
      + +

      + + + + + + +

      +
      + +
      +
      + +
      + + + + + diff --git a/install/html/result.html b/install/html/result.html new file mode 100644 index 0000000..082d391 --- /dev/null +++ b/install/html/result.html @@ -0,0 +1,159 @@ + + + + + +
      + +
      +
      + +

      完成!

      +
      +

      ThinkSAAS 安装完成。您是否还沉浸在愉悦的安装过程中?很遗憾,一切皆已完成! :)

      + + + + + + + + + +
      登录Email:
      登录密码:
      +

      进入前台 进入后台

      + +
      +
      + +
      + + + diff --git a/install/index.php b/install/index.php new file mode 100644 index 0000000..91ce3bb --- /dev/null +++ b/install/index.php @@ -0,0 +1,16 @@ +意见反馈";'), + (16, 'plugins_pubs_counter', '1585042191s:19:"";'), + (18, 'plugins_home_links', '1679448128a:2:{i:0;a:2:{s:8:"linkname";s:9:"ThinkSAAS";s:7:"linkurl";s:25:"https://www.thinksaas.cn/";}i:1;a:2:{s:8:"linkname";s:12:"开源社区";s:7:"linkurl";s:25:"https://www.thinksaas.cn/";}}'), + (17, 'plugins_pubs_navs', '1679448108a:1:{i:0;a:3:{s:7:"navname";s:15:"ThinkSAAS官网";s:6:"navurl";s:25:"https://www.thinksaas.cn/";s:7:"newpage";s:1:"1";}}'), + (24, 'system_mynav', '1660378868a:6:{s:5:"group";s:6:"小组";s:5:"topic";s:6:"话题";s:7:"article";s:6:"文章";s:5:"photo";s:6:"相册";s:5:"weibo";s:6:"唠叨";s:7:"comment";s:6:"评论";}'), + (25, 'pubs_options', '1645846991a:3:{s:20:"phone_code_send_time";s:1:"1";s:20:"email_code_send_time";s:1:"1";s:15:"comment_isaudit";s:1:"0";}'), + (26, 'search_options', '1645846998a:8:{s:7:"appname";s:6:"搜索";s:7:"appdesc";s:6:"搜索";s:6:"appkey";s:6:"搜索";s:2:"ds";s:5:"topic";s:5:"group";s:1:"1";s:5:"topic";s:1:"1";s:4:"user";s:1:"1";s:7:"article";s:1:"1";}'), + (27, 'sms_options', '1605233458a:5:{s:10:"sms_server";s:6:"aliyun";s:9:"sms_appid";s:1:"1";s:10:"sms_appkey";s:1:"2";s:8:"sms_tpid";s:1:"3";s:8:"sms_sign";s:1:"4";}'), + (28, 'plugins_home_recommendarticle', '1589619069a:1:{s:11:"isrecommend";i:0;}'), + (29, 'plugins_home_recommendtopic', '1589619075a:1:{s:11:"isrecommend";i:0;}'), + (30, 'plugins_pubs_morenav', '1589619544a:1:{i:0;a:3:{s:7:"navname";s:9:"ThinkSAAS";s:6:"navurl";s:24:"https://www.thinksaas.cn";s:7:"newpage";s:0:"";}}'), + (31, 'topic_options', '1660378868a:5:{s:7:"appname";s:6:"话题";s:7:"appdesc";s:12:"话题帖子";s:6:"appkey";s:6:"话题";s:9:"allowpost";s:1:"0";s:7:"isaudit";s:1:"0";}'), + (32, 'article_permissions', '1636679009a:4:{i:1;a:9:{s:11:"article_add";s:1:"1";s:12:"article_show";s:1:"1";s:12:"article_edit";s:1:"1";s:14:"article_delete";s:1:"1";s:21:"article_admin_options";s:1:"1";s:25:"article_admin_permissions";s:1:"1";s:22:"article_admin_cate_add";s:1:"1";s:23:"article_admin_cate_edit";s:1:"1";s:16:"article_api_show";s:1:"1";}i:2;a:9:{s:11:"article_add";s:1:"1";s:12:"article_show";s:1:"1";s:12:"article_edit";s:1:"1";s:14:"article_delete";s:1:"1";s:21:"article_admin_options";s:1:"1";s:25:"article_admin_permissions";s:1:"1";s:22:"article_admin_cate_add";s:1:"1";s:23:"article_admin_cate_edit";s:1:"1";s:16:"article_api_show";s:1:"1";}i:3;a:5:{s:11:"article_add";s:1:"1";s:12:"article_show";s:1:"1";s:12:"article_edit";s:1:"1";s:14:"article_delete";s:1:"1";s:16:"article_api_show";s:1:"1";}i:4;a:2:{s:12:"article_show";s:1:"1";s:16:"article_api_show";s:1:"1";}}'), + (33, 'tag_options', '1654007528a:4:{s:7:"appname";s:6:"标签";s:7:"appdesc";s:6:"标签";s:6:"appkey";s:6:"标签";s:7:"isaudit";s:1:"0";}'), + (34, 'comment_options', '1654007754a:4:{s:7:"appname";s:6:"评论";s:7:"appdesc";s:6:"评论";s:6:"appkey";s:6:"评论";s:15:"comment_isaudit";s:1:"0";}'); +/*!40000 ALTER TABLE `ts_cache` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_collect 结构 +DROP TABLE IF EXISTS `ts_collect`; +CREATE TABLE IF NOT EXISTS `ts_collect` ( + `collectid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', + `ptable` varchar(64) NOT NULL DEFAULT '' COMMENT '应用表名称', + `pkey` varchar(64) NOT NULL DEFAULT '' COMMENT '应用表字段', + `pid` varchar(64) NOT NULL DEFAULT '' COMMENT '应用表字段值', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `title` varchar(128) NOT NULL DEFAULT '' COMMENT '标题', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', + PRIMARY KEY (`collectid`) USING BTREE +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='收藏表'; + +-- 正在导出表 d_thinksaas.ts_collect 的数据:0 rows +DELETE FROM `ts_collect`; +/*!40000 ALTER TABLE `ts_collect` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_collect` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_comment 结构 +DROP TABLE IF EXISTS `ts_comment`; +CREATE TABLE IF NOT EXISTS `ts_comment` ( + `commentid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增评论ID', + `ptable` varchar(64) NOT NULL DEFAULT '' COMMENT '应用表名称', + `pkey` varchar(64) NOT NULL DEFAULT '' COMMENT '应用表字段', + `pid` varchar(64) NOT NULL DEFAULT '' COMMENT '应用表字段值', + `referid` int(11) NOT NULL DEFAULT '0' COMMENT '上级评论ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `touserid` int(11) NOT NULL DEFAULT '0' COMMENT '回复用户ID', + `content` text NOT NULL COMMENT '回复内容', + `ispublic` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0公开1不公开(仅自己和发帖者可看)', + `isaudit` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否审核通过0是1否', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '回复时间', + PRIMARY KEY (`commentid`), + KEY `ptable_pkey_pid_referid` (`ptable`,`pkey`,`pid`,`referid`), + KEY `ptable_pkey_pid` (`ptable`,`pkey`,`pid`) +) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='回复/评论'; + +-- 正在导出表 d_thinksaas.ts_comment 的数据:0 rows +DELETE FROM `ts_comment`; +/*!40000 ALTER TABLE `ts_comment` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_comment` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_draft 结构 +DROP TABLE IF EXISTS `ts_draft`; +CREATE TABLE IF NOT EXISTS `ts_draft` ( + `draftid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `types` varchar(50) NOT NULL DEFAULT '' COMMENT '类型:比如帖子topic', + `title` varchar(64) NOT NULL DEFAULT '' COMMENT '标题', + `content` longtext NOT NULL COMMENT '内容', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '时间', + PRIMARY KEY (`draftid`), + UNIQUE KEY `userid_types` (`userid`,`types`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='草稿箱'; + +-- 正在导出表 d_thinksaas.ts_draft 的数据:0 rows +DELETE FROM `ts_draft`; +/*!40000 ALTER TABLE `ts_draft` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_draft` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_editor 结构 +DROP TABLE IF EXISTS `ts_editor`; +CREATE TABLE IF NOT EXISTS `ts_editor` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', + `ptable` varchar(50) NOT NULL DEFAULT '' COMMENT '项目表名', + `pkey` varchar(50) NOT NULL DEFAULT '' COMMENT '项目字段名', + `pid` int(11) NOT NULL DEFAULT '0' COMMENT '项目ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `type` char(32) NOT NULL DEFAULT 'photo' COMMENT '类型photo,file', + `title` varchar(64) NOT NULL DEFAULT '' COMMENT '标题', + `path` char(32) NOT NULL DEFAULT '' COMMENT '路径', + `url` char(32) NOT NULL DEFAULT '' COMMENT '图片或者文件', + `isface` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'photo类型,是否为封面0否1是', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '时间', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='编辑器上传图片和文件'; + +-- 数据导出被取消选择。 + +-- 导出 表 d_thinksaas.ts_email_code 结构 +DROP TABLE IF EXISTS `ts_email_code`; +CREATE TABLE IF NOT EXISTS `ts_email_code` ( + `email` varchar(32) CHARACTER SET utf8 NOT NULL COMMENT 'Email', + `code` varchar(32) CHARACTER SET utf8 NOT NULL COMMENT '验证码', + `nums` int(11) NOT NULL DEFAULT '0' COMMENT '错误次数', + `addtime` datetime NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT '时间', + UNIQUE KEY `email` (`email`) USING BTREE +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='Email验证码'; + +-- 正在导出表 d_thinksaas.ts_email_code 的数据:0 rows +DELETE FROM `ts_email_code`; +/*!40000 ALTER TABLE `ts_email_code` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_email_code` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_group 结构 +DROP TABLE IF EXISTS `ts_group`; +CREATE TABLE IF NOT EXISTS `ts_group` ( + `groupid` int(11) NOT NULL AUTO_INCREMENT COMMENT '小组ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `cateid` int(11) NOT NULL DEFAULT '0' COMMENT '分类ID', + `cateid2` int(11) NOT NULL DEFAULT '0' COMMENT '二级分类ID', + `cateid3` int(11) NOT NULL DEFAULT '0' COMMENT '三级分类ID', + `orderid` int(11) NOT NULL DEFAULT '0' COMMENT '排序ID', + `groupname` varchar(32) NOT NULL DEFAULT '' COMMENT '群组名字', + `groupdesc` text NOT NULL COMMENT '小组介绍', + `path` char(32) NOT NULL DEFAULT '' COMMENT '图标路径', + `photo` char(32) NOT NULL DEFAULT '' COMMENT '小组图标', + `bgphoto` char(32) NOT NULL DEFAULT '' COMMENT '背景图片', + `count_topic` int(11) NOT NULL DEFAULT '0' COMMENT '帖子统计', + `count_topic_today` int(11) NOT NULL DEFAULT '0' COMMENT '统计今天发帖', + `count_user` int(11) NOT NULL DEFAULT '0' COMMENT '小组成员数', + `count_topic_audit` int(11) NOT NULL DEFAULT '0' COMMENT '统计未审核帖子数', + `joinway` tinyint(1) NOT NULL DEFAULT '0' COMMENT '加入方式', + `price` int(11) NOT NULL DEFAULT '0' COMMENT '加入支付金币', + `role_leader` char(32) NOT NULL DEFAULT '组长' COMMENT '组长角色名称', + `role_admin` char(32) NOT NULL DEFAULT '管理员' COMMENT '管理员角色名称', + `role_user` char(32) NOT NULL DEFAULT '成员' COMMENT '成员角色名称', + `addtime` int(11) DEFAULT '0' COMMENT '创建时间', + `isrecommend` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否推荐', + `isopen` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否公开或者私密', + `isaudit` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否审核', + `ispost` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否允许会员发帖', + `isshow` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否显示', + `ispostaudit` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否发帖审核', + `uptime` int(11) NOT NULL DEFAULT '0' COMMENT '最后更新时间', + PRIMARY KEY (`groupid`), + KEY `userid` (`userid`), + KEY `isshow` (`isshow`), + KEY `groupname` (`groupname`), + KEY `cateid` (`cateid`), + KEY `isaudit` (`isaudit`), + KEY `addtime` (`addtime`), + KEY `isrecommend` (`isrecommend`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='群组(小组)'; + +-- 正在导出表 d_thinksaas.ts_group 的数据:0 rows +DELETE FROM `ts_group`; +/*!40000 ALTER TABLE `ts_group` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_group` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_group_cate 结构 +DROP TABLE IF EXISTS `ts_group_cate`; +CREATE TABLE IF NOT EXISTS `ts_group_cate` ( + `cateid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增分类ID', + `catename` varchar(64) NOT NULL DEFAULT '' COMMENT '分类名字', + `referid` int(11) NOT NULL DEFAULT '0' COMMENT '上级分类ID', + `count_group` int(11) NOT NULL DEFAULT '0' COMMENT '群组个数', + `uptime` int(11) NOT NULL DEFAULT '0' COMMENT '最后更新时间', + PRIMARY KEY (`cateid`), + KEY `referid` (`referid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='小组分类'; + +-- 正在导出表 d_thinksaas.ts_group_cate 的数据:0 rows +DELETE FROM `ts_group_cate`; +/*!40000 ALTER TABLE `ts_group_cate` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_group_cate` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_group_user 结构 +DROP TABLE IF EXISTS `ts_group_user`; +CREATE TABLE IF NOT EXISTS `ts_group_user` ( + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `groupid` int(11) NOT NULL DEFAULT '0' COMMENT '群组ID', + `isadmin` int(11) NOT NULL DEFAULT '0' COMMENT '是否管理员', + `isfounder` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否创始人', + `endtime` date NOT NULL DEFAULT '1970-01-01' COMMENT '到期时间', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '加入时间', + UNIQUE KEY `userid_2` (`userid`,`groupid`), + KEY `userid` (`userid`), + KEY `groupid` (`groupid`), + KEY `groupid_2` (`groupid`,`isadmin`,`isfounder`), + KEY `addtime` (`addtime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='群组和用户对应关系'; + +-- 正在导出表 d_thinksaas.ts_group_user 的数据:0 rows +DELETE FROM `ts_group_user`; +/*!40000 ALTER TABLE `ts_group_user` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_group_user` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_group_user_isaudit 结构 +DROP TABLE IF EXISTS `ts_group_user_isaudit`; +CREATE TABLE IF NOT EXISTS `ts_group_user_isaudit` ( + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `groupid` int(11) NOT NULL DEFAULT '0' COMMENT '小组ID', + UNIQUE KEY `userid` (`userid`,`groupid`), + KEY `groupid` (`groupid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='用于申请加入小组的成员审核'; + +-- 正在导出表 d_thinksaas.ts_group_user_isaudit 的数据:0 rows +DELETE FROM `ts_group_user_isaudit`; +/*!40000 ALTER TABLE `ts_group_user_isaudit` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_group_user_isaudit` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_home_info 结构 +DROP TABLE IF EXISTS `ts_home_info`; +CREATE TABLE IF NOT EXISTS `ts_home_info` ( + `infoid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', + `orderid` int(11) NOT NULL DEFAULT '0' COMMENT '排序ID', + `title` varchar(64) NOT NULL DEFAULT '' COMMENT '标题', + `content` text NOT NULL COMMENT '内容', + PRIMARY KEY (`infoid`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='关于我们等信息'; + +-- 正在导出表 d_thinksaas.ts_home_info 的数据:5 rows +DELETE FROM `ts_home_info`; +/*!40000 ALTER TABLE `ts_home_info` DISABLE KEYS */; +INSERT INTO `ts_home_info` (`infoid`, `orderid`, `title`, `content`) VALUES + (1, 0, '关于我们', '\n<p>关于我们</p><p><br></p>\n'), + (2, 0, '联系我们', '\n<p>联系我们</p><p><br></p>\n'), + (3, 0, '用户条款', '\n<p>本协议适用ThinkSAAS发布的所有程序版本和代码,所有版本都将按照最新发布的【用户条款】执行。<br>1、ThinkSAAS官方指:ThinkSAAS社区、thinksaas.cn和ThinkSAAS社区系统开发者邱君。<br>2、ThinkSAAS禁止用户在使用中触犯中国法律范围内的任何法律条文。<br>3、ThinkSAAS、及其创始人邱君拥有对ThinkSAAS的所有权,任何个人,公司和组织不得以任何形式和目的侵犯ThinkSAAS的版权和著作权。<br>4、ThinkSAAS官方拥有对ThinkSAAS社区软件绝对的版权和著作权。<br>5、ThinkSAAS程序代码完全开源,不做任何加密处理。ThinkSAAS允许【自身运营】用户对程序代码进行二次开发,但必须遵循本条款第6、7、8和9条规定执行。<br>6、所有使用ThinkSAAS的用户在保留底部Powered by ThinkSAAS 文字链接或者标识的情况下,可以免费使用ThinkSAAS。<br>7、用户在购买ThinkSAAS商业授权后才可以去除底部Powered by ThinkSAAS 文字链接或者标识。<br>8、ThinkSAAS不会监控用户网站信息,但有权通过邮件或者其他联系方式获悉用户使用情况,有权拿用户网站用作案例展示。<br>9、在未经ThinkSAAS官方书面允许的情况下,除【自身运营】外,任何个人、公司和组织不能单方面发布和出售以ThinkSAAS为基础开发的任何互联网软件或者产品,否则将视为侵权行为,将依照中华人民共和国法律追究其法律责任。<br>10、公司企业等组织机构使用ThinkSAAS软件必须购买ThinkSAAS商业授权协议。<br>11、ThinkSAAS官方拥有对此协议的修改和不断完善。<br><br>【自身运营】解释:即用户在使用ThinkSAAS中,不通过出售任何以ThinkSAAS为基础开发的产品,仅用作自身学习和自身商业运营的网站。<br><br>【用户条款】网址:https://www.thinksaas.cn/home/info/key/agreement/<br>【官方网站】网址:https://www.thinksaas.cn/<br>【演示网站】网址:https://demo.thinksaas.cn/</p>\n'), + (4, 0, '隐私声明', '\n<p>隐私声明</p>\n'), + (5, 0, '加入我们', '\n<p>加入我们</p>\n'); +/*!40000 ALTER TABLE `ts_home_info` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_logs 结构 +DROP TABLE IF EXISTS `ts_logs`; +CREATE TABLE IF NOT EXISTS `ts_logs` ( + `logid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', + `ptable` varchar(50) NOT NULL DEFAULT '0' COMMENT '应用表名称', + `pkey` varchar(50) NOT NULL DEFAULT '0' COMMENT '应用表字段', + `pid` varchar(50) NOT NULL DEFAULT '0' COMMENT '应用表字段值', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `title` varchar(64) NOT NULL DEFAULT '' COMMENT '标题', + `content` longtext NOT NULL COMMENT '内容', + `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0添加1修改2删除', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '时间', + PRIMARY KEY (`logid`), + KEY `userid` (`userid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='用户操作记录表'; + +-- 正在导出表 d_thinksaas.ts_logs 的数据:0 rows +DELETE FROM `ts_logs`; +/*!40000 ALTER TABLE `ts_logs` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_logs` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_love 结构 +DROP TABLE IF EXISTS `ts_love`; +CREATE TABLE IF NOT EXISTS `ts_love` ( + `loveid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', + `ptable` varchar(64) NOT NULL DEFAULT '' COMMENT '应用表名称', + `pkey` varchar(64) NOT NULL DEFAULT '' COMMENT '应用表字段', + `pid` varchar(64) NOT NULL DEFAULT '' COMMENT '应用表字段值', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `title` varchar(128) NOT NULL DEFAULT '' COMMENT '标题', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', + PRIMARY KEY (`loveid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='点赞/喜欢表'; + +-- 正在导出表 d_thinksaas.ts_love 的数据:0 rows +DELETE FROM `ts_love`; +/*!40000 ALTER TABLE `ts_love` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_love` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_mail_options 结构 +DROP TABLE IF EXISTS `ts_mail_options`; +CREATE TABLE IF NOT EXISTS `ts_mail_options` ( + `optionid` int(11) NOT NULL AUTO_INCREMENT COMMENT '选项ID', + `optionname` varchar(32) NOT NULL DEFAULT '' COMMENT '选项名字', + `optionvalue` varchar(512) NOT NULL DEFAULT '' COMMENT '选项内容', + PRIMARY KEY (`optionid`), + UNIQUE KEY `optionname` (`optionname`) +) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COMMENT='发信邮件配置'; + +-- 正在导出表 d_thinksaas.ts_mail_options 的数据:8 rows +DELETE FROM `ts_mail_options`; +/*!40000 ALTER TABLE `ts_mail_options` DISABLE KEYS */; +INSERT INTO `ts_mail_options` (`optionid`, `optionname`, `optionvalue`) VALUES + (1, 'appname', '邮件'), + (2, 'appdesc', 'ThinkSAAS邮件'), + (3, 'isenable', '0'), + (4, 'mailhost', 'smtp.exmail.qq.com'), + (5, 'ssl', '1'), + (6, 'mailport', '587'), + (7, 'mailuser', 'postmaster@thinksaas.cn'), + (8, 'mailpwd', ''); +/*!40000 ALTER TABLE `ts_mail_options` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_message 结构 +DROP TABLE IF EXISTS `ts_message`; +CREATE TABLE IF NOT EXISTS `ts_message` ( + `messageid` int(11) NOT NULL AUTO_INCREMENT COMMENT '消息ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '发送用户ID', + `touserid` int(11) NOT NULL DEFAULT '0' COMMENT '接收消息的用户ID', + `content` text NOT NULL COMMENT '内容', + `tourl` varchar(255) NOT NULL DEFAULT '' COMMENT '消息跳转地址', + `extend` varchar(255) NOT NULL DEFAULT '' COMMENT '消息扩展', + `isread` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已读', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', + PRIMARY KEY (`messageid`), + KEY `touserid` (`touserid`,`isread`), + KEY `userid` (`userid`,`touserid`,`isread`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='短消息表'; + +-- 正在导出表 d_thinksaas.ts_message 的数据:0 rows +DELETE FROM `ts_message`; +/*!40000 ALTER TABLE `ts_message` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_message` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_permissions 结构 +DROP TABLE IF EXISTS `ts_permissions`; +CREATE TABLE IF NOT EXISTS `ts_permissions` ( + `permissionsid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', + `ugid` int(11) NOT NULL DEFAULT '0' COMMENT '用户组ID', + `app` varchar(50) NOT NULL DEFAULT '' COMMENT 'APP', + `action` varchar(50) NOT NULL DEFAULT '' COMMENT 'ACTION', + `mg` varchar(50) NOT NULL DEFAULT '' COMMENT 'MG', + `api` varchar(50) NOT NULL DEFAULT '' COMMENT 'API', + `ts` varchar(50) NOT NULL DEFAULT '' COMMENT 'TS', + `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '权限状态0无1有', + PRIMARY KEY (`permissionsid`) +) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COMMENT='用户组权限表'; + +-- 正在导出表 d_thinksaas.ts_permissions 的数据:~25 rows (大约) +DELETE FROM `ts_permissions`; +/*!40000 ALTER TABLE `ts_permissions` DISABLE KEYS */; +INSERT INTO `ts_permissions` (`permissionsid`, `ugid`, `app`, `action`, `mg`, `api`, `ts`, `status`) VALUES + (1, 1, 'article', 'add', '', '', '', 1), + (2, 1, 'article', 'show', '', '', '', 1), + (3, 1, 'article', 'edit', '', '', '', 1), + (4, 1, 'article', 'delete', '', '', '', 1), + (5, 1, 'article', 'admin', 'options', '', '', 1), + (6, 1, 'article', 'admin', 'permissions', '', '', 1), + (7, 1, 'article', 'admin', 'cate', '', 'add', 1), + (8, 1, 'article', 'admin', 'cate', '', 'edit', 1), + (9, 1, 'article', 'api', '', 'show', '', 1), + (10, 2, 'article', 'add', '', '', '', 1), + (11, 2, 'article', 'show', '', '', '', 1), + (12, 2, 'article', 'edit', '', '', '', 1), + (13, 2, 'article', 'delete', '', '', '', 1), + (14, 2, 'article', 'admin', 'options', '', '', 1), + (15, 2, 'article', 'admin', 'permissions', '', '', 1), + (16, 2, 'article', 'admin', 'cate', '', 'add', 1), + (17, 2, 'article', 'admin', 'cate', '', 'edit', 1), + (18, 2, 'article', 'api', '', 'show', '', 1), + (19, 3, 'article', 'add', '', '', '', 1), + (20, 3, 'article', 'show', '', '', '', 1), + (21, 3, 'article', 'edit', '', '', '', 1), + (22, 3, 'article', 'delete', '', '', '', 1), + (23, 3, 'article', 'api', '', 'show', '', 1), + (24, 4, 'article', 'show', '', '', '', 1), + (25, 4, 'article', 'api', '', 'show', '', 1); +/*!40000 ALTER TABLE `ts_permissions` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_phone_code 结构 +DROP TABLE IF EXISTS `ts_phone_code`; +CREATE TABLE IF NOT EXISTS `ts_phone_code` ( + `phone` varchar(32) CHARACTER SET utf8 NOT NULL COMMENT '手机号', + `code` varchar(32) CHARACTER SET utf8 NOT NULL COMMENT '验证码', + `nums` int(11) NOT NULL DEFAULT '0' COMMENT '错误次数', + `addtime` datetime NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT '时间', + UNIQUE KEY `phone` (`phone`) USING BTREE +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='手机号验证码'; + +-- 正在导出表 d_thinksaas.ts_phone_code 的数据:0 rows +DELETE FROM `ts_phone_code`; +/*!40000 ALTER TABLE `ts_phone_code` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_phone_code` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_photo 结构 +DROP TABLE IF EXISTS `ts_photo`; +CREATE TABLE IF NOT EXISTS `ts_photo` ( + `photoid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增图片ID', + `albumid` int(11) NOT NULL DEFAULT '0' COMMENT '相册ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `title` varchar(64) NOT NULL DEFAULT '' COMMENT '图片名称', + `phototype` char(32) NOT NULL DEFAULT '' COMMENT '图片类型', + `path` char(32) NOT NULL DEFAULT '' COMMENT '图片路径', + `photourl` varchar(64) NOT NULL DEFAULT '' COMMENT '图片地址', + `photosize` char(32) NOT NULL DEFAULT '' COMMENT '图片大小', + `photodesc` char(120) NOT NULL DEFAULT '' COMMENT '图片介绍', + `count_view` int(11) NOT NULL DEFAULT '0' COMMENT '统计浏览量', + `count_comment` int(11) NOT NULL DEFAULT '0' COMMENT '统计评论数', + `count_love` int(11) NOT NULL DEFAULT '0' COMMENT '统计点赞喜欢数', + `isrecommend` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0不推荐1推荐', + `addtime` datetime NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT '添加时间', + `uptime` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', + PRIMARY KEY (`photoid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='相册图片'; + +-- 正在导出表 d_thinksaas.ts_photo 的数据:0 rows +DELETE FROM `ts_photo`; +/*!40000 ALTER TABLE `ts_photo` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_photo` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_photo_album 结构 +DROP TABLE IF EXISTS `ts_photo_album`; +CREATE TABLE IF NOT EXISTS `ts_photo_album` ( + `albumid` int(11) NOT NULL AUTO_INCREMENT COMMENT '相册ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `path` char(32) NOT NULL DEFAULT '' COMMENT '相册路径', + `albumface` varchar(64) NOT NULL DEFAULT '' COMMENT '相册封面', + `albumname` varchar(64) NOT NULL DEFAULT '' COMMENT '相册名称', + `albumdesc` varchar(512) NOT NULL DEFAULT '' COMMENT '相册介绍', + `count_photo` int(11) NOT NULL DEFAULT '0' COMMENT '统计图片数', + `count_view` int(11) NOT NULL DEFAULT '0' COMMENT '统计浏览量', + `isrecommend` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否推荐', + `isaudit` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0审核1未审核', + `addtime` datetime NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT '添加时间', + `uptime` datetime NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT '更新时间', + PRIMARY KEY (`albumid`), + KEY `userid` (`userid`), + KEY `isrecommend` (`isrecommend`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='相册'; + +-- 正在导出表 d_thinksaas.ts_photo_album 的数据:0 rows +DELETE FROM `ts_photo_album`; +/*!40000 ALTER TABLE `ts_photo_album` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_photo_album` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_slide 结构 +DROP TABLE IF EXISTS `ts_slide`; +CREATE TABLE IF NOT EXISTS `ts_slide` ( + `slideid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', + `typeid` int(11) NOT NULL DEFAULT '0' COMMENT '类型ID默认0为web端轮播', + `title` varchar(64) NOT NULL DEFAULT '' COMMENT '标题', + `info` varchar(128) NOT NULL DEFAULT '' COMMENT '介绍', + `url` varchar(64) NOT NULL DEFAULT '' COMMENT '链接', + `path` char(32) NOT NULL DEFAULT '' COMMENT '路径', + `photo` char(32) NOT NULL DEFAULT '' COMMENT '图片', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '时间', + PRIMARY KEY (`slideid`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='轮播图'; + +-- 正在导出表 d_thinksaas.ts_slide 的数据:1 rows +DELETE FROM `ts_slide`; +/*!40000 ALTER TABLE `ts_slide` DISABLE KEYS */; +INSERT INTO `ts_slide` (`slideid`, `typeid`, `title`, `info`, `url`, `path`, `photo`, `addtime`) VALUES + (1, 0, 'ThinkSAAS开源社区', '关注官方微信,时刻获取最新版本更新通知', 'https://www.thinksaas.cn', '0/0', '0/0/1.jpg', 1416533676); +/*!40000 ALTER TABLE `ts_slide` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_system_options 结构 +DROP TABLE IF EXISTS `ts_system_options`; +CREATE TABLE IF NOT EXISTS `ts_system_options` ( + `optionname` varchar(64) NOT NULL DEFAULT '' COMMENT '选项名字', + `optionvalue` varchar(512) NOT NULL DEFAULT '' COMMENT '选项内容', + UNIQUE KEY `optionname` (`optionname`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='系统管理配置'; + +-- 正在导出表 d_thinksaas.ts_system_options 的数据:47 rows +DELETE FROM `ts_system_options`; +/*!40000 ALTER TABLE `ts_system_options` DISABLE KEYS */; +INSERT INTO `ts_system_options` (`optionname`, `optionvalue`) VALUES + ('site_title', 'ThinkSAAS'), + ('site_subtitle', '又一个ThinkSAAS社区'), + ('site_key', 'thinksaas'), + ('site_desc', 'thinksaas'), + ('site_url', 'http://d.qiniao.com/'), + ('link_url', 'http://d.qiniao.com/'), + ('site_pkey', '4c523b534c11b6f5de89a53d0e6af0c4'), + ('site_email', 'admin@admin.com'), + ('site_icp', '豫ICP备00000000号'), + ('isface', '0'), + ('isinvite', '0'), + ('regtype', '0'), + ('isplogin', '0'), + ('isverify', '0'), + ('isverifyphone', '0'), + ('istomy', '0'), + ('isauthcode', '0'), + ('istoken', '0'), + ('is_weixin', '0'), + ('weixin_appid', ''), + ('weixin_appsecret', ''), + ('is_vaptcha', '0'), + ('vaptcha_vid', ''), + ('vaptcha_key', ''), + ('timezone', 'Asia/Hong_Kong'), + ('visitor', '0'), + ('publisher', '0'), + ('isniming', '0'), + ('pubtime', ''), + ('timeblank', '0'), + ('isallowedit', '0'), + ('isallowdelete', '0'), + ('anti_word_type', '0'), + ('site_theme', 'sample'), + ('site_urltype', '1'), + ('file_upload_type', '0'), + ('alioss_accesskey_id', ''), + ('alioss_accesskey_secret', ''), + ('alioss_bucket', ''), + ('alioss_endpoint', ''), + ('alioss_bucket_url', ''), + ('photo_size', '10'), + ('photo_type', 'jpg,gif,png,jpeg'), + ('photo_check', '0'), + ('photo_driver', 'gd'), + ('attach_size', '10'), + ('attach_type', 'zip,rar,doc,txt,ppt'), + ('dayscoretop', '10'), + ('logo', 'logo.png'); +/*!40000 ALTER TABLE `ts_system_options` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_tag 结构 +DROP TABLE IF EXISTS `ts_tag`; +CREATE TABLE IF NOT EXISTS `ts_tag` ( + `tagid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', + `tagname` varchar(32) NOT NULL DEFAULT '' COMMENT '标签名称', + `count_user` int(11) NOT NULL DEFAULT '0' COMMENT '统计用户标签', + `count_group` int(11) NOT NULL DEFAULT '0' COMMENT '统计小组标签', + `count_topic` int(11) NOT NULL DEFAULT '0' COMMENT '统计帖子标签', + `count_article` int(11) NOT NULL DEFAULT '0' COMMENT '统计文章标签', + `count_photo` int(11) NOT NULL DEFAULT '0' COMMENT '统计图片使用数', + `isaudit` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否审核0是1否', + `uptime` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', + PRIMARY KEY (`tagid`), + UNIQUE KEY `tagname` (`tagname`) +) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='标签表'; + + +-- 正在导出表 d_thinksaas.ts_tag 的数据:0 rows +DELETE FROM `ts_tag`; +/*!40000 ALTER TABLE `ts_tag` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_tag` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_tag_article_index 结构 +DROP TABLE IF EXISTS `ts_tag_article_index`; +CREATE TABLE IF NOT EXISTS `ts_tag_article_index` ( + `articleid` int(11) NOT NULL DEFAULT '0' COMMENT '帖子ID', + `tagid` int(11) NOT NULL DEFAULT '0' COMMENT '标签ID', + UNIQUE KEY `articleid_2` (`articleid`,`tagid`), + KEY `articleid` (`articleid`), + KEY `tagid` (`tagid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='文章标签关联'; + +-- 正在导出表 d_thinksaas.ts_tag_article_index 的数据:0 rows +DELETE FROM `ts_tag_article_index`; +/*!40000 ALTER TABLE `ts_tag_article_index` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_tag_article_index` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_tag_group_index 结构 +DROP TABLE IF EXISTS `ts_tag_group_index`; +CREATE TABLE IF NOT EXISTS `ts_tag_group_index` ( + `groupid` int(11) NOT NULL DEFAULT '0' COMMENT '小组ID', + `tagid` int(11) NOT NULL DEFAULT '0' COMMENT '标签ID', + UNIQUE KEY `groupid_2` (`groupid`,`tagid`), + KEY `groupid` (`groupid`), + KEY `tagid` (`tagid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='小组标签关联'; + +-- 正在导出表 d_thinksaas.ts_tag_group_index 的数据:0 rows +DELETE FROM `ts_tag_group_index`; +/*!40000 ALTER TABLE `ts_tag_group_index` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_tag_group_index` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_tag_photo_index 结构 +DROP TABLE IF EXISTS `ts_tag_photo_index`; +CREATE TABLE IF NOT EXISTS `ts_tag_photo_index` ( + `photoid` int(11) NOT NULL DEFAULT '0' COMMENT '图片ID', + `tagid` int(11) NOT NULL DEFAULT '0' COMMENT '标签ID', + UNIQUE KEY `photoid_2` (`photoid`,`tagid`), + KEY `tagid` (`tagid`), + KEY `photoid` (`photoid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='相册图片标签关联'; + +-- 正在导出表 d_thinksaas.ts_tag_photo_index 的数据:0 rows +DELETE FROM `ts_tag_photo_index`; +/*!40000 ALTER TABLE `ts_tag_photo_index` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_tag_photo_index` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_tag_topic_index 结构 +DROP TABLE IF EXISTS `ts_tag_topic_index`; +CREATE TABLE IF NOT EXISTS `ts_tag_topic_index` ( + `topicid` int(11) NOT NULL DEFAULT '0' COMMENT '帖子ID', + `tagid` int(11) NOT NULL DEFAULT '0' COMMENT '标签ID', + UNIQUE KEY `topicid_2` (`topicid`,`tagid`), + KEY `topicid` (`topicid`), + KEY `tagid` (`tagid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='帖子标签关联'; + +-- 正在导出表 d_thinksaas.ts_tag_topic_index 的数据:0 rows +DELETE FROM `ts_tag_topic_index`; +/*!40000 ALTER TABLE `ts_tag_topic_index` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_tag_topic_index` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_tag_user_index 结构 +DROP TABLE IF EXISTS `ts_tag_user_index`; +CREATE TABLE IF NOT EXISTS `ts_tag_user_index` ( + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `tagid` int(11) NOT NULL DEFAULT '0' COMMENT '标签ID', + UNIQUE KEY `userid_2` (`userid`,`tagid`), + KEY `userid` (`userid`), + KEY `tagid` (`tagid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='用户标签关联'; + +-- 正在导出表 d_thinksaas.ts_tag_user_index 的数据:0 rows +DELETE FROM `ts_tag_user_index`; +/*!40000 ALTER TABLE `ts_tag_user_index` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_tag_user_index` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_task 结构 +DROP TABLE IF EXISTS `ts_task`; +CREATE TABLE IF NOT EXISTS `ts_task` ( + `taskid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增任务ID', + `taskkey` char(32) NOT NULL DEFAULT '' COMMENT '任务标识', + `title` varchar(64) NOT NULL DEFAULT '' COMMENT '任务标题', + `content` text NOT NULL COMMENT '任务介绍', + `addtime` datetime NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT '时间', + PRIMARY KEY (`taskid`), + UNIQUE KEY `taskkey` (`taskkey`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='任务'; + +-- 正在导出表 d_thinksaas.ts_task 的数据:0 rows +DELETE FROM `ts_task`; +/*!40000 ALTER TABLE `ts_task` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_task` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_task_user 结构 +DROP TABLE IF EXISTS `ts_task_user`; +CREATE TABLE IF NOT EXISTS `ts_task_user` ( + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `taskkey` char(32) NOT NULL DEFAULT '' COMMENT '任务key', + `addtime` datetime NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT '时间', + UNIQUE KEY `userid` (`userid`,`taskkey`), + KEY `taskkey` (`taskkey`), + KEY `userid_2` (`userid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='用户任务关联'; + +-- 正在导出表 d_thinksaas.ts_task_user 的数据:0 rows +DELETE FROM `ts_task_user`; +/*!40000 ALTER TABLE `ts_task_user` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_task_user` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_topic 结构 +DROP TABLE IF EXISTS `ts_topic`; +CREATE TABLE IF NOT EXISTS `ts_topic` ( + `topicid` int(11) NOT NULL AUTO_INCREMENT COMMENT '话题ID', + `ptable` varchar(64) NOT NULL DEFAULT '' COMMENT '应用表名称', + `pkey` varchar(64) NOT NULL DEFAULT '' COMMENT '应用表字段', + `pid` varchar(64) NOT NULL DEFAULT '' COMMENT '应用表字段值', + `pjson` varchar(512) NOT NULL DEFAULT '' COMMENT '应用json数据', + `typeid` int(11) NOT NULL DEFAULT '0' COMMENT '帖子分类ID', + `groupid` int(11) NOT NULL DEFAULT '0' COMMENT '小组ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `title` varchar(64) NOT NULL DEFAULT '' COMMENT '帖子标题', + `label` varchar(64) NOT NULL DEFAULT '' COMMENT '快速标注', + `content` longtext NOT NULL COMMENT '帖子内容', + `gaiyao` varchar(256) NOT NULL DEFAULT '' COMMENT '内容概要', + `score` int(11) NOT NULL DEFAULT '0' COMMENT '查看需要积分', + `count_comment` int(11) NOT NULL DEFAULT '0' COMMENT '回复统计', + `count_view` int(11) NOT NULL DEFAULT '0' COMMENT '帖子展示数', + `count_love` int(11) NOT NULL DEFAULT '0' COMMENT '喜欢数', + `istop` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否置顶', + `isclose` int(4) NOT NULL DEFAULT '0' COMMENT '是否关闭帖子', + `iscomment` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否允许评论', + `iscommentshow` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否评论后显示内容', + `isposts` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否精华帖子', + `isaudit` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0不审核1审核', + `isdelete` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0不删除1删除', + `isrecommend` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1为推荐', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `uptime` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', + PRIMARY KEY (`topicid`), + KEY `groupid` (`groupid`), + KEY `userid` (`userid`), + KEY `title` (`title`), + KEY `groupid_2` (`groupid`), + KEY `typeid` (`typeid`), + KEY `addtime` (`addtime`), + KEY `count_comment` (`count_comment`), + KEY `count_view` (`count_view`), + KEY `count_love` (`count_love`), + KEY `count_view_2` (`count_view`,`addtime`), + KEY `isshow` (`isaudit`,`uptime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='话题(帖子)'; + +-- 正在导出表 d_thinksaas.ts_topic 的数据:0 rows +DELETE FROM `ts_topic`; +/*!40000 ALTER TABLE `ts_topic` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_topic` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_topic_edit 结构 +DROP TABLE IF EXISTS `ts_topic_edit`; +CREATE TABLE IF NOT EXISTS `ts_topic_edit` ( + `editid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增编辑ID', + `topicid` int(11) NOT NULL DEFAULT '0' COMMENT '话题ID', + `title` varchar(128) NOT NULL DEFAULT '' COMMENT '标题', + `content` text NOT NULL COMMENT '内容', + `isupdate` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0未更新1更新', + `addtime` datetime NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT '修改时间', + PRIMARY KEY (`editid`), + UNIQUE KEY `topicid` (`topicid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='话题编辑'; + +-- 正在导出表 d_thinksaas.ts_topic_edit 的数据:0 rows +DELETE FROM `ts_topic_edit`; +/*!40000 ALTER TABLE `ts_topic_edit` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_topic_edit` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_topic_photo 结构 +DROP TABLE IF EXISTS `ts_topic_photo`; +CREATE TABLE IF NOT EXISTS `ts_topic_photo` ( + `photoid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `topicid` int(11) NOT NULL DEFAULT '0' COMMENT '帖子ID', + `orderid` int(11) NOT NULL DEFAULT '0' COMMENT '排序ID', + `path` varchar(50) NOT NULL DEFAULT '' COMMENT '路径', + `photo` varchar(50) NOT NULL DEFAULT '' COMMENT '图片', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', + PRIMARY KEY (`photoid`), + UNIQUE KEY `photoid` (`photoid`), + KEY `topicid` (`topicid`), + KEY `userid` (`userid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='帖子图片表'; + +-- 正在导出表 d_thinksaas.ts_topic_photo 的数据:0 rows +DELETE FROM `ts_topic_photo`; +/*!40000 ALTER TABLE `ts_topic_photo` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_topic_photo` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_topic_type 结构 +DROP TABLE IF EXISTS `ts_topic_type`; +CREATE TABLE IF NOT EXISTS `ts_topic_type` ( + `typeid` int(11) NOT NULL AUTO_INCREMENT COMMENT '帖子分类ID', + `groupid` int(11) NOT NULL DEFAULT '0' COMMENT '小组ID', + `typename` varchar(64) NOT NULL DEFAULT '' COMMENT '帖子分类名称', + `count_topic` int(11) NOT NULL DEFAULT '0' COMMENT '统计帖子', + PRIMARY KEY (`typeid`), + KEY `groupid` (`groupid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='帖子分类'; + +-- 正在导出表 d_thinksaas.ts_topic_type 的数据:0 rows +DELETE FROM `ts_topic_type`; +/*!40000 ALTER TABLE `ts_topic_type` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_topic_type` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_topic_user 结构 +DROP TABLE IF EXISTS `ts_topic_user`; +CREATE TABLE IF NOT EXISTS `ts_topic_user` ( + `topicid` int(11) NOT NULL DEFAULT '0' COMMENT '帖子ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '时间', + UNIQUE KEY `topicid_userid` (`topicid`,`userid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='积分帖子用户关联表'; + +-- 正在导出表 d_thinksaas.ts_topic_user 的数据:0 rows +DELETE FROM `ts_topic_user`; +/*!40000 ALTER TABLE `ts_topic_user` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_topic_user` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_upload 结构 +DROP TABLE IF EXISTS `ts_upload`; +CREATE TABLE IF NOT EXISTS `ts_upload` ( + `upid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `fileurl` varchar(50) NOT NULL DEFAULT '' COMMENT '文件存储地址', + `filename` varchar(50) NOT NULL DEFAULT '' COMMENT '文件名称', + `filesize` varchar(50) NOT NULL DEFAULT '' COMMENT '文件大小', + `filetype` varchar(50) NOT NULL DEFAULT '' COMMENT '文件类型', + `addtime` datetime NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT '添加时间', + PRIMARY KEY (`upid`) USING BTREE, + KEY `userid` (`userid`) USING BTREE +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='分块上传临时存储'; + +-- 正在导出表 d_thinksaas.ts_upload 的数据:0 rows +DELETE FROM `ts_upload`; +/*!40000 ALTER TABLE `ts_upload` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_upload` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_user 结构 +DROP TABLE IF EXISTS `ts_user`; +CREATE TABLE IF NOT EXISTS `ts_user` ( + `userid` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID', + `pwd` char(32) NOT NULL DEFAULT '' COMMENT '用户密码', + `salt` char(32) NOT NULL DEFAULT '' COMMENT '加点盐', + `email` varchar(64) NOT NULL DEFAULT '' COMMENT '用户email', + `phone` varchar(64) NOT NULL DEFAULT '' COMMENT '手机号', + `resetpwd` char(32) NOT NULL DEFAULT '' COMMENT '重设密码', + `code` char(32) NOT NULL DEFAULT '' COMMENT '邮箱验证码', + PRIMARY KEY (`userid`), + UNIQUE KEY `email` (`email`), + UNIQUE KEY `phone` (`phone`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='用户'; + +-- 正在导出表 d_thinksaas.ts_user 的数据:0 rows +DELETE FROM `ts_user`; +/*!40000 ALTER TABLE `ts_user` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_user` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_user_follow 结构 +DROP TABLE IF EXISTS `ts_user_follow`; +CREATE TABLE IF NOT EXISTS `ts_user_follow` ( + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `touserid` int(11) NOT NULL DEFAULT '0' COMMENT '被关注的用户ID', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', + UNIQUE KEY `userid_touserid` (`userid`,`touserid`) USING BTREE, + KEY `userid` (`userid`), + KEY `touserid` (`touserid`) USING BTREE +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='用户关注跟随'; + +-- 正在导出表 d_thinksaas.ts_user_follow 的数据:0 rows +DELETE FROM `ts_user_follow`; +/*!40000 ALTER TABLE `ts_user_follow` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_user_follow` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_user_gb 结构 +DROP TABLE IF EXISTS `ts_user_gb`; +CREATE TABLE IF NOT EXISTS `ts_user_gb` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增留言ID', + `reid` int(11) NOT NULL DEFAULT '0' COMMENT '回复留言ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '留言用户ID', + `touserid` int(11) NOT NULL DEFAULT '0' COMMENT '被留言用户ID', + `content` text NOT NULL COMMENT '内容', + `addtime` datetime NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT '时间', + PRIMARY KEY (`id`), + KEY `userid` (`userid`), + KEY `touserid` (`touserid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='留言表'; + +-- 正在导出表 d_thinksaas.ts_user_gb 的数据:0 rows +DELETE FROM `ts_user_gb`; +/*!40000 ALTER TABLE `ts_user_gb` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_user_gb` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_user_group 结构 +DROP TABLE IF EXISTS `ts_user_group`; +CREATE TABLE IF NOT EXISTS `ts_user_group` ( + `ugid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增用户组ID', + `ugname` varchar(50) NOT NULL DEFAULT '' COMMENT '用户组名字', + `uginfo` varchar(256) NOT NULL DEFAULT '' COMMENT '描述', + PRIMARY KEY (`ugid`) USING BTREE, + UNIQUE KEY `groupname` (`ugname`) USING BTREE +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='用户组'; + +-- 正在导出表 d_thinksaas.ts_user_group 的数据:4 rows +DELETE FROM `ts_user_group`; +/*!40000 ALTER TABLE `ts_user_group` DISABLE KEYS */; +INSERT INTO `ts_user_group` (`ugid`, `ugname`, `uginfo`) VALUES + (1, '系统管理员', '系统管理最高权限组'), + (2, '内容管理员', '对用户发布的内容进行管理操作'), + (3, '普通用户', '默认普通用户组'), + (4, '游客', '未登录用户'); +/*!40000 ALTER TABLE `ts_user_group` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_user_info 结构 +DROP TABLE IF EXISTS `ts_user_info`; +CREATE TABLE IF NOT EXISTS `ts_user_info` ( + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `fuserid` int(11) NOT NULL DEFAULT '0' COMMENT '来自邀请用户', + `ugid` int(11) NOT NULL DEFAULT '0' COMMENT '用户组ID', + `username` char(32) NOT NULL DEFAULT '' COMMENT '用户名', + `email` varchar(64) NOT NULL DEFAULT '' COMMENT 'Email邮箱', + `sex` char(32) NOT NULL DEFAULT '女' COMMENT '性别', + `phone` varchar(64) NOT NULL DEFAULT '' COMMENT '电话号码', + `roleid` int(11) NOT NULL DEFAULT '1' COMMENT '角色ID', + `province` varchar(64) NOT NULL DEFAULT '' COMMENT '省/直辖市/自治区', + `city` varchar(64) NOT NULL DEFAULT '' COMMENT '市县区', + `district` varchar(64) NOT NULL DEFAULT '' COMMENT '区域', + `path` char(32) NOT NULL DEFAULT '' COMMENT '头像路径', + `face` char(64) NOT NULL DEFAULT '' COMMENT '会员头像', + `signed` varchar(64) NOT NULL DEFAULT '' COMMENT '签名', + `blog` char(32) NOT NULL DEFAULT '' COMMENT '博客', + `about` varchar(255) NOT NULL DEFAULT '' COMMENT '关于我', + `ip` char(32) NOT NULL DEFAULT '' COMMENT '登陆IP', + `address` varchar(64) NOT NULL DEFAULT '' COMMENT '地址', + `comefrom` tinyint(1) NOT NULL DEFAULT '0' COMMENT '注册来自0web1手机客户端', + `allscore` int(11) NOT NULL DEFAULT '0' COMMENT '所有获得的总积分', + `count_score` int(11) NOT NULL DEFAULT '0' COMMENT '统计积分', + `count_follow` int(11) NOT NULL DEFAULT '0' COMMENT '统计用户跟随的', + `count_followed` int(11) NOT NULL DEFAULT '0' COMMENT '统计用户被跟随的', + `count_group` int(11) NOT NULL DEFAULT '0' COMMENT '统计小组数', + `count_topic` int(11) NOT NULL DEFAULT '0' COMMENT '统计帖子', + `count_collect` int(11) NOT NULL DEFAULT '0' COMMENT '统计收藏', + `isadmin` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否是管理员', + `isenable` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否启用:0启用1禁用', + `isverify` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0未验证1验证', + `isverifyphone` tinyint(1) NOT NULL DEFAULT '0' COMMENT '手机号验证0未验证1验证', + `isrenzheng` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否认证0未认证1认证', + `isrecommend` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否推荐', + `verifycode` char(11) NOT NULL DEFAULT '' COMMENT '验证码', + `autologin` char(128) NOT NULL DEFAULT '' COMMENT '自动登陆', + `signin` int(11) NOT NULL DEFAULT '0' COMMENT '签到时间', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `uptime` int(11) NOT NULL DEFAULT '0' COMMENT '登陆时间', + UNIQUE KEY `email` (`email`), + UNIQUE KEY `userid` (`userid`), + UNIQUE KEY `email_2` (`email`,`autologin`), + KEY `fuserid` (`fuserid`), + KEY `isrecommend` (`isrecommend`), + KEY `isrenzheng` (`isrenzheng`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='用户'; + +-- 正在导出表 d_thinksaas.ts_user_info 的数据:0 rows +DELETE FROM `ts_user_info`; +/*!40000 ALTER TABLE `ts_user_info` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_user_info` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_user_invites 结构 +DROP TABLE IF EXISTS `ts_user_invites`; +CREATE TABLE IF NOT EXISTS `ts_user_invites` ( + `inviteid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增邀请ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `invitecode` char(32) NOT NULL DEFAULT '' COMMENT '邀请码', + `isused` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否使用', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', + PRIMARY KEY (`inviteid`), + UNIQUE KEY `invitecode` (`invitecode`), + KEY `isused` (`isused`), + KEY `userid` (`userid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='用户邀请码'; + +-- 正在导出表 d_thinksaas.ts_user_invites 的数据:0 rows +DELETE FROM `ts_user_invites`; +/*!40000 ALTER TABLE `ts_user_invites` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_user_invites` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_user_open 结构 +DROP TABLE IF EXISTS `ts_user_open`; +CREATE TABLE IF NOT EXISTS `ts_user_open` ( + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `sitename` varchar(64) NOT NULL DEFAULT '' COMMENT '连接网站名称', + `openid` varchar(64) NOT NULL DEFAULT '' COMMENT 'openid', + `access_token` varchar(128) NOT NULL DEFAULT '' COMMENT 'access_token', + `uptime` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', + UNIQUE KEY `userid_2` (`userid`,`sitename`), + UNIQUE KEY `sitename` (`sitename`,`openid`), + KEY `userid` (`userid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='第三方连接登录'; + +-- 正在导出表 d_thinksaas.ts_user_open 的数据:0 rows +DELETE FROM `ts_user_open`; +/*!40000 ALTER TABLE `ts_user_open` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_user_open` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_user_role 结构 +DROP TABLE IF EXISTS `ts_user_role`; +CREATE TABLE IF NOT EXISTS `ts_user_role` ( + `roleid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增角色ID', + `rolename` char(32) NOT NULL DEFAULT '' COMMENT '角色名称', + `score_start` int(11) NOT NULL DEFAULT '0' COMMENT '积分开始', + `score_end` int(11) NOT NULL DEFAULT '0' COMMENT '积分结束', + PRIMARY KEY (`roleid`) +) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COMMENT='角色'; + +-- 正在导出表 d_thinksaas.ts_user_role 的数据:17 rows +DELETE FROM `ts_user_role`; +/*!40000 ALTER TABLE `ts_user_role` DISABLE KEYS */; +INSERT INTO `ts_user_role` (`roleid`, `rolename`, `score_start`, `score_end`) VALUES + (1, '列兵', 0, 5000), + (2, '下士', 5000, 20000), + (3, '中士', 20000, 40000), + (4, '上士', 40000, 80000), + (5, '三级准尉', 80000, 160000), + (6, '二级准尉', 160000, 320000), + (7, '一级准尉', 320000, 640000), + (8, '少尉', 640000, 1280000), + (9, '中尉', 1280000, 2560000), + (10, '上尉', 2560000, 5120000), + (11, '少校', 5120000, 10240000), + (12, '中校', 10240000, 20480000), + (13, '上校', 20480000, 40960000), + (14, '准将', 40960000, 81920000), + (15, '少将', 81920000, 123840000), + (16, '中将', 123840000, 327680000), + (17, '上将', 327680000, 0); +/*!40000 ALTER TABLE `ts_user_role` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_user_score 结构 +DROP TABLE IF EXISTS `ts_user_score`; +CREATE TABLE IF NOT EXISTS `ts_user_score` ( + `scoreid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增积分ID', + `scorekey` varchar(64) NOT NULL DEFAULT '' COMMENT '积分key', + `scorename` varchar(64) NOT NULL DEFAULT '' COMMENT '积分名称', + `app` char(32) NOT NULL DEFAULT '' COMMENT 'APP', + `action` char(32) NOT NULL DEFAULT '' COMMENT 'ACTION', + `mg` char(32) NOT NULL DEFAULT '' COMMENT 'MG', + `api` char(32) NOT NULL DEFAULT '' COMMENT 'API', + `ts` char(32) NOT NULL DEFAULT '' COMMENT 'TS', + `score` int(11) NOT NULL DEFAULT '0' COMMENT '积分数', + `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0加积分1减积分', + PRIMARY KEY (`scoreid`), + UNIQUE KEY `app_action_mg_api_ts` (`app`,`action`,`mg`,`api`,`ts`) +) ENGINE=MyISAM AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COMMENT='用户积分设置表'; + +-- 正在导出表 d_thinksaas.ts_user_score 的数据:17 rows +DELETE FROM `ts_user_score`; +/*!40000 ALTER TABLE `ts_user_score` DISABLE KEYS */; +INSERT INTO `ts_user_score` (`scoreid`, `scorekey`, `scorename`, `app`, `action`, `mg`, `api`, `ts`, `score`, `status`) VALUES + (1, 'user_register', '用户注册', 'user', 'register', '', '', 'do', 10, 0), + (2, 'user_login', '用户登陆', 'user', 'login', '', '', 'do', 5, 0), + (3, 'topic_add', '发帖', 'topic', 'add', '', '', 'do', 10, 0), + (4, 'pubs_comment', '评论', 'pubs', 'comment', '', '', 'do', 5, 0), + (5, 'attach_upload', '资料上传', 'attach', 'upload', '', '', 'do', 10, 0), + (6, 'user_signin', '用户签到', 'user', 'signin', '', '', '', 5, 0), + (7, 'group_topic_delete', '删除帖子', 'group', 'do', '', '', 'deltopic', 5, 1), + (8, 'article_add', '发布文章', 'article', 'add', '', '', 'do', 5, 0), + (9, 'article_delete', '删除文章', 'article', 'delete', '', '', '', 5, 1), + (11, 'article_admin_post_isaudit0', '后台文章审核通过', 'article', 'admin', 'post', '', 'isaudit0', 5, 0), + (12, 'article_admin_post_isaudit1', '后台文章审核不通过', 'article', 'admin', 'post', '', 'isaudit1', 5, 1), + (13, 'ask_admin_topic_isaudit0', '后台问题审核通过', 'ask', 'admin', 'topic', '', 'isaudit0', 5, 0), + (14, 'ask_admin_topic_isaudit1', '后台问题审核不通过', 'ask', 'admin', 'topic', '', 'isaudit1', 5, 1), + (15, 'ask_new_do', '前台发布问题', 'ask', 'new', '', '', 'do', 5, 0), + (16, 'ask_ajax_ask2commentid', '前台问题采纳', 'ask', 'ajax', '', '', 'ask2commentid', 5, 0), + (17, 'article_admin_post_delete', '后台文章删除', 'article', 'admin', 'post', '', 'delete', 5, 1), + (18, 'user_phone_do', '手机号注册', 'user', 'phone', '', '', 'do', 10, 0); +/*!40000 ALTER TABLE `ts_user_score` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_user_score_log 结构 +DROP TABLE IF EXISTS `ts_user_score_log`; +CREATE TABLE IF NOT EXISTS `ts_user_score_log` ( + `logid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增积分记录ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `scorename` varchar(64) NOT NULL DEFAULT '' COMMENT '积分说明', + `score` int(11) NOT NULL DEFAULT '0' COMMENT '得分', + `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0增加1减少', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '积分时间', + PRIMARY KEY (`logid`), + KEY `userid` (`userid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='用户积分记录'; + +-- 正在导出表 d_thinksaas.ts_user_score_log 的数据:0 rows +DELETE FROM `ts_user_score_log`; +/*!40000 ALTER TABLE `ts_user_score_log` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_user_score_log` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_weibo 结构 +DROP TABLE IF EXISTS `ts_weibo`; +CREATE TABLE IF NOT EXISTS `ts_weibo` ( + `weiboid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增唠叨ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `title` varchar(256) NOT NULL DEFAULT '' COMMENT '一句话内容', + `count_comment` int(11) NOT NULL DEFAULT '0' COMMENT '统计评论数', + `count_view` int(11) NOT NULL DEFAULT '0' COMMENT '统计阅读数', + `count_love` int(11) NOT NULL DEFAULT '0' COMMENT '统计点赞数', + `path` char(32) NOT NULL DEFAULT '' COMMENT '路径', + `photo` char(32) NOT NULL DEFAULT '' COMMENT '图片', + `video` char(32) NOT NULL DEFAULT '' COMMENT '视频', + `audio` char(32) NOT NULL DEFAULT '' COMMENT '音频', + `isaudit` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否审核', + `addtime` datetime NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT '添加时间', + `uptime` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', + PRIMARY KEY (`weiboid`), + KEY `userid` (`userid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='唠叨'; + +-- 正在导出表 d_thinksaas.ts_weibo 的数据:0 rows +DELETE FROM `ts_weibo`; +/*!40000 ALTER TABLE `ts_weibo` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_weibo` ENABLE KEYS */; + +-- 导出 表 d_thinksaas.ts_weibo_photo 结构 +DROP TABLE IF EXISTS `ts_weibo_photo`; +CREATE TABLE IF NOT EXISTS `ts_weibo_photo` ( + `photoid` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', + `userid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', + `weiboid` int(11) NOT NULL DEFAULT '0' COMMENT '微博ID', + `orderid` int(11) NOT NULL DEFAULT '0' COMMENT '排序ID', + `path` varchar(50) NOT NULL DEFAULT '' COMMENT '路径', + `photo` varchar(50) NOT NULL DEFAULT '' COMMENT '图片', + `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', + PRIMARY KEY (`photoid`) USING BTREE, + UNIQUE KEY `photoid` (`photoid`) USING BTREE, + KEY `weiboid` (`weiboid`) USING BTREE, + KEY `userid` (`userid`) USING BTREE +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='微博图片表'; + +-- 正在导出表 d_thinksaas.ts_weibo_photo 的数据:0 rows +DELETE FROM `ts_weibo_photo`; +/*!40000 ALTER TABLE `ts_weibo_photo` DISABLE KEYS */; +/*!40000 ALTER TABLE `ts_weibo_photo` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; +/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */; \ No newline at end of file diff --git a/install/skin/logo.gif b/install/skin/logo.gif new file mode 100644 index 0000000..9d7849e Binary files /dev/null and b/install/skin/logo.gif differ diff --git a/install/skin/style.css b/install/skin/style.css new file mode 100644 index 0000000..6b2b232 --- /dev/null +++ b/install/skin/style.css @@ -0,0 +1,20 @@ +/**框架CSS**/ + +h2{font-size:14px;padding:5px;margin:0px;} +a {color:#336699;text-decoration:none;} +/*头部*/ +.header{background:#3A81C0;width:100%;overflow:hidden;} +.header .head{width:960px;height:60px;margin:0 auto;overflow:hidden;} + +.header .head .logo{float:left;margin:10px 0 0 0;color:#FFFFFF;} + +.header .head .menu{float:right;margin:20px 0 0 0;color:#FFFFFF;} + +/*中部*/ +.midder{width:960px;margin:0 auto;overflow:hidden;} + + +/*底部*/ +.footer{background:#F0F0F0;padding:10px 0;text-align:center;color:#999999;} + +.fs12{font-size: 12px;} \ No newline at end of file diff --git a/plugins/home/article/about.php b/plugins/home/article/about.php new file mode 100644 index 0000000..6e72af2 --- /dev/null +++ b/plugins/home/article/about.php @@ -0,0 +1,14 @@ +'home_index_right', //钩子 + 'name' => '首页最新文章', + 'version' => '1.0', + 'desc' => '首页最新文章', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '0', +); \ No newline at end of file diff --git a/plugins/home/article/article.html b/plugins/home/article/article.html new file mode 100644 index 0000000..f6ecf35 --- /dev/null +++ b/plugins/home/article/article.html @@ -0,0 +1,16 @@ +
      +
      最新文章
      +
      + {if $arrArticle} +
      + +
      + {else} +
      暂无文章
      + {/if} +
      +
      \ No newline at end of file diff --git a/plugins/home/article/article.php b/plugins/home/article/article.php new file mode 100644 index 0000000..55b31a8 --- /dev/null +++ b/plugins/home/article/article.php @@ -0,0 +1,24 @@ +findAll('article',array( + 'isaudit'=>0 + ),'addtime desc','articleid,cateid,userid,title,gaiyao,path,photo,count_view,count_comment,addtime',10); + foreach($arrArticle as $key=>$item){ + $arrArticle[$key]['title'] = tsTitle($item['title']); + $arrArticle[$key]['content'] = tsDecode($item['content']); + $arrArticle[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + if($item['cateid']){ + $arrArticle[$key]['cate'] = aac('article')->find('article_cate',array( + 'cateid'=>$item['cateid'], + )); + } + } + + include template('article','article'); + +} + +addAction('home_index_right','article'); \ No newline at end of file diff --git a/plugins/home/friendlinks/about.php b/plugins/home/friendlinks/about.php new file mode 100644 index 0000000..b33f354 --- /dev/null +++ b/plugins/home/friendlinks/about.php @@ -0,0 +1,14 @@ +'home_index_footer', //钩子 + 'name' => '友链', + 'version' => '1.0', + 'desc' => '友链', + 'url' => 'https://lmve.net', + 'email' => '1337087466@qq.com', + 'author' => '无闻风', + 'author_url' => 'https://lmve.net', + 'isedit' => '0', +); \ No newline at end of file diff --git a/plugins/home/friendlinks/friendlinks.html b/plugins/home/friendlinks/friendlinks.html new file mode 100644 index 0000000..406698b --- /dev/null +++ b/plugins/home/friendlinks/friendlinks.html @@ -0,0 +1,22 @@ +
      +
      友情链接|友链申请|
      + +
      +
      +
        + {loop $friends $key $item} +
      • + {if $item['face']} + {$item['name']} + {else} + {$item['name']} + {/if} + +
      • + {/loop} +
      +
      +
      +
      \ No newline at end of file diff --git a/plugins/home/friendlinks/friendlinks.php b/plugins/home/friendlinks/friendlinks.php new file mode 100644 index 0000000..2b33031 --- /dev/null +++ b/plugins/home/friendlinks/friendlinks.php @@ -0,0 +1,6 @@ +getfriends(20); + include template('friendlinks','friendlinks'); + } +addAction('home_index_footer','friendlinks'); diff --git a/plugins/home/hottopic/about.php b/plugins/home/hottopic/about.php new file mode 100644 index 0000000..2fdfed7 --- /dev/null +++ b/plugins/home/hottopic/about.php @@ -0,0 +1,14 @@ +'home_index_right', //钩子 + 'name' => '首页热门话题', + 'version' => '1.0', + 'desc' => '首页热门话题', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '0', +); \ No newline at end of file diff --git a/plugins/home/hottopic/hottopic.php b/plugins/home/hottopic/hottopic.php new file mode 100644 index 0000000..1930293 --- /dev/null +++ b/plugins/home/hottopic/hottopic.php @@ -0,0 +1,24 @@ +findAll('group_topic',array( + 'isaudit'=>0, + ),'count_comment desc,count_view desc,isrecommend desc,addtime desc','topicid,title',25); + + echo '
      '; + echo '
      推荐话题
      '; + echo '
      '; + echo '
      '; + echo ''; + echo '
      '; + echo '
      '; + echo '
      '; + +} + +addAction('home_index_right','hottopic'); diff --git a/plugins/home/links/about.php b/plugins/home/links/about.php new file mode 100644 index 0000000..89f3ca6 --- /dev/null +++ b/plugins/home/links/about.php @@ -0,0 +1,14 @@ +'home_index_footer', //钩子 + 'name' => '友情连接插件', + 'version' => '1.0', + 'desc' => '开启友情连接插件后,将在首页显示友情链接', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '1', +); \ No newline at end of file diff --git a/plugins/home/links/edit.php b/plugins/home/links/edit.php new file mode 100644 index 0000000..e6ce752 --- /dev/null +++ b/plugins/home/links/edit.php @@ -0,0 +1,39 @@ +get('plugins_home_links'); + } + + include template('edit_set','links'); + break; + + case "do": + $arrLinkName = $_POST['linkname']; + $arrLinkUrl = $_POST['linkurl']; + + foreach($arrLinkName as $key=>$item){ + $linkname = tsTrim($item); + $linkurl = tsTrim($arrLinkUrl[$key]); + if($linkname && $linkurl){ + $arrLink[] = array( + 'linkname' => $linkname, + 'linkurl' => $linkurl, + ); + } + + } + + fileWrite('plugins_home_links.php','data',$arrLink); + $tsMySqlCache->set('plugins_home_links',$arrLink); + + header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=links&in=edit&ts=set'); + break; +} \ No newline at end of file diff --git a/plugins/home/links/edit_set.html b/plugins/home/links/edit_set.html new file mode 100644 index 0000000..723d17b --- /dev/null +++ b/plugins/home/links/edit_set.html @@ -0,0 +1,27 @@ +{php include pubTemplate("header_admin")} + + + + +
      + +{php include pubTemplate("plugin_menu")} + +
      + + +{loop $arrLink $key $item} + +{/loop} + + + +
      链接名字链接URL
      点我增加链接(说明:如需删除某一项,请将要删除的某项清空提交即可。)
      +
      +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/plugins/home/links/links.html b/plugins/home/links/links.html new file mode 100644 index 0000000..5577c3e --- /dev/null +++ b/plugins/home/links/links.html @@ -0,0 +1,10 @@ +
      +
      友情链接
      +
      + {if $arrLink} + {loop $arrLink $key $item} + {$item['linkname']} + {/loop} + {/if} +
      +
      \ No newline at end of file diff --git a/plugins/home/links/links.php b/plugins/home/links/links.php new file mode 100644 index 0000000..bb0b57f --- /dev/null +++ b/plugins/home/links/links.php @@ -0,0 +1,16 @@ +get('plugins_home_links'); + } + + include template('links','links'); + +} + +addAction('home_index_footer','links'); \ No newline at end of file diff --git a/plugins/home/login/about.php b/plugins/home/login/about.php new file mode 100644 index 0000000..c519a16 --- /dev/null +++ b/plugins/home/login/about.php @@ -0,0 +1,14 @@ +'home_index_right', //钩子 + 'name' => '首页登录框', + 'version' => '1.0', + 'desc' => '首页登录框', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '0', +); \ No newline at end of file diff --git a/plugins/home/login/login.html b/plugins/home/login/login.html new file mode 100644 index 0000000..45a8901 --- /dev/null +++ b/plugins/home/login/login.html @@ -0,0 +1,186 @@ +{if $TS_USER['userid']} + +
      +
      +
      +
      +{$strUser[username]} +
      + +
      +{$strUser[username]} + +
      + +
      + + + +
      + +
      + +{if $strUser['isverify']==1}通过Email认证{else}未通过Email认证{/if} + + {if $strUser['isrenzheng']==1} + 通过人工认证 + {else} + 未通过人工认证 + {/if} + +
      +角色:{$strUser['rolename']} 积分:{$strUser['count_score']} + +
      +
      + + + +
      +
      + + +{else} + +
      +
      + +
      +
      + + + + + + + + + + + + + + + + +{/if} \ No newline at end of file diff --git a/plugins/home/login/login.php b/plugins/home/login/login.php new file mode 100644 index 0000000..d95e500 --- /dev/null +++ b/plugins/home/login/login.php @@ -0,0 +1,22 @@ +getOneUser($TS_USER['userid']); + $strUser['rolename'] = aac('user')->getRole($strUser['count_score']); + } + + include template('login','login'); +} + +function login_css(){ + + echo ''; + +} + +addAction('home_index_right','login'); +addAction('pub_header_top','login_css'); \ No newline at end of file diff --git a/plugins/home/login/style.css b/plugins/home/login/style.css new file mode 100644 index 0000000..10616f9 --- /dev/null +++ b/plugins/home/login/style.css @@ -0,0 +1,47 @@ +.login { + overflow: hidden; +} + +legend { + display: none; +} +fieldset { + border: 0 none; + margin: 0; + padding: 0; + margin-bottom: 0px; +} +fieldset legend { + color: #666666; + padding: 0 5px; +} +.login .item { + margin-bottom: 10px; +} +.item label { + width: 4em; +} +label { + font-family: Tahoma; + vertical-align: middle; +} +.item input { + width: 80%; + height:30px; + line-height:30px; + font-size:14px; +} +.login .item a { + font-size: 12px; +} +.login .item1 { + color: #666666; + float: left; + font-size: 12px; + margin: 0 2px 0px 0; +} +.login .item1 label { + display: inline-block; + margin-left: 4.5em; + margin-top: 4px; +} \ No newline at end of file diff --git a/plugins/home/newgroup/about.php b/plugins/home/newgroup/about.php new file mode 100644 index 0000000..1afc00b --- /dev/null +++ b/plugins/home/newgroup/about.php @@ -0,0 +1,14 @@ +'home_index_right', //钩子 + 'name' => '最新创建小组', + 'version' => '1.0', + 'desc' => '最新创建小组', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '0', +); \ No newline at end of file diff --git a/plugins/home/newgroup/newgroup.html b/plugins/home/newgroup/newgroup.html new file mode 100644 index 0000000..98a830f --- /dev/null +++ b/plugins/home/newgroup/newgroup.html @@ -0,0 +1,20 @@ +
      +
      最新创建小组
      +
      + + {if $arrNewGroup} +
      + +
      + {else} + +
      暂无小组
      + + {/if} + +
      +
      \ No newline at end of file diff --git a/plugins/home/newgroup/newgroup.php b/plugins/home/newgroup/newgroup.php new file mode 100644 index 0000000..0cc622b --- /dev/null +++ b/plugins/home/newgroup/newgroup.php @@ -0,0 +1,13 @@ +findAll('group',array( + 'isaudit'=>0, + ),'addtime desc','groupid,groupname',10); + + include template('newgroup','newgroup'); + +} + +addAction('home_index_right','newgroup'); \ No newline at end of file diff --git a/plugins/home/newtopic/about.php b/plugins/home/newtopic/about.php new file mode 100644 index 0000000..811976d --- /dev/null +++ b/plugins/home/newtopic/about.php @@ -0,0 +1,14 @@ +'home_index_left', //钩子 + 'name' => '最新帖子列表', + 'version' => '1.0', + 'desc' => '最新帖子列表', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '0', +); \ No newline at end of file diff --git a/plugins/home/newtopic/newtopic.html b/plugins/home/newtopic/newtopic.html new file mode 100644 index 0000000..64764de --- /dev/null +++ b/plugins/home/newtopic/newtopic.html @@ -0,0 +1,56 @@ +
      +
      最新话题
      + +
      +
      +
      {$pageUrl}
      +
        +{loop $arrTopic $key $item} +
      • +
        {$item['user']['username']}
        + +
        +
        + + {if $item['label']}{tsTitle($item['label'])}{/if} + + {$item[title]} +
        + +
        +
        {$item['count_comment']}
        +
        {$item['count_view']}
        +
        + +
        + {$item['gaiyao']} +
        + {if $item['photos']} +
        + {loop $item['photos'] $pkey $pitem} + + {/loop} +
        + {/if} +
        + +[{$item[group][groupname]}] + + + +{php echo getTime($item[uptime],time())} + {$item[user][username]} + +
        + +
        + +
        +
      • +{/loop} +
      +
      {$pageUrl}
      +
      +
      + +
      \ No newline at end of file diff --git a/plugins/home/newtopic/newtopic.php b/plugins/home/newtopic/newtopic.php new file mode 100644 index 0000000..7079814 --- /dev/null +++ b/plugins/home/newtopic/newtopic.php @@ -0,0 +1,35 @@ +findCount('group_topic'); + $pageUrl = pagination($topicNum, 20, $page, $url); + $arrTopic = aac('group')->findAll('group_topic',array( + 'isaudit'=>0, + ),'addtime desc','topicid,userid,groupid,title,gaiyao,label,count_comment,count_view,uptime',$lstart.',20'); + + foreach($arrTopic as $key=>$item){ + $arrTopic[$key]['title']=tsTitle($item['title']); + $arrTopic[$key]['gaiyao']=tsTitle($item['gaiyao']); + $arrTopic[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + $arrTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']); + $arrTopic[$key]['photos'] = aac('group')->getTopicPhoto($item['topicid'],3); + } + + include template('newtopic','newtopic'); + +} + +function newtopic_css(){ + + echo ''; + +} + +addAction('home_index_left','newtopic'); +addAction('pub_header_top','newtopic_css'); diff --git a/plugins/home/newtopic/style.css b/plugins/home/newtopic/style.css new file mode 100644 index 0000000..0149b88 --- /dev/null +++ b/plugins/home/newtopic/style.css @@ -0,0 +1,34 @@ +/*帖子列表*/ +.topic_list{overflow:hidden;} +.topic_list ul, .topic_list ul li{list-style: none;margin:0;padding:0;} +.topic_list ul{overflow:hidden;} +.topic_list ul li{overflow:hidden;padding:15px 0;display: block;border-bottom: 1px dashed #999999;} + +.topic_list ul li .other{background: none repeat scroll 0 0 #F8F8F8; + border-left: 3px solid #EEEEEE; + margin-left: 38px; + margin-top: 5px; + padding: 5px;} +.topic_list ul li .other p{margin:0px;padding:5px 0;} + +.topic_list .userimg{float:left;width:38px;overflow:hidden;} + +.topic_list .topic_title{margin-left:40px;overflow:hidden;} + +.topic_list .topic_title .title a{color:#343434;font-size:14px;} + +.topic_list .topic_title .gaiyao{color:#999999;} + +.topic_list .topic_title .photo{} +.topic_list .topic_title .photo img{max-width: 25%;margin-right: 10px;} + +.topic_list .topic_info{overflow: hidden;font-size:12px;color:#999999;} + +.rank { + background: none repeat scroll 0 0 #BBBBBB; + height: 15px; + line-height: 15px; + margin: 0 0 0 5px; + padding: 0 3px; + border-radius:5px 5px 5px 5px; +} \ No newline at end of file diff --git a/plugins/home/photo/about.php b/plugins/home/photo/about.php new file mode 100644 index 0000000..4b36698 --- /dev/null +++ b/plugins/home/photo/about.php @@ -0,0 +1,14 @@ +'home_index_footer', //钩子 + 'name' => '相册插件', + 'version' => '1.0', + 'desc' => '相册插件', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '0', +); \ No newline at end of file diff --git a/plugins/home/photo/photo.html b/plugins/home/photo/photo.html new file mode 100644 index 0000000..e0464ca --- /dev/null +++ b/plugins/home/photo/photo.html @@ -0,0 +1,32 @@ +
      +
      推荐相册 +更多 +
      +
      + + +{if $arrAlbum} +
      +
      + {loop $arrAlbum $key $item} +
      + + {$item['albumname']} + + +
      {$item['count_photo']} 张图片
      +
      + {/loop} +
      +
      + +{else} + +
      暂无推荐相册
      + +{/if} + + + +
      +
      \ No newline at end of file diff --git a/plugins/home/photo/photo.php b/plugins/home/photo/photo.php new file mode 100644 index 0000000..7f6e091 --- /dev/null +++ b/plugins/home/photo/photo.php @@ -0,0 +1,24 @@ +findAll('photo_album',array( + 'isrecommend'=>1, + ),'addtime desc',null,12); + foreach($arrAlbum as $key=>$item){ + $arrAlbum[$key]['albumname']=tsTitle($item['albumname']); + } + + include template('photo','photo'); + +} + +function photo_css(){ + + echo ''; + +} + +addAction('home_index_footer','photo'); +addAction('pub_header_top','photo_css'); \ No newline at end of file diff --git a/plugins/home/photo/style.css b/plugins/home/photo/style.css new file mode 100644 index 0000000..e4d3722 --- /dev/null +++ b/plugins/home/photo/style.css @@ -0,0 +1,5 @@ +.photoalbumlist{} +.photoalbumlist ul{} +.photoalbumlist ul li{float:left;border:solid 1px #DDDDDD;margin:0 7px 7px 7px;height:220px;} +.photoalbumlist ul li .info{padding:5px;} +.photoalbumlist ul li .info p{color:#999999;margin:0px;} \ No newline at end of file diff --git a/plugins/home/recommendarticle/about.php b/plugins/home/recommendarticle/about.php new file mode 100644 index 0000000..dd6790c --- /dev/null +++ b/plugins/home/recommendarticle/about.php @@ -0,0 +1,14 @@ +'home_index_left', //钩子 + 'name' => '首页推荐文章', + 'version' => '1.0', + 'desc' => '首页推荐文章', + 'url' => 'https://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'https://www.thinksaas.cn', + 'isedit' => '1', +); \ No newline at end of file diff --git a/plugins/home/recommendarticle/edit.php b/plugins/home/recommendarticle/edit.php new file mode 100644 index 0000000..44be874 --- /dev/null +++ b/plugins/home/recommendarticle/edit.php @@ -0,0 +1,30 @@ +get('plugins_home_recommendarticle'); + } + + include template('edit_set','recommendarticle'); + break; + + case "do": + $isrecommend = intval($_POST['isrecommend']); + + $strData = array( + 'isrecommend'=>$isrecommend, + ); + + fileWrite('plugins_home_recommendarticle.php','data',$strData); + $tsMySqlCache->set('plugins_home_recommendarticle',$strData); + + header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=recommendarticle&in=edit&ts=set'); + break; +} \ No newline at end of file diff --git a/plugins/home/recommendarticle/edit_set.html b/plugins/home/recommendarticle/edit_set.html new file mode 100644 index 0000000..cc89b19 --- /dev/null +++ b/plugins/home/recommendarticle/edit_set.html @@ -0,0 +1,24 @@ +{php include pubTemplate("header_admin")} + + +
      + +{php include pubTemplate("plugin_menu")} + +
      + + + + + + +
      内容获取方式: + + 最新内容 + 推荐内容 + +
      +
      +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/plugins/home/recommendarticle/recommendarticle.html b/plugins/home/recommendarticle/recommendarticle.html new file mode 100644 index 0000000..4931fec --- /dev/null +++ b/plugins/home/recommendarticle/recommendarticle.html @@ -0,0 +1,104 @@ +
      +
      推荐文章
      +
      + + {if $arrArticle} +{loop $arrArticle $key $item} + {if $item['photo']} +
      + +
      + + + +
      +
      + +
      + {$item['title']} + {if $item['istop']=='1'} + [置顶] + {/if} +
      + +
      {$item['user']['username']} 发表于 {$item['addtime']}
      + +
      {if $item['gaiyao']}{tsTitle($item['gaiyao'])}{else}暂无概要{/if} (查看全文)
      + + + + + +
      + + +
      + + {$item['count_view']} + {$item['count_comment']} + + +
      + +
      + + + + + + + +
      + +
      + + + {else} + +
      + {$item['title']} + {if $item['istop']=='1'} + [置顶] + {/if} +
      + +
      {$item['user']['username']} 发表于 {$item['addtime']}
      + + {if $item['score']==0} +
      {if $item['gaiyao']}{$item['gaiyao']}{else}暂无概要{/if} (查看全文)
      + {/if} + + + + +
      + + +
      + + {$item['count_view']} + {$item['count_comment']} +
      + +
      + + + + {/if} + + + +{/loop} + +{else} + +
      暂无推荐文章
      + +{/if} + +
      +
      \ No newline at end of file diff --git a/plugins/home/recommendarticle/recommendarticle.php b/plugins/home/recommendarticle/recommendarticle.php new file mode 100644 index 0000000..3a15a00 --- /dev/null +++ b/plugins/home/recommendarticle/recommendarticle.php @@ -0,0 +1,44 @@ +get('plugins_home_recommendarticle'); + } + + if($strData['isrecommend']==1){ + $where = array( + 'isrecommend'=>1, + 'isaudit'=>0 + ); + }else{ + $where = array( + 'isaudit'=>0 + ); + } + + $arrArticle = aac('article')->findAll('article',$where,'istop desc,addtime desc','articleid,cateid,userid,title,gaiyao,path,photo,count_view,count_comment,istop,addtime,uptime',10); + foreach($arrArticle as $key=>$item){ + $arrArticle[$key]['title'] = tsTitle($item['title']); + $arrArticle[$key]['gaiyao'] = tsTitle($item['gaiyao']); + $arrArticle[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + if($item['cateid']){ + $arrArticle[$key]['cate'] = aac('article')->find('article_cate',array( + 'cateid'=>$item['cateid'], + )); + } + + #封面图 + if($item['photo']){ + $arrArticle[$key]['photo_url'] = aac('article')->getArticlePhoto($item); + } + + } + + include template('recommendarticle','recommendarticle'); + +} + +addAction('home_index_left','recommendarticle'); \ No newline at end of file diff --git a/plugins/home/recommendgroup/about.php b/plugins/home/recommendgroup/about.php new file mode 100644 index 0000000..73fece1 --- /dev/null +++ b/plugins/home/recommendgroup/about.php @@ -0,0 +1,13 @@ +'home_index_left', //钩子 + 'name' => '推荐小组', + 'version' => '1.0', + 'desc' => '推荐小组', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '0', +); \ No newline at end of file diff --git a/plugins/home/recommendgroup/recommendgroup.html b/plugins/home/recommendgroup/recommendgroup.html new file mode 100644 index 0000000..e23e050 --- /dev/null +++ b/plugins/home/recommendgroup/recommendgroup.html @@ -0,0 +1,28 @@ +
      +
      推荐小组
      +
      + {if $arrRecommendGroup} +
      + {loop $arrRecommendGroup $key $item} +
      +
      +
      + + {$item['groupname']} + +
      +
      + {$item['groupname']} {$item['count_user']} 成员 +
      {php echo cututf8(t($item['groupdesc']),0,43,false)}
      +
      +
      +
      + {/loop} +
      + {else} + +
      暂无推荐小组
      + + {/if} +
      +
      \ No newline at end of file diff --git a/plugins/home/recommendgroup/recommendgroup.php b/plugins/home/recommendgroup/recommendgroup.php new file mode 100644 index 0000000..620ed14 --- /dev/null +++ b/plugins/home/recommendgroup/recommendgroup.php @@ -0,0 +1,12 @@ +getRecommendGroup('12'); + include template('recommendgroup','recommendgroup'); +} +function recommendgroup_css(){ + echo ''; +} +addAction('home_index_left','recommendgroup'); +addAction('pub_header_top','recommendgroup_css'); \ No newline at end of file diff --git a/plugins/home/recommendgroup/style.css b/plugins/home/recommendgroup/style.css new file mode 100644 index 0000000..e54b620 --- /dev/null +++ b/plugins/home/recommendgroup/style.css @@ -0,0 +1,26 @@ +.sub-item{ + border-bottom: 1px dashed #AAAAAA; + height: 72px; + margin: 0 2px 15px 0; + overflow: hidden; +} +.sub-item .pic { + float: left; + width: 48px; +} +.sub-item .info { + color: #666666; + vertical-align: top; + word-wrap: break-word; + margin-left:60px; +} +.sub-item .pic img { + height: 48px; + margin-bottom: -3px; + width: 48px; +} +.sub-item .info .content{font-size:12px;} + +.sub-item p { + margin: 0; +} \ No newline at end of file diff --git a/plugins/home/recommendtopic/about.php b/plugins/home/recommendtopic/about.php new file mode 100644 index 0000000..c8c15b5 --- /dev/null +++ b/plugins/home/recommendtopic/about.php @@ -0,0 +1,14 @@ +'home_index_left', //钩子 + 'name' => '推荐话题列表', + 'version' => '1.0', + 'desc' => '推荐话题列表', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '1', +); \ No newline at end of file diff --git a/plugins/home/recommendtopic/edit.php b/plugins/home/recommendtopic/edit.php new file mode 100644 index 0000000..dd9d6ca --- /dev/null +++ b/plugins/home/recommendtopic/edit.php @@ -0,0 +1,30 @@ +get('plugins_home_recommendtopic'); + } + + include template('edit_set','recommendtopic'); + break; + + case "do": + $isrecommend = intval($_POST['isrecommend']); + + $strData = array( + 'isrecommend'=>$isrecommend, + ); + + fileWrite('plugins_home_recommendtopic.php','data',$strData); + $tsMySqlCache->set('plugins_home_recommendtopic',$strData); + + header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=recommendtopic&in=edit&ts=set'); + break; +} \ No newline at end of file diff --git a/plugins/home/recommendtopic/edit_set.html b/plugins/home/recommendtopic/edit_set.html new file mode 100644 index 0000000..e053671 --- /dev/null +++ b/plugins/home/recommendtopic/edit_set.html @@ -0,0 +1,24 @@ +{php include pubTemplate("header_admin")} + + +
      + +{php include pubTemplate("plugin_menu")} + +
      + + + + + + +
      内容获取方式: + + 最新内容 + 推荐内容 + +
      +
      +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/plugins/home/recommendtopic/recommendtopic.html b/plugins/home/recommendtopic/recommendtopic.html new file mode 100644 index 0000000..759f237 --- /dev/null +++ b/plugins/home/recommendtopic/recommendtopic.html @@ -0,0 +1,86 @@ +
      +
      推荐话题
      + +
      + +{if $arrTopic} + +
      +
        +{loop $arrTopic $key $item} +
      • +
        {$item['user']['username']}
        + +
        +
        + + {if $item['label']}{tsTitle($item['label'])}{/if} + + {$item[title]} + + {if $item['istop']=='1'} + [置顶] + {/if} + +
        + +{if $item['group']['isopen']==0 && $item['score']==0 && $item['iscommentshow']==0} +
        + {$item['gaiyao']} +
        + + + {if $item['ptable']=='' && $item['pjson']} +
        + {loop $item['pjson'] $pkey $pitem} + + {/loop} +
        + {/if} + + + {if $item['ptable']=='video' && $item['pjson']['siteid']==0} +
        + {if $item['pjson']['photo']} + + {else} + + {/if} +
        + {/if} + +{/if} + + +
        +
        + {$item['user']['username']} + {php echo getTime($item['uptime'],time())} + 发表于 + [{$item['group']['groupname']}] +
        +
        +
        {$item['count_comment']}
        +
        {$item['count_view']}
        +
        +
        + + + +
        + +
        +
      • +{/loop} +
      +
      + +{else} + +
      暂无推荐话题
      + +{/if} + +
      + +
      \ No newline at end of file diff --git a/plugins/home/recommendtopic/recommendtopic.php b/plugins/home/recommendtopic/recommendtopic.php new file mode 100644 index 0000000..1b0b513 --- /dev/null +++ b/plugins/home/recommendtopic/recommendtopic.php @@ -0,0 +1,47 @@ +get('plugins_home_recommendtopic'); + } + + if($strData['isrecommend']==1){ + $where = array( + 'isrecommend'=>1, + 'isaudit'=>0 + ); + }else{ + $where = array( + 'isaudit'=>0 + ); + } + + //推荐帖子 + $arrTopic = aac('group')->findAll('topic',$where,'istop desc,uptime desc','topicid,ptable,pkey,pid,pjson,userid,groupid,title,gaiyao,score,label,count_comment,count_view,iscommentshow,istop,uptime',35); + + foreach($arrTopic as $key=>$item){ + $arrTopic[$key]['title']=tsTitle($item['title']); + $arrTopic[$key]['gaiyao']=tsTitle($item['gaiyao']); + $arrTopic[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + $arrTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']); + #应用扩展 + if($item['pjson']){ + $arrTopic[$key]['pjson'] = json_decode($item['pjson'],true); + } + } + + include template('recommendtopic','recommendtopic'); + +} + +function recommendtopic_css(){ + + echo ''; + +} + +addAction('home_index_left','recommendtopic'); +addAction('pub_header_top','recommendtopic_css'); \ No newline at end of file diff --git a/plugins/home/recommendtopic/style.css b/plugins/home/recommendtopic/style.css new file mode 100644 index 0000000..540faec --- /dev/null +++ b/plugins/home/recommendtopic/style.css @@ -0,0 +1,34 @@ +/*帖子列表*/ +.topic_list{overflow:hidden;} +.topic_list ul, .topic_list ul li{list-style: none;margin:0;padding:0;} +.topic_list ul{overflow:hidden;} +.topic_list ul li{overflow:hidden;padding:15px 0;display: block;border-bottom: 1px dashed #999999;} + +.topic_list ul li .other{background: none repeat scroll 0 0 #F8F8F8; + border-left: 3px solid #EEEEEE; + margin-left: 38px; + margin-top: 5px; + padding: 5px;} +.topic_list ul li .other p{margin:0px;padding:5px 0;} + +.topic_list .userimg{float:left;width:38px;overflow:hidden;} + +.topic_list .topic_title{margin-left:40px;overflow:hidden;} + +.topic_list .topic_title .title a{font-size:18px;font-weight: bold;} + +.topic_list .topic_title .gaiyao{color:#999999;} + +.topic_list .topic_title .photo{} +.topic_list .topic_title .photo img{max-width: 25%;margin-right: 10px;} + +.topic_list .topic_info{overflow: hidden;font-size:12px;color:#999999;} + +.rank { + background: none repeat scroll 0 0 #BBBBBB; + height: 15px; + line-height: 15px; + margin: 0 0 0 5px; + padding: 0 3px; + border-radius:5px 5px 5px 5px; +} \ No newline at end of file diff --git a/plugins/home/signuser/about.php b/plugins/home/signuser/about.php new file mode 100644 index 0000000..3942f17 --- /dev/null +++ b/plugins/home/signuser/about.php @@ -0,0 +1,14 @@ +'home_index_left', //钩子 + 'name' => '最新签到用户', + 'version' => '1.0', + 'desc' => '看看哪些用户来了哦', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '0', +); \ No newline at end of file diff --git a/plugins/home/signuser/signuser.html b/plugins/home/signuser/signuser.html new file mode 100644 index 0000000..d94649c --- /dev/null +++ b/plugins/home/signuser/signuser.html @@ -0,0 +1,17 @@ +
      +
      最新签到用户
      +
      +
      + +
      +
      +
      \ No newline at end of file diff --git a/plugins/home/signuser/signuser.php b/plugins/home/signuser/signuser.php new file mode 100644 index 0000000..e83a874 --- /dev/null +++ b/plugins/home/signuser/signuser.php @@ -0,0 +1,9 @@ +getHotUser(20); + include template('signuser','signuser'); +} + +addAction('home_index_left','signuser'); \ No newline at end of file diff --git a/plugins/home/slide/about.php b/plugins/home/slide/about.php new file mode 100644 index 0000000..3b44161 --- /dev/null +++ b/plugins/home/slide/about.php @@ -0,0 +1,14 @@ +'home_index_header', //钩子 + 'name' => '首页幻灯片', + 'version' => '1.0', + 'desc' => '首页幻灯片', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '1', +); \ No newline at end of file diff --git a/plugins/home/slide/edit.php b/plugins/home/slide/edit.php new file mode 100644 index 0000000..21f4ddb --- /dev/null +++ b/plugins/home/slide/edit.php @@ -0,0 +1,126 @@ +findAll('slide',null,'slideid asc'); + + foreach($arrSlide as $key=>$item){ + if($GLOBALS['TS_SITE']['file_upload_type']==1){ + $arrSlide[$key]['photo_url'] = $GLOBALS['TS_SITE']['alioss_bucket_url'].'/uploadfile/slide/'.$item['photo'].'?v='.$item['addtime']; + }else{ + $arrSlide[$key]['photo_url'] = SITE_URL.'uploadfile/slide/'.$item['photo'].'?v='.$item['addtime']; + } + } + + include template('edit_set','slide'); + break; + + case "do": + + + $typeid = intval($_POST['typeid']); + $title = tsTrim($_POST['title']); + $info = tsTrim($_POST['info']); + $url = tsTrim($_POST['url']); + + $slideid = $new[$app]->create('slide',array( + 'typeid'=>$typeid, + 'title'=>$title, + 'info'=>$info, + 'url'=>$url, + 'addtime'=>time(), + )); + + + //上传 + $arrUpload = tsUpload($_FILES['photo'],$slideid,'slide',array('jpg','gif','png','jpeg')); + + if($arrUpload){ + + $new[$app]->update('slide',array( + 'slideid'=>$slideid, + ),array( + 'path'=>$arrUpload['path'], + 'photo'=>$arrUpload['url'], + )); + } + + header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=slide&in=edit&ts=set'); + break; + + case "edit": + + $slideid = intval($_GET['slideid']); + + $strSlide = $new[$app]->find('slide',array( + 'slideid'=>$slideid, + )); + + + include template('edit_edit','slide'); + break; + + case "editdo": + + $slideid = intval($_POST['slideid']); + $typeid = intval($_POST['typeid']); + $title = tsTrim($_POST['title']); + $info = tsTrim($_POST['info']); + $url = tsTrim($_POST['url']); + + $new[$app]->update('slide',array( + 'slideid'=>$slideid, + ),array( + 'typeid'=>$typeid, + 'title'=>$title, + 'info'=>$info, + 'url'=>$url, + )); + + + //上传 + $arrUpload = tsUpload($_FILES['photo'],$slideid,'slide',array('jpg','gif','png','jpeg')); + + if($arrUpload){ + + $new[$app]->update('slide',array( + 'slideid'=>$slideid, + ),array( + 'path'=>$arrUpload['path'], + 'photo'=>$arrUpload['url'], + 'addtime'=>time(), + )); + + tsDimg($arrUpload['url'],'slide','748','210',$arrUpload['path']); + + } + + header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=slide&in=edit&ts=set'); + + break; + + case "delete": + + $slideid = intval($_GET['slideid']); + + $strSlide = $new[$app]->find('slide',array( + 'slideid'=>$slideid, + )); + + unlink('uploadfile/slide/'.$strSlide['photo']); + + $new[$app]->delete('slide',array( + 'slideid'=>$slideid, + )); + + header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=slide&in=edit&ts=set'); + + break; +} \ No newline at end of file diff --git a/plugins/home/slide/edit_edit.html b/plugins/home/slide/edit_edit.html new file mode 100644 index 0000000..3645378 --- /dev/null +++ b/plugins/home/slide/edit_edit.html @@ -0,0 +1,57 @@ +{php include pubTemplate("header_admin")} + +
      + + +{include pubTemplate("plugin_menu")} + +
      + + +
      + + + + + + + + + + + + + + + +
      类型: + + + +
      标题:
      内容:
      URL:
      图片: + +{if $strSlide['photo']} + +
      +{/if} + +
      + + +
      + + + + + +
      +
      + + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/plugins/home/slide/edit_set.html b/plugins/home/slide/edit_set.html new file mode 100644 index 0000000..693350c --- /dev/null +++ b/plugins/home/slide/edit_set.html @@ -0,0 +1,63 @@ +{php include pubTemplate("header_admin")} + +
      + + +{php include pubTemplate("plugin_menu")} + +
      +
      + + + + + + + + + +
      类型: + + + +
      标题:
      内容:
      URL:
      图片:
      +(PC端图1110*300;手机端图640*320)
      +
      +
      + + + + + + + + + + + {loop $arrSlide $key $item} + + + + + + + + + {/loop} + + + +
      ID类型标题URL图片操作
      {$item['slideid']}{$item['typeid']}{$item['title']}{$item['url']} + + 修改 + + + 删除
      + +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/plugins/home/slide/slide.html b/plugins/home/slide/slide.html new file mode 100644 index 0000000..09fbcfe --- /dev/null +++ b/plugins/home/slide/slide.html @@ -0,0 +1,34 @@ + + \ No newline at end of file diff --git a/plugins/home/slide/slide.php b/plugins/home/slide/slide.php new file mode 100644 index 0000000..e776a98 --- /dev/null +++ b/plugins/home/slide/slide.php @@ -0,0 +1,21 @@ +findAll('slide',array( + 'typeid'=>0, + ),'addtime desc'); + + foreach($arrSlide as $key=>$item){ + if($GLOBALS['TS_SITE']['file_upload_type']==1){ + $arrSlide[$key]['photo_url'] = $GLOBALS['TS_SITE']['alioss_bucket_url'].'/uploadfile/slide/'.$item['photo'].'?v='.$item['addtime']; + }else{ + $arrSlide[$key]['photo_url'] = SITE_URL.'uploadfile/slide/'.$item['photo'].'?v='.$item['addtime']; + } + } + + include template('slide','slide'); +} + +addAction('home_index_header','slide'); \ No newline at end of file diff --git a/plugins/home/tag/about.php b/plugins/home/tag/about.php new file mode 100644 index 0000000..83e4b86 --- /dev/null +++ b/plugins/home/tag/about.php @@ -0,0 +1,14 @@ +'home_index_left', //钩子 + 'name' => '社区标签', + 'version' => '1.0', + 'desc' => '社区标签', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '1', +); \ No newline at end of file diff --git a/plugins/home/tag/edit.php b/plugins/home/tag/edit.php new file mode 100644 index 0000000..ca9b3ee --- /dev/null +++ b/plugins/home/tag/edit.php @@ -0,0 +1,25 @@ +get('plugins_home_tag'); + } + + include template('edit_set','tag'); + break; + + case "do": + $tag = tsTrim($_POST['tag']); + fileWrite('plugins_home_tag.php','data',$tag); + $tsMySqlCache->set('plugins_home_tag',$tag); + + header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=tag&in=edit&ts=set'); + break; +} \ No newline at end of file diff --git a/plugins/home/tag/edit_set.html b/plugins/home/tag/edit_set.html new file mode 100644 index 0000000..1b45409 --- /dev/null +++ b/plugins/home/tag/edit_set.html @@ -0,0 +1,23 @@ +{php include pubTemplate("header_admin")} + +
      + +{php include pubTemplate("plugin_menu")} + +
      + + + + + + +
      调用(仅支持调用一种内容的标签): + + 帖子 + 文章 + +
      +
      +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/plugins/home/tag/tag.html b/plugins/home/tag/tag.html new file mode 100644 index 0000000..410217f --- /dev/null +++ b/plugins/home/tag/tag.html @@ -0,0 +1,30 @@ +
      +
      热门标签 + {if $tag=='topic'} + 更多 + {elseif $tag=='article'} + 更多 + {/if} + +
      +
      + + {if $arrTag} + + {loop $arrTag $key $item} + {if $tag=='topic'} + {$item['tagname']} + {elseif $tag=='article'} + {$item['tagname']} + {/if} + + {/loop} + + {else} + +
      暂无推荐标签
      + + {/if} + +
      +
      \ No newline at end of file diff --git a/plugins/home/tag/tag.php b/plugins/home/tag/tag.php new file mode 100644 index 0000000..41e9a94 --- /dev/null +++ b/plugins/home/tag/tag.php @@ -0,0 +1,29 @@ +get('plugins_home_tag'); + if($tag == '') $tag='topic'; + } + + if($tag=='topic'){ + $where = "`count_topic`>'0' and `isaudit`=0"; + }elseif($tag=='article'){ + $where = "`count_article`>'0' and `isaudit`=0"; + } + + //最新标签 + $arrTag = aac('tag')->findAll('tag',$where,'uptime desc',null,30); + + foreach($arrTag as $key=>$item){ + $arrTag[$key]['tagname'] = tsTitle($item['tagname']); + } + + include template('tag','tag'); + +} + +addAction('home_index_left','tag'); \ No newline at end of file diff --git a/plugins/home/topic/about.php b/plugins/home/topic/about.php new file mode 100644 index 0000000..f0c97e7 --- /dev/null +++ b/plugins/home/topic/about.php @@ -0,0 +1,14 @@ +'home_index_right', //钩子 + 'name' => '最新话题', + 'version' => '1.0', + 'desc' => '首页最新话题', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '0', +); \ No newline at end of file diff --git a/plugins/home/topic/topic.html b/plugins/home/topic/topic.html new file mode 100644 index 0000000..186a6c8 --- /dev/null +++ b/plugins/home/topic/topic.html @@ -0,0 +1,16 @@ +
      +
      最新话题
      +
      + {if $arrTopic} +
      + +
      + {else} +
      暂无话题
      + {/if} +
      +
      \ No newline at end of file diff --git a/plugins/home/topic/topic.php b/plugins/home/topic/topic.php new file mode 100644 index 0000000..5908371 --- /dev/null +++ b/plugins/home/topic/topic.php @@ -0,0 +1,13 @@ +findAll('topic',array( + 'isaudit'=>0, + ),'addtime desc','topicid,title',10); + + include template('topic','topic'); + +} + +addAction('home_index_right','topic'); \ No newline at end of file diff --git a/plugins/home/weibo/about.php b/plugins/home/weibo/about.php new file mode 100644 index 0000000..3c31195 --- /dev/null +++ b/plugins/home/weibo/about.php @@ -0,0 +1,14 @@ +'home_index_right', //钩子 + 'name' => '微博说', + 'version' => '1.0', + 'desc' => '微博说', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '0', +); \ No newline at end of file diff --git a/plugins/home/weibo/style.css b/plugins/home/weibo/style.css new file mode 100644 index 0000000..a6a4815 --- /dev/null +++ b/plugins/home/weibo/style.css @@ -0,0 +1,76 @@ +.weiform{} +.weiform form { + background: none repeat scroll 0 0 #0099FF; + border: 1px solid #0099FF; + margin: 0 0 10px; + height:36px; + width:100%; + position: relative; + overflow:hidden; + border-radius: 0px; +} +.weiform textarea { + background: none repeat scroll 0 0 #FFFFFF; + border: 0 none; + float: left; + font-size: 9pt; + height: 36px; + overflow: auto; + padding: 2px; + resize: none; + width: 80%; +} +.weiform input { + background: none repeat scroll 0 0 #0099FF; + border: 0 none; + color: #FFFFFF; + float: right; + font-size: 10pt; + height: 36px; + width: 20%; + cursor: pointer; +} + +.weilist{} + +.weilist ul, .weilist ul li{list-style: none;margin:0;padding:0;} + +.weilist ul li { + border-bottom: 1px dashed #DDDDDD; + margin: 0 0 5px; + padding: 0 0 8px; + display: flex; +} +.weilist ul li .portrait { + + padding-top: 3px; + width: 45px; +} +.weilist ul li .portrait img { + background: none repeat scroll 0 0 #FFFFFF; + height: 32px; + padding: 1px; + width: 32px; +} +.weilist ul li .body { + flex:1; + font-size: 9pt; + overflow: hidden; +} +.weilist ul li .user a { + +} + +.weilist ul li .log { + color: #999; + word-break: break-all; +} +.weilist ul li .time { + color: #9A9A9A; + display: block; + margin: 5px 0 0; +} +.weilist ul li .time a { + color: #9A9A9A; + text-decoration: none; +} \ No newline at end of file diff --git a/plugins/home/weibo/weibo.html b/plugins/home/weibo/weibo.html new file mode 100644 index 0000000..90f6abc --- /dev/null +++ b/plugins/home/weibo/weibo.html @@ -0,0 +1,48 @@ +
      +
      唠唠叨叨
      +
      +
      + + + + +
      +
      +
        + {loop $arrWeibo $key $item} +
      • + {$item['user']['username']} +
        +
        + {$item['user']['username']}{$item['title']} +
        + +{if $item['photo']} +
        + {loop $item['photo'] $pkey $pitem} + + {/loop} +
        +{/if} + +
        {php echo getTime(strtotime($item['addtime']),time())} ({$item['count_comment']}评) +
        +
        +
        +
      • + {/loop} +
      +
      +
      +
      +
      \ No newline at end of file diff --git a/plugins/home/weibo/weibo.js b/plugins/home/weibo/weibo.js new file mode 100644 index 0000000..420d934 --- /dev/null +++ b/plugins/home/weibo/weibo.js @@ -0,0 +1,32 @@ +function sendweibo(){ + var title = $("#weibotitle").val(); + + if(title==''){ + tsNotice('发布内容不能为空!');return false; + } + + $("#weibosend").attr('disabled','disabled'); + + $.post(siteUrl+'index.php?app=weibo&ac=ajax&ts=add',{'title':title},function(rs){ + if(rs==0){ + + tsNotice('请登陆后再发布唠叨!'); + + }else if(rs==1){ + + tsNotice('发布内容不能为空!'); + + }else if(rs==2){ + $("#weibotitle").val(''); + $("#weibosend").removeAttr('disabled'); + weibolist(); + + } + }); +} + +function weibolist(){ + $.get(siteUrl+'index.php?app=weibo&ac=ajax&ts=list',function(rs){ + $("#weibolist").html(rs); + }) +} \ No newline at end of file diff --git a/plugins/home/weibo/weibo.php b/plugins/home/weibo/weibo.php new file mode 100644 index 0000000..23232aa --- /dev/null +++ b/plugins/home/weibo/weibo.php @@ -0,0 +1,28 @@ +findAll('weibo',array( + 'isaudit'=>0, + ),'addtime desc',null,10); + foreach($arrWeibo as $key=>$item){ + $arrWeibo[$key]['title'] = tsTitle($item['title']); + $arrWeibo[$key]['user'] = aac('user')->getSimpleUser($item['userid']); + $arrWeibo[$key]['photo'] = aac('weibo')->getWeiboPhoto($item['weiboid'],4); + } + + include template('weibo','weibo'); +} + +function weibo_css(){ + + echo ''; + +} +function weibo_js(){ + echo ''; +} + +addAction('home_index_right','weibo'); +addAction('pub_header_top','weibo_css'); +addAction('pub_footer','weibo_js'); \ No newline at end of file diff --git a/plugins/index.php b/plugins/index.php new file mode 100644 index 0000000..04bcd52 --- /dev/null +++ b/plugins/index.php @@ -0,0 +1,17 @@ + + + + +你找的页面不存在 + + + +

      404

      +

      你找的页面不存在

      + + +'; \ No newline at end of file diff --git a/plugins/pubs/counter/about.php b/plugins/pubs/counter/about.php new file mode 100644 index 0000000..6f1ec2d --- /dev/null +++ b/plugins/pubs/counter/about.php @@ -0,0 +1,12 @@ + '统计代码插件', + 'version' => '1.0', + 'desc' => '添加第三方统计代码,统计网站访问信息。', + 'url' => 'http://www.thinksaas.cn', + 'email' => 'thinksaas@qq.com', + 'author' => '邱君', + 'author_url' => 'http://www.thinksaas.cn', + 'isedit' => '1', +); \ No newline at end of file diff --git a/plugins/pubs/counter/counter.php b/plugins/pubs/counter/counter.php new file mode 100644 index 0000000..73aa701 --- /dev/null +++ b/plugins/pubs/counter/counter.php @@ -0,0 +1,19 @@ +get('plugins_pubs_counter'); + } + + $code = stripslashes($code); + + echo '
      '; + echo $code; + echo '
      '; +} + +addAction('pub_footer','counter_html'); \ No newline at end of file diff --git a/plugins/pubs/counter/edit.php b/plugins/pubs/counter/edit.php new file mode 100644 index 0000000..ae238e2 --- /dev/null +++ b/plugins/pubs/counter/edit.php @@ -0,0 +1,27 @@ +get('plugins_pubs_counter'); + } + $code = stripslashes($code); + + include template('edit_set','counter'); + break; + + case "do": + $code = tsTrim($_POST['code']); + + fileWrite('plugins_pubs_counter.php','data',$code); + $tsMySqlCache->set('plugins_pubs_counter',$code); + + header('Location: '.SITE_URL.'index.php?app=pubs&ac=plugin&plugin=counter&in=edit&ts=set'); + break; +} \ No newline at end of file diff --git a/plugins/pubs/counter/edit_set.html b/plugins/pubs/counter/edit_set.html new file mode 100644 index 0000000..3bfc489 --- /dev/null +++ b/plugins/pubs/counter/edit_set.html @@ -0,0 +1,19 @@ +{php include pubTemplate("header_admin")} + + +
      + +{php include pubTemplate("plugin_menu")} + +
      + + + + + + +
      统计代码:
      +
      +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/plugins/pubs/feedback/about.php b/plugins/pubs/feedback/about.php new file mode 100644 index 0000000..b147206 --- /dev/null +++ b/plugins/pubs/feedback/about.php @@ -0,0 +1 @@ + 'Feedback反馈插件', 'version' => '1.0', 'desc' => '在你的网站右侧加入浮动的Feedback反馈功能!', 'url' => 'http://www.thinksaas.cn', 'email' => 'thinksaas@qq.com', 'author' => '邱君', 'author_url' => 'http://www.thinksaas.cn', 'isedit' => '1', ); \ No newline at end of file diff --git a/plugins/pubs/feedback/edit.php b/plugins/pubs/feedback/edit.php new file mode 100644 index 0000000..8d3a0cc --- /dev/null +++ b/plugins/pubs/feedback/edit.php @@ -0,0 +1,29 @@ +get('plugins_pubs_feedback'); + } + + $code = stripslashes($code); + + include template('edit_set','feedback'); + break; + + case "do": + $code = tsTrim($_POST['code']); + + fileWrite('plugins_pubs_feedback.php','data',$code); + $tsMySqlCache->set('plugins_pubs_feedback',$code); + + header('Location: '.SITE_URL.'index.php?app=pubs&ac=plugin&plugin=feedback&in=edit&ts=set'); + break; +} \ No newline at end of file diff --git a/plugins/pubs/feedback/edit_set.html b/plugins/pubs/feedback/edit_set.html new file mode 100644 index 0000000..c31d2cb --- /dev/null +++ b/plugins/pubs/feedback/edit_set.html @@ -0,0 +1,19 @@ +{php include pubTemplate("header_admin")} + + +
      + +{php include pubTemplate("plugin_menu")} + +
      + + + + + + +
      反馈代码:
      +
      +
      + +{php include pubTemplate("footer_admin")} \ No newline at end of file diff --git a/plugins/pubs/feedback/feed-back.png b/plugins/pubs/feedback/feed-back.png new file mode 100644 index 0000000..2cc4fad Binary files /dev/null and b/plugins/pubs/feedback/feed-back.png differ diff --git a/plugins/pubs/feedback/feedback.php b/plugins/pubs/feedback/feedback.php new file mode 100644 index 0000000..0eb182b --- /dev/null +++ b/plugins/pubs/feedback/feedback.php @@ -0,0 +1,39 @@ +get('plugins_pubs_feedback'); + } + + echo '