# bookmark
**Repository Path**: maccliu/bookmark
## Basic Information
- **Project Name**: bookmark
- **Description**: 多用户网址书签管理工具,可作为浏览器内置书签功能的增补。
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 43
- **Created**: 2015-04-08
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
网址书签
========
## 安装步骤
* 部署代码并配置好web服务器;
* 创建并导入`db/bookmark.sql`到数据库;
* 修改`root/config/base.php`配置数据库连接参数及其他选项;
* 申请第三方应用并配置`root/config/oauth.php`;
* 修改`root/data/*`目录为可写权限;
## nginx配置参考
```
server {
listen 80;
server_name f.wuwenbin.info;
index index.php index.html index.htm;
root /var/www/bookmark;
error_log off;
access_log logs/bookmark_access.log;
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}
# rewrite rules ...
}
```
## url重写配置参考
配置文件`root/config/base.php`修改:
```
switch (App::getName()) {
case "public":
$config["rewriteRules"] = array(
"User_Index" => "/[uid]",
"User_Login" => "/login",
"User_Logout" => "/logout",
"User_Rand" => "/rand",
);
break;
case "mobile":
$config["rewriteRules"] = array(
"User_Index" => "/m/[uid]",
"User_Login" => "/login",
"User_Logout" => "/logout",
);
break;
}
```
nginx配置url重写规则:
```
rewrite ^/bookmark/([0-9]+)$ /?do=User_Index&uid=$1&$args last;
rewrite ^/bookmark/login$ /?do=User_Login&$args last;
rewrite ^/bookmark/logout$ /?do=User_Logout&$args last;
rewrite ^/bookmark/rand$ /?do=User_Rand&$args last;
rewrite ^/bookmark/m/([0-9]+)$ /m/?do=User_Index&uid=$1&$args last;
```
apache配置`.htaccess`url重写规则:
```
RewriteEngine On
RewriteRule ^([0-9]+)$ /?do=User_Index&uid=$1&%{QUERY_STRING} [L]
RewriteRule ^login$ /?do=User_Login&%{QUERY_STRING} [L]
RewriteRule ^logout$ /?do=User_Logout&%{QUERY_STRING} [L]
RewriteRule ^rand$ /?do=User_Rand&%{QUERY_STRING} [L]
RewriteRule ^m/([0-9]+)$ /m/?do=User_Index&uid=$1&%{QUERY_STRING} [L]
```
## 第三方应用申请地址
* 微博:
* QQ:
* 百度:
## 新浪SAE配置说明
* 数据库表请使用SAE提供的`PHPMyAdmin`导入;
* 数据库连接配置请直接填写`SAE_MYSQL_*`开头的常量;
* 鉴于SAE目录不能直接写入文件,所以模板编译路径需要配置到临时目录`SAE_TMP_PATH`,示例如下:
配置文件`root/config/base.php`添加如下代码:
```
// 模板编译路径
$config["templateCompilePath"] = SAE_TMP_PATH;
```
## 官方主页
*
## 授权协议
* MIT