├── .htaccess ├── 401.html ├── 403.html ├── 404.html ├── LICENSE.txt ├── README.md ├── admin-edit-comment.php ├── admin-edit-post.php ├── admin-link.php ├── admin-node.php ├── admin-setting.php ├── admin-setuser.php ├── admin-user.php ├── api └── qq_utils.php ├── avatar ├── large │ ├── 0.png │ └── Thumbs.db ├── mini │ ├── 0.png │ └── Thumbs.db └── normal │ ├── 0.png │ └── Thumbs.db ├── common.php ├── config.php ├── favicon.ico ├── favorites.php ├── feed.php ├── forgot.php ├── gototopic.php ├── include ├── index.htm ├── index.html ├── index.php └── mysql.class.php ├── index.php ├── indexpage.php ├── install.php ├── login.php ├── logout.php ├── member.php ├── model.php ├── newpost.php ├── nodepage.php ├── notifications.php ├── qqcallback.php ├── qqlogin.php ├── qqsetname.php ├── readme-nginx.txt ├── rename.htaccess ├── robots.php ├── saetv2.ex.class.php ├── seccode.php ├── setting.php ├── sigin.php ├── sitemap.php ├── static ├── Thumbs.db ├── connect_logo_7.png ├── default │ ├── img │ │ ├── bg.PNG │ │ ├── bg_ft.png │ │ ├── bg_header.png │ │ ├── bg_item.png │ │ ├── index.htm │ │ ├── index.html │ │ ├── index.php │ │ ├── newisred.GIF │ │ ├── newistop.GIF │ │ ├── newrelease.jpg │ │ └── top.png │ ├── index.htm │ ├── index.html │ ├── index.php │ ├── style.css │ └── style_ios.css ├── grey.gif ├── grey2.gif ├── images │ ├── index.htm │ ├── index.html │ └── index.php ├── index.htm ├── index.html ├── index.php ├── js │ ├── index.htm │ ├── index.html │ ├── index.php │ ├── jquery-1.6.4.js │ ├── jquery.lazyload.min.js │ ├── jquery.upload-1.0.2.min.js │ └── postsave.js ├── qq_logo_55_24.png ├── weibo_login.png ├── weibo_login_55_24.png └── weibo_login_63_24.png ├── templates └── default │ ├── admin-edit-comment.php │ ├── admin-edit-post.php │ ├── admin-link.php │ ├── admin-node.php │ ├── admin-setting.php │ ├── admin-setuser.php │ ├── admin-user.php │ ├── favorites.php │ ├── forgot.php │ ├── home.php │ ├── indexpage.php │ ├── ios_admin-edit-comment.php │ ├── ios_admin-edit-post.php │ ├── ios_admin-link.php │ ├── ios_admin-node.php │ ├── ios_admin-setting.php │ ├── ios_admin-setuser.php │ ├── ios_admin-user.php │ ├── ios_favorites.php │ ├── ios_forgot.php │ ├── ios_home.php │ ├── ios_indexpage.php │ ├── ios_layout.php │ ├── ios_member.php │ ├── ios_newpost.php │ ├── ios_node.php │ ├── ios_notifications.php │ ├── ios_postpage.php │ ├── ios_qqsetname.php │ ├── ios_setting.php │ ├── ios_sigin_login.php │ ├── ios_user-edit-post.php │ ├── layout.php │ ├── member.php │ ├── newpost.php │ ├── node.php │ ├── notifications.php │ ├── postpage.php │ ├── qqsetname.php │ ├── setting.php │ ├── sider.php │ ├── sigin_login.php │ ├── upload.php │ └── user-edit-post.php ├── topicpage.php ├── upload.php ├── upload ├── index.htm └── index.php ├── upyun.class.php ├── user-edit-post.php ├── viewat.php ├── wbcallback.php ├── wblogin.php ├── wbsetname.php ├── youbbs.conf └── yunbbs_mysql.sql /.htaccess: -------------------------------------------------------------------------------- 1 | # errordoc 2 | ErrorDocument 404 /404.html 3 | 4 | RewriteEngine on 5 | RewriteBase / 6 | RewriteRule ^n-([0-9]+)(-([0-9]*))?$ nodepage.php?cid=$1&page=$3 [L] 7 | RewriteRule ^t-([0-9]+)(-([0-9]*))?$ topicpage.php?tid=$1&page=$3 [L] 8 | RewriteRule ^page/([0-9]+)$ indexpage.php?page=$1 [L] 9 | RewriteRule ^notifications$ notifications.php [L] 10 | RewriteRule ^favorites$ favorites.php [L] 11 | RewriteRule ^qqlogin$ qqlogin.php [L] 12 | RewriteRule ^qqcallback$ qqcallback.php [L] 13 | RewriteRule ^qqsetname$ qqsetname.php [L] 14 | RewriteRule ^wblogin$ wblogin.php [L] 15 | RewriteRule ^wbcallback$ wbcallback.php [L] 16 | RewriteRule ^wbsetname$ wbsetname.php [L] 17 | RewriteRule ^feed$ feed.php [L] 18 | RewriteRule ^robots.txt$ robots.php [L] 19 | RewriteRule ^sitemap-([0-9]+)$ sitemap.php?id=$1 [L] 20 | RewriteRule ^forgot$ forgot.php [L] 21 | RewriteRule ^upload-(650|590)$ upload.php?mw=$1 [L] 22 | RewriteRule ^viewat-(desktop|mobile)$ viewat.php?via=$1 [L] 23 | RewriteRule ^goto-t-([0-9]+)$ gototopic.php?tid=$1 [L] 24 | RewriteRule ^member/([a-zA-Z0-9\x80-\xff]{1,20})$ member.php?mid=$1 [L] 25 | RewriteRule ^newpost/([0-9]+)$ newpost.php?cid=$1 [L] 26 | RewriteRule ^admin-edit-post-([0-9]+)$ admin-edit-post.php?tid=$1 [L] 27 | RewriteRule ^admin-edit-comment-([0-9]+)$ admin-edit-comment.php?rid=$1 [L] 28 | RewriteRule ^admin-setuser-([0-9]+)$ admin-setuser.php?mid=$1 [L] 29 | RewriteRule ^admin-node(-([0-9]*))?$ admin-node.php?nid=$2 [L] 30 | RewriteRule ^admin-setting$ admin-setting.php [L] 31 | RewriteRule ^admin-user-([a-z]+)(-([0-9]*))?$ admin-user.php?act=$1&mid=$3 [L] 32 | RewriteRule ^admin-link-([a-z]+)(-([0-9]*))?$ admin-link.php?act=$1&lid=$3 [L] 33 | RewriteRule ^(login|sigin|logout|forgot|setting|install)$ $1.php [L] 34 | RewriteRule ^.*?templates 404.html [L] 35 | RewriteRule ^.*?avatar/$ 404.html [L] 36 | RewriteRule ^upload/([0-9]+/)?$ 404.html [L] 37 | RewriteRule ^.*?avatar/(large|normal|mini)/$ 404.html [L] 38 | 39 | # 40 | AddOutputFilterByType DEFLATE text/html 41 | AddOutputFilterByType DEFLATE text/css 42 | AddOutputFilterByType DEFLATE text/javascript 43 | AddOutputFilterByType DEFLATE image/png 44 | AddOutputFilterByType DEFLATE image/jpeg 45 | -------------------------------------------------------------------------------- /401.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 401 6 | 7 | 8 | 9 | 10 | error:401 访问的网址需要先登录 返回首页 11 | 12 | -------------------------------------------------------------------------------- /403.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 403 6 | 7 | 8 | 9 | 10 | error:403 访问的网址需要对应权限,你的权限不足, 返回首页 11 | 12 | -------------------------------------------------------------------------------- /404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 404 6 | 7 | 8 | 9 | 10 | error:404 访问的网址资源不存在 返回首页 11 | 12 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 ego008 2 | 3 | https://github.com/ego008/saepy-log 4 | http://code.google.com/p/sae-python-tornado-blog/ 5 | 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | YouBBS-ACICFG 2 | ===================== 3 | YouBBS-ACICFG 4 | ver 1.04.02 5 | 6 | This is a simple and quick BBS. 7 | 8 | Looks like V2EX, but in PHP. 9 | 10 | Smaller than StartBBS(Openshift quick install ver. avalable in my Github:-) ). 11 | 12 | We made some improvements: 13 | ---------------- 14 | 1.Set a post at top(finally! After 180+ days of waiting!) 15 | 16 | 2.Make it easier for admins to delete or edit posts. 17 | 18 | 3.Allow users to edit their posts. 19 | 20 | And more... 21 | 22 | Install: 23 | ------------ 24 | The same as the original one. 25 | 26 | Detailed instruction pending. 27 | 28 | Special notes to nginx users 29 | ------------ 30 | To help you fix the annoying rewrite, we put a readme-nginx.txt in it. 31 | 32 | Just copy and paste them in the .conf file. 33 | 34 | Name 35 | ---------- 36 | 1.04 .02 37 | Original ver. Our update 38 | 39 | 40 | ----- 41 | 42 | Official BBS:http://youbbs.sinaapp.com/ 43 | 44 | Our test website:http://www.acicfg.tk/ 45 | 46 | Our official website: http://forum.chineseaci.com/ 47 | 48 | For help. get in touch with us at www.chineseaci.com. 49 | 50 | Hope you like it:) 51 | -------------------------------------------------------------------------------- /admin-edit-comment.php: -------------------------------------------------------------------------------- 1 | fetch_one_array($query); 12 | if(!$r_obj){ 13 | exit('404'); 14 | } 15 | 16 | if($_SERVER['REQUEST_METHOD'] == 'POST'){ 17 | $r_content = addslashes(trim($_POST['content'])); 18 | 19 | if($r_content){ 20 | $r_content = htmlspecialchars($r_content); 21 | $DBS->unbuffered_query("UPDATE yunbbs_comments SET content='$r_content' WHERE id='$rid'"); 22 | $tip = '评论已成功修改'; 23 | }else{ 24 | $tip = '内容 不能留空'; 25 | } 26 | }else{ 27 | $r_content = $r_obj['content']; 28 | $tip = ''; 29 | } 30 | 31 | // 页面变量 32 | $title = '修改评论'; 33 | // 设置回复图片最大宽度 34 | $img_max_w = 590; 35 | 36 | 37 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'admin-edit-comment.php'; 38 | 39 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 40 | 41 | ?> 42 | -------------------------------------------------------------------------------- /admin-edit-post.php: -------------------------------------------------------------------------------- 1 | fetch_one_array($query); 12 | if(!$t_obj){ 13 | exit('404'); 14 | } 15 | 16 | if($t_obj['closecomment']){ 17 | $t_obj['closecomment'] = 'checked'; 18 | }else{ 19 | $t_obj['closecomment'] = ''; 20 | } 21 | 22 | if($t_obj['visible']){ 23 | $t_obj['visible'] = 'checked'; 24 | }else{ 25 | $t_obj['visible'] = ''; 26 | } 27 | 28 | 29 | if($t_obj['top']){ 30 | $t_obj['top'] = 'checked'; 31 | }else{ 32 | $t_obj['top'] = ''; 33 | } 34 | 35 | if($t_obj['isred']){ 36 | $t_obj['isred'] = 'checked'; 37 | }else{ 38 | $t_obj['isred'] = ''; 39 | } 40 | 41 | 42 | 43 | // 获取1000个热点分类 44 | $query = $DBS->query("SELECT `id`, `name` FROM `yunbbs_categories` ORDER BY `articles` DESC LIMIT 1000"); 45 | $all_nodes = array(); 46 | while($node = $DBS->fetch_array($query)) { 47 | $all_nodes[$node['id']] = $node['name']; 48 | } 49 | if( !array_key_exists($t_obj['cid'], $all_nodes) ){ 50 | $cid = $t_obj['cid']; 51 | $c_obj = $DBS->fetch_one_array("SELECT id,name FROM yunbbs_categories WHERE id='".$cid."'"); 52 | $all_nodes[$c_obj['id']] = $c_obj['name']; 53 | } 54 | 55 | unset($node); 56 | $DBS->free_result($query); 57 | 58 | if($_SERVER['REQUEST_METHOD'] == 'POST'){ 59 | $old_cid = $t_obj['cid']; 60 | $p_cid = $_POST['select_cid']; 61 | $p_title = addslashes(trim($_POST['title'])); 62 | $p_content = addslashes(trim($_POST['content'])); 63 | $p_closecomment = intval($_POST['closecomment']); 64 | $p_visible = intval($_POST['visible']); 65 | $p_top = intval($_POST['top']); 66 | $p_isred = intval($_POST['isred']); 67 | 68 | 69 | if($p_title){ 70 | $p_title = htmlspecialchars($p_title); 71 | $p_content = htmlspecialchars($p_content); 72 | $DBS->unbuffered_query("UPDATE yunbbs_articles SET cid='$p_cid',title='$p_title',content='$p_content',closecomment='$p_closecomment',visible='$p_visible',isred='$p_isred',top='$p_top',isunderline='$p_isunderline' WHERE id='$tid'"); 73 | if($p_cid != $old_cid){ 74 | $DBS->unbuffered_query("UPDATE yunbbs_categories SET articles=articles+1 WHERE id='$p_cid'"); 75 | $DBS->unbuffered_query("UPDATE yunbbs_categories SET articles=articles-1 WHERE id='$old_cid'"); 76 | } 77 | 78 | header('location: /t-'.$tid); 79 | exit; 80 | }else{ 81 | $tip = '标题 不能留空'; 82 | } 83 | }else{ 84 | $p_title = $t_obj['title']; 85 | $p_content = $t_obj['content']; 86 | $tip = ''; 87 | } 88 | // 页面变量 89 | $title = '修改帖子 - '.$t_obj['title']; 90 | // 设置回复图片最大宽度 91 | $img_max_w = 650; 92 | 93 | 94 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'admin-edit-post.php'; 95 | 96 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 97 | 98 | ?> 99 | -------------------------------------------------------------------------------- /admin-link.php: -------------------------------------------------------------------------------- 1 | fetch_one_array($query); 14 | if(!$l_obj){ 15 | header('location: /admin-link-list'); 16 | exit; 17 | } 18 | } 19 | 20 | $tip1 = ''; 21 | $tip2 = ''; 22 | if($_SERVER['REQUEST_METHOD'] == 'POST'){ 23 | $action = $_POST['action']; 24 | if($action=='add'){ 25 | $n_name = trim($_POST['name']); 26 | $n_url = trim($_POST['url']); 27 | if($n_name && $n_url){ 28 | if($DBS->query("INSERT INTO yunbbs_links (id,name,url) VALUES (null,'$n_name','$n_url')")){ 29 | $tip1 = '已成功添加'; 30 | }else{ 31 | $tip1 = '数据库更新失败,修改尚未保存,请稍后再试'; 32 | } 33 | }else{ 34 | $tip1 = '链接名 和 网址 不能留空'; 35 | } 36 | }else if($action=='edit'){ 37 | $n_name = trim($_POST['name']); 38 | $n_url = trim($_POST['url']); 39 | if($n_name && $n_url){ 40 | if($DBS->unbuffered_query("UPDATE yunbbs_links SET name='$n_name',url='$n_url' WHERE id='$lid'")){ 41 | $l_obj['name'] = $n_name; 42 | $l_obj['url'] = $n_url; 43 | $tip2 = '已成功保存'; 44 | }else{ 45 | $tip2 = '数据库更新失败,修改尚未保存,请稍后再试'; 46 | } 47 | 48 | }else{ 49 | $tip2 = '链接名 和 网址 不能留空'; 50 | } 51 | } 52 | }else{ 53 | if($act == 'del'){ 54 | $DBS->unbuffered_query("DELETE FROM yunbbs_links WHERE id='$lid'"); 55 | } 56 | 57 | } 58 | 59 | // 获取链接列表 60 | $query_sql = "SELECT * FROM yunbbs_links"; 61 | $query = $DBS->query($query_sql); 62 | $linkdb=array(); 63 | while ($link = $DBS->fetch_array($query)) { 64 | $linkdb[] = $link; 65 | } 66 | 67 | 68 | // 页面变量 69 | $title = '链接管理'; 70 | 71 | 72 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'admin-link.php'; 73 | 74 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 75 | 76 | ?> 77 | -------------------------------------------------------------------------------- /admin-node.php: -------------------------------------------------------------------------------- 1 | fetch_one_array($query); 13 | if(!$c_obj){ 14 | header('location: /admin-node#edit'); 15 | exit; 16 | } 17 | } 18 | 19 | $tip1 = ''; 20 | $tip2 = ''; 21 | if($_SERVER['REQUEST_METHOD'] == 'POST'){ 22 | $action = $_POST['action']; 23 | 24 | if($action=='find'){ 25 | $n_id = trim($_POST['findid']); 26 | if($n_id){ 27 | header('location: /admin-node-'.$n_id); 28 | }else{ 29 | header('location: /admin-node#edit'); 30 | } 31 | exit; 32 | }else if($action=='add'){ 33 | $n_name = trim($_POST['name']); 34 | $n_about = trim($_POST['about']); 35 | if($n_name){ 36 | $check_obj = $DBS->fetch_one_array("SELECT * FROM yunbbs_categories WHERE name='".$n_name."'"); 37 | if($check_obj){ 38 | $tip1 = $n_name.' 分类名已存在,请修改为不同的分类名'; 39 | }else{ 40 | if($DBS->query("INSERT INTO yunbbs_categories (id,name,about) VALUES (null,'$n_name','$n_about')")){ 41 | $tip1 = '已成功添加'; 42 | }else{ 43 | $tip1 = '数据库更新失败,修改尚未保存,请稍后再试'; 44 | } 45 | } 46 | }else{ 47 | $tip1 = '分类名不能留空'; 48 | } 49 | }else if($action=='edit'){ 50 | $n_name = trim($_POST['name']); 51 | $n_about = trim($_POST['about']); 52 | if($n_name){ 53 | if($DBS->unbuffered_query("UPDATE yunbbs_categories SET name='$n_name',about='$n_about' WHERE id='$nid'")){ 54 | $c_obj['name'] = $n_name; 55 | $c_obj['about'] = $n_about; 56 | $tip2 = '已成功保存'; 57 | }else{ 58 | $tip2 = '数据库更新失败,修改尚未保存,请稍后再试'; 59 | } 60 | }else{ 61 | $tip2 = '分类名不能留空'; 62 | } 63 | 64 | } 65 | 66 | } 67 | 68 | // 页面变量 69 | $title = '分类管理'; 70 | 71 | 72 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'admin-node.php'; 73 | 74 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 75 | 76 | ?> 77 | -------------------------------------------------------------------------------- /admin-user.php: -------------------------------------------------------------------------------- 1 | unbuffered_query("UPDATE yunbbs_users SET flag=5 WHERE id='$mid'")){ 18 | if($act=='pass'){ 19 | $tip1 = '已成功操作'; 20 | }else{ 21 | $tip2 = '已成功操作'; 22 | } 23 | }else{ 24 | if($act=='pass'){ 25 | $tip1 = '数据库更新失败,修改尚未保存,请稍后再试'; 26 | }else{ 27 | $tip2 = '数据库更新失败,修改尚未保存,请稍后再试'; 28 | } 29 | } 30 | 31 | } 32 | 33 | 34 | // users表flag 列没加入到索引,如果用户上10万,获取下面用户有点慢,8~10秒 35 | 36 | // 获取最近等待审核的用户 37 | $query_sql = "SELECT id,name,regtime FROM yunbbs_users WHERE flag=1 ORDER BY id DESC LIMIT 10"; 38 | $query = $DBS->query($query_sql); 39 | $userdb=array(); 40 | while ($user = $DBS->fetch_array($query)) { 41 | // 格式化内容 42 | $user['regtime'] = showtime($user['regtime']); 43 | $userdb[] = $user; 44 | } 45 | 46 | // 获取最近被禁用的用户 47 | $query_sql = "SELECT id,name,regtime FROM yunbbs_users WHERE flag=0 ORDER BY id DESC LIMIT 10"; 48 | $query = $DBS->query($query_sql); 49 | $userdb2=array(); 50 | while ($user = $DBS->fetch_array($query)) { 51 | // 格式化内容 52 | $user['regtime'] = showtime($user['regtime']); 53 | $userdb2[] = $user; 54 | } 55 | 56 | // 页面变量 57 | $title = '用户管理'; 58 | 59 | 60 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'admin-user.php'; 61 | 62 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 63 | 64 | ?> 65 | -------------------------------------------------------------------------------- /api/qq_utils.php: -------------------------------------------------------------------------------- 1 | 42 | -------------------------------------------------------------------------------- /avatar/large/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/avatar/large/0.png -------------------------------------------------------------------------------- /avatar/large/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/avatar/large/Thumbs.db -------------------------------------------------------------------------------- /avatar/mini/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/avatar/mini/0.png -------------------------------------------------------------------------------- /avatar/mini/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/avatar/mini/Thumbs.db -------------------------------------------------------------------------------- /avatar/normal/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/avatar/normal/0.png -------------------------------------------------------------------------------- /avatar/normal/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/avatar/normal/Thumbs.db -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/favicon.ico -------------------------------------------------------------------------------- /favorites.php: -------------------------------------------------------------------------------- 1 | fetch_one_array("SELECT * FROM yunbbs_favorites WHERE uid='".$cur_uid."'"); 23 | 24 | // 处理收藏操作 25 | if($act && $tid){ 26 | if($act == 'add'){ 27 | // 添加 28 | if($user_fav){ 29 | if($user_fav['content']){ 30 | $ids_arr = explode(",", $user_fav['content']); 31 | if(!in_array($tid, $ids_arr)){ 32 | array_unshift($ids_arr, $tid); 33 | $articles = count($ids_arr); 34 | $content = implode(',', $ids_arr); 35 | $user_fav['content'] = $content; 36 | $user_fav['articles'] = $articles; 37 | 38 | $DBS->unbuffered_query("UPDATE yunbbs_favorites SET articles='$articles',content='$content' WHERE uid='$cur_uid'"); 39 | $DBS->unbuffered_query("UPDATE yunbbs_articles SET favorites=favorites+1 WHERE id='$tid'"); 40 | } 41 | unset($ids_arr); 42 | }else{ 43 | $user_fav['content'] = $tid; 44 | $user_fav['articles'] = 1; 45 | $DBS->unbuffered_query("UPDATE yunbbs_favorites SET articles='1',content='$tid' WHERE uid='$cur_uid'"); 46 | $DBS->unbuffered_query("UPDATE yunbbs_articles SET favorites=favorites+1 WHERE id='$tid'"); 47 | } 48 | }else{ 49 | $user_fav= array('id'=>'','uid'=>$cur_uid, 'articles'=>1, 'content' => $tid); 50 | $DBS->query("INSERT INTO yunbbs_favorites (id,uid,articles,content) VALUES (null,'$cur_uid','1','$tid')"); 51 | $DBS->unbuffered_query("UPDATE yunbbs_articles SET favorites=favorites+1 WHERE id='$tid'"); 52 | } 53 | 54 | }else if($act == 'del'){ 55 | // 删除 56 | if($user_fav){ 57 | if($user_fav['content']){ 58 | $ids_arr = explode(",", $user_fav['content']); 59 | if(in_array($tid, $ids_arr)){ 60 | foreach($ids_arr as $k=>$v){ 61 | if($v == $tid){ 62 | unset($ids_arr[$k]); 63 | break; 64 | } 65 | } 66 | $articles = count($ids_arr); 67 | $content = implode(',', $ids_arr); 68 | $user_fav['content'] = $content; 69 | $user_fav['articles'] = $articles; 70 | 71 | $DBS->unbuffered_query("UPDATE yunbbs_favorites SET articles='$articles',content='$content' WHERE uid='$cur_uid'"); 72 | $DBS->unbuffered_query("UPDATE yunbbs_articles SET favorites=favorites-1 WHERE id='$tid'"); 73 | } 74 | unset($ids_arr); 75 | } 76 | } 77 | } 78 | } 79 | 80 | // 处理正确的页数 81 | // 第一页是1 82 | if($user_fav && $user_fav['articles']){ 83 | $taltol_page = ceil($user_fav['articles']/$options['list_shownum']); 84 | if($page<0){ 85 | header('location: /favorites'); 86 | exit; 87 | }else if($page==1){ 88 | header('location: /favorites'); 89 | exit; 90 | }else{ 91 | if($page>$taltol_page){ 92 | header('location: /favorites?page='.$taltol_page); 93 | exit; 94 | } 95 | } 96 | }else{ 97 | $page = 0; 98 | } 99 | 100 | // 获取收藏文章列表 101 | if($user_fav['articles']){ 102 | if($page == 0) $page = 1; 103 | $from_i = $options['list_shownum']*($page-1); 104 | $to_i = $from_i + $options['list_shownum']; 105 | 106 | if($user_fav['articles'] > 1){ 107 | $id_arr = array_slice( explode(',', $user_fav['content']), $from_i, $to_i); 108 | }else{ 109 | $id_arr = array($user_fav['content']); 110 | } 111 | $ids = implode(',', $id_arr); 112 | //exit($ids); 113 | $query_sql = "SELECT a.id,a.uid,a.cid,a.ruid,a.title,a.addtime,a.edittime,a.comments,c.name as cname,u.avatar as uavatar,u.name as author,ru.name as rauthor 114 | FROM yunbbs_articles a 115 | LEFT JOIN yunbbs_categories c ON c.id=a.cid 116 | LEFT JOIN yunbbs_users u ON a.uid=u.id 117 | LEFT JOIN yunbbs_users ru ON a.ruid=ru.id 118 | WHERE a.id in(".$ids.")"; 119 | $query = $DBS->query($query_sql); 120 | $articledb=array(); 121 | // 按收藏顺序排列 122 | foreach($id_arr as $aid){ 123 | $articledb[$aid] = ''; 124 | } 125 | 126 | while ($article = $DBS->fetch_array($query)) { 127 | // 格式化内容 128 | $article['addtime'] = showtime($article['addtime']); 129 | $article['edittime'] = showtime($article['edittime']); 130 | $articledb[$article['id']] = $article; 131 | } 132 | unset($article); 133 | $DBS->free_result($query); 134 | } 135 | 136 | // 页面变量 137 | $title = '个人收藏'; 138 | $newest_nodes = get_newest_nodes(); 139 | 140 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'favorites.php'; 141 | 142 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 143 | 144 | ?> 145 | -------------------------------------------------------------------------------- /feed.php: -------------------------------------------------------------------------------- 1 | query($query_sql); 18 | $articledb=array(); 19 | while ($article = $DBS->fetch_array($query)) { 20 | // 格式化内容 21 | $article['addtime'] = gmdate('Y-m-dTH:M:SZ',$article['addtime']); 22 | $article['edittime'] = gmdate('Y-m-dTH:M:SZ',$article['edittime']); 23 | $articledb[] = $article; 24 | } 25 | unset($article); 26 | $DBS->free_result($query); 27 | 28 | $base_url = 'http://'.$_SERVER['HTTP_HOST']; 29 | 30 | 31 | ob_start(); 32 | echo ' 33 | 34 | ',htmlspecialchars($options['name']),' 35 | 36 | 37 | ',gmdate('Y-m-dTH:M:SZ',$timestamp),' 38 | ',$_SERVER["REQUEST_URI"],' 39 | 40 | ',htmlspecialchars($options['name']),' 41 | 42 | '; 43 | 44 | foreach($articledb as $article){ 45 | echo ' 46 | 47 | ',htmlspecialchars($article['title']),' 48 | t-',$article['id'],' 49 | 50 | ',$article['addtime'],' 51 | ',$article['edittime'],' 52 | 53 | ',htmlspecialchars($article['cname']),' - ',htmlspecialchars($article['author']),' - ',htmlspecialchars(mb_substr($article['content'], 0, 150, 'utf-8')),' 54 | 55 | '; 56 | 57 | } 58 | 59 | echo ''; 60 | 61 | $_output = ob_get_contents(); 62 | ob_end_clean(); 63 | 64 | header("content-Type: application/atom+xml"); 65 | 66 | echo $_output; 67 | 68 | ?> 69 | -------------------------------------------------------------------------------- /forgot.php: -------------------------------------------------------------------------------- 1 | fetch_one_array("SELECT * FROM yunbbs_users WHERE name='".$name."' LIMIT 1"); 26 | if($db_user){ 27 | if($email == $db_user['email']){ 28 | header("content-Type: text/html; charset=UTF-8"); 29 | exit('请用该邮箱: '.$db_user['email'].' 给管理员(管理员信箱'.$options['admin_email'].')发送一封密码重设请求,内容只需包含您的用户名“'.$name.'”'); 30 | }else{ 31 | $errors[] = '填写的邮箱 和 个人设置里的邮箱 不一致'; 32 | } 33 | }else{ 34 | $errors[] = '用户名 错误'; 35 | } 36 | }else{ 37 | $errors[] = '邮箱 格式错误'; 38 | } 39 | } 40 | }else{ 41 | $errors[] = '名字 太长 或 太短 或 包含非法字符'; 42 | } 43 | }else{ 44 | $errors[] = '用户名 或 email 太长了'; 45 | } 46 | }else{ 47 | $errors[] = '用户名 和 邮箱 必填'; 48 | } 49 | } 50 | 51 | // 页面变量 52 | $title = '找回密码'; 53 | 54 | 55 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'forgot.php'; 56 | 57 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 58 | 59 | ?> 60 | -------------------------------------------------------------------------------- /gototopic.php: -------------------------------------------------------------------------------- 1 | fetch_one_array("SELECT * FROM yunbbs_users WHERE id='".$cur_uid."' LIMIT 1"); 9 | 10 | if($db_user['notic']){ 11 | $n_arr = explode(',', $db_user['notic']); 12 | foreach($n_arr as $k=>$v){ 13 | if($v == $tid){ 14 | unset($n_arr[$k]); 15 | } 16 | } 17 | $new_notic = implode(',', $n_arr); 18 | $DBS->unbuffered_query("UPDATE yunbbs_users SET notic = '$new_notic' WHERE id='$cur_uid'"); 19 | 20 | unset($n_arr); 21 | unset($new_notic); 22 | } 23 | header('location: /t-'.$tid); 24 | exit; 25 | ?> 26 | -------------------------------------------------------------------------------- /include/index.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/include/index.htm -------------------------------------------------------------------------------- /include/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/include/index.html -------------------------------------------------------------------------------- /include/index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 404 Not Found 7 | 8 |

