Permalink
Browse files

2014/09/24 Modify for new theme

New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.2014/09/24 Modify for new theme
New responsive design theme.
  • Loading branch information...
1 parent a972ac8 commit 88488767d3ac8245c09330cb754c15a27c36ea6c qakcn committed Sep 24, 2014
View
@@ -9,22 +9,23 @@
define('SITE_DESCRIPTION', '上传与分享'); // 网站描述
define('SITE_KEYWORDS', 'images, photos, image hosting, photo hosting, free image hosting'); //网站关键字
define('ADMIN_EMAIL', 'admin@example.com'); // 管理员Email
+// 主站设置
+define('MAIN_SITE', false); // 是否显示主站链接
+define('MAIN_SITE_NAME', ''); // 主站名称
+define('MAIN_SITE_LOGO', ''); // 主站logo地址
+define('MAIN_SITE_URL', ''); // 主站URL
// 版权声明
-define('COPYRIGHT', '所有未声明版权图片均在<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">知识共享 署名-非商业使用-相同方式共享 4.0 协议</a>下发布。');
-
-// 管理设置
-define('MANAGE_NAME','admin'); // 管理员用户名
-define('MANAGE_PASSWORD','admin'); // 管理员密码
+define('COPYRIGHT', '所有未声明版权图片均需在<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">知识共享 署名-非商业使用-相同方式共享 4.0 协议</a>下发布。');
// 服务设置
define('SERVICE', 'tietuku'); // 服务提供商:目前仅支持'tietuku'(贴图库)
-define('ALBUM_STRATEGY', 'monthly'); // 相册使用策略,'single'所有照片存入一个相册,'monthly'每个月一个相册
+define('ALBUM_STRATEGY', 'single'); // 相册使用策略,'single'所有照片存入一个相册,'monthly'每个月一个相册
define('SINGLE_ALBUM', 0); // 'single‘策略所使用的相册ID
define('ALBUM_PREFIX', 'qchan'); // 'monthly'策略的相册前缀
define('DIRECT_AJAX', false); // 设置为true时直接上传到服务提供商,不经过本程序的服务器
// 贴图库API设置
-// 下面两个Key请到[贴图库]->[开放平台]->[管理中心]->[密钥]获取
+// 下面两个Key请到[贴图库]->[开放平台]->(登录后)[管理中心]->[密钥]获取
define('TIETUKU_ACCESSKEY', ''); // 贴图库API的AccessKey
define('TIETUKU_SECRETKEY', ''); // 贴图库API的SecretKey
View
@@ -10,14 +10,12 @@
function check_config() {
if (!(
defined('UI_LANG') &&
- is_string(UI_LANG) &&
preg_match('/[a-z]{2,3}(-[A-Z]{2})?|zh-Han[ts]/', UI_LANG)
)) {
exit('UI_LANG set incorrectly.');
}
if (!(
defined('UI_THEME') &&
- is_string(UI_THEME) &&
file_exists(ABSPATH . '/themes/' . UI_THEME)
)) {
exit('UI_THEME set incorrectly.');
@@ -42,32 +40,91 @@ function check_config() {
}
if(!(
defined('ADMIN_EMAIL') &&
- is_string(ADMIN_EMAIL) &&
preg_match('/(\w+\.)*\w+@(\w+\.)+[A-Za-z]+/', ADMIN_EMAIL)
)) {
exit('ADMIN_EMAIL set incorrectly.');
}
if(!(
- defined('MANAGE_NAME') &&
- is_string(MANAGE_NAME)
+ defined('MAIN_SITE') &&
+ is_bool(MAIN_SITE)
)) {
- exit('MANAGE_NAME set incorrectly.');
- }
- if(!(
- defined('MANAGE_PASSWORD') &&
- is_string(MANAGE_PASSWORD)
- )) {
- exit('MANAGE_PASSWORD set incorrectly.');
+ exit('MAIN_SITE set incorrectly.');
+ }else if(MAIN_SITE) {
+ if(!(
+ defined('MAIN_SITE_NAME') &&
+ is_string(MAIN_SITE_NAME)
+ )) {
+ exit('MAIN_SITE_NAME set incorrectly.');
+ }
+ if(!(
+ defined('MAIN_SITE_LOGO') &&
+ is_string(MAIN_SITE_LOGO)
+ )) {
+ exit('MAIN_SITE_LOGO set incorrectly.');
+ }
+ if(!(
+ defined('MAIN_SITE_URL') &&
+ preg_match('/^https?:\/\/[a-zA-Z_\-.]+(\/.*)?$/', MAIN_SITE_URL)
+ )) {
+ exit('MAIN_SITE_URL set incorrectly.');
+ }
}
if(!(
defined('COPYRIGHT') &&
is_string(COPYRIGHT)
)) {
exit('COPYRIGHT set incorrectly.');
}
+ if(!(
+ defined('SERVICE') &&
+ SERVICE == 'tietuku'
+ )) {
+ exit('SERVICE set incorrectly.');
+ }else if(SERVICE == 'tietuku') {
+ if(!(
+ defined('TIETUKU_ACCESSKEY') &&
+ preg_match('/^[0-9a-f]{40}$/', TIETUKU_ACCESSKEY)
+ )) {
+ exit('TIETUKU_ACCESSKEY set incorrectly.');
+ }
+ if(!(
+ defined('TIETUKU_SECRETKEY') &&
+ preg_match('/^[0-9a-f]{40}$/', TIETUKU_ACCESSKEY)
+ )) {
+ exit('TIETUKU_SECRETKEY set incorrectly.');
+ }
+ }
+ if(!(
+ defined('ALBUM_STRATEGY') &&
+ (ALBUM_STRATEGY == 'single' || ALBUM_STRATEGY == 'monthly')
+ )) {
+ exit('ALBUM_STRATEGY set incorrectly.');
+ }else if(ALBUM_STRATEGY == 'single') {
+ if(!(
+ defined('SINGLE_ALBUM') &&
+ is_int(SINGLE_ALBUM) &&
+ SINGLE_ALBUM != 0
+ )) {
+ exit('SINGLE_ALBUM set incorrectly.');
+ }
+ }else if(ALBUM_STRATEGY == 'monthly') {
+ if(!(
+ defined('ALBUM_PREFIX') &&
+ is_string(SALBUM_PREFIX)
+ )) {
+ exit('ALBUM_PREFIX set incorrectly.');
+ }
+ }
+ if(!(
+ defined('DIRECT_AJAX') &&
+ is_bool(DIRECT_AJAX)
+ )) {
+ exit('DIRECT_AJAX set incorrectly.');
+ }
}
define('QCHAN_VER', 'lite-1.0pre build 20140912');
+define('QCHAN_URL', 'https://github.com/qakcn/qchan-lite');
date_default_timezone_set('UTC');
define('ABSPATH', __DIR__);
@@ -3,15 +3,29 @@
function __($message) {
global $lang;
if ($lang && isset($lang[$message])) {
- return $lang[$message];
+ if(func_num_args()==1) {
+ return $lang[$message];
+ }else{
+ $args=func_get_args();
+ array_shift($args);
+ return vsprintf($lang[$message],$args);
+ }
}else {
- return $message;
+ if(func_num_args()==1) {
+ return $message;
+ }else{
+ $args=func_get_args();
+ array_shift($args);
+ return vsprintf($message,$args);
+ }
}
}
-function get_locale() {
+function get_locale($nocookie=false) {
if(isset($_GET['lang'])) {
- setcookie('UI_LANG',$_GET['lang'],time()+60*60*24*365);
+ if(!$nocookie) {
+ setcookie('UI_LANG',$_GET['lang'],time()+60*60*24*365);
+ }
return $_GET['lang'];
}else if(isset($_COOKIE['UI_LANG'])) {
return $_COOKIE['UI_LANG'];
@@ -20,8 +34,8 @@ function get_locale() {
}
}
-function get_available_langs() {
- $langfiles = scandir(ABSPATH.'/lang');
+function get_available_langs($manage=false) {
+ $langfiles = scandir(ABSPATH. '/' . ($manage?'manage/':theme_path()) .'lang');
$out = array();
foreach ($langfiles as $key => $langfile) {
if(preg_match('/.+\.json$/', $langfile)) {
@@ -31,26 +45,26 @@ function get_available_langs() {
return $out;
}
-function get_langlist() {
+function get_langlist($manage=false) {
$langlist = '';
- $langs = get_available_langs();
+ $langs = get_available_langs($manage=false);
foreach($langs as $lang) {
$langlist .= sprintf('<li><a href="?lang=%s">%s</a></li>', $lang, get_lang_name($lang)) . "\n";
}
return $langlist;
}
-function load_lang() {
+function load_lang($manage=false) {
$locale = get_locale();
- $langfiles = get_available_langs();
+ $langfiles = get_available_langs($manage);
while($langfile = array_pop($langfiles)) {
if($langfile==$locale || $langfile==substr($locale,0,2)) {
- return json_decode(file_get_contents(ABSPATH.'/lang/' . $langfile . '.json'),true);
+ return json_decode(file_get_contents(ABSPATH . '/' . ($manage?'manage/':theme_path()).'lang/' . $langfile . '.json'),true);
}else if(substr_compare($langfile,$locale,0,2)==0) {
$remember = $langfile;
}
}
- return isset($remember) ? json_decode(file_get_contents(ABSPATH.'/lang/' . $remember . '.json'),true) : false;
+ return isset($remember) ? json_decode(file_get_contents(ABSPATH . '/' . ($manage?'manage/':theme_path()).'lang/' . $remember . '.json'),true) : false;
}
function get_lang_name($locale) {
@@ -6,9 +6,10 @@ function theme_path() {
function load_theme($results=null) {
require_once ABSPATH.'/'.theme_path().'functions.php';
- if (isset($_GET['page'])) {
- if(file_exists(ABSPATH . '/' . theme_path().'page-'.$_GET['page'].'.php')) {
- require_once ABSPATH . '/' . theme_path().'page-'.$_GET['page'].'.php';
+ $page=is_page();
+ if ($page) {
+ if(file_exists(ABSPATH . '/' . theme_path().'page-'.$page.'.php')) {
+ require_once ABSPATH . '/' . theme_path().'page-'.$page.'.php';
}else {
return_404();
}
@@ -17,17 +18,17 @@ function load_theme($results=null) {
}
}
+function is_page() {
+ return isset($_GET['page'])?$_GET['page']:false;
+}
+
function load_header() {
require_once ABSPATH.'/'.theme_path().'header.php';
}
function load_footer() {
- if(defined('DIRECT_AJAX') && DIRECT_AJAX) {
- if(SERVICE=='tietuku') {
- echo '<script type="application/javascript" src="'.get_url().theme_path().'ttk-direct-ajax.js"></script>';
- }
-
- }
+ if(DIRECT_AJAX) {
+ echo '<script type="application/javascript" src="<?=get_url().theme_path() ?>js/ttk-direct-ajax.js"></script>';
+ }
require_once ABSPATH.'/'.theme_path().'footer.php';
-}
-
+}
View
@@ -1,21 +0,0 @@
-<?php
-
-define('MANAGE_RUN',true);
-
-/* Load Functions */
-require '../engine.php';
-
-require ABSPATH.'/manage/functions.php';
-
-$logerror=-1;
-if($logged=is_login()) {
- set_login();
-}else {
- $result = array('error'=>'not_login');
-}
-
-if(isset($_GET['action']) && $_GET['action']=='delete') {
- $works = json_decode($HTTP_RAW_POST_DATA,true);
- $result=delete_files($works);
-}
-echo json_encode($result);
Oops, something went wrong.

0 comments on commit 8848876

Please sign in to comment.