├── .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 '';
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('').appendTo("body"),
11 | i='';if(b.isFunction(d)){c=a;a=d;d={}}j=b("input:checkbox",this);h=b("input:checked",this);i=f.wrapAll(i).parent("form").attr("action",e);j.removeAttr("checked");h.attr("checked",true);g=(g=m(d))?b(g).appendTo(i):null;i.submit(function(){k.load(function(){var l=o(this,c),q=b("input:checked",f);i.after(f).remove();j.removeAttr("checked");q.attr("checked",true);g&&g.remove();setTimeout(function(){k.remove();c==="script"&&b.globalEval(l);
12 | a&&a.call(f,l)},0)})}).submit();return this}})(jQuery);
13 |
--------------------------------------------------------------------------------
/static/js/postsave.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | var StoragePrefix = "youBBS-acicfg-";
3 | var saveDays = 7;
4 |
5 | var s_Unsupported = "不支持的浏览器";
6 | var s_LastSave = "上次保存于:";
7 | var s_NoSave = "尚未保存过";
8 | var s_Saved = "已保存";
9 | var s_Spacer = " ";
10 | var s_Save = '保存';
11 | var s_Restore = '恢复';
12 | var s_Delete = '删除';
13 | var s_Confirm = "恢复数据会覆盖现有内容,是否确认?";
14 |
15 | var saveNode = document.getElementById('id-post-autosave');
16 | var $ = function(a) { return document.getElementById(a); }; //Local variable. It won't clash with jQuery in the global scope.
17 |
18 | if(saveNode) {
19 | if(window.localStorage) {
20 | var saveAnchor = document.createElement('a');
21 | var restoreAnchor = document.createElement('a');
22 | var delAnchor = document.createElement('a');
23 | var timeSpan = document.createElement('span');
24 |
25 | var gcLocalStorage = function() { //Use var xxx = function() to avoid polluting global scope. Some browsers consider function xxx() to be window.xxx = function().
26 | var i, k, p, t = new Date().getTime();
27 | for(i = 0; i < window.localStorage.length; i++) {
28 | k = window.localStorage.key(i);
29 | if(k.indexOf(StoragePrefix) !== 0) {
30 | continue;
31 | }
32 | try {
33 | p = JSON.parse(window.localStorage[k]);
34 | if(t > p["TTL"]) {
35 | window.localStorage.removeItem(k);
36 | i--;
37 | }
38 | } catch(e) {
39 | window.localStorage.removeItem(k);
40 | }
41 | }
42 | };
43 |
44 | var setLocalStorage = function(key, value, exdays) {
45 | key = StoragePrefix + key;
46 | gcLocalStorage();
47 | window.localStorage[key] = JSON.stringify({"TTL":new Date().getTime() + exdays * 86400 * 1000, "value":value});
48 | };
49 |
50 | var getLocalStorage = function(key) {
51 | key = StoragePrefix + key;
52 | gcLocalStorage();
53 | if(key in window.localStorage) {
54 | var p = JSON.parse(window.localStorage[key]);
55 | return p["value"];
56 | }
57 | };
58 |
59 | var delLocalStorage = function(key) {
60 | key = StoragePrefix + key;
61 | gcLocalStorage();
62 | if(key in window.localStorage) {
63 | window.localStorage.removeItem(key);
64 | }
65 | };
66 |
67 | var getSanitizedPathname = function() {
68 | if(/^\/t-[0-9]+/.test(location.pathname)) {
69 | return /^\/t-[0-9]+/.exec(location.pathname);
70 | }
71 | if(/^\/newpost\/[0-9]+$/.test(location.pathname)) {
72 | return location.pathname;
73 | }
74 | throw "This should not happen.";
75 | };
76 |
77 | var postKey = function() {
78 | return "postsave" + getSanitizedPathname();
79 | };
80 |
81 | var updateLastSave = function() {
82 | var p = getLocalStorage(postKey());
83 | if(p) {
84 | timeSpan.innerHTML = new Date(p["time"]).toLocaleString();
85 | } else {
86 | timeSpan.innerHTML = s_NoSave;
87 | }
88 | };
89 |
90 | var savePost = function(auto) {
91 | var p = {};
92 |
93 | if($('id-post-title')) {
94 | p["title"] = $('id-post-title').value;
95 | }
96 | p["message"] = $('id-content').value;
97 | p["path"] = getSanitizedPathname();
98 | p["time"] = new Date().getTime();
99 |
100 | setLocalStorage(postKey(), p, saveDays);
101 | updateLastSave();
102 | if(!auto) {
103 | alert(s_Saved);
104 | }
105 | };
106 |
107 | var restorePost = function() {
108 | if(!confirm(s_Confirm)) {
109 | return;
110 | }
111 | var p = getLocalStorage(postKey());
112 | if(p) {
113 | if($('id-post-title')) {
114 | $('id-post-title').value = p["title"];
115 | }
116 | $('id-content').value = p["message"];
117 | }
118 | };
119 |
120 | var deletePost = function() {
121 | delLocalStorage(postKey());
122 | updateLastSave();
123 | }
124 |
125 | updateLastSave();
126 |
127 | $('id-post-submit').addEventListener('click', function() { savePost(true); });
128 | saveAnchor.addEventListener('click', function() { savePost(false); });
129 | restoreAnchor.addEventListener('click', restorePost);
130 | delAnchor.addEventListener('click', deletePost);
131 |
132 | saveAnchor.appendChild(document.createTextNode(s_Save));
133 | restoreAnchor.appendChild(document.createTextNode(s_Restore));
134 | delAnchor.appendChild(document.createTextNode(s_Delete));
135 |
136 | saveNode.innerHTML = '';
137 | saveNode.appendChild(document.createTextNode(s_LastSave));
138 | saveNode.appendChild(timeSpan);
139 | saveNode.appendChild(document.createTextNode(s_Spacer));
140 | saveNode.appendChild(saveAnchor);
141 | saveNode.appendChild(document.createTextNode(s_Spacer));
142 | saveNode.appendChild(restoreAnchor);
143 | saveNode.appendChild(document.createTextNode(s_Spacer));
144 | saveNode.appendChild(delAnchor);
145 | } else {
146 | saveNode.innerHTML = s_CantSave;
147 | }
148 | }
149 |
150 | }());
151 |
--------------------------------------------------------------------------------
/static/qq_logo_55_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/qq_logo_55_24.png
--------------------------------------------------------------------------------
/static/weibo_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/weibo_login.png
--------------------------------------------------------------------------------
/static/weibo_login_55_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/weibo_login_55_24.png
--------------------------------------------------------------------------------
/static/weibo_login_63_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/static/weibo_login_63_24.png
--------------------------------------------------------------------------------
/templates/default/admin-edit-comment.php:
--------------------------------------------------------------------------------
1 |
6 | ',$options['name'],' » - 修改评论';
7 | echo '
8 |
9 |
10 | ';
11 | if($tip){
12 | echo '
',$tip,'
';
13 | }
14 |
15 | echo '
16 |
26 |
查看这条评论所在的帖子
27 |
';
28 |
29 |
30 | ?>
31 |
--------------------------------------------------------------------------------
/templates/default/admin-edit-post.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
',$options['name'],' » - 修改帖子 »
8 |
20 |
21 |
22 | ';
56 |
57 |
58 | ?>
59 |
--------------------------------------------------------------------------------
/templates/default/admin-link.php:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 | ';
11 | if($tip1){
12 | echo '
',$tip1,'
';
13 | }
14 |
15 | echo '
16 |
22 |
';
23 |
24 |
25 | if($l_obj){
26 | echo '
27 |
28 | 修改链接
29 |
30 | ';
31 | if($tip2){
32 | echo '
',$tip2,'
';
33 | }
34 |
35 | echo '
36 |
44 |
';
45 | }
46 |
47 | if($linkdb){
48 | echo '
49 |
50 | 链接列表
51 |
52 | ';
53 | echo '
54 |
';
55 | foreach($linkdb as $link){
56 | echo '- ',$link['name'],' • ',$link['url'],' • 编辑 • 删除
';
57 | }
58 |
59 | echo '
60 |
';
61 | }
62 |
63 | ?>
64 |
--------------------------------------------------------------------------------
/templates/default/admin-node.php:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 | ';
11 | if($tip1){
12 | echo '
',$tip1,'
';
13 | }
14 |
15 | echo '
16 |
24 |
';
25 |
26 | echo '
27 |
28 | 修改分类
29 |
30 | ';
55 |
56 | ?>
57 |
--------------------------------------------------------------------------------
/templates/default/admin-setuser.php:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
',$tip4,'
8 |
32 |
33 |
34 |
35 |
36 | ',$title,' ',$m_obj['name'],'
37 |
38 |
',$tip1,'
39 |
62 |
63 |
64 |
65 |
66 | 为',$m_obj['name'],'设置头像
67 |
68 |
',$tip2,'
69 |
92 |
93 |
94 |
95 |
96 | 为',$m_obj['name'],'重设密码
97 |
98 |
',$tip3,'
99 |
118 |
119 |
';
120 | ?>
121 |
--------------------------------------------------------------------------------
/templates/default/admin-user.php:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | ';
11 | if($tip1){
12 | echo '
',$tip1,'
';
13 | }
14 | echo '
15 |
';
16 | foreach($userdb as $user){
17 | echo '- ',$user['name'],' • 于',$user['regtime'],'注册 • 通过注册
';
18 | }
19 |
20 | echo '
21 |
';
22 | }
23 |
24 | if($userdb2){
25 | echo '
26 |
27 |
28 |
29 | ';
30 | if($tip2){
31 | echo '
',$tip2,'
';
32 | }
33 | echo '
34 |
';
35 | foreach($userdb2 as $user){
36 | echo '- ',$user['name'],' • 于',$user['regtime'],'注册 • 解禁
';
37 | }
38 |
39 | echo '
40 |
';
41 | }
42 |
43 | }else{
44 | echo '
45 |
46 |
47 |
48 |
49 |
目前尚无 等待审核的用户 或 被禁用的用户
50 |
51 |
';
52 |
53 | }
54 |
55 | ?>
56 |
--------------------------------------------------------------------------------
/templates/default/favorites.php:
--------------------------------------------------------------------------------
1 |
6 | ',$options['name'],' » 个人收藏的帖子 (',$user_fav['articles'],')
7 |
8 |
9 | ';
10 |
11 | if($articledb){
12 |
13 | foreach($articledb as $article){
14 | echo '
15 |
16 |
19 |
20 |
21 |
',$article['cname'],' • ',$article['author'],'';
22 | if($article['comments']){
23 | echo ' • ',$article['edittime'],' • 最后回复来自 ',$article['rauthor'],'';
24 | }else{
25 | echo ' • ',$article['addtime'];
26 | }
27 | echo ' • <取消收藏>
28 |
';
29 | if($article['comments']){
30 | $gotopage = ceil($article['comments']/$options['commentlist_num']);
31 | if($gotopage == 1){
32 | $c_page = '';
33 | }else{
34 | $c_page = '-'.$gotopage;
35 | }
36 | echo '
';
37 | }
38 | echo '
39 |
';
40 |
41 | }
42 |
43 |
44 | if($user_fav['articles'] > $options['list_shownum']){
45 | echo '';
54 | }
55 |
56 |
57 | }else{
58 | echo '
暂无收藏帖子
';
59 | }
60 |
61 | echo '
';
62 |
63 | ?>
--------------------------------------------------------------------------------
/templates/default/forgot.php:
--------------------------------------------------------------------------------
1 | ',$options['name'],' » ',$title,'
6 |
7 |
';
8 | foreach($errors as $error){
9 | echo '› ',$error,'
';
10 | }
11 | echo '
12 |
请填写登录名和个人设置里的邮箱:
13 |
28 |
';
29 |
30 | ?>
31 |
--------------------------------------------------------------------------------
/templates/default/home.php:
--------------------------------------------------------------------------------
1 |
6 | ';
9 | if($cur_user && $cur_user['flag']>4 && $newest_nodes){
10 | //echo '请先选择相关主题再发帖
';
11 | echo '';
12 | }
13 | echo '
14 |
15 |
16 | ';
17 |
18 | foreach($articledb as $article){
19 | echo '
20 |
21 |
28 |
29 |
30 |
',$article['cname'],' • ',$article['author'],'';
31 | if($article['comments']){
32 | echo ' • ',$article['edittime'],' • 最后回复来自 ',$article['rauthor'],'';
33 | }else{
34 | echo ' • ',$article['addtime'];
35 | }
36 | echo '
37 |
';
38 | if($article['comments']){
39 | $gotopage = ceil($article['comments']/$options['commentlist_num']);
40 | if($gotopage == 1){
41 | $c_page = '';
42 | }else{
43 | $c_page = '-'.$gotopage;
44 | }
45 | echo '
';
46 | }
47 | echo '
48 |
';
49 |
50 | }
51 |
52 |
53 | if(count($articledb) == $options['home_shownum']){
54 | echo '';
58 | }
59 |
60 |
61 | echo '
';
62 |
63 | if(isset($bot_nodes)){
64 | echo '
65 | 热门分类
66 |
67 |
';
68 | foreach( $bot_nodes as $k=>$v ){
69 | echo '',$v,'';
70 | }
71 | echo '
72 |
73 |
74 |
75 |
';
76 | }
77 |
78 | ?>
--------------------------------------------------------------------------------
/templates/default/indexpage.php:
--------------------------------------------------------------------------------
1 |
6 | ';
8 |
9 | if($cur_user && $cur_user['flag']>4){
10 | echo '';
11 | }
12 | echo '
13 |
14 |
15 | ';
16 |
17 | foreach($articledb as $article){
18 | echo '
19 |
20 |
27 |
28 |
29 |
',$article['cname'],' • ',$article['author'],'';
30 | if($article['comments']){
31 | echo ' • ',$article['edittime'],' • 最后回复来自 ',$article['rauthor'],'';
32 | }else{
33 | echo ' • ',$article['addtime'];
34 | }
35 | echo '
36 |
';
37 | if($article['comments']){
38 | $gotopage = ceil($article['comments']/$options['commentlist_num']);
39 | if($gotopage == 1){
40 | $c_page = '';
41 | }else{
42 | $c_page = '-'.$gotopage;
43 | }
44 | echo '
';
45 | }
46 | echo '
47 |
';
48 |
49 | }
50 |
51 | if($taltol_article > $options['list_shownum']){
52 | echo '';
65 | }
66 |
67 |
68 | echo '
';
69 |
70 | ?>
--------------------------------------------------------------------------------
/templates/default/ios_admin-edit-comment.php:
--------------------------------------------------------------------------------
1 |
6 | ',$options['name'],' » - 修改评论';
7 | echo '
8 |
9 |
10 | ';
11 | if($tip){
12 | echo '
',$tip,'
';
13 | }
14 |
15 | echo '
16 |
20 |
查看这条评论所在的帖子
21 |
';
22 |
23 |
24 | ?>
25 |
--------------------------------------------------------------------------------
/templates/default/ios_admin-edit-post.php:
--------------------------------------------------------------------------------
1 |
6 |
7 | » - 修改帖子 »
8 |
22 |
23 |
24 | ';
51 |
52 |
53 | ?>
54 |
--------------------------------------------------------------------------------
/templates/default/ios_admin-link.php:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 | ';
23 |
24 |
25 | if($l_obj){
26 | echo '
27 |
28 | 修改链接
29 |
30 | ';
45 | }
46 |
47 | if($linkdb){
48 | echo '
49 |
50 | 链接列表
51 |
52 | ';
53 | echo '
54 |
';
55 | foreach($linkdb as $link){
56 | echo '- ',$link['name'],' • ',$link['url'],'
---------------- • 编辑 • 删除 ';
57 | }
58 |
59 | echo '
60 |
';
61 | }
62 |
63 | ?>
64 |
--------------------------------------------------------------------------------
/templates/default/ios_admin-node.php:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 | ';
11 | if($tip1){
12 | echo '
',$tip1,'
';
13 | }
14 |
15 | echo '
16 |
24 |
';
25 |
26 | echo '
27 |
28 | 修改分类
29 |
30 | ';
55 |
56 | ?>
57 |
--------------------------------------------------------------------------------
/templates/default/ios_admin-setuser.php:
--------------------------------------------------------------------------------
1 |
5 |
6 | ';
7 | if($tip4){
8 | echo '
',$tip4,'
';
9 | }
10 | echo '
11 |
12 |
36 |
37 |
38 |
39 |
40 | ',$title,' ',$m_obj['name'],'
41 | ';
42 | if($tip1){
43 | echo '
',$tip1,'
';
44 | }
45 | echo '
46 |
69 |
70 |
71 |
72 |
73 | 为',$m_obj['name'],'重设密码
74 | ';
75 | if($tip3){
76 | echo '
',$tip3,'
';
77 | }
78 | echo '
79 |
98 |
99 |
';
100 | ?>
101 |
--------------------------------------------------------------------------------
/templates/default/ios_admin-user.php:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | ';
11 | if($tip1){
12 | echo '
',$tip1,'
';
13 | }
14 | echo '
15 |
';
16 | foreach($userdb as $user){
17 | echo '- ',$user['name'],' • 于',$user['regtime'],'注册 • 通过注册
';
18 | }
19 |
20 | echo '
21 |
';
22 | }
23 |
24 | if($userdb2){
25 | echo '
26 |
27 |
28 |
29 | ';
30 | if($tip2){
31 | echo '
',$tip2,'
';
32 | }
33 | echo '
34 |
';
35 | foreach($userdb2 as $user){
36 | echo '- ',$user['name'],' • 于',$user['regtime'],'注册 • 解禁
';
37 | }
38 |
39 | echo '
40 |
';
41 | }
42 |
43 | }else{
44 | echo '
45 |
46 |
47 |
48 |
49 |
目前尚无 等待审核的用户 或 被禁用的用户
50 |
51 |
';
52 |
53 | }
54 |
55 | ?>
56 |
--------------------------------------------------------------------------------
/templates/default/ios_favorites.php:
--------------------------------------------------------------------------------
1 |
6 | 个人收藏的帖子 (',$user_fav['articles'],')
7 |
8 |
9 | ';
10 |
11 | if($articledb){
12 |
13 | foreach($articledb as $article){
14 | echo '
15 |
16 |
17 |
18 |
19 |
',$article['cname'],'';
20 | if($article['comments']){
21 | echo ' • ',$article['rauthor'],' ',$article['edittime'],'回复';
22 | }else{
23 | echo ' • ',$article['author'],' ',$article['addtime'],'发表';
24 | }
25 | echo ' • <取消收藏>
26 |
';
27 | if($article['comments']){
28 | $gotopage = ceil($article['comments']/$options['commentlist_num']);
29 | if($gotopage == 1){
30 | $c_page = '';
31 | }else{
32 | $c_page = '-'.$gotopage;
33 | }
34 | echo '
';
35 | }
36 | echo '
37 |
';
38 |
39 | }
40 |
41 |
42 | if($user_fav['articles'] > $options['list_shownum']){
43 | echo '';
52 | }
53 |
54 |
55 | }else{
56 | echo '
暂无收藏帖子
';
57 | }
58 |
59 | echo '
';
60 |
61 | ?>
--------------------------------------------------------------------------------
/templates/default/ios_forgot.php:
--------------------------------------------------------------------------------
1 | ',$options['name'],' » ',$title,'
6 |
7 |
';
8 | foreach($errors as $error){
9 | echo '› ',$error,'
';
10 | }
11 | echo '
12 |
请填写登录名和个人设置里的邮箱:
13 |
28 |
';
29 |
30 | ?>
31 |
--------------------------------------------------------------------------------
/templates/default/ios_home.php:
--------------------------------------------------------------------------------
1 |
6 |
7 | » 最近更新
8 |
';
9 | if($cur_user && $cur_user['flag']>4 && $newest_nodes){
10 | echo '';
11 | }
12 | echo '
13 |
14 |
15 | ';
16 |
17 | foreach($articledb as $article){
18 | echo '
19 |
20 |
23 |
24 |
25 |
',$article['cname'],'';
26 | if($article['comments']){
27 | echo ' • ',$article['rauthor'],' ',$article['edittime'],'回复';
28 | }else{
29 | echo ' • ',$article['author'],' ',$article['addtime'],'发表';
30 | }
31 | echo '
32 |
';
33 | if($article['comments']){
34 | $gotopage = ceil($article['comments']/$options['commentlist_num']);
35 | if($gotopage == 1){
36 | $c_page = '';
37 | }else{
38 | $c_page = '-'.$gotopage;
39 | }
40 | echo '
';
41 | }
42 | echo '
43 |
';
44 |
45 | }
46 |
47 |
48 | if(count($articledb) == $options['home_shownum']){
49 | echo '';
53 | }
54 |
55 |
56 | echo '
';
57 |
58 |
59 | ?>
--------------------------------------------------------------------------------
/templates/default/ios_indexpage.php:
--------------------------------------------------------------------------------
1 |
6 |
7 | » 第',$page,'页 / 共',$taltol_page,'页
8 |
';
9 | if($cur_user && $cur_user['flag']>4 && $newest_nodes){
10 | echo '';
11 | }
12 | echo '
13 |
14 |
15 | ';
16 |
17 | foreach($articledb as $article){
18 | echo '
19 |
20 |
23 |
24 |
25 |
',$article['cname'],'';
26 | if($article['comments']){
27 | echo ' • ',$article['rauthor'],' ',$article['edittime'],'回复';
28 | }else{
29 | echo ' • ',$article['author'],' ',$article['addtime'],'发表';
30 | }
31 | echo '
32 |
';
33 | if($article['comments']){
34 | $gotopage = ceil($article['comments']/$options['commentlist_num']);
35 | if($gotopage == 1){
36 | $c_page = '';
37 | }else{
38 | $c_page = '-'.$gotopage;
39 | }
40 | echo '
';
41 | }
42 | echo '
43 |
';
44 |
45 | }
46 |
47 |
48 | if($taltol_article > $options['list_shownum']){
49 | echo '';
58 | }
59 |
60 |
61 | echo '
';
62 |
63 |
64 | ?>
--------------------------------------------------------------------------------
/templates/default/ios_layout.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ',$title,'
10 |
11 |
12 |
13 |
14 |
15 |
16 | ';
17 | if($options['head_meta']){
18 | echo $options['head_meta'];
19 | }
20 |
21 | if(isset($meta_des) && $meta_des){
22 | echo '';
23 | }
24 | if(isset($canonical)){
25 | echo '';
26 | }
27 |
28 | echo '
29 |
30 |
31 |
57 |
58 |
59 |
60 |
';
61 |
62 | if($cur_user){
63 | if($cur_user['flag'] == 0){
64 | echo '
站内提醒 » 帐户已被管理员禁用
';
65 | }else if($cur_user['flag'] == 1){
66 | echo '
站内提醒 » 帐户在等待管理员审核
';
67 | }else{
68 | if(!$cur_user['password']){
69 | echo '
';
70 | }
71 | if($cur_user['notic']){
72 | $notic_n = count(array_unique(explode(',', $cur_user['notic'])))-1;
73 | echo '
';
74 | }
75 | }
76 | }
77 |
78 | if($options['close']){
79 | echo '
80 |
网站暂时关闭公告 »
81 | ';
82 | if($options['close_note']){
83 | echo $options['close_note'];
84 | }else{
85 | echo '数据调整中。。。';
86 | }
87 | echo '
88 |
';
89 | }
90 |
91 | if($cur_user && $cur_user['flag']>=99){
92 | echo '
93 |
94 |
';
101 | }
102 |
103 | include($pagefile);
104 |
105 | if(isset($newest_nodes) && $newest_nodes){
106 | echo '
107 |
最近添加的分类
108 |
109 |
';
110 | foreach( $newest_nodes as $k=>$v ){
111 | echo '
',$v,'';
112 | }
113 | echo '
114 |
115 |
116 |
117 |
';
118 | }
119 |
120 |
121 | if(isset($bot_nodes)){
122 | echo '
123 |
热门分类
124 |
125 |
';
126 | foreach( $bot_nodes as $k=>$v ){
127 | echo '
',$v,'';
128 | }
129 | echo '
130 |
131 |
132 |
133 |
';
134 | }
135 |
136 | echo '
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 | ';
159 |
160 | if($options['ad_web_bot']){
161 | echo $options['ad_web_bot'];
162 | }
163 |
164 | if($options['analytics_code']){
165 | echo $options['analytics_code'];
166 | }
167 |
168 | echo '
169 |
170 | ';
171 |
172 | $_output = ob_get_contents();
173 | ob_end_clean();
174 |
175 | // 304
176 | $etag = md5($_output);
177 | if($_SERVER['HTTP_IF_NONE_MATCH'] == $etag){
178 | header("HTTP/1.1 304 Not Modified");
179 | header("Status: 304 Not Modified");
180 | header("Etag: ".$etag);
181 | exit;
182 | }else{
183 | header("Etag: ".$etag);
184 | }
185 |
186 | echo $_output;
187 |
188 | ?>
--------------------------------------------------------------------------------
/templates/default/ios_member.php:
--------------------------------------------------------------------------------
1 |
6 | ',$options['name'],' » 会员:',$m_obj['name'],'
7 |
8 |
9 |
10 |
11 |
12 |
会员:',$m_obj['name'],' (第',$m_obj['id'],'号会员,',$m_obj['regtime'],'加入)';
13 | if($cur_user && $cur_user['flag']>=99){
14 | echo ' • (',$m_obj['flag'],') 编辑';
15 | }
16 | echo '
17 |
18 |
主贴: ',$m_obj['articles'],' 回贴: ',$m_obj['replies'],'
19 |
网站: ',$m_obj['url'],'
';
20 |
21 | if($weibo_user['openid']){
22 | echo '
新浪微博: http://weibo.cn/u/',$weibo_user['openid'],'
';
23 | }
24 | if($openid_user['name']){
25 | echo '
腾讯微博: http://t.qq.com/',$openid_user['name'],'
';
26 | }
27 |
28 | echo '
关于:
',htmlspecialchars($m_obj['about']),'
29 |
30 |
31 |
';
32 |
33 |
34 | if($m_obj['articles']){
35 | echo '
36 |
37 | ',$m_obj['name'],' 最近发表的帖子
38 |
39 |
40 | ';
41 |
42 | foreach($articledb as $article){
43 | echo '
44 |
45 |
46 |
47 |
48 |
',$article['cname'],'';
49 | if($article['comments']){
50 | echo ' • ',$article['rauthor'],' ',$article['edittime'],'回复';
51 | }else{
52 | echo ' • ',$m_obj['name'],' ',$article['addtime'],'发表';
53 | }
54 | echo '
55 |
';
56 | if($article['comments']){
57 | $gotopage = ceil($article['comments']/$options['commentlist_num']);
58 | if($gotopage == 1){
59 | $c_page = '';
60 | }else{
61 | $c_page = '-'.$gotopage;
62 | }
63 | echo '
';
64 | }
65 | echo '
66 |
';
67 |
68 | }
69 |
70 | echo '
';
71 | }
72 |
73 |
74 | ?>
--------------------------------------------------------------------------------
/templates/default/ios_newpost.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 | » ';
9 | if($options['main_nodes']){
10 | echo '
';
20 | }else{
21 | echo '
',$c_obj['name'],' (',$c_obj['articles'],') ';
22 | }
23 | echo '- 发新帖
24 |
25 |
26 | ';
27 | if($tip){
28 | echo '
',$tip,'
';
29 | }
30 | echo '
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
发帖指南:
39 |
40 | 字数限制: 标题最多字数',$options['article_title_max_len'],',内容最多字数:',$options['article_content_max_len'],'
41 | 纯文本格式,不支持html 或 ubb 代码
42 | 贴图: 可直接粘贴图片地址,如 http://www.baidu.com/xxx.gif (支持jpg/gif/png后缀名),也可直接上传
43 | 贴视频: 可直接视频地址栏里的网址,如 http://www.tudou.com/programs/view/PAH86KJNoiQ/ (仅支持土豆/优酷/QQ)
44 |
45 |
46 |
';
47 |
48 |
49 | ?>
--------------------------------------------------------------------------------
/templates/default/ios_node.php:
--------------------------------------------------------------------------------
1 |
6 |
7 | » ',$c_obj['name'],'(',$c_obj['articles'],')';
8 | if($cur_user && $cur_user['flag']>=99){
9 | echo ' •
编辑';
10 | }
11 | echo '
';
12 | if($cur_user && $cur_user['flag']>4){
13 | echo '';
14 | }
15 | echo '
16 |
17 |
18 | ';
19 |
20 | if($c_obj['about']){
21 | echo '
';
22 | }
23 |
24 | foreach($articledb as $article){
25 | echo '
26 |
27 |
29 |
';
39 | if($article['comments']){
40 | $gotopage = ceil($article['comments']/$options['commentlist_num']);
41 | if($gotopage == 1){
42 | $c_page = '';
43 | }else{
44 | $c_page = '-'.$gotopage;
45 | }
46 | echo '
';
47 | }
48 | echo '
49 |
';
50 |
51 | }
52 |
53 | if($c_obj['articles'] > $options['list_shownum']){
54 | echo '';
63 | }
64 |
65 |
66 | echo '
';
67 |
68 |
69 | ?>
--------------------------------------------------------------------------------
/templates/default/ios_notifications.php:
--------------------------------------------------------------------------------
1 |
6 | 站内提醒 » 有人在下面的文章回复或提起了你
7 |
8 |
9 | ';
10 |
11 | if($articledb){
12 |
13 | foreach($articledb as $article){
14 | echo '
15 |
16 |
17 |
18 |
19 |
',$article['cname'],'';
20 | if($article['comments']){
21 | echo ' • ',$article['rauthor'],' ',$article['edittime'],'回复';
22 | }else{
23 | echo ' • ',$article['author'],' ',$article['addtime'],'发表';
24 | }
25 | echo '
26 |
';
27 | if($article['comments']){
28 | $gotopage = ceil($article['comments']/$options['commentlist_num']);
29 | if($gotopage == 1){
30 | $c_page = '';
31 | }else{
32 | $c_page = '-'.$gotopage;
33 | }
34 | echo '
';
35 | }
36 | echo '
37 |
';
38 |
39 | }
40 |
41 | }else{
42 | echo '
暂无未读提醒
';
43 | }
44 |
45 | echo '
';
46 |
47 | ?>
--------------------------------------------------------------------------------
/templates/default/ios_postpage.php:
--------------------------------------------------------------------------------
1 |
6 | ';
9 | if($cur_user && $cur_user['flag']>4){
10 | echo '';
11 | }
12 | echo '
13 |
14 |
15 |
16 |
17 |
18 |
',$t_obj['title'],'
19 |
20 |
',$t_obj['author'],' ',$t_obj['addtime'],' • ',$t_obj['views'],'点击';
21 | if($t_obj['favorites']){
22 | echo ' • ',$t_obj['favorites'],'收藏';
23 | }
24 | if($cur_user && $cur_user['flag']>4){
25 | if(!$t_obj['closecomment']){
26 | echo ' •
回复';
27 | }
28 | if($in_favorites){
29 | echo ' •
取消收藏';
30 | }else{
31 | echo ' •
收藏';
32 | }
33 |
34 | if($cur_user['flag']>=99){
35 | echo ' •
编辑';
36 | }
37 | if($cur_user['id']==$t_obj['uid']&&$cur_user['flag']<99){
38 | echo ' •
编辑';
39 | }
40 | }
41 | echo '
42 |
43 |
44 |
45 |
46 |
47 |
48 |
',$t_obj['content'],'
49 |
50 |
51 |
52 |
53 | ';
54 |
55 | if($t_obj['comments']){
56 | echo '
57 |
58 | ',$t_obj['comments'],' 回复 | 直到 ',$t_obj['edittime'],'
59 |
60 | ';
61 |
62 | $count_n = ($page-1)*$options['commentlist_num'];
63 | foreach($commentdb as $comment){
64 | $count_n += 1;
65 | echo '
66 |
67 |
68 |
69 |
70 |
',$comment['content'],'
71 |
72 |
73 |
74 |
',$comment['author'],' at ',$comment['addtime'];
75 | if($cur_user && $cur_user['flag']>=99){
76 | echo ' •
编辑';
77 | }
78 | echo '
79 |
';
80 | if(!$t_obj['closecomment'] && $cur_user && $cur_user['flag']>4 && $cur_user['name'] != $comment['author']){
81 | echo '«
回复';
82 | }
83 | echo '
',$count_n,'
84 |
85 |
86 |
87 |
88 |
89 |
';
90 | }
91 |
92 | if($t_obj['comments'] > $options['commentlist_num']){
93 | echo '';
102 | }
103 |
104 | echo '
105 |
106 |
107 |
108 |
109 | ';
116 |
117 | }else{
118 | echo '';
119 | }
120 |
121 | if($t_obj['closecomment']){
122 | echo '';
123 | }else{
124 |
125 | if($cur_user && $cur_user['flag']>4){
126 |
127 | echo '
128 |
129 |
添加一条新回复
130 |
131 |
132 |
133 | ';
134 | if($tip){
135 | echo '
',$tip,'
';
136 | }
137 | echo '
143 |
144 | ';
145 |
146 | }else{
147 | echo '';
148 | }
149 |
150 | }
151 |
152 |
153 | ?>
--------------------------------------------------------------------------------
/templates/default/ios_qqsetname.php:
--------------------------------------------------------------------------------
1 | ',$options['name'],' » ',$title,'
6 | ';
7 |
8 | if($options['close_register'] || $options['close']){
9 | echo '
网站暂时关闭 或 已停止新用户注册';
10 | }else{
11 |
12 | echo '
';
13 | if($options['authorized']){
14 | echo $options['name'],' 已设置只有登录用户才能访问,请先登录!
';
15 | }
16 | if($options['register_review']){
17 | echo $options['name'],' 已设置注册用户验证,注册后需要管理员审核!
';
18 | }
19 |
20 | foreach($errors as $error){
21 | echo '› ',$error,'
';
22 | }
23 |
24 | echo '
25 |
欢迎',$name,'用 ',$logintype,' 成功登录本站,请先设置您在本站显示的名字:
26 |
27 |
• 第一次来?请先设置在网站显示的名字
28 |
29 |
';
35 |
36 | echo '
37 |
• 以前有注册?请先输入原登录名和密码完成绑定
38 |
39 |
';
46 |
47 | }
48 |
49 | echo '
';
50 |
51 | ?>
52 |
--------------------------------------------------------------------------------
/templates/default/ios_setting.php:
--------------------------------------------------------------------------------
1 |
5 |
6 | ';
7 |
8 | if($tip1){
9 | echo '
',$tip1,'
';
10 | }
11 | echo '
12 |
38 |
39 |
';
40 |
41 | if($cur_user['password']){
42 |
43 | echo '
44 |
45 | 更改密码
46 | ';
47 | if($tip3){
48 | echo '
',$tip3,'
';
49 | }
50 | echo '
51 |
74 |
75 |
';
76 |
77 | }else{
78 |
79 | echo '
80 | 设置登录密码: 设置一个登录密码,以备急用
81 | ';
82 | if($tip3){
83 | echo '
',$tip3,'
';
84 | }
85 | echo '
86 |
109 |
110 |
';
111 |
112 | }
113 |
114 | ?>
--------------------------------------------------------------------------------
/templates/default/ios_sigin_login.php:
--------------------------------------------------------------------------------
1 | ',$options['name'],' » ',$title,'
6 | ';
49 |
50 | ?>
51 |
--------------------------------------------------------------------------------
/templates/default/ios_user-edit-post.php:
--------------------------------------------------------------------------------
1 |
6 |
7 | » - 修改帖子 »
8 |
22 |
23 |
24 | ';
25 | if($tip){
26 | echo '
',$tip,'
';
27 | }
28 |
29 | echo '
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
发帖指南:
40 |
41 | 纯文本格式,不支持html 或 ubb 代码
42 | 贴图: 可直接粘贴图片地址,如 http://www.baidu.com/xxx.gif (支持jpg/gif/png后缀名),也可直接上传
43 | 贴视频: 可直接视频地址栏里的网址,如 http://www.tudou.com/programs/view/PAH86KJNoiQ/ (仅支持土豆/优酷/QQ)
44 |
45 |
46 |
';
47 |
48 |
49 | ?>
50 |
--------------------------------------------------------------------------------
/templates/default/layout.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ',$title,'
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | ';
18 | if($options['head_meta']){
19 | echo $options['head_meta'];
20 | }
21 |
22 | if(isset($meta_des) && $meta_des){
23 | echo '';
24 | }
25 | if(isset($canonical)){
26 | echo '';
27 | }
28 |
29 | echo '
30 |
31 |
32 |
92 |
93 |
94 |
95 |
';
96 |
97 | include($pagefile);
98 |
99 | echo '
100 |
101 |
';
102 |
103 | include(dirname(__FILE__) . '/sider.php');
104 | echo '
105 |
106 |
107 |
108 |
109 |
110 |
';
111 |
112 | echo '
113 |
133 |
134 |
135 |
136 |
144 | ';
145 | if($options['analytics_code']){
146 | echo $options['analytics_code'];
147 | }
148 |
149 | echo '
150 |
151 | ';
152 |
153 | $_output = ob_get_contents();
154 | ob_end_clean();
155 |
156 | // 304
157 | if(!$options['show_debug']){
158 | $etag = md5($_output);
159 | if($_SERVER['HTTP_IF_NONE_MATCH'] == $etag){
160 | header("HTTP/1.1 304 Not Modified");
161 | header("Status: 304 Not Modified");
162 | header("Etag: ".$etag);
163 | exit;
164 | }else{
165 | header("Etag: ".$etag);
166 | }
167 | }
168 |
169 | echo $_output;
170 |
171 | ?>
--------------------------------------------------------------------------------
/templates/default/member.php:
--------------------------------------------------------------------------------
1 |
6 | ',$options['name'],' » 会员:',$m_obj['name'],'
7 |
8 |
9 |
10 |
11 |
12 |
会员:',$m_obj['name'],' (第',$m_obj['id'],'号会员,',$m_obj['regtime'],'加入)';
13 | if($cur_user && $cur_user['flag']>=99){
14 | echo ' • (',$m_obj['flag'],') 编辑';
15 | }
16 | echo '
17 |
18 |
主贴: ',$m_obj['articles'],' 回贴: ',$m_obj['replies'],'
19 |
网站: ',$m_obj['url'],'
';
20 |
21 | if($weibo_user['openid']){
22 | echo '
新浪微博: http://weibo.com/',$weibo_user['openid'],'
';
23 | }
24 | if($openid_user['name']){
25 | echo '
腾讯微博: http://t.qq.com/',$openid_user['name'],'
';
26 | }
27 |
28 | echo '
关于:
',htmlspecialchars($m_obj['about']),'
29 |
30 |
31 |
';
32 |
33 |
34 | if($m_obj['articles']){
35 | echo '
36 |
37 | ',$m_obj['name'],' 最近发表的帖子
38 |
39 |
40 | ';
41 |
42 | foreach($articledb as $article){
43 | echo '
44 |
45 |
52 |
53 |
54 |
',$article['cname'],' • ',$m_obj['name'],'';
55 | if($article['comments']){
56 | echo ' • ',$article['edittime'],' • 最后回复来自 ',$article['rauthor'],'';
57 | }else{
58 | echo ' • ',$article['addtime'];
59 | }
60 | echo '
61 |
';
62 | if($article['comments']){
63 | $gotopage = ceil($article['comments']/$options['commentlist_num']);
64 | if($gotopage == 1){
65 | $c_page = '';
66 | }else{
67 | $c_page = '-'.$gotopage;
68 | }
69 | echo '
';
70 | }
71 | echo '
72 |
';
73 |
74 | }
75 |
76 | echo '
';
77 | }
78 |
79 |
80 | ?>
--------------------------------------------------------------------------------
/templates/default/newpost.php:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
',$options['name'],' » ';
10 | if($options['main_nodes']){
11 | echo '
';
21 | }else{
22 | echo '
',$c_obj['name'],' (',$c_obj['articles'],')';
23 | }
24 | echo '
25 | - 发新帖
26 |
27 |
28 |
29 | ';
30 | if($tip){
31 | echo '
',$tip,'
';
32 | }
33 | echo '
34 |
35 |
36 |
37 |
38 |
39 |
自动保存正在初始化...
40 |
';
41 | if(!$options['close_upload']){
42 | include(dirname(__FILE__) . '/upload.php');
43 | }
44 | echo '
45 |
46 |
47 |
48 |
49 |
50 |
51 |
';
52 |
53 |
54 | ?>
55 |
--------------------------------------------------------------------------------
/templates/default/node.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
',$options['name'],' » ',$c_obj['name'],'(',$c_obj['articles'],')';
8 | if($cur_user && $cur_user['flag']>=99){
9 | echo ' •
编辑';
10 | }
11 | echo '
';
12 | if($cur_user && $cur_user['flag']>4){
13 | echo '';
14 | }
15 | echo '
16 |
17 |
18 | ';
19 |
20 | if($c_obj['about']){
21 | echo '
';
22 | }
23 |
24 | foreach($articledb as $article){
25 | echo '
26 |
27 |
34 |
35 |
36 |
by ',$article['author'],'';
37 | if($article['comments']){
38 | echo ' • ',$article['edittime'],' • 最后回复来自 ',$article['rauthor'],'';
39 | }else{
40 | echo ' • ',$article['addtime'];
41 | }
42 | echo '
43 |
';
44 | if($article['comments']){
45 | $gotopage = ceil($article['comments']/$options['commentlist_num']);
46 | if($gotopage == 1){
47 | $c_page = '';
48 | }else{
49 | $c_page = '-'.$gotopage;
50 | }
51 | echo '
';
52 | }
53 | echo '
54 |
';
55 |
56 | }
57 |
58 | if($c_obj['articles'] > $options['list_shownum']){
59 | echo '';
68 | }
69 |
70 |
71 | echo '
';
72 |
73 |
74 | ?>
--------------------------------------------------------------------------------
/templates/default/notifications.php:
--------------------------------------------------------------------------------
1 |
6 | ',$options['name'],' » 站内提醒 ( 有人在下面的文章回复或提起了你 )
7 |
8 |
9 | ';
10 |
11 | if($articledb){
12 |
13 | foreach($articledb as $article){
14 | echo '
15 |
16 |
19 |
20 |
21 |
',$article['cname'],' • ',$article['author'],'';
22 | if($article['comments']){
23 | echo ' • ',$article['edittime'],' • 最后回复来自 ',$article['rauthor'],'';
24 | }else{
25 | echo ' • ',$article['addtime'];
26 | }
27 | echo '
28 |
';
29 | if($article['comments']){
30 | $gotopage = ceil($article['comments']/$options['commentlist_num']);
31 | if($gotopage == 1){
32 | $c_page = '';
33 | }else{
34 | $c_page = '-'.$gotopage;
35 | }
36 | echo '
';
37 | }
38 | echo '
39 |
';
40 |
41 | }
42 |
43 | }else{
44 | echo '
暂无未读提醒
';
45 | }
46 |
47 | echo '
';
48 |
49 | ?>
--------------------------------------------------------------------------------
/templates/default/qqsetname.php:
--------------------------------------------------------------------------------
1 | ',$options['name'],' » ',$title,'
6 | ';
7 |
8 | if($options['close_register'] || $options['close']){
9 | echo '
网站暂时关闭 或 已停止新用户注册';
10 | }else{
11 |
12 | echo '
';
13 | if($options['authorized']){
14 | echo $options['name'],' 已设置只有登录用户才能访问,请先登录!
';
15 | }
16 | if($options['register_review']){
17 | echo $options['name'],' 已设置注册用户验证,注册后需要管理员审核!
';
18 | }
19 |
20 | foreach($errors as $error){
21 | echo '› ',$error,'
';
22 | }
23 |
24 | echo '
25 |
欢迎',$name,'用 ',$logintype,' 成功登录本站,请先设置您在本站显示的名字:
26 |
27 |
• 第一次来?请先设置在网站显示的名字
28 |
29 |
';
35 |
36 | echo '
37 |
• 以前有注册?请先输入原登录名和密码完成绑定
38 |
39 |
';
46 |
47 | }
48 |
49 | echo '
';
50 |
51 | ?>
52 |
--------------------------------------------------------------------------------
/templates/default/setting.php:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
',$tip1,'
8 |
34 |
35 |
36 |
37 |
38 | 设置头像
39 |
40 |
',$tip2,'
41 |
64 |
65 |
';
66 |
67 | if($cur_user['password']){
68 |
69 | echo '
70 |
71 | 更改密码
72 |
73 |
',$tip3,'
74 |
97 |
98 |
';
99 |
100 | }else{
101 |
102 | echo '
103 |
104 | 设置登录密码: 你可以设置一个登录密码,以备急用
105 |
106 |
',$tip3,'
107 |
130 |
131 |
';
132 |
133 | }
134 |
135 | ?>
--------------------------------------------------------------------------------
/templates/default/sider.php:
--------------------------------------------------------------------------------
1 | =99){
5 | echo '
6 | ';
15 | }
16 |
17 |
18 | if($options['ad_sider_top']){
19 | echo '
20 |
21 |
广而告之
22 |
',$options['ad_sider_top'],'
23 |
24 |
25 |
';
26 | }
27 |
28 |
29 | if($options['close']){
30 | echo '
31 |
32 |
网站暂时关闭公告
33 |
34 |
';
35 | if($options['close_note']){
36 | echo $options['close_note'];
37 | }else{
38 | echo '数据调整中。。。';
39 | }
40 | echo '
41 |
42 |
43 |
';
44 |
45 | }
46 |
47 |
48 | if(isset($newpost_page)){
49 | echo '
50 |
51 |
发帖指南
52 |
53 |
54 | - • 不欢迎灌水
55 | - • 字数限制: 标题 < ',$options['article_title_max_len'],',内容 < ',$options['article_content_max_len'],'
56 | - • 纯文本格式,不支持html 或 ubb 代码
57 | - • 贴图: 可直接粘贴图片地址,
如 http://www.baidu.com/xxx.gif
支持jpg/gif/png后缀名,
也可利用“围脖是个好图床”提供的通道,
上传后直接粘贴地址
58 | - • 贴视频: 可直接视频地址栏里的网址,
如 http://www.tudou.com/programs/view/PAH86KJNoiQ/
仅支持土豆/优酷/QQ
59 |
60 |
61 |
62 | ';
63 |
64 | }
65 |
66 | if(isset($bot_nodes)){
67 | echo '
68 |
69 |
最热主题
70 |
71 |
';
72 | foreach(array_slice($bot_nodes, 0, intval($options['hot_node_num']), true) as $k=>$v ){
73 | echo '
',$v,'';
74 | }
75 | echo '
76 |
77 |
78 |
';
79 | }
80 |
81 | if(isset($newest_nodes) && $newest_nodes){
82 | echo '
83 |
84 |
最近添加的分类
85 |
86 |
';
87 | foreach( $newest_nodes as $k=>$v ){
88 | echo '
',$v,'';
89 | }
90 | echo '
91 |
92 |
93 |
';
94 | }
95 |
96 | if(isset($links) && $links){
97 | echo '
98 |
99 |
链接
100 |
101 |
';
102 | foreach( $links as $k=>$v ){
103 | echo '
',$k,'';
104 | }
105 | echo '
106 |
107 |
108 |
';
109 | }
110 |
111 | if(isset($site_infos)){
112 | echo '
113 |
114 |
站点运行信息(',round(($timestamp - $options['site_create'])/86400)+1,'天)
115 |
116 |
';
117 | foreach($site_infos as $k=>$v){
118 | echo '- ',$k,': ',$v,'
';
119 | }
120 | echo '
121 |
122 |
123 |
';
124 | }
125 | ?>
126 |
--------------------------------------------------------------------------------
/templates/default/sigin_login.php:
--------------------------------------------------------------------------------
1 | ',$options['name'],' » ',$title,'
6 | ';
49 |
50 | ?>
51 |
--------------------------------------------------------------------------------
/templates/default/upload.php:
--------------------------------------------------------------------------------
1 |
6 | 上传附件';
7 | if($options['ext_list']){
8 | echo '(',$options['ext_list'],')';
9 | }
10 | echo '
11 |
12 | 附件上传中,请稍候!
13 |
14 |
15 |
16 |
17 |
18 |
37 |
38 |
39 | ';
40 | ?>
41 |
--------------------------------------------------------------------------------
/templates/default/user-edit-post.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
',$options['name'],' » - 修改帖子 »
8 |
20 |
21 |
22 | ';
23 | if($tip){
24 | echo '
',$tip,'
';
25 | }
26 |
27 | echo '
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | ';
39 |
40 | if(!$options['close_upload']){
41 | include(dirname(__FILE__) . '/upload.php');
42 | }
43 |
44 | echo '
45 |
46 |
47 |
发帖指南:
48 |
49 | 纯文本格式,不支持html 或 ubb 代码
50 | 贴图: 可直接粘贴图片地址,如 http://www.baidu.com/xxx.gif (支持jpg/gif/png后缀名),也可直接上传
51 | 贴视频: 可直接视频地址栏里的网址,如 http://www.tudou.com/programs/view/PAH86KJNoiQ/ (仅支持土豆/优酷/QQ)
52 |
53 |
54 |
';
55 |
56 |
57 | ?>
58 |
--------------------------------------------------------------------------------
/upload/index.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ACICFG/youBBS-ACICFG/2702eb3f30f790f5bcec36e0b8fc770590d3c977/upload/index.htm
--------------------------------------------------------------------------------
/upload/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 |
--------------------------------------------------------------------------------
/user-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 |
36 |
37 |
38 | // 获取1000个热点分类
39 | $query = $DBS->query("SELECT `id`, `name` FROM `yunbbs_categories` ORDER BY `articles` DESC LIMIT 1000");
40 | $all_nodes = array();
41 | while($node = $DBS->fetch_array($query)) {
42 | $all_nodes[$node['id']] = $node['name'];
43 | }
44 | if( !array_key_exists($t_obj['cid'], $all_nodes) ){
45 | $cid = $t_obj['cid'];
46 | $c_obj = $DBS->fetch_one_array("SELECT id,name FROM yunbbs_categories WHERE id='".$cid."'");
47 | $all_nodes[$c_obj['id']] = $c_obj['name'];
48 | }
49 |
50 | unset($node);
51 | $DBS->free_result($query);
52 |
53 | if($_SERVER['REQUEST_METHOD'] == 'POST'){
54 | $old_cid = $t_obj['cid'];
55 | $p_cid = $_POST['select_cid'];
56 | $p_title = addslashes(trim($_POST['title']));
57 | $p_content = addslashes(trim($_POST['content']));
58 | $p_closecomment = intval($_POST['closecomment']);
59 | $p_visible = intval($_POST['visible']);
60 | $p_top = intval($_POST['top']);
61 |
62 | if($p_title){
63 | $p_title = htmlspecialchars($p_title);
64 | $p_content = htmlspecialchars($p_content);
65 | $DBS->unbuffered_query("UPDATE yunbbs_articles SET cid='$p_cid',title='$p_title',content='$p_content',closecomment='$p_closecomment',visible='$p_visible',top='$p_top' WHERE id='$tid'");
66 | if($p_cid != $old_cid){
67 | $DBS->unbuffered_query("UPDATE yunbbs_categories SET articles=articles+1 WHERE id='$p_cid'");
68 | $DBS->unbuffered_query("UPDATE yunbbs_categories SET articles=articles-1 WHERE id='$old_cid'");
69 | }
70 |
71 | header('location: /t-'.$tid);
72 | exit;
73 | }else{
74 | $tip = '标题 不能留空';
75 | }
76 | }else{
77 | $p_title = $t_obj['title'];
78 | $p_content = $t_obj['content'];
79 | $tip = '';
80 | }
81 | // 页面变量
82 | $title = '修改帖子 - '.$t_obj['title'];
83 | // 设置回复图片最大宽度
84 | $img_max_w = 650;
85 |
86 |
87 | $pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'user-edit-post.php';
88 |
89 | include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php');
90 |
91 | ?>
92 |
--------------------------------------------------------------------------------
/viewat.php:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/wbcallback.php:
--------------------------------------------------------------------------------
1 | getAccessToken( 'code', $keys ) ;
20 | } catch (OAuthException $e) {
21 | //
22 | }
23 | }
24 |
25 | if ($token) {
26 | //$_SESSION['token'] = $token;
27 | //setcookie( 'weibojs_'.$o->client_id, http_build_query($token) );
28 | //
29 | //var_dump($token);
30 | /*
31 | $token
32 | array(4) {
33 | ["access_token"]=>
34 | string(32) "2.00_1hs1B0xxttu14ec6eedxxxxxx"
35 | ["remind_in"]=>
36 | string(9) "157679999"
37 | ["expires_in"]=>
38 | int(157679999)
39 | ["uid"]=>
40 | string(10) "12246xxxxx"
41 | }
42 |
43 | */
44 | $openid = $token['uid'];
45 | $_SESSION["openid"] = $openid;
46 |
47 | $db_openid = $DBS->fetch_one_array("SELECT `id`,`uid`,`name` FROM `yunbbs_weibo` WHERE `openid`='".$openid."'");
48 |
49 | if($db_openid && $db_openid['uid']){
50 |
51 | // 直接登录
52 | $cur_uid = $db_openid['uid'];
53 | $db_user = $DBS->fetch_one_array("SELECT * FROM `yunbbs_users` WHERE `id`='".$cur_uid."' LIMIT 1");
54 | if($db_user){
55 | $db_ucode = md5($db_user['id'].$db_user['password'].$db_user['regtime'].$db_user['lastposttime'].$db_user['lastreplytime']);
56 | //设置cookie
57 | $u_key = 'u_'.$cur_uid;
58 |
59 | $timestamp = time();
60 | setcookie('cur_uid', $cur_uid, $timestamp+ 86400 * 365, '/');
61 | setcookie('cur_uname', $db_user['name'], $timestamp+86400 * 365, '/');
62 | setcookie('cur_ucode', $db_ucode, $timestamp+86400 * 365, '/');
63 | $cur_user = $db_user;
64 | unset($db_user);
65 | }
66 |
67 | header("Location:/");
68 | exit;
69 | }
70 |
71 | /// 获取用户信息
72 | $c = new SaeTClientV2( $options['wb_key'] , $options['wb_secret'] , $token['access_token'] );
73 | $uid_get = $c->get_uid();
74 | $uid = $uid_get['uid'];
75 | $user_info = $c->show_user_by_id( $uid);//根据ID获取用户等基本信息
76 | //var_dump($user_info);
77 | //
78 | /*
79 | * $user_message
80 | * screen_name 用户昵称
81 | * profile_url 用户的微博统一URL地址
82 | * avatar_large 用户大头像地址
83 | */
84 | ///
85 |
86 | // 尝试获取用户信息(通过审核才能获取)
87 | $name = $user_info['profile_url'];
88 | $_SESSION["nick"] = $user_info['name'];
89 | if($user_info['avatar_large']){
90 | $_SESSION["avatar"] = $user_info['avatar_large'];
91 | }
92 |
93 | if($db_openid){
94 | if($db_openid['uid']){
95 | // pass
96 | }else{
97 | header("Location:/wbsetname");
98 | exit;
99 | }
100 | }else{
101 | $DBS->query("INSERT INTO `yunbbs_weibo` (`id`,`uid`,`name`,`openid`) VALUES (null,'0','$name', '$openid')");
102 | header("Location:/wbsetname");
103 | exit;
104 |
105 | }
106 |
107 | } else {
108 | echo 'Get token failed. Go back Home';
109 | exit;
110 | }
111 |
112 |
113 | ?>
114 |
--------------------------------------------------------------------------------
/wblogin.php:
--------------------------------------------------------------------------------
1 | getAuthorizeURL( 'http://'.$_SERVER['HTTP_HOST'].'/wbcallback' );
12 |
13 | header("Location:$code_url");
14 | exit;
15 |
16 | ?>
17 |
--------------------------------------------------------------------------------
/youbbs.conf:
--------------------------------------------------------------------------------
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 ^/page/([0-9]+)$ /indexpage.php?page=$1 last;
4 | rewrite ^/notifications$ /notifications.php last;
5 | rewrite ^/favorites$ /favorites.php last;
6 | rewrite ^/qqlogin$ /qqlogin.php last;
7 | rewrite ^/qqcallback$ /qqcallback.php last;
8 | rewrite ^/qqsetname$ /qqsetname.php last;
9 | rewrite ^/wblogin$ /wblogin.php last;
10 | rewrite ^/wbcallback$ /wbcallback.php last;
11 | rewrite ^/wbsetname$ /wbsetname.php last;
12 | rewrite ^/feed$ /feed.php last;
13 | rewrite ^/robots.txt$ /robots.php last;
14 | rewrite ^/sitemap-([0-9]+)$ /sitemap.php?id=$1 last;
15 | rewrite ^/forgot$ /forgot.php last;
16 | rewrite ^/upload-(650|590)$ /upload.php?mw=$1 last;
17 | rewrite ^/viewat-(desktop|mobile)$ /viewat.php?via=$1 last;
18 | rewrite ^/goto-t-([0-9]+)$ /gototopic.php?tid=$1 last;
19 | rewrite ^/member/([a-zA-Z0-9x80-xff]{1,20})$ /member.php?mid=$1 last;
20 | rewrite ^/newpost/([0-9]+)$ /newpost.php?cid=$1 last;
21 | rewrite ^/admin-edit-post-([0-9]+)$ /admin-edit-post.php?tid=$1 last;
22 | rewrite ^/admin-edit-comment-([0-9]+)$ /admin-edit-comment.php?rid=$1 last;
23 | rewrite ^/admin-setuser-([0-9]+)$ /admin-setuser.php?mid=$1 last;
24 | rewrite ^/admin-node(-([0-9]*))?$ /admin-node.php?nid=$2 last;
25 | rewrite ^/admin-setting$ /admin-setting.php last;
26 | rewrite ^/admin-user-([a-z]+)(-([0-9]*))?$ /admin-user.php?act=$1&mid=$3 last;
27 | rewrite ^/admin-link-([a-z]+)(-([0-9]*))?$ /admin-link.php?act=$1&lid=$3 last;
28 | rewrite ^/(login|sigin|logout|forgot|setting|install)$ /$1.php last;
29 | rewrite ^/.*?templates /404.html last;
30 | rewrite ^/.*?avatar/$ /404.html last;
31 | rewrite ^/upload/([0-9]+/)?$ /404.html last;
32 | rewrite ^/.*?avatar/(large|normal|mini)/$ /404.html last;
33 |
--------------------------------------------------------------------------------
',$article['title'],'
19 | ',$article['cname'],''; 20 | if($article['comments']){ 21 | echo ' • ',$article['rauthor'],' ',$article['edittime'],'回复'; 22 | }else{ 23 | echo ' • ',$article['author'],' ',$article['addtime'],'发表'; 24 | } 25 | echo ' • <取消收藏> 26 |