Not Found

9 | The requested URL was not found on this server.

10 |


11 |
Web Server at Port
12 | -------------------------------------------------------------------------------- /include/mysql.class.php: -------------------------------------------------------------------------------- 1 | link = @mysql_connect($servername.':'.$dbport, $dbusername, $dbpassword)) { 13 | $this->halt('Can not connect to MySQL server'); 14 | } 15 | 16 | if($this->version() > '4.1') { 17 | global $charset, $dbcharset; 18 | if(!$dbcharset && in_array(strtolower($charset), array('gbk', 'big5', 'utf-8'))) { 19 | $dbcharset = str_replace('-', '', $charset); 20 | } 21 | 22 | if($dbcharset) { 23 | mysql_query("SET character_set_connection=$dbcharset, character_set_results=$dbcharset, character_set_client=binary", $this->link); 24 | } 25 | 26 | if($this->version() > '5.0.1') { 27 | mysql_query("SET sql_mode=''", $this->link); 28 | } 29 | } 30 | 31 | if($dbname) { 32 | mysql_select_db($dbname, $this->link); 33 | } 34 | } 35 | 36 | 37 | function geterrdesc() { 38 | return (($this->link) ? mysql_error($this->link) : mysql_error()); 39 | } 40 | 41 | function geterrno() { 42 | return intval(($this->link) ? mysql_errno($this->link) : mysql_errno()); 43 | } 44 | 45 | function insert_id() { 46 | return ($id = mysql_insert_id($this->link)) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0); 47 | } 48 | 49 | function fetch_array($query, $result_type = MYSQL_ASSOC) { 50 | return mysql_fetch_array($query, $result_type); 51 | } 52 | 53 | function query($sql, $type = '') { 54 | $func = $type == 'UNBUFFERED' && @function_exists('mysql_unbuffered_query') ? 'mysql_unbuffered_query' : 'mysql_query'; 55 | if(!($query = $func($sql)) && $type != 'SILENT') { 56 | $this->halt('MySQL Query Error', $sql); 57 | } 58 | $this->querycount++; 59 | return $query; 60 | } 61 | 62 | function unbuffered_query($sql) { 63 | $query = $this->query($sql, 'UNBUFFERED'); 64 | return $query; 65 | } 66 | 67 | function select_db($dbname) { 68 | return mysql_select_db($dbname, $this->link); 69 | } 70 | 71 | function fetch_row($query) { 72 | $query = mysql_fetch_row($query); 73 | return $query; 74 | } 75 | 76 | function fetch_one_array($query) { 77 | $result = $this->query($query); 78 | $record = $this->fetch_array($result); 79 | return $record; 80 | } 81 | 82 | function num_rows($query) { 83 | $query = mysql_num_rows($query); 84 | return $query; 85 | } 86 | 87 | function num_fields($query) { 88 | return mysql_num_fields($query); 89 | } 90 | 91 | function result($query, $row) { 92 | $query = @mysql_result($query, $row); 93 | return $query; 94 | } 95 | 96 | function free_result($query) { 97 | $query = mysql_free_result($query); 98 | return $query; 99 | } 100 | 101 | function version() { 102 | return mysql_get_server_info($this->link); 103 | } 104 | 105 | function close() { 106 | return mysql_close($this->link); 107 | } 108 | 109 | function halt($msg ='', $sql=''){ 110 | $message = "\n\n"; 111 | $message .= "\n"; 112 | $message .= "\n"; 117 | $message .= "\n"; 118 | $message .= "\n"; 119 | 120 | $message .= "

数据库出错:

".htmlspecialchars($msg)."
\n"; 121 | $message .= "Mysql error description: ".htmlspecialchars($this->geterrdesc())."\n
"; 122 | $message .= "Mysql error number: ".$this->geterrno()."\n
"; 123 | $message .= "Date: ".date("Y-m-d @ H:i")."\n
"; 124 | $message .= "Script: http://".$_SERVER['HTTP_HOST'].getenv("REQUEST_URI")."\n
"; 125 | 126 | $message .= "\n"; 127 | @header("content-Type: text/html; charset=UTF-8"); 128 | echo $message; 129 | exit; 130 | } 131 | } 132 | ?> -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | query($query_sql); 19 | $articledb=array(); 20 | while ($article = $DBS->fetch_array($query)) { 21 | // 格式化内容 22 | //这几行代码我自己感觉写的糟透了,但是没想出来怎么改。。。谁动手重构一下? 23 | if($article['isred'] == '1' && $article['cid'] == '3' && $article['top'] == '1'){ 24 | $article['title'] = $article['title']."\"发布\"\"置顶\"\"精品\""; 25 | }elseif($article['isred'] == '1' && $article['cid'] == '3'){ 26 | $article['title'] = $article['title']."\"发布\"\"置顶\""; 27 | }elseif($article['isred'] == '1' && $article['top'] == '1'){ 28 | $article['title'] = $article['title']."\"置顶\"\"精品\""; 29 | }elseif($article['cid'] == '3' && $article['top'] == '1'){ 30 | $article['title'] = $article['title']."\"发布\"\"置顶\""; 31 | }elseif($article['isred'] == '1'){ 32 | $article['title'] = $article['title']."\"精品\""; 33 | }elseif($article['cid'] == '3'){ 34 | $article['title'] = $article['title']."\"发布\""; 35 | }elseif($article['top'] == '1'){ 36 | $article['title'] = $article['title']."\"置顶\""; 37 | } 38 | 39 | //elseif($article['isred'] == '1'){ 40 | // $article['title'] = $article['title']."\"精品\""; 41 | //} 42 | 43 | 44 | 45 | 46 | $article['addtime'] = showtime($article['addtime']); 47 | $article['edittime'] = showtime($article['edittime']); 48 | $articledb[] = $article; 49 | } 50 | unset($article); 51 | $DBS->free_result($query); 52 | 53 | // 页面变量 54 | $title = $options['name']; 55 | 56 | $site_infos = get_site_infos(); 57 | $newest_nodes = get_newest_nodes(); 58 | if(count($newest_nodes)==$options['newest_node_num']){ 59 | $bot_nodes = get_bot_nodes(); 60 | } 61 | 62 | $links = get_links(); 63 | if($options['site_des']){ 64 | $meta_des = htmlspecialchars(mb_substr($options['site_des'], 0, 150, 'utf-8')); 65 | } 66 | 67 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'home.php'; 68 | 69 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 70 | 71 | ?> 72 | -------------------------------------------------------------------------------- /indexpage.php: -------------------------------------------------------------------------------- 1 | fetch_one_array("SHOW TABLE STATUS LIKE 'yunbbs_articles'"); 11 | $taltol_article = $table_status['Auto_increment'] -1; 12 | $taltol_page = ceil($taltol_article/$options['list_shownum']); 13 | if($page<0){ 14 | header('location: /'); 15 | exit; 16 | }else if($page==1){ 17 | header('location: /'); 18 | exit; 19 | }else{ 20 | if($page>$taltol_page){ 21 | header('location: /page/'.$taltol_page); 22 | exit; 23 | } 24 | } 25 | 26 | // 获取最近文章列表 27 | if($page == 0) $page = 1; 28 | 29 | $query_sql = "SELECT a.id,a.uid,a.ruid,a.title,a.top,a.addtime,a.isred,a.edittime,a.comments,a.visible,u.avatar as uavatar,u.name as author,ru.name as rauthor,u.flag as flag 30 | FROM yunbbs_articles a 31 | LEFT JOIN yunbbs_users u ON a.uid=u.id 32 | LEFT JOIN yunbbs_users ru ON a.ruid=ru.id 33 | WHERE `visible` != '0' 34 | 35 | ORDER BY `top` DESC ,`edittime` DESC LIMIT ".($page-1)*$options['list_shownum'].",".$options['list_shownum']; 36 | $query = $DBS->query($query_sql); 37 | $articledb=array(); 38 | while ($article = $DBS->fetch_array($query)) { 39 | // 格式化内容 40 | //这几行代码我自己感觉写的糟透了,但是没想出来怎么改。。。谁动手重构一下? 41 | if($article['isred'] == '1' && $article['cid'] == '3' && $article['top'] == '1'){ 42 | $article['title'] = $article['title']."\"发布\"\"置顶\"\"精品\""; 43 | }elseif($article['isred'] == '1' && $article['cid'] == '3'){ 44 | $article['title'] = $article['title']."\"发布\"\"置顶\""; 45 | }elseif($article['isred'] == '1' && $article['top'] == '1'){ 46 | $article['title'] = $article['title']."\"置顶\"\"精品\""; 47 | }elseif($article['cid'] == '3' && $article['top'] == '1'){ 48 | $article['title'] = $article['title']."\"发布\"\"置顶\""; 49 | }elseif($article['isred'] == '1'){ 50 | $article['title'] = $article['title']."\"精品\""; 51 | }elseif($article['cid'] == '3'){ 52 | $article['title'] = $article['title']."\"发布\""; 53 | }elseif($article['top'] == '1'){ 54 | $article['title'] = $article['title']."\"置顶\""; 55 | } 56 | 57 | 58 | 59 | $article['addtime'] = showtime($article['addtime']); 60 | $article['edittime'] = showtime($article['edittime']); 61 | $articledb[] = $article; 62 | } 63 | unset($article); 64 | $DBS->free_result($query); 65 | 66 | 67 | // 页面变量 68 | $title = $options['name'].' - page '.$page; 69 | 70 | $site_infos = get_site_infos(); 71 | $newest_nodes = get_newest_nodes(); 72 | if(count($newest_nodes)==$options['newest_node_num']){ 73 | $bot_nodes = get_bot_nodes(); 74 | } 75 | 76 | $show_sider_ad = "1"; 77 | $links = get_links(); 78 | 79 | if($options['site_des']){ 80 | $meta_des = htmlspecialchars(mb_substr($options['site_des'], 0, 150, 'utf-8')).' - page '.$page; 81 | } 82 | 83 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'indexpage.php'; 84 | 85 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 86 | 87 | ?> 88 | -------------------------------------------------------------------------------- /install.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/install.php -------------------------------------------------------------------------------- /login.php: -------------------------------------------------------------------------------- 1 | 微博登录'; 14 | } 15 | if($options['qq_appid'] && $options['qq_appkey']){ 16 | echo ' QQ登录'; 17 | } 18 | echo ' 返回首页'; 19 | exit; 20 | } 21 | 22 | */ 23 | 24 | if($cur_user){ 25 | // 如果已经登录用户无聊打开这网址就让他重新登录吧 26 | setcookie("cur_uid", '', $timestamp-86400 * 365, '/'); 27 | setcookie("cur_uname", '', $timestamp-86400 * 365, '/'); 28 | setcookie("cur_ucode", '', $timestamp-86400 * 365, '/'); 29 | $cur_user = null; 30 | $cur_uid = ''; 31 | } 32 | 33 | $errors = array(); 34 | if($_SERVER['REQUEST_METHOD'] == 'POST'){ 35 | if(empty($_SERVER['HTTP_REFERER']) || $_POST['formhash'] != formhash() || preg_replace("/https?:\/\/([^\:\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) !== preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST'])) { 36 | exit('403: unknown referer.'); 37 | } 38 | 39 | $name = addslashes(strtolower(trim($_POST["name"]))); 40 | $pw = addslashes(trim($_POST["pw"])); 41 | $seccode = intval(trim($_POST["seccode"])); 42 | if($name && $pw && $seccode){ 43 | if(strlen($name)<21 && strlen($pw)<32){ 44 | if(preg_match('/^[a-zA-Z0-9\x80-\xff]{4,20}$/i', $name)){ 45 | if(preg_match('/^[0-9]{4,20}$/', $name)){ 46 | $errors[] = '名字不能全为数字'; 47 | }else{ 48 | error_reporting(0); 49 | session_start(); 50 | if($seccode === intval($_SESSION['code'])){ 51 | $db_user = $DBS->fetch_one_array("SELECT * FROM yunbbs_users WHERE name='".$name."' LIMIT 1"); 52 | if($db_user){ 53 | $pwmd5 = md5($pw); 54 | if($pwmd5 == $db_user['password']){ 55 | //设置cookie 56 | $db_ucode = md5($db_user['id'].$db_user['password'].$db_user['regtime'].$db_user['lastposttime'].$db_user['lastreplytime']); 57 | $cur_uid = $db_user['id']; 58 | 59 | setcookie("cur_uid", $cur_uid, time()+ 86400 * 365, '/'); 60 | setcookie("cur_uname", $name, time()+86400 * 365, '/'); 61 | setcookie("cur_ucode", $db_ucode, time()+86400 * 365, '/'); 62 | $cur_user = $db_user; 63 | unset($db_user); 64 | 65 | header('location: /'); 66 | exit('logined'); 67 | }else{ 68 | // 用户名和密码不匹配 69 | $errors[] = '用户名 或 密码 错误'; 70 | } 71 | }else{ 72 | // 没有该用户名 73 | $errors[] = '用户名 或 密码 错误'; 74 | } 75 | }else{ 76 | $errors[] = '验证码输入不对'; 77 | } 78 | } 79 | }else{ 80 | $errors[] = '名字 太长 或 太短 或 包含非法字符'; 81 | } 82 | }else{ 83 | $errors[] = '用户名 或 密码 太长了'; 84 | } 85 | }else{ 86 | $errors[] = '用户名 和 密码 验证码 必填'; 87 | } 88 | } 89 | 90 | // 页面变量 91 | $title = '登 录'; 92 | 93 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'sigin_login.php'; 94 | 95 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 96 | 97 | ?> 98 | -------------------------------------------------------------------------------- /logout.php: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /member.php: -------------------------------------------------------------------------------- 1 | fetch_one_array($query); 25 | if($m_obj){ 26 | if(!$mid){ 27 | // 可以重定向到网址 /member/id 为了减少请求,下面用 $canonical 来让SEO感觉友好 28 | //header('location: /member/'.$m_obj['id']); 29 | //exit; 30 | $mid = $m_obj['id']; 31 | } 32 | if($m_obj['flag'] == 0){ 33 | if(!$cur_user || ($cur_user && $cur_user['flag']<99)){ 34 | //header("content-Type: text/html; charset=UTF-8"); 35 | //exit('该用户已被禁用'); 36 | } 37 | } 38 | $openid_user = $DBS->fetch_one_array("SELECT name FROM yunbbs_qqweibo WHERE uid='".$mid."'"); 39 | $weibo_user = $DBS->fetch_one_array("SELECT `openid` FROM `yunbbs_weibo` WHERE `uid`='".$mid."'"); 40 | }else{ 41 | exit('404'); 42 | } 43 | 44 | $m_obj['regtime'] = showtime($m_obj['regtime']); 45 | 46 | // 获取用户最近文章列表 47 | if($m_obj['articles']){ 48 | 49 | $query_sql = "SELECT a.id,a.cid,a.ruid,a.title,a.addtime,a.edittime,a.comments,c.name as cname,ru.name as rauthor 50 | FROM yunbbs_articles a 51 | LEFT JOIN yunbbs_categories c ON c.id=a.cid 52 | LEFT JOIN yunbbs_users ru ON a.ruid=ru.id 53 | WHERE a.uid='".$mid."' ORDER BY id DESC LIMIT 10"; 54 | $query = $DBS->query($query_sql); 55 | $articledb=array(); 56 | while ($article = $DBS->fetch_array($query)) { 57 | // 格式化内容 58 | $article['addtime'] = showtime($article['addtime']); 59 | $article['edittime'] = showtime($article['edittime']); 60 | $articledb[] = $article; 61 | } 62 | unset($article); 63 | $DBS->free_result($query); 64 | 65 | } 66 | 67 | // 用户最近回复文章列表不能获取 68 | // 若想实现则在users 表里添加一列来保存最近回复文章的id 69 | 70 | 71 | // 页面变量 72 | $title = '会员: '.$m_obj['name']; 73 | $newest_nodes = get_newest_nodes(); 74 | $canonical = '/member/'.$m_obj['id']; 75 | $meta_des = $m_obj['name'].' - '.htmlspecialchars(mb_substr($m_obj['about'], 0, 150, 'utf-8')); 76 | 77 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'member.php'; 78 | 79 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 80 | 81 | ?> 82 | -------------------------------------------------------------------------------- /model.php: -------------------------------------------------------------------------------- 1 | query("SELECT `title`, `value` FROM `yunbbs_settings`"); 8 | $options = array(); 9 | while($setting = $DBS->fetch_array($query)) { 10 | $options[$setting['title']] = $setting['value']; 11 | } 12 | 13 | // 检测新增的 site_create 14 | if( !$options['site_create']){ 15 | $query = "SELECT regtime FROM yunbbs_users WHERE id='1'"; 16 | $m_obj = $DBS->fetch_one_array($query); 17 | if($m_obj){ 18 | $site_create = $m_obj['regtime']; 19 | $DBS->query("INSERT INTO yunbbs_settings VALUES('site_create', '$site_create')"); 20 | $options['site_create'] = $site_create; 21 | } 22 | } 23 | 24 | $options = stripslashes_array($options); 25 | 26 | if(!$options['safe_imgdomain']){ 27 | $options['safe_imgdomain'] = $_SERVER['HTTP_HOST']; 28 | } 29 | 30 | unset($setting); 31 | $DBS->free_result($query); 32 | 33 | //获取链接 34 | function get_links() { 35 | global $DBS; 36 | $query = $DBS->query("SELECT `name`, `url` FROM `yunbbs_links`"); 37 | $links = array(); 38 | while($link = $DBS->fetch_array($query)) { 39 | $links[$link['name']] = $link['url']; 40 | } 41 | unset($link); 42 | $DBS->free_result($query); 43 | return $links; 44 | } 45 | 46 | // 获取最新添加的分类 47 | function get_newest_nodes() { 48 | global $DBS, $options; 49 | $query = $DBS->query("SELECT `id`, `name`, `articles` FROM `yunbbs_categories` ORDER BY `id` DESC LIMIT ".$options['newest_node_num']); 50 | $node_arr = array(); 51 | while($node = $DBS->fetch_array($query)) { 52 | $node_arr['n-'.$node['id']] = $node['name']; 53 | } 54 | unset($node); 55 | $DBS->free_result($query); 56 | return $node_arr; 57 | } 58 | 59 | // 获取热门分类 60 | function get_bot_nodes() { 61 | global $DBS, $options; 62 | $query = $DBS->query("SELECT `id`, `name`, `articles` FROM `yunbbs_categories` ORDER BY `articles` DESC LIMIT ".$options['bot_node_num']); 63 | $node_arr = array(); 64 | while($node = $DBS->fetch_array($query)) { 65 | $node_arr['n-'.$node['id']] = $node['name']; 66 | } 67 | unset($node); 68 | $DBS->free_result($query); 69 | return $node_arr; 70 | } 71 | 72 | // 获取站点信息 73 | function get_site_infos() { 74 | global $DBS; 75 | // 如果删除表里的数据则下面信息不准确 76 | $site_infos = array(); 77 | $table_status = $DBS->fetch_one_array("SHOW TABLE STATUS LIKE 'yunbbs_users'"); 78 | $site_infos['会员'] = $table_status['Auto_increment'] -1; 79 | $table_status = $DBS->fetch_one_array("SHOW TABLE STATUS LIKE 'yunbbs_categories'"); 80 | $site_infos['分类'] = $table_status['Auto_increment'] -1; 81 | $table_status = $DBS->fetch_one_array("SHOW TABLE STATUS LIKE 'yunbbs_articles'"); 82 | $site_infos['帖子'] = $table_status['Auto_increment'] -1; 83 | $table_status = $DBS->fetch_one_array("SHOW TABLE STATUS LIKE 'yunbbs_comments'"); 84 | $site_infos['回复'] = $table_status['Auto_increment'] -1; 85 | 86 | return $site_infos; 87 | 88 | } 89 | 90 | ?> -------------------------------------------------------------------------------- /newpost.php: -------------------------------------------------------------------------------- 1 | query("SELECT `id`, `name` FROM `yunbbs_categories` WHERE `id` in($main_nodes_str)"); 27 | 28 | $main_nodes_arr = array(); 29 | while($node = $DBS->fetch_array($query)) { 30 | $main_nodes_arr[$node['id']] = $node['name']; 31 | } 32 | 33 | unset($node); 34 | $DBS->free_result($query); 35 | } 36 | 37 | 38 | if($_SERVER['REQUEST_METHOD'] == 'POST'){ 39 | if(empty($_SERVER['HTTP_REFERER']) || $_POST['formhash'] != formhash() || preg_replace("/https?:\/\/([^\:\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) !== preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST'])) { 40 | exit('403: unknown referer.'); 41 | } 42 | 43 | $p_title = addslashes(trim($_POST['title'])); 44 | $p_content = addslashes(trim($_POST['content'])); 45 | 46 | // spam_words 47 | if($options['spam_words'] && $cur_user['flag']<99){ 48 | $check_con = ' '.$p_title.$p_content; 49 | $spam_words_arr = explode(",", $options['spam_words']); 50 | foreach($spam_words_arr as $spam){ 51 | if(strpos($check_con, $spam)){ 52 | // has spam word 53 | $DBS->unbuffered_query("UPDATE yunbbs_users SET flag='0' WHERE id='$cur_uid'"); 54 | 55 | exit('403: dont post any spam.'); 56 | } 57 | } 58 | } 59 | 60 | if($options['main_nodes']){ 61 | $cid = $_POST['select_cid']; 62 | } 63 | if(($timestamp - $cur_user['lastposttime']) > $options['article_post_space']){ 64 | if($p_title){ 65 | if(mb_strlen($p_title,'utf-8')<=$options['article_title_max_len'] && mb_strlen($p_content,'utf-8')<=$options['article_content_max_len']){ 66 | $p_title = htmlspecialchars($p_title); 67 | $p_content = htmlspecialchars($p_content); 68 | $DBS->query("INSERT INTO yunbbs_articles (id,cid,uid,title,content,addtime,edittime) VALUES (null,$cid,$cur_uid, '$p_title', '$p_content', $timestamp, $timestamp)"); 69 | $new_aid = $DBS->insert_id(); 70 | $DBS->unbuffered_query("UPDATE yunbbs_categories SET articles=articles+1 WHERE id='$cid'"); 71 | $DBS->unbuffered_query("UPDATE yunbbs_users SET articles=articles+1, lastposttime=$timestamp WHERE id='$cur_uid'"); 72 | // 更新u_code 73 | $cur_user['lastposttime'] = $timestamp; 74 | // 75 | $new_ucode = md5($cur_uid.$cur_user['password'].$cur_user['regtime'].$cur_user['lastposttime'].$cur_user['lastreplytime']); 76 | setcookie("cur_uid", $cur_uid, $timestamp+ 86400 * 365, '/'); 77 | setcookie("cur_uname", $cur_uname, $timestamp+86400 * 365, '/'); 78 | setcookie("cur_ucode", $new_ucode, $timestamp+86400 * 365, '/'); 79 | 80 | // mentions 没有提醒用户的id 81 | $mentions = find_mentions(' '.$p_title.' '.$p_content, $cur_uname); 82 | if($mentions && count($mentions)<=10){ 83 | foreach($mentions as $m_name){ 84 | $DBS->unbuffered_query("UPDATE yunbbs_users SET notic = concat('$new_aid,', notic) WHERE name='$m_name'"); 85 | } 86 | } 87 | 88 | $p_title = $p_content = ''; 89 | header('location: /t-'.$new_aid); 90 | exit; 91 | }else{ 92 | $tip = '标题'.mb_strlen($p_title,'utf-8').' 或 内容'.mb_strlen($p_content,'utf-8').' 太长了'; 93 | } 94 | }else{ 95 | $tip = '标题 不能留空'; 96 | } 97 | }else{ 98 | $tip = '发帖最小间隔时间是 '.$options['article_post_space'].'秒'; 99 | } 100 | }else{ 101 | $p_title = ''; 102 | $p_content = ''; 103 | $tip = ''; 104 | $c_obj = $DBS->fetch_one_array("SELECT * FROM yunbbs_categories WHERE id='".$cid."'"); 105 | if(!$c_obj){ 106 | exit('error: 404'); 107 | } 108 | } 109 | // 页面变量 110 | $title = '发新帖子'; 111 | // 设置处理图片的最大宽度 112 | $img_max_w = 650; 113 | $newpost_page = '1'; 114 | 115 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'newpost.php'; 116 | 117 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 118 | 119 | ?> 120 | -------------------------------------------------------------------------------- /nodepage.php: -------------------------------------------------------------------------------- 1 | fetch_one_array("SELECT * FROM yunbbs_categories WHERE id='".$cid."'"); 11 | if(!$c_obj){ 12 | header("HTTP/1.0 404 Not Found"); 13 | header("Status: 404 Not Found"); 14 | include(dirname(__FILE__) . '/404.html'); 15 | exit; 16 | 17 | }; 18 | 19 | // 处理正确的页数 20 | $taltol_page = ceil($c_obj['articles']/$options['list_shownum']); 21 | if($page<0){ 22 | header('location: /n-'.$cid); 23 | exit; 24 | }else if($page==1){ 25 | header('location: /n-'.$cid); 26 | exit; 27 | }else{ 28 | if($page>$taltol_page){ 29 | header('location: /n-'.$cid.'-'.$taltol_page); 30 | exit; 31 | } 32 | } 33 | 34 | 35 | // 获取最近文章列表 36 | if($page == 0) $page = 1; 37 | 38 | $query_sql = "SELECT a.id,a.uid,a.ruid,a.title,a.top,a.isred,a.addtime,a.edittime,a.comments,u.avatar as uavatar,u.name as author,ru.name as rauthor,u.flag as flag 39 | FROM yunbbs_articles a 40 | LEFT JOIN yunbbs_users u ON a.uid=u.id 41 | LEFT JOIN yunbbs_users ru ON a.ruid=ru.id 42 | WHERE a.cid='".$cid."' AND `visible` != '0' 43 | ORDER BY `top` DESC ,edittime DESC LIMIT ".($page-1)*$options['list_shownum'].",".$options['list_shownum']; 44 | $query = $DBS->query($query_sql); 45 | $articledb=array(); 46 | while ($article = $DBS->fetch_array($query)) { 47 | // 格式化内容 48 | if($article['isred'] == '1' && $article['cid'] == '3' && $article['top'] == '1'){ 49 | $article['title'] = $article['title']."\"发布\"\"置顶\"\"精品\""; 50 | }elseif($article['isred'] == '1' && $article['cid'] == '3'){ 51 | $article['title'] = $article['title']."\"发布\"\"置顶\""; 52 | }elseif($article['isred'] == '1' && $article['top'] == '1'){ 53 | $article['title'] = $article['title']."\"置顶\"\"精品\""; 54 | }elseif($article['cid'] == '3' && $article['top'] == '1'){ 55 | $article['title'] = $article['title']."\"发布\"\"置顶\""; 56 | }elseif($article['isred'] == '1'){ 57 | $article['title'] = $article['title']."\"精品\""; 58 | }elseif($article['cid'] == '3'){ 59 | $article['title'] = $article['title']."\"发布\""; 60 | }elseif($article['top'] == '1'){ 61 | $article['title'] = $article['title']."\"置顶\""; 62 | } 63 | 64 | 65 | $article['addtime'] = showtime($article['addtime']); 66 | $article['edittime'] = showtime($article['edittime']); 67 | $articledb[] = $article; 68 | } 69 | unset($article); 70 | $DBS->free_result($query); 71 | 72 | 73 | // 页面变量 74 | $title = $c_obj['name']; 75 | $newest_nodes = get_newest_nodes(); 76 | $links = get_links(); 77 | $meta_des = $c_obj['name'].' - '.htmlspecialchars(mb_substr($c_obj['about'], 0, 150, 'utf-8')).' - page '.$page; 78 | 79 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'node.php'; 80 | 81 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 82 | 83 | ?> 84 | -------------------------------------------------------------------------------- /notifications.php: -------------------------------------------------------------------------------- 1 | fetch_one_array("SELECT * FROM yunbbs_users WHERE id='".$cur_uid."' LIMIT 1"); 19 | 20 | if($cur_user['notic']){ 21 | $ids = implode(',', array_unique(explode(',', substr($cur_user['notic'], 0, -1)))); 22 | 23 | $query_sql = "SELECT a.id,a.uid,a.cid,a.ruid,a.title,a.addtime,a.edittime,a.comments,c.name as cname,u.avatar as uavatar,u.name as author,ru.name as rauthor 24 | FROM yunbbs_articles a 25 | LEFT JOIN yunbbs_categories c ON c.id=a.cid 26 | LEFT JOIN yunbbs_users u ON a.uid=u.id 27 | LEFT JOIN yunbbs_users ru ON a.ruid=ru.id 28 | WHERE a.id in(".$ids.")"; 29 | $query = $DBS->query($query_sql); 30 | $articledb=array(); 31 | while ($article = $DBS->fetch_array($query)) { 32 | // 格式化内容 33 | $article['addtime'] = showtime($article['addtime']); 34 | $article['edittime'] = showtime($article['edittime']); 35 | $articledb[] = $article; 36 | } 37 | unset($article); 38 | $DBS->free_result($query); 39 | } 40 | 41 | // 页面变量 42 | $title = '站内提醒'; 43 | $newest_nodes = get_newest_nodes(); 44 | 45 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'notifications.php'; 46 | 47 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 48 | 49 | ?> 50 | -------------------------------------------------------------------------------- /qqcallback.php: -------------------------------------------------------------------------------- 1 | error)) 38 | { 39 | echo "

error:

" . $msg->error; 40 | echo "

msg :

" . $msg->error_description; 41 | exit; 42 | } 43 | } 44 | 45 | $params = array(); 46 | parse_str($response, $params); 47 | 48 | //debug 49 | //print_r($params); 50 | 51 | //set access token to session 52 | $_SESSION["access_token"] = $params["access_token"]; 53 | 54 | } 55 | else 56 | { 57 | echo("The state does not match. You may be a victim of CSRF."); 58 | } 59 | } 60 | 61 | function get_openid() 62 | { 63 | $graph_url = "https://graph.qq.com/oauth2.0/me?access_token=" 64 | . $_SESSION['access_token']; 65 | 66 | $str = get_url_contents($graph_url); 67 | if (strpos($str, "callback") !== false) 68 | { 69 | $lpos = strpos($str, "("); 70 | $rpos = strrpos($str, ")"); 71 | $str = substr($str, $lpos + 1, $rpos - $lpos -1); 72 | } 73 | 74 | $user = json_decode($str); 75 | if (isset($user->error)) 76 | { 77 | echo "

error:

" . $user->error; 78 | echo "

msg :

" . $user->error_description; 79 | echo '

尝试再登录

'; 80 | exit; 81 | } 82 | 83 | //set openid to session 84 | $_SESSION["openid"] = $user->openid; 85 | } 86 | 87 | function get_user_info() 88 | { 89 | $get_user_info = "https://graph.qq.com/user/get_user_info?" 90 | . "access_token=" . $_SESSION['access_token'] 91 | . "&oauth_consumer_key=" . $_SESSION["appid"] 92 | . "&openid=" . $_SESSION["openid"] 93 | . "&format=json"; 94 | 95 | $info = get_url_contents($get_user_info); 96 | $arr = json_decode($info, true); 97 | 98 | return $arr; 99 | } 100 | 101 | function get_info() 102 | { 103 | $get_info = "https://graph.qq.com/user/get_info?" 104 | . "access_token=" . $_SESSION['access_token'] 105 | . "&oauth_consumer_key=" . $_SESSION["appid"] 106 | . "&openid=" . $_SESSION["openid"] 107 | . "&format=json"; 108 | 109 | $info = get_url_contents($get_info); 110 | $arr = json_decode($info, true); 111 | 112 | return $arr; 113 | } 114 | 115 | //QQ登录成功后的回调地址,主要保存access token 116 | qq_callback(); 117 | 118 | //获取用户标示id 119 | get_openid(); 120 | 121 | $openid = $_SESSION["openid"]; 122 | 123 | $db_openid = $DBS->fetch_one_array("SELECT id,uid FROM yunbbs_qqweibo WHERE openid='".$openid."'"); 124 | 125 | if($db_openid && $db_openid['uid']){ 126 | // 直接登录 127 | $cur_uid = $db_openid['uid']; 128 | $db_user = $DBS->fetch_one_array("SELECT * FROM yunbbs_users WHERE id='".$cur_uid."' LIMIT 1"); 129 | if($db_user){ 130 | $db_ucode = md5($db_user['id'].$db_user['password'].$db_user['regtime'].$db_user['lastposttime'].$db_user['lastreplytime']); 131 | //设置cookie 132 | $u_key = 'u_'.$cur_uid; 133 | 134 | $timestamp = time(); 135 | setcookie('cur_uid', $cur_uid, $timestamp+ 86400 * 365, '/'); 136 | setcookie('cur_uname', $db_user['name'], $timestamp+86400 * 365, '/'); 137 | setcookie('cur_ucode', $db_ucode, $timestamp+86400 * 365, '/'); 138 | $cur_user = $db_user; 139 | unset($db_user); 140 | } 141 | 142 | header("Location:/"); 143 | exit; 144 | } 145 | 146 | /// 147 | if(strpos(' '.$_SESSION["scope"], 'get_info')){ 148 | $user_info = get_info(); 149 | 150 | /** 151 | * $user_info['data']['head'] 头像 /100 152 | * $user_info['data']['name'] 微博地址 http://t.qq.com/#{name} 153 | * $user_info['data']['nick'] 网站名字 154 | * $user_info['data']['regtime'] 判断是否是新用户,至少三个月 155 | */ 156 | 157 | $regtime = intval($user_info['data']['regtime']); 158 | if(!$regtime || ($timestamp - $regtime)<7776000){ 159 | echo '

抱歉,您还没开通腾讯微博,或者开通未达到3个月,请先去开通 http://t.qq.com

'; 160 | echo '

尝试再登录

'; 161 | echo '

返回首页

'; 162 | exit; 163 | } 164 | 165 | $name = $user_info['data']['name']; 166 | 167 | $_SESSION["nick"] = $user_info['data']['nick']; 168 | if($user_info['data']['head']){ 169 | $_SESSION["avatar"] = $user_info['data']['head'].'/100'; 170 | } 171 | 172 | }else{ 173 | $user_info = get_user_info(); 174 | 175 | /** 176 | * $user_info['figureurl_2'] 头像 100px 177 | * $user_info['nickname'] 178 | */ 179 | 180 | $name = ""; 181 | $_SESSION["nick"] = $user_info['nickname']; 182 | $_SESSION["avatar"] = $user_info['figureurl_2']; 183 | 184 | } 185 | 186 | 187 | 188 | if($db_openid){ 189 | if($db_openid['uid']){ 190 | // pass 191 | }else{ 192 | header("Location:/qqsetname"); 193 | exit; 194 | } 195 | }else{ 196 | $DBS->query("INSERT INTO yunbbs_qqweibo (id,uid,name,openid) VALUES (null,'0','$name', '$openid')"); 197 | header("Location:/qqsetname"); 198 | exit; 199 | } 200 | 201 | ?> 202 | -------------------------------------------------------------------------------- /qqlogin.php: -------------------------------------------------------------------------------- 1 | 28 | -------------------------------------------------------------------------------- /readme-nginx.txt: -------------------------------------------------------------------------------- 1 | rewrite ^/n-([0-9]+)(-([0-9]*))?$ /nodepage.php?cid=$1&page=$3 last; 2 | rewrite ^/t-([0-9]+)(-([0-9]*))?$ /topicpage.php?tid=$1&page=$3 last; 3 | rewrite ^/notifications$ /notifications.php last; 4 | rewrite ^/favorites$ /favorites.php last; 5 | rewrite ^/qqlogin$ /qqlogin.php last; 6 | rewrite ^/qqcallback$ /qqcallback.php last; 7 | rewrite ^/qqsetname$ /qqsetname.php last; 8 | rewrite ^/feed$ /feed.php last; 9 | rewrite ^/robots$ /robots.php last; 10 | rewrite ^/forgot$ /forgot.php last; 11 | rewrite ^/sitemap-([0-9]+)$ /sitemap.php?id=$1 last; 12 | rewrite ^/upload-(650|590)$ /upload.php?mw=$1 last; 13 | rewrite ^/viewat-(desktop|mobile)$ /viewat.php?via=$1 last; 14 | rewrite ^/goto-t-([0-9]+)$ /gototopic.php?tid=$1 last; 15 | rewrite ^/member/(.+)$ /member.php?mid=$1 last; 16 | rewrite ^/newpost/([0-9]+)$ /newpost.php?cid=$1 last; 17 | rewrite ^/admin-edit-post-([0-9]+)$ /admin-edit-post.php?tid=$1 last; 18 | rewrite ^/admin-edit-comment-([0-9]+)$ /admin-edit-comment.php?rid=$1 last; 19 | rewrite ^/admin-setuser-([0-9]+)$ /admin-setuser.php?mid=$1 last; 20 | rewrite ^/admin-node(-([0-9]*))?$ /admin-node.php?nid=$2 last; 21 | rewrite ^/admin-setting$ /admin-setting.php last; 22 | rewrite ^/admin-user-([a-z]+)(-([0-9]*))?$ /admin-user.php?act=$1&mid=$3 last; 23 | rewrite ^/admin-link-([a-z]+)(-([0-9]*))?$ /admin-link.php?act=$1&lid=$3 last; 24 | rewrite ^/(login|sigin|logout|forgot|setting|install)$ /$1.php last; 25 | rewrite ^/.*?templates /404.html last; 26 | rewrite ^/.*?avatar/$ /404.html last; 27 | rewrite ^/upload/([0-9]+/)?$ /404.html last; 28 | rewrite ^/.*?avatar/(large|normal|mini)/$ /404.html last; 29 | 30 | 31 | 32 | rewrite ^/user-edit-post-([0-9]+)$ /user-edit-post.php?tid=$1 last; -------------------------------------------------------------------------------- /rename.htaccess: -------------------------------------------------------------------------------- 1 | # errordoc 2 | ErrorDocument 404 /404.html 3 | 4 | RewriteEngine on 5 | RewriteBase / 6 | RewriteRule ^n-([0-9]+)(-([0-9]*))?$ nodepage.php?cid=$1&page=$3 [L] 7 | RewriteRule ^t-([0-9]+)(-([0-9]*))?$ topicpage.php?tid=$1&page=$3 [L] 8 | RewriteRule ^page/([0-9]+)$ indexpage.php?page=$1 [L] 9 | RewriteRule ^notifications$ notifications.php [L] 10 | RewriteRule ^favorites$ favorites.php [L] 11 | RewriteRule ^qqlogin$ qqlogin.php [L] 12 | RewriteRule ^qqcallback$ qqcallback.php [L] 13 | RewriteRule ^qqsetname$ qqsetname.php [L] 14 | RewriteRule ^wblogin$ wblogin.php [L] 15 | RewriteRule ^wbcallback$ wbcallback.php [L] 16 | RewriteRule ^wbsetname$ wbsetname.php [L] 17 | RewriteRule ^feed$ feed.php [L] 18 | RewriteRule ^robots.txt$ robots.php [L] 19 | RewriteRule ^sitemap-([0-9]+)$ sitemap.php?id=$1 [L] 20 | RewriteRule ^forgot$ forgot.php [L] 21 | RewriteRule ^upload-(650|590)$ upload.php?mw=$1 [L] 22 | RewriteRule ^viewat-(desktop|mobile)$ viewat.php?via=$1 [L] 23 | RewriteRule ^goto-t-([0-9]+)$ gototopic.php?tid=$1 [L] 24 | RewriteRule ^member/([a-zA-Z0-9\x80-\xff]{1,20})$ member.php?mid=$1 [L] 25 | RewriteRule ^newpost/([0-9]+)$ newpost.php?cid=$1 [L] 26 | RewriteRule ^admin-edit-post-([0-9]+)$ admin-edit-post.php?tid=$1 [L] 27 | RewriteRule ^admin-edit-comment-([0-9]+)$ admin-edit-comment.php?rid=$1 [L] 28 | RewriteRule ^admin-setuser-([0-9]+)$ admin-setuser.php?mid=$1 [L] 29 | RewriteRule ^admin-node(-([0-9]*))?$ admin-node.php?nid=$2 [L] 30 | RewriteRule ^admin-setting$ admin-setting.php [L] 31 | RewriteRule ^admin-user-([a-z]+)(-([0-9]*))?$ admin-user.php?act=$1&mid=$3 [L] 32 | RewriteRule ^admin-link-([a-z]+)(-([0-9]*))?$ admin-link.php?act=$1&lid=$3 [L] 33 | RewriteRule ^(login|sigin|logout|forgot|setting|install)$ $1.php [L] 34 | RewriteRule ^.*?templates 404.html [L] 35 | RewriteRule ^.*?avatar/$ 404.html [L] 36 | RewriteRule ^upload/([0-9]+/)?$ 404.html [L] 37 | RewriteRule ^.*?avatar/(large|normal|mini)/$ 404.html [L] 38 | 39 | # 40 | AddOutputFilterByType DEFLATE text/html 41 | AddOutputFilterByType DEFLATE text/css 42 | AddOutputFilterByType DEFLATE text/javascript 43 | AddOutputFilterByType DEFLATE image/png 44 | AddOutputFilterByType DEFLATE image/jpeg 45 | -------------------------------------------------------------------------------- /robots.php: -------------------------------------------------------------------------------- 1 | fetch_one_array("SHOW TABLE STATUS LIKE 'yunbbs_articles'"); 23 | $post_num = $table_status['Auto_increment'] -1; 24 | 25 | $max_num = 39000; 26 | $taltol_page = ceil($post_num/$max_num); 27 | $base_url = 'http://'.$_SERVER['HTTP_HOST']; 28 | 29 | for($i = 1; $i <= $post_num; $i+=$max_num){ 30 | echo 'Sitemap: ',$base_url,'/sitemap-',$i,"\n"; 31 | } 32 | 33 | ?> 34 | -------------------------------------------------------------------------------- /seccode.php: -------------------------------------------------------------------------------- 1 | array('3c','66','66','66','66','66','66','66','66','3c'), 63 | 1 => array('1c','0c','0c','0c','0c','0c','0c','0c','1c','0c'), 64 | 2 => array('7e','60','60','30','18','0c','06','06','66','3c'), 65 | 3 => array('3c','66','06','06','06','1c','06','06','66','3c'), 66 | 4 => array('1e','0c','7e','4c','2c','2c','1c','1c','0c','0c'), 67 | 5 => array('3c','66','06','06','06','7c','60','60','60','7e'), 68 | 6 => array('3c','66','66','66','66','7c','60','60','30','1c'), 69 | 7 => array('30','30','18','18','0c','0c','06','06','66','7e'), 70 | 8 => array('3c','66','66','66','66','3c','66','66','66','3c'), 71 | 9 => array('38','0c','06','06','3e','66','66','66','66','3c') 72 | ); 73 | 74 | for($i = 0; $i < 10; $i++) { 75 | for($j = 0; $j < 6; $j++) { 76 | $a1 = substr('012', mt_rand(0, 2), 1).substr('012345', mt_rand(0, 5), 1); 77 | $a2 = substr('012345', mt_rand(0, 5), 1).substr('0123', mt_rand(0, 3), 1); 78 | mt_rand(0, 1) == 1 ? array_push($numbers[$i], $a1) : array_unshift($numbers[$i], $a1); 79 | mt_rand(0, 1) == 0 ? array_push($numbers[$i], $a1) : array_unshift($numbers[$i], $a2); 80 | } 81 | } 82 | 83 | $bitmap = array(); 84 | for($i = 0; $i < 20; $i++) { 85 | for($j = 0; $j < 4; $j++) { 86 | $n = substr($code, $j, 1); 87 | $bytes = $numbers[$n][$i]; 88 | $a = mt_rand(0, 14); 89 | switch($a) { 90 | case 1: str_replace('9', '8', $bytes); break; 91 | case 3: str_replace('c', 'e', $bytes); break; 92 | case 6: str_replace('3', 'b', $bytes); break; 93 | case 8: str_replace('8', '9', $bytes); break; 94 | case 0: str_replace('e', 'f', $bytes); break; 95 | } 96 | array_push($bitmap, $bytes); 97 | } 98 | } 99 | 100 | for($i = 0; $i < 8; $i++) { 101 | $a = substr('012', mt_rand(0, 2), 1) . substr('012345', mt_rand(0, 5), 1); 102 | array_unshift($bitmap, $a); 103 | array_push($bitmap, $a); 104 | } 105 | 106 | $image = pack('H*', '424d9e000000000000003e000000280000002000000018000000010001000000'. 107 | '0000600000000000000000000000000000000000000000000000FFFFFF00'.implode('', $bitmap)); 108 | 109 | header('Content-Type: image/bmp'); 110 | echo $image; 111 | } 112 | 113 | ?> 114 | -------------------------------------------------------------------------------- /sigin.php: -------------------------------------------------------------------------------- 1 | 微博登录'; 13 | } 14 | if($options['qq_appid'] && $options['qq_appkey']){ 15 | echo ' QQ登录'; 16 | } 17 | echo ' 返回首页'; 18 | exit; 19 | } 20 | 21 | 22 | if($cur_user){ 23 | header('location: /'); 24 | exit; 25 | }else{ 26 | if($options['close_register']){ 27 | header('location: /login'); 28 | exit; 29 | } 30 | } 31 | 32 | $errors = array(); 33 | if($_SERVER['REQUEST_METHOD'] == 'POST'){ 34 | if(empty($_SERVER['HTTP_REFERER']) || $_POST['formhash'] != formhash() || preg_replace("/https?:\/\/([^\:\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) !== preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST'])) { 35 | exit('403: unknown referer.'); 36 | } 37 | 38 | $name = addslashes(strtolower(trim($_POST["name"]))); 39 | $pw = addslashes(trim($_POST["pw"])); 40 | $pw2 = addslashes(trim($_POST["pw2"])); 41 | $seccode = intval(trim($_POST["seccode"])); 42 | if($name && $pw && $pw2 && $seccode){ 43 | if($pw === $pw2){ 44 | if(strlen($name)<21 && strlen($pw)<32){ 45 | //检测字符 46 | if(preg_match('/^[a-zA-Z0-9\x80-\xff]{4,20}$/i', $name)){ 47 | if(preg_match('/^[0-9]{4,20}$/', $name)){ 48 | $errors[] = '名字不能全为数字'; 49 | }else{ 50 | error_reporting(0); 51 | session_start(); 52 | if($seccode === intval($_SESSION['code'])){ 53 | $db_user = $DBS->fetch_one_array("SELECT id FROM yunbbs_users WHERE name='".$name."' LIMIT 1"); 54 | if(!$db_user){ 55 | //正常 56 | }else{ 57 | $errors[] = '这名字太火了,已经被抢注了,换一个吧!'; 58 | } 59 | }else{ 60 | $errors[] = '验证码输入不对'; 61 | } 62 | } 63 | }else{ 64 | $errors[] = '名字 太长 或 太短 或 包含非法字符'; 65 | } 66 | }else{ 67 | $errors[] = '用户名 或 密码 太长了'; 68 | } 69 | }else{ 70 | $errors[] = '密码、重复密码 输入不一致'; 71 | } 72 | }else{ 73 | $errors[] = '用户名、密码、重复密码、验证码 必填'; 74 | } 75 | //// 76 | if(!$errors){ 77 | $pwmd5 = md5($pw); 78 | 79 | if($options['register_review']){ 80 | $flag = 1; 81 | }else{ 82 | $flag = 5; 83 | } 84 | $DBS->query("INSERT INTO yunbbs_users (id,name,flag,password,regtime) VALUES (null,'$name', $flag, '$pwmd5', $timestamp)"); 85 | $new_uid = $DBS->insert_id(); 86 | if($new_uid == 1){ 87 | $DBS->unbuffered_query("UPDATE yunbbs_users SET flag = '99' WHERE id='1'"); 88 | } 89 | 90 | //设置cookie 91 | $db_ucode = md5($new_uid.$pwmd5.$timestamp.'00'); 92 | $cur_uid = $new_uid; 93 | setcookie("cur_uid", $cur_uid, $timestamp+ 86400 * 365, '/'); 94 | setcookie("cur_uname", $name, $timestamp+86400 * 365, '/'); 95 | setcookie("cur_ucode", $db_ucode, $timestamp+86400 * 365, '/'); 96 | header('location: /'); 97 | exit; 98 | } 99 | } 100 | 101 | // 页面变量 102 | $title = '注 册'; 103 | 104 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'sigin_login.php'; 105 | 106 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php'); 107 | 108 | ?> 109 | -------------------------------------------------------------------------------- /sitemap.php: -------------------------------------------------------------------------------- 1 | '."\n "; 9 | $xml .= ''."\n "; 10 | 11 | if($is_spider){ 12 | $id = intval($_GET['id']); 13 | 14 | $table_status = $DBS->fetch_one_array("SHOW TABLE STATUS LIKE 'yunbbs_articles'"); 15 | $post_num = $table_status['Auto_increment'] -1; 16 | 17 | $max_num = 39000; 18 | 19 | $from_i = $id; 20 | $to_i = $from_i + $max_num; 21 | if($to_i > $post_num){ 22 | $to_i = $post_num + 1; 23 | } 24 | 25 | 26 | for($i = $from_i; $i < $to_i; $i++){ 27 | $xml .= ''.$base_url.'/t-'.$i.''."\n "; 28 | } 29 | }else{ 30 | $xml .= ''.$base_url.''."\n "; 31 | } 32 | 33 | $xml .= ''; 34 | 35 | header("content-Type: text/xml"); 36 | echo $xml; 37 | ?> 38 | -------------------------------------------------------------------------------- /static/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/Thumbs.db -------------------------------------------------------------------------------- /static/connect_logo_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/connect_logo_7.png -------------------------------------------------------------------------------- /static/default/img/bg.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/default/img/bg.PNG -------------------------------------------------------------------------------- /static/default/img/bg_ft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/default/img/bg_ft.png -------------------------------------------------------------------------------- /static/default/img/bg_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/default/img/bg_header.png -------------------------------------------------------------------------------- /static/default/img/bg_item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/default/img/bg_item.png -------------------------------------------------------------------------------- /static/default/img/index.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/default/img/index.htm -------------------------------------------------------------------------------- /static/default/img/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/default/img/index.html -------------------------------------------------------------------------------- /static/default/img/index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 404 Not Found 7 | 8 |

Not Found

9 | The requested URL was not found on this server.

10 |


11 |
Web Server at Port
12 | -------------------------------------------------------------------------------- /static/default/img/newisred.GIF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/default/img/newisred.GIF -------------------------------------------------------------------------------- /static/default/img/newistop.GIF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/default/img/newistop.GIF -------------------------------------------------------------------------------- /static/default/img/newrelease.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/default/img/newrelease.jpg -------------------------------------------------------------------------------- /static/default/img/top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/default/img/top.png -------------------------------------------------------------------------------- /static/default/index.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/default/index.htm -------------------------------------------------------------------------------- /static/default/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/default/index.html -------------------------------------------------------------------------------- /static/default/index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 404 Not Found 7 | 8 |

Not Found

9 | The requested URL was not found on this server.

10 |


11 |
Web Server at Port
12 | -------------------------------------------------------------------------------- /static/grey.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/grey.gif -------------------------------------------------------------------------------- /static/grey2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/grey2.gif -------------------------------------------------------------------------------- /static/images/index.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/images/index.htm -------------------------------------------------------------------------------- /static/images/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/images/index.html -------------------------------------------------------------------------------- /static/images/index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 404 Not Found 7 | 8 |

Not Found

9 | The requested URL was not found on this server.

10 |


11 |
Web Server at Port
12 | -------------------------------------------------------------------------------- /static/index.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/index.htm -------------------------------------------------------------------------------- /static/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/index.html -------------------------------------------------------------------------------- /static/index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 404 Not Found 7 | 8 |

Not Found

9 | The requested URL was not found on this server.

10 |


11 |
Web Server at Port
12 | -------------------------------------------------------------------------------- /static/js/index.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/js/index.htm -------------------------------------------------------------------------------- /static/js/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/js/index.html -------------------------------------------------------------------------------- /static/js/index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 404 Not Found 7 | 8 |

Not Found

9 | The requested URL was not found on this server.

10 |


11 |
Web Server at Port
12 | -------------------------------------------------------------------------------- /static/js/jquery.lazyload.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Lazy Load - jQuery plugin for lazy loading images 3 | * 4 | * Copyright (c) 2007-2012 Mika Tuupola 5 | * 6 | * Licensed under the MIT license: 7 | * http://www.opensource.org/licenses/mit-license.php 8 | * 9 | * Project home: 10 | * http://www.appelsiini.net/projects/lazyload 11 | * 12 | * Version: 1.8.0 13 | * 14 | */ 15 | (function(a,b){var c=a(b);a.fn.lazyload=function(d){function h(){var b=0;e.each(function(){var c=a(this);if(g.skip_invisible&&!c.is(":visible"))return;if(!a.abovethetop(this,g)&&!a.leftofbegin(this,g))if(!a.belowthefold(this,g)&&!a.rightoffold(this,g))c.trigger("appear");else if(++b>g.failure_limit)return!1})}var e=this,f,g={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null};return d&&(undefined!==d.failurelimit&&(d.failure_limit=d.failurelimit,delete d.failurelimit),undefined!==d.effectspeed&&(d.effect_speed=d.effectspeed,delete d.effectspeed),a.extend(g,d)),f=g.container===undefined||g.container===b?c:a(g.container),0===g.event.indexOf("scroll")&&f.bind(g.event,function(a){return h()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,c.one("appear",function(){if(!this.loaded){if(g.appear){var d=e.length;g.appear.call(b,d,g)}a("").bind("load",function(){c.hide().attr("src",c.data(g.data_attribute))[g.effect](g.effect_speed),b.loaded=!0;var d=a.grep(e,function(a){return!a.loaded});e=a(d);if(g.load){var f=e.length;g.load.call(b,f,g)}}).attr("src",c.data(g.data_attribute))}}),0!==g.event.indexOf("scroll")&&c.bind(g.event,function(a){b.loaded||c.trigger("appear")})}),c.bind("resize",function(a){h()}),h(),this},a.belowthefold=function(d,e){var f;return e.container===undefined||e.container===b?f=c.height()+c.scrollTop():f=a(e.container).offset().top+a(e.container).height(),f<=a(d).offset().top-e.threshold},a.rightoffold=function(d,e){var f;return e.container===undefined||e.container===b?f=c.width()+c.scrollLeft():f=a(e.container).offset().left+a(e.container).width(),f<=a(d).offset().left-e.threshold},a.abovethetop=function(d,e){var f;return e.container===undefined||e.container===b?f=c.scrollTop():f=a(e.container).offset().top,f>=a(d).offset().top+e.threshold+a(d).height()},a.leftofbegin=function(d,e){var f;return e.container===undefined||e.container===b?f=c.scrollLeft():f=a(e.container).offset().left,f>=a(d).offset().left+e.threshold+a(d).width()},a.inviewport=function(b,c){return!a.rightofscreen(b,c)&&!a.leftofscreen(b,c)&&!a.belowthefold(b,c)&&!a.abovethetop(b,c)},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return!a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})})(jQuery,window) 16 | -------------------------------------------------------------------------------- /static/js/jquery.upload-1.0.2.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery.upload v1.0.2 3 | * 4 | * Copyright (c) 2010 lagos 5 | * Dual licensed under the MIT and GPL licenses. 6 | * 7 | * http://lagoscript.org 8 | */ 9 | (function(b){function m(e){return b.map(n(e),function(d){return''}).join("")}function n(e){function d(c,f){a.push({name:c,value:f})}if(b.isArray(e))return e;var a=[];if(typeof e==="object")b.each(e,function(c){b.isArray(this)?b.each(this,function(){d(c,this)}):d(c,b.isFunction(this)?this():this)});else typeof e==="string"&&b.each(e.split("&"),function(){var c=b.map(this.split("="),function(f){return decodeURIComponent(f.replace(/\+/g," "))}); 10 | d(c[0],c[1])});return a}function o(e,d){var a;a=b(e).contents().get(0);if(b.isXMLDoc(a)||a.XMLDocument)return a.XMLDocument||a;a=b(a).find("body").html();switch(d){case "xml":a=a;if(window.DOMParser)a=(new DOMParser).parseFromString(a,"application/xml");else{var c=new ActiveXObject("Microsoft.XMLDOM");c.async=false;c.loadXML(a);a=c}break;case "json":a=window.eval("("+a+")");break}return a}var p=0;b.fn.upload=function(e,d,a,c){var f=this,g,j,h;h="jquery_upload"+ ++p;var k=b('