├── README.md ├── favicon.ico ├── admin ├── js │ └── Moxie.swf ├── img │ ├── editor.png │ ├── editor@2x.png │ ├── noscreen.png │ ├── ajax-loader.gif │ ├── editor │ │ ├── editor-hr.png │ │ ├── editor-bold.png │ │ ├── editor-code.png │ │ ├── editor-image.png │ │ ├── editor-link.png │ │ ├── editor-more.png │ │ ├── editor-olist.png │ │ ├── editor-quote.png │ │ ├── editor-redo.png │ │ ├── editor-ulist.png │ │ ├── editor-undo.png │ │ ├── editor-heading.png │ │ ├── editor-italic.png │ │ ├── 2x │ │ │ ├── editor-bold@2x.png │ │ │ ├── editor-code@2x.png │ │ │ ├── editor-hr@2x.png │ │ │ ├── editor-link@2x.png │ │ │ ├── editor-more@2x.png │ │ │ ├── editor-redo@2x.png │ │ │ ├── editor-undo@2x.png │ │ │ ├── editor-image@2x.png │ │ │ ├── editor-italic@2x.png │ │ │ ├── editor-olist@2x.png │ │ │ ├── editor-quote@2x.png │ │ │ ├── editor-ulist@2x.png │ │ │ ├── editor-exitfull@2x.png │ │ │ ├── editor-heading@2x.png │ │ │ └── editor-fullscreen@2x.png │ │ ├── editor-exitfull.png │ │ └── editor-fullscreen.png │ ├── icons │ │ ├── icon-edit.png │ │ ├── mime-audio.png │ │ ├── mime-html.png │ │ ├── mime-image.png │ │ ├── mime-text.png │ │ ├── mime-video.png │ │ ├── icon-delete.png │ │ ├── icon-exlink.png │ │ ├── icon-upload.png │ │ ├── mime-archive.png │ │ ├── mime-office.png │ │ ├── mime-script.png │ │ ├── mime-unknow.png │ │ ├── icon-upload-active.png │ │ └── mime-application.png │ ├── icons-2x │ │ ├── icon-edit.png │ │ ├── mime-audio.png │ │ ├── mime-html.png │ │ ├── mime-image.png │ │ ├── mime-text.png │ │ ├── mime-video.png │ │ ├── icon-delete.png │ │ ├── icon-exlink.png │ │ ├── icon-upload.png │ │ ├── mime-archive.png │ │ ├── mime-office.png │ │ ├── mime-script.png │ │ ├── mime-unknow.png │ │ ├── mime-application.png │ │ └── icon-upload-active.png │ ├── icons-s0c4f1c5ae6.png │ └── icons-2x-s481937020b.png ├── footer.php ├── page-title.php ├── extending.php ├── table-js.php ├── user.php ├── options-forum.php ├── category.php ├── options-general.php ├── options-plugin.php ├── options-discussion.php ├── options-permalink.php ├── copyright.php ├── form-js.php ├── menu.php ├── options-reading.php ├── options-theme.php ├── file-upload.php ├── upgrade.php ├── welcome.php ├── header.php ├── custom-fields-js.php ├── register.php ├── login.php ├── common.php ├── profile.php └── theme-editor.php ├── usr ├── avatar │ ├── default.jpg │ └── 000 │ │ └── 00 │ │ └── 00 │ │ └── 01 │ │ └── 1.jpg ├── themes │ └── default │ │ ├── img │ │ ├── logo.png │ │ ├── credits.png │ │ ├── icon-search.png │ │ └── stacks-logos-grid.png │ │ ├── screenshot.png │ │ ├── js │ │ └── plupload │ │ │ └── Moxie.swf │ │ ├── functions.php │ │ ├── user │ │ ├── widget_login.php │ │ ├── activate.php │ │ ├── replys.php │ │ ├── forgot_reset.php │ │ ├── setting_avatar.php │ │ ├── login.php │ │ ├── forgot.php │ │ ├── posts.php │ │ ├── widget_user.php │ │ ├── messages.php │ │ ├── ucenter.php │ │ ├── widget_info.php │ │ ├── credits.php │ │ ├── register.php │ │ └── favorite.php │ │ ├── 404.php │ │ ├── codemirror │ │ └── theme │ │ │ └── neo.css │ │ ├── page.php │ │ ├── footer.php │ │ ├── comments.php │ │ ├── sidebar.php │ │ ├── post.php │ │ ├── header.php │ │ └── page │ │ └── home.php └── plugins │ └── HelloWorld │ └── Plugin.php ├── var ├── Util │ ├── captcha │ │ └── ttfs │ │ │ ├── 1.ttf │ │ │ └── 2.ttf │ ├── verify │ │ ├── changemail.html │ │ ├── register.html │ │ └── reset.html │ ├── Session.php │ └── Connect │ │ └── Connect.php ├── Typecho │ ├── Db │ │ ├── Exception.php │ │ ├── Query │ │ │ └── Exception.php │ │ ├── Adapter │ │ │ ├── Exception.php │ │ │ └── Pdo │ │ │ │ ├── Mysql.php │ │ │ │ ├── Pgsql.php │ │ │ │ └── SQLite.php │ │ └── Adapter.php │ ├── Plugin │ │ ├── Exception.php │ │ └── Interface.php │ ├── Router │ │ └── Exception.php │ ├── Widget │ │ ├── Exception.php │ │ └── Helper │ │ │ ├── Empty.php │ │ │ ├── Form │ │ │ └── Element │ │ │ │ ├── Submit.php │ │ │ │ ├── Textarea.php │ │ │ │ ├── Text.php │ │ │ │ ├── Password.php │ │ │ │ ├── Hidden.php │ │ │ │ ├── Fake.php │ │ │ │ ├── Select.php │ │ │ │ ├── Radio.php │ │ │ │ └── Checkbox.php │ │ │ ├── PageNavigator │ │ │ └── Classic.php │ │ │ └── PageNavigator.php │ ├── Http │ │ ├── Client │ │ │ └── Exception.php │ │ └── Client.php │ ├── Exception.php │ ├── I18n │ │ └── GetTextMulti.php │ ├── Date.php │ └── Cookie.php ├── Widget │ ├── Interface │ │ └── Do.php │ ├── ExceptionHandle.php │ ├── Users │ │ ├── Logout.php │ │ ├── Messages.php │ │ ├── Author.php │ │ ├── Query.php │ │ ├── Login.php │ │ └── Favorites.php │ ├── Metas │ │ ├── Query.php │ │ ├── Tag │ │ │ ├── Admin.php │ │ │ └── Cloud.php │ │ ├── List.php │ │ └── Category │ │ │ └── Admin.php │ ├── Contents │ │ ├── Query.php │ │ ├── Post │ │ │ ├── Recent.php │ │ │ └── Date.php │ │ ├── Attachment │ │ │ ├── Unattached.php │ │ │ └── Related.php │ │ ├── Page │ │ │ ├── List.php │ │ │ └── Admin.php │ │ ├── Related │ │ │ └── Author.php │ │ └── Related.php │ ├── Comments │ │ └── Query.php │ ├── Notice.php │ ├── Themes │ │ ├── Config.php │ │ └── List.php │ ├── Init.php │ ├── Abstract │ │ └── Options.php │ ├── Security.php │ └── Abstract.php └── Markdown.php └── index.php /README.md: -------------------------------------------------------------------------------- 1 | # sisome 2 | 基于Typecho内核的社区系统 3 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/favicon.ico -------------------------------------------------------------------------------- /admin/js/Moxie.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/js/Moxie.swf -------------------------------------------------------------------------------- /admin/img/editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor.png -------------------------------------------------------------------------------- /admin/img/editor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor@2x.png -------------------------------------------------------------------------------- /admin/img/noscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/noscreen.png -------------------------------------------------------------------------------- /usr/avatar/default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/usr/avatar/default.jpg -------------------------------------------------------------------------------- /admin/img/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/ajax-loader.gif -------------------------------------------------------------------------------- /var/Util/captcha/ttfs/1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/var/Util/captcha/ttfs/1.ttf -------------------------------------------------------------------------------- /var/Util/captcha/ttfs/2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/var/Util/captcha/ttfs/2.ttf -------------------------------------------------------------------------------- /admin/img/editor/editor-hr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-hr.png -------------------------------------------------------------------------------- /admin/img/icons/icon-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/icon-edit.png -------------------------------------------------------------------------------- /admin/img/icons/mime-audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/mime-audio.png -------------------------------------------------------------------------------- /admin/img/icons/mime-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/mime-html.png -------------------------------------------------------------------------------- /admin/img/icons/mime-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/mime-image.png -------------------------------------------------------------------------------- /admin/img/icons/mime-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/mime-text.png -------------------------------------------------------------------------------- /admin/img/icons/mime-video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/mime-video.png -------------------------------------------------------------------------------- /usr/avatar/000/00/00/01/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/usr/avatar/000/00/00/01/1.jpg -------------------------------------------------------------------------------- /admin/img/editor/editor-bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-bold.png -------------------------------------------------------------------------------- /admin/img/editor/editor-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-code.png -------------------------------------------------------------------------------- /admin/img/editor/editor-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-image.png -------------------------------------------------------------------------------- /admin/img/editor/editor-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-link.png -------------------------------------------------------------------------------- /admin/img/editor/editor-more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-more.png -------------------------------------------------------------------------------- /admin/img/editor/editor-olist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-olist.png -------------------------------------------------------------------------------- /admin/img/editor/editor-quote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-quote.png -------------------------------------------------------------------------------- /admin/img/editor/editor-redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-redo.png -------------------------------------------------------------------------------- /admin/img/editor/editor-ulist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-ulist.png -------------------------------------------------------------------------------- /admin/img/editor/editor-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-undo.png -------------------------------------------------------------------------------- /admin/img/icons-2x/icon-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/icon-edit.png -------------------------------------------------------------------------------- /admin/img/icons-2x/mime-audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/mime-audio.png -------------------------------------------------------------------------------- /admin/img/icons-2x/mime-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/mime-html.png -------------------------------------------------------------------------------- /admin/img/icons-2x/mime-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/mime-image.png -------------------------------------------------------------------------------- /admin/img/icons-2x/mime-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/mime-text.png -------------------------------------------------------------------------------- /admin/img/icons-2x/mime-video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/mime-video.png -------------------------------------------------------------------------------- /admin/img/icons-s0c4f1c5ae6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-s0c4f1c5ae6.png -------------------------------------------------------------------------------- /admin/img/icons/icon-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/icon-delete.png -------------------------------------------------------------------------------- /admin/img/icons/icon-exlink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/icon-exlink.png -------------------------------------------------------------------------------- /admin/img/icons/icon-upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/icon-upload.png -------------------------------------------------------------------------------- /admin/img/icons/mime-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/mime-archive.png -------------------------------------------------------------------------------- /admin/img/icons/mime-office.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/mime-office.png -------------------------------------------------------------------------------- /admin/img/icons/mime-script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/mime-script.png -------------------------------------------------------------------------------- /admin/img/icons/mime-unknow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/mime-unknow.png -------------------------------------------------------------------------------- /usr/themes/default/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/usr/themes/default/img/logo.png -------------------------------------------------------------------------------- /usr/themes/default/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/usr/themes/default/screenshot.png -------------------------------------------------------------------------------- /admin/img/editor/editor-heading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-heading.png -------------------------------------------------------------------------------- /admin/img/editor/editor-italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-italic.png -------------------------------------------------------------------------------- /admin/img/icons-2x-s481937020b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x-s481937020b.png -------------------------------------------------------------------------------- /admin/img/icons-2x/icon-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/icon-delete.png -------------------------------------------------------------------------------- /admin/img/icons-2x/icon-exlink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/icon-exlink.png -------------------------------------------------------------------------------- /admin/img/icons-2x/icon-upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/icon-upload.png -------------------------------------------------------------------------------- /admin/img/icons-2x/mime-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/mime-archive.png -------------------------------------------------------------------------------- /admin/img/icons-2x/mime-office.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/mime-office.png -------------------------------------------------------------------------------- /admin/img/icons-2x/mime-script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/mime-script.png -------------------------------------------------------------------------------- /admin/img/icons-2x/mime-unknow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/mime-unknow.png -------------------------------------------------------------------------------- /usr/themes/default/img/credits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/usr/themes/default/img/credits.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-bold@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-bold@2x.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-code@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-code@2x.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-hr@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-hr@2x.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-link@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-link@2x.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-more@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-more@2x.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-redo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-redo@2x.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-undo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-undo@2x.png -------------------------------------------------------------------------------- /admin/img/editor/editor-exitfull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-exitfull.png -------------------------------------------------------------------------------- /admin/img/editor/editor-fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/editor-fullscreen.png -------------------------------------------------------------------------------- /admin/img/icons/icon-upload-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/icon-upload-active.png -------------------------------------------------------------------------------- /admin/img/icons/mime-application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons/mime-application.png -------------------------------------------------------------------------------- /usr/themes/default/img/icon-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/usr/themes/default/img/icon-search.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-image@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-image@2x.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-italic@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-italic@2x.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-olist@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-olist@2x.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-quote@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-quote@2x.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-ulist@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-ulist@2x.png -------------------------------------------------------------------------------- /admin/img/icons-2x/mime-application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/mime-application.png -------------------------------------------------------------------------------- /usr/themes/default/js/plupload/Moxie.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/usr/themes/default/js/plupload/Moxie.swf -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-exitfull@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-exitfull@2x.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-heading@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-heading@2x.png -------------------------------------------------------------------------------- /admin/img/icons-2x/icon-upload-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/icons-2x/icon-upload-active.png -------------------------------------------------------------------------------- /admin/img/editor/2x/editor-fullscreen@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/admin/img/editor/2x/editor-fullscreen@2x.png -------------------------------------------------------------------------------- /usr/themes/default/img/stacks-logos-grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangmuzi/sisome/HEAD/usr/themes/default/img/stacks-logos-grid.png -------------------------------------------------------------------------------- /usr/themes/default/functions.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | end(); 7 | -------------------------------------------------------------------------------- /var/Util/verify/changemail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Bootstrap 101 Template 4 | 5 |

Hi {name},

6 |

您正在进行修改邮件的操作:

7 |

本次操作的验证码是:{token}

8 |

{siteTitle}

9 | 10 | -------------------------------------------------------------------------------- /admin/page-title.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |

title; ?>addLink)) { 5 | echo "addLink}\">" . _t("新增") . ""; 6 | } 7 | ?>

8 |
9 | -------------------------------------------------------------------------------- /var/Util/verify/register.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Bootstrap 101 Template 4 | 5 |

Hi {name},

6 |

欢迎注册 {siteTitle}

7 |

请点击下面的地址验证你的帐号:

8 |

{url}

9 |

此为系统邮件请勿回复

10 |

{siteTitle}

11 | 12 | -------------------------------------------------------------------------------- /var/Util/verify/reset.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Bootstrap 101 Template 4 | 5 |

Hi {name},

6 |

我们的系统收到一个请求,说你希望通过电子邮件重新设置你在 {siteTitle} 的密码。

7 |

你可以点击下面的链接开始重设密码:

8 |

{url}

9 |

如果这个请求不是由你发起的,那没问题,你不用担心,你可以安全地忽略这封邮件。

10 |

此为系统邮件请勿回复

11 |

{siteTitle}

12 | 13 | -------------------------------------------------------------------------------- /admin/extending.php: -------------------------------------------------------------------------------- 1 | get('panel'); 5 | $panelTable = unserialize($options->panelTable); 6 | 7 | if (!isset($panelTable['file']) || !in_array(urlencode($panel), $panelTable['file'])) { 8 | throw new Typecho_Plugin_Exception(_t('页面不存在'), 404); 9 | } 10 | 11 | list ($pluginName, $file) = explode('/', trim($panel, '/'), 2); 12 | 13 | require_once $options->pluginDir($pluginName) . '/' . $panel; 14 | -------------------------------------------------------------------------------- /var/Typecho/Db/Exception.php: -------------------------------------------------------------------------------- 1 | 9 | * @license GNU General Public License 2.0 10 | */ 11 | interface Widget_Interface_Do 12 | { 13 | /** 14 | * 接口需要实现的入口函数 15 | * 16 | * @access public 17 | * @return void 18 | */ 19 | public function action(); 20 | } 21 | -------------------------------------------------------------------------------- /usr/themes/default/user/widget_login.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | options->title(); ?> 5 |
options->description(); ?>
6 |
7 |
8 | 9 |

已注册用户请

10 |
11 |
12 | -------------------------------------------------------------------------------- /var/Typecho/Exception.php: -------------------------------------------------------------------------------- 1 | message = $message; 22 | $this->code = $code; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /admin/table-js.php: -------------------------------------------------------------------------------- 1 | 2 | 19 | -------------------------------------------------------------------------------- /admin/user.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |
12 | form()->render(); ?> 13 |
14 |
15 |
16 |
17 | 18 | 24 | -------------------------------------------------------------------------------- /admin/options-forum.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |
12 | form()->render(); ?> 13 |
14 |
15 |
16 |
17 | 18 | 24 | -------------------------------------------------------------------------------- /admin/category.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |
12 | form()->render(); ?> 13 |
14 |
15 |
16 |
17 | 18 | 24 | -------------------------------------------------------------------------------- /admin/options-general.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |
12 | form()->render(); ?> 13 |
14 |
15 |
16 |
17 | 18 | 24 | -------------------------------------------------------------------------------- /admin/options-plugin.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |
12 | config()->render(); ?> 13 |
14 |
15 |
16 |
17 | 18 | 24 | -------------------------------------------------------------------------------- /admin/options-discussion.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |
12 | form()->render(); ?> 13 |
14 |
15 |
16 |
17 | 18 | 24 | -------------------------------------------------------------------------------- /admin/options-permalink.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |
12 | form()->render(); ?> 13 |
14 |
15 |
16 |
17 | 18 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /var/Markdown.php: -------------------------------------------------------------------------------- 1 | transform($text); 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /usr/themes/default/404.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | need('sidebar.php'); ?> 4 |
5 |
6 |
404 -
7 |
8 |

9 |
10 |

11 |

12 |
13 |
14 |
15 |
16 | need('footer.php'); ?> 17 | -------------------------------------------------------------------------------- /admin/copyright.php: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | begin(); 21 | 22 | /** 开始路由分发 */ 23 | Typecho_Router::dispatch(); 24 | 25 | /** 注册一个结束插件 */ 26 | Typecho_Plugin::factory('index.php')->end(); 27 | -------------------------------------------------------------------------------- /var/Widget/ExceptionHandle.php: -------------------------------------------------------------------------------- 1 | widget('Widget_Archive@404', 'type=404')->render(); 28 | exit; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /admin/form-js.php: -------------------------------------------------------------------------------- 1 | 2 | 27 | -------------------------------------------------------------------------------- /admin/menu.php: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | -------------------------------------------------------------------------------- /var/Widget/Users/Logout.php: -------------------------------------------------------------------------------- 1 | user->logout(); 32 | $this->pluginHandle()->logout(); 33 | $this->response->goBack(NULL, $this->options->index); 34 | @session_destroy(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /var/Widget/Users/Messages.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | class Widget_Users_Messages extends Widget_Abstract_Messages{ 13 | public function addMessage($uid,$srcId,$type='comment'){ 14 | $row = array( 15 | 'uid'=>$uid, 16 | 'type'=>$type, 17 | 'srcId'=>$srcId, 18 | 'created'=>$this->options->gmtTime, 19 | 'status'=>0 20 | ); 21 | return $this->insert($row); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /var/Widget/Users/Author.php: -------------------------------------------------------------------------------- 1 | parameter->uid) { 33 | $this->db->fetchRow($this->select() 34 | ->where('uid = ?', $this->parameter->uid), array($this, 'push')); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /var/Widget/Metas/Query.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | class Widget_Metas_Query extends Widget_Abstract_Metas 13 | { 14 | /** 15 | * 执行函数,初始化数据 16 | * 17 | * @access public 18 | * @return void 19 | */ 20 | public function execute() 21 | { 22 | if ($this->parameter->mid) { 23 | $this->db->fetchRow($this->select() 24 | ->where('table.metas.mid = ?', $this->parameter->mid)->limit(1), array($this, 'push')); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /var/Widget/Contents/Query.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | class Widget_Contents_Query extends Widget_Abstract_Contents 13 | { 14 | /** 15 | * 执行函数,初始化数据 16 | * 17 | * @access public 18 | * @return void 19 | */ 20 | public function execute() 21 | { 22 | if ($this->parameter->cid) { 23 | $this->db->fetchRow($this->select() 24 | ->where('table.contents.cid = ?', $this->parameter->cid)->limit(1), array($this, 'push')); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /usr/themes/default/codemirror/theme/neo.css: -------------------------------------------------------------------------------- 1 | /* neo theme for codemirror */ 2 | 3 | /* Color scheme */ 4 | 5 | .cm-s-neo.CodeMirror { 6 | background-color:#f9f9f9; 7 | color:#2e383c; 8 | line-height: 1.4; 9 | } 10 | .cm-s-neo .cm-comment {color:#75787b} 11 | .cm-s-neo .cm-keyword, .cm-s-neo .cm-property {color:#1d75b3} 12 | .cm-s-neo .cm-atom,.cm-s-neo .cm-number {color:#75438a} 13 | .cm-s-neo .cm-node,.cm-s-neo .cm-tag {color:#9c3328} 14 | .cm-s-neo .cm-string {color:#b35e14} 15 | .cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier {color:#047d65} 16 | 17 | 18 | /* Editor styling */ 19 | 20 | .cm-s-neo pre { 21 | padding:0px 0px 0px 10px; 22 | } 23 | 24 | .cm-s-neo .CodeMirror-gutters { 25 | border:none; 26 | border-right:10px solid transparent; 27 | background-color:#f0f0f0; 28 | } 29 | 30 | .cm-s-neo .CodeMirror-linenumber { 31 | padding:0; 32 | color:#ccc; 33 | } 34 | 35 | .cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; } 36 | .cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; } -------------------------------------------------------------------------------- /var/Widget/Comments/Query.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | class Widget_Comments_Query extends Widget_Abstract_Comments 13 | { 14 | /** 15 | * 执行函数,初始化数据 16 | * 17 | * @access public 18 | * @return void 19 | */ 20 | public function execute() 21 | { 22 | if ($this->parameter->coid) { 23 | $this->db->fetchRow($this->select() 24 | ->where('table.comments.coid = ?', $this->parameter->coid)->limit(1), array($this, 'push')); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /admin/options-reading.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |
12 | form()->render(); ?> 13 |
14 |
15 |
16 |
17 | 18 | 23 | 35 | 38 | -------------------------------------------------------------------------------- /usr/themes/default/user/activate.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 10 |
11 |
12 |
13 | options->title();?>   »   14 | getMetaTitle();?> 15 |
16 |
17 |

18 | user->hasLogin()):?> 19 |

20 | 21 |

22 |
23 |
24 |
25 | need('footer.php'); ?> 26 | -------------------------------------------------------------------------------- /var/Widget/Contents/Post/Recent.php: -------------------------------------------------------------------------------- 1 | parameter->setDefault(array('pageSize' => $this->options->postsListSize)); 32 | 33 | $this->db->fetchAll($this->select() 34 | ->where('table.contents.status = ?', 'publish') 35 | ->where('table.contents.created < ?', $this->options->gmtTime) 36 | ->where('table.contents.type = ?', 'post') 37 | ->order('table.contents.created', Typecho_Db::SORT_DESC) 38 | ->limit($this->parameter->pageSize), array($this, 'push')); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /var/Widget/Contents/Attachment/Unattached.php: -------------------------------------------------------------------------------- 1 | select()->where('table.contents.type = ? AND 33 | (table.contents.parent = 0 OR table.contents.parent IS NULL)', 'attachment'); 34 | 35 | /** 加上对用户的判断 */ 36 | $this->where('table.contents.authorId = ?', $this->user->uid); 37 | 38 | /** 提交查询 */ 39 | $select->order('table.contents.created', Typecho_Db::SORT_DESC); 40 | 41 | $this->db->fetchAll($select, array($this, 'push')); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /usr/themes/default/page.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 6 |
7 |
8 |
9 |
10 | options->title();?>   »   11 | is('index')): ?> 12 | 13 | is('post')): ?> 14 | category(); ?> » title(); ?> 15 | 16 | archiveTitle(' » ','',''); ?> 17 | 18 |
19 |
20 |
21 |

title() ?>

22 |
23 | content(); ?> 24 |
25 |
26 |
modified,'Y-m-d H:i:s')?>
27 |
28 |
29 | need('footer.php'); ?> 30 | -------------------------------------------------------------------------------- /admin/options-theme.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |
12 |
    13 |
  • 14 | 15 |
  • 16 | 17 |
  • 18 |
19 |
20 |
21 | config()->render(); ?> 22 |
23 |
24 |
25 |
26 | 27 | 33 | -------------------------------------------------------------------------------- /usr/themes/default/user/replys.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 6 |
7 | need('user/widget_info.php'); ?> 8 |
9 | comments->have()): ?> 10 | comments->next()): ?> 11 |
comments->title(); ?> 12 | comments->dateWord(); ?> 13 |
14 |
comments->content(); ?>
15 | 16 |
17 | comments->pageLink('上一页','prev');?> 18 | comments->getCurrentPage().'/'.$this->comments->getTotalPage();?> 19 | comments->pageLink('下一页','next');?> 20 |
21 | 22 |
23 |

24 |
25 | 26 | 27 |
28 |
29 | need('footer.php'); ?> -------------------------------------------------------------------------------- /var/Typecho/Plugin/Interface.php: -------------------------------------------------------------------------------- 1 | select()->where('table.contents.type = ?', 'page') 33 | ->where('table.contents.status = ?', 'publish') 34 | ->where('table.contents.created < ?', $this->options->gmtTime) 35 | ->order('table.contents.order', Typecho_Db::SORT_ASC); 36 | 37 | //去掉自定义首页 38 | $frontPage = explode(':', $this->options->frontPage); 39 | if (2 == count($frontPage) && 'page' == $frontPage[0]) { 40 | $select->where('table.contents.cid <> ?', $frontPage[1]); 41 | } 42 | 43 | $this->db->fetchAll($select, array($this, 'push')); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /var/Widget/Users/Query.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | class Widget_Users_Query extends Widget_Abstract_Users 13 | { 14 | /** 15 | * 执行函数,初始化数据 16 | * 17 | * @access public 18 | * @return void 19 | */ 20 | public function execute() 21 | { 22 | if($this->parameter->uid){ 23 | $this->db->fetchRow($this->select() 24 | ->where('table.users.uid = ?', $this->parameter->uid)->limit(1), array($this, 'push')); 25 | }else if ($this->parameter->name) { 26 | $this->db->fetchRow($this->select() 27 | ->where('table.users.name = ?', $this->parameter->name)->limit(1), array($this, 'push')); 28 | }else if ($this->parameter->mail) { 29 | $this->db->fetchRow($this->select() 30 | ->where('table.users.mail = ?', $this->parameter->mail)->limit(1), array($this, 'push')); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /var/Typecho/Widget/Helper/Form/Element/Submit.php: -------------------------------------------------------------------------------- 1 | setAttribute('class', 'typecho-option typecho-option-submit'); 34 | $input = new Typecho_Widget_Helper_Layout('button', array('type' => 'submit')); 35 | $this->container($input); 36 | $this->inputs[] = $input; 37 | 38 | return $input; 39 | } 40 | 41 | /** 42 | * 设置表单元素值 43 | * 44 | * @access protected 45 | * @param mixed $value 表单元素值 46 | * @return void 47 | */ 48 | protected function _value($value) 49 | { 50 | $this->input->html($value); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /usr/themes/default/user/forgot_reset.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 4 | 7 |
8 |
9 |
10 | options->title();?>   »   11 | getMetaTitle();?> 12 |
13 |
14 |
15 |
16 |
17 | 18 | 19 |
20 |
21 | 22 | 23 |
24 |
25 | 26 | 27 |
28 | 29 |
30 |
31 |
32 | need('footer.php'); ?> 33 | -------------------------------------------------------------------------------- /var/Typecho/Http/Client.php: -------------------------------------------------------------------------------- 1 | select()->where('type = ?', 'tag')->order('mid', Typecho_Db::SORT_DESC); 32 | $this->db->fetchAll($select, array($this, 'push')); 33 | } 34 | 35 | /** 36 | * 获取菜单标题 37 | * 38 | * @access public 39 | * @return string 40 | */ 41 | public function getMenuTitle() 42 | { 43 | if (isset($this->request->mid)) { 44 | $tag = $this->db->fetchRow($this->select() 45 | ->where('type = ? AND mid = ?', 'tag', $this->request->mid)); 46 | 47 | if (!empty($tag)) { 48 | return _t('编辑标签 %s', $tag['name']); 49 | } 50 | } else { 51 | return; 52 | } 53 | 54 | throw new Typecho_Widget_Exception(_t('标签不存在'), 404); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /var/Widget/Contents/Related/Author.php: -------------------------------------------------------------------------------- 1 | parameter->setDefault('limit=5'); 33 | 34 | if ($this->parameter->author) { 35 | $this->db->fetchAll($this->select() 36 | ->where('table.contents.authorId = ?', $this->parameter->author) 37 | ->where('table.contents.cid <> ?', $this->parameter->cid) 38 | ->where('table.contents.status = ?', 'publish') 39 | ->where('table.contents.password IS NULL') 40 | ->where('table.contents.created < ?', $this->options->gmtTime) 41 | ->where('table.contents.type = ?', $this->parameter->type) 42 | ->order('table.contents.created', Typecho_Db::SORT_DESC) 43 | ->limit($this->parameter->limit), array($this, 'push')); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /var/Typecho/Widget/Helper/Form/Element/Textarea.php: -------------------------------------------------------------------------------- 1 | $name . '-0-' . self::$uniqueId, 'name' => $name)); 34 | $this->label->setAttribute('for', $name . '-0-' . self::$uniqueId); 35 | $this->container($input->setClose(false)); 36 | $this->inputs[] = $input; 37 | 38 | return $input; 39 | } 40 | 41 | /** 42 | * 设置表单项默认值 43 | * 44 | * @access protected 45 | * @param string $value 表单项默认值 46 | * @return void 47 | */ 48 | protected function _value($value) 49 | { 50 | $this->input->html(htmlspecialchars($value)); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /admin/file-upload.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | cid : $page->cid; 6 | 7 | if ($cid) { 8 | Typecho_Widget::widget('Widget_Contents_Attachment_Related', 'parentId=' . $cid)->to($attachment); 9 | } else { 10 | Typecho_Widget::widget('Widget_Contents_Attachment_Unattached')->to($attachment); 11 | } 12 | } 13 | 14 | ?> 15 | 16 |
17 |
或者 %s选择文件上传%s', '', ''); ?>
18 | 32 |
33 | 34 | -------------------------------------------------------------------------------- /admin/upgrade.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |
12 |
13 |
16 |

17 |
    18 |
  • 19 |
  • %s 升级到 %s', $options->version, Typecho_Common::VERSION); ?>
  • 20 |
  • 21 |
22 |

23 |
24 |
25 |
26 |
27 |
28 |
29 | 30 | 34 | 41 | 42 | -------------------------------------------------------------------------------- /admin/welcome.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |
12 |
13 |
14 |

title); ?>

15 |
    16 |
  1. 17 | pass('contributor', true)): ?> 18 |
  2. 19 |
  3. 20 | 21 |
  4. 22 | 23 |
24 |

25 |
26 |
27 |
28 |
29 |
30 |
31 | 32 | 37 | -------------------------------------------------------------------------------- /var/Typecho/Widget/Helper/Form/Element/Text.php: -------------------------------------------------------------------------------- 1 | $name . '-0-' . self::$uniqueId, 34 | 'name' => $name, 'type' => 'text', 'class' => 'text')); 35 | $this->container($input); 36 | $this->label->setAttribute('for', $name . '-0-' . self::$uniqueId); 37 | $this->inputs[] = $input; 38 | 39 | return $input; 40 | } 41 | 42 | /** 43 | * 设置表单项默认值 44 | * 45 | * @access protected 46 | * @param mixed $value 表单项默认值 47 | * @return void 48 | */ 49 | protected function _value($value) 50 | { 51 | $this->input->setAttribute('value', htmlspecialchars($value)); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /var/Typecho/Widget/Helper/Form/Element/Password.php: -------------------------------------------------------------------------------- 1 | $name . '-0-' . self::$uniqueId, 34 | 'name' => $name, 'type' => 'password', 'class' => 'password')); 35 | $this->label->setAttribute('for', $name . '-0-' . self::$uniqueId); 36 | $this->container($input); 37 | $this->inputs[] = $input; 38 | return $input; 39 | } 40 | 41 | /** 42 | * 设置表单项默认值 43 | * 44 | * @access protected 45 | * @param string $value 表单项默认值 46 | * @return void 47 | */ 48 | protected function _value($value) 49 | { 50 | $this->input->setAttribute('value', htmlspecialchars($value)); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /var/Widget/Contents/Attachment/Related.php: -------------------------------------------------------------------------------- 1 | parameter->setDefault('parentId=0&limit=0'); 32 | 33 | //如果没有cid值 34 | if (!$this->parameter->parentId) { 35 | return; 36 | } 37 | 38 | /** 构建基础查询 */ 39 | $select = $this->select()->where('table.contents.type = ?', 'attachment'); 40 | 41 | //order字段在文件里代表所属文章 42 | $select->where('table.contents.parent = ?', $this->parameter->parentId); 43 | 44 | /** 提交查询 */ 45 | $select->order('table.contents.created', Typecho_Db::SORT_ASC); 46 | 47 | if ($this->parameter->limit > 0) { 48 | $select->limit($this->parameter->limit); 49 | } 50 | 51 | if ($this->parameter->offset > 0) { 52 | $select->offset($this->parameter->offset); 53 | } 54 | 55 | $this->db->fetchAll($select, array($this, 'push')); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /usr/themes/default/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 |
23 | 24 | is('post')): ?> 25 | 26 | 27 |
28 | 29 | 30 | footer(); ?> 31 | 32 | 33 | -------------------------------------------------------------------------------- /var/Widget/Contents/Page/Admin.php: -------------------------------------------------------------------------------- 1 | select()->where('table.contents.type = ? OR (table.contents.type = ? AND table.contents.parent = ?)', 'page', 'page_draft', 0); 33 | 34 | /** 过滤标题 */ 35 | if (NULL != ($keywords = $this->request->keywords)) { 36 | $args = array(); 37 | $keywordsList = explode(' ', $keywords); 38 | $args[] = implode(' OR ', array_fill(0, count($keywordsList), 'table.contents.title LIKE ?')); 39 | 40 | foreach ($keywordsList as $keyword) { 41 | $args[] = '%' . Typecho_Common::filterSearchQuery($keyword) . '%'; 42 | } 43 | 44 | call_user_func_array(array($select, 'where'), $args); 45 | } 46 | 47 | /** 提交查询 */ 48 | $select->order('table.contents.order', Typecho_Db::SORT_ASC); 49 | 50 | $this->db->fetchAll($select, array($this, 'push')); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /var/Typecho/Widget/Helper/Form/Element/Hidden.php: -------------------------------------------------------------------------------- 1 | setAttribute('style', 'display:none'); 33 | } 34 | 35 | /** 36 | * 初始化当前输入项 37 | * 38 | * @access public 39 | * @param string $name 表单元素名称 40 | * @param array $options 选择项 41 | * @return Typecho_Widget_Helper_Layout 42 | */ 43 | public function input($name = NULL, array $options = NULL) 44 | { 45 | $input = new Typecho_Widget_Helper_Layout('input', array('name' => $name, 'type' => 'hidden')); 46 | $this->container($input); 47 | $this->inputs[] = $input; 48 | return $input; 49 | } 50 | 51 | /** 52 | * 设置表单项默认值 53 | * 54 | * @access protected 55 | * @param string $value 表单项默认值 56 | * @return void 57 | */ 58 | protected function _value($value) 59 | { 60 | $this->input->setAttribute('value', htmlspecialchars($value)); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /admin/header.php: -------------------------------------------------------------------------------- 1 | adminStaticUrl('css')) . '"> 7 | 8 | 9 | '; 13 | 14 | /** 注册一个初始化插件 */ 15 | $header = Typecho_Plugin::factory('admin/header.php')->header($header); 16 | 17 | ?> 18 | 19 | 20 | 21 | 22 | 23 | 24 | <?php _e('%s - %s - Powered by SOMEBBS', $menu->title, $options->title); ?> 25 | 26 | 27 | 28 | > 29 | 32 | -------------------------------------------------------------------------------- /usr/themes/default/user/setting_avatar.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 4 | 7 |
8 |
9 |
10 | options->title();?>   »   11 | getMetaTitle();?> 12 |
13 |
14 |
15 |
16 |
17 | 18 |

19 | user->uid,96,null,'avatar vab mr10');?> 20 | user->uid,48,null,'avatar vab mr10');?> 21 | user->uid,24,null,'avatar vab mr10');?> 22 |

23 |
24 |
25 | 26 | 27 |
28 |
29 | 30 |

支持 2MB 以内的 PNG / JPG / GIF 文件

31 |
32 |
33 | 34 | 35 |
36 |
37 |
38 |
39 | need('footer.php'); ?> 40 | -------------------------------------------------------------------------------- /usr/themes/default/user/login.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 4 | 7 |
8 |
9 |
10 | options->title();?>   »   11 | getMetaTitle();?> 12 |
13 |
14 |
15 |
16 |
17 |
18 | 19 | 20 |
21 |
22 | 23 | 24 |
25 |
26 | 27 |
28 |
29 | 30 | 31 |
32 |
33 | 34 |

忘记密码?

35 |
36 | 37 |
38 |
39 |
40 | need('footer.php'); ?> 41 | -------------------------------------------------------------------------------- /var/Widget/Metas/Tag/Cloud.php: -------------------------------------------------------------------------------- 1 | parameter->setDefault(array('sort' => 'count', 'ignoreZeroCount' => false, 'desc' => true, 'limit' => 0)); 32 | $select = $this->select()->where('type = ?', 'tag')->order($this->parameter->sort, 33 | $this->parameter->desc ? Typecho_Db::SORT_DESC : Typecho_Db::SORT_ASC); 34 | 35 | /** 忽略零数量 */ 36 | if ($this->parameter->ignoreZeroCount) { 37 | $select->where('count > 0'); 38 | } 39 | 40 | /** 总数限制 */ 41 | if ($this->parameter->limit) { 42 | $select->limit($this->parameter->limit); 43 | } 44 | 45 | $this->db->fetchAll($select, array($this, 'push')); 46 | } 47 | 48 | /** 49 | * 按分割数输出字符串 50 | * 51 | * @access public 52 | * @param string $param 需要输出的值 53 | * @return void 54 | */ 55 | public function split() 56 | { 57 | $args = func_get_args(); 58 | array_unshift($args, $this->count); 59 | echo call_user_func_array(array('Typecho_Common', 'splitByCount'), $args); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /usr/themes/default/comments.php: -------------------------------------------------------------------------------- 1 | 2 | allow('comment')): ?> 3 |
4 | comments()->to($comments); ?> 5 | have()): ?> 6 |
commentsNum(_t('%d 条回复')); ?> 7 |
8 | 9 | listComments(); ?> 10 |
11 | pageNav('«', '»'); ?> 12 |
13 | 14 |
15 |

16 |
17 | 18 |
19 |
20 |
21 | 22 | cancelReply(); ?> 23 | 24 |
25 |
26 | user->hasLogin()): ?> 27 |
28 | 29 |
30 |
31 | 32 | 33 |
34 | 35 |

36 | 已注册用户请 或者

37 | 38 |
39 | 40 |
41 | -------------------------------------------------------------------------------- /usr/plugins/HelloWorld/Plugin.php: -------------------------------------------------------------------------------- 1 | navBar = array('HelloWorld_Plugin', 'render'); 23 | } 24 | 25 | /** 26 | * 禁用插件方法,如果禁用失败,直接抛出异常 27 | * 28 | * @static 29 | * @access public 30 | * @return void 31 | * @throws Typecho_Plugin_Exception 32 | */ 33 | public static function deactivate(){} 34 | 35 | /** 36 | * 获取插件配置面板 37 | * 38 | * @access public 39 | * @param Typecho_Widget_Helper_Form $form 配置面板 40 | * @return void 41 | */ 42 | public static function config(Typecho_Widget_Helper_Form $form) 43 | { 44 | /** 分类名称 */ 45 | $name = new Typecho_Widget_Helper_Form_Element_Text('word', NULL, 'Hello World', _t('说点什么')); 46 | $form->addInput($name); 47 | } 48 | 49 | /** 50 | * 个人用户的配置面板 51 | * 52 | * @access public 53 | * @param Typecho_Widget_Helper_Form $form 54 | * @return void 55 | */ 56 | public static function personalConfig(Typecho_Widget_Helper_Form $form){} 57 | 58 | /** 59 | * 插件实现方法 60 | * 61 | * @access public 62 | * @return void 63 | */ 64 | public static function render() 65 | { 66 | echo '' 67 | . htmlspecialchars(Typecho_Widget::widget('Widget_Options')->plugin('HelloWorld')->word) 68 | . ''; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /admin/custom-fields-js.php: -------------------------------------------------------------------------------- 1 | 2 | 45 | -------------------------------------------------------------------------------- /admin/register.php: -------------------------------------------------------------------------------- 1 | hasLogin() || !$options->allowRegister) { 5 | $response->redirect($options->siteUrl); 6 | } 7 | $rememberName = htmlspecialchars(Typecho_Cookie::get('__some_remember_name')); 8 | $rememberMail = htmlspecialchars(Typecho_Cookie::get('__some_remember_mail')); 9 | Typecho_Cookie::delete('__some_remember_name'); 10 | Typecho_Cookie::delete('__some_remember_mail'); 11 | 12 | $bodyClass = 'body-100'; 13 | 14 | include 'header.php'; 15 | ?> 16 |
17 | 39 |
40 | 43 | 48 | 51 | -------------------------------------------------------------------------------- /usr/themes/default/user/forgot.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 4 | 7 |
8 |
9 |
10 | options->title();?>   »   11 | getMetaTitle();?> 12 |
13 |
14 |
15 | request->isPost()):?> 16 |

17 | → 18 | 19 |
20 |
21 |
22 | 23 | 24 |
25 |
26 | 27 | 28 |
29 |
30 | 31 |

32 |
33 |
34 | 35 | 36 |
37 |
38 | 39 | 40 |
41 |
42 | 43 |
44 |
45 | need('footer.php'); ?> 46 | -------------------------------------------------------------------------------- /var/Typecho/Widget/Helper/PageNavigator/Classic.php: -------------------------------------------------------------------------------- 1 | prev($prevWord); 33 | $this->next($nextWord); 34 | } 35 | 36 | /** 37 | * 输出上一页 38 | * 39 | * @access public 40 | * @param string $prevWord 上一页文字 41 | * @return void 42 | */ 43 | public function prev($prevWord = 'PREV') 44 | { 45 | //输出上一页 46 | if ($this->_total > 0 && $this->_currentPage > 1) { 47 | echo ''; 49 | } 50 | } 51 | 52 | /** 53 | * 输出下一页 54 | * 55 | * @access public 56 | * @param string $prevWord 下一页文字 57 | * @return void 58 | */ 59 | public function next($nextWord = 'NEXT') 60 | { 61 | //输出下一页 62 | if ($this->_total > 0 && $this->_currentPage < $this->_totalPage) { 63 | echo ''; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /var/Widget/Notice.php: -------------------------------------------------------------------------------- 1 | highlight = $theId; 36 | Typecho_Cookie::set('__some_notice_highlight', $theId, 37 | $this->widget('Widget_Options')->gmtTime + $this->widget('Widget_Options')->timezone + 86400); 38 | } 39 | 40 | /** 41 | * 获取高亮的id 42 | * 43 | * @access public 44 | * @return integer 45 | */ 46 | public function getHighlightId() 47 | { 48 | return preg_match("/[0-9]+/", $this->highlight, $matches) ? $matches[0] : 0; 49 | } 50 | 51 | /** 52 | * 设定堆栈每一行的值 53 | * 54 | * @param string $value 值对应的键值 55 | * @param string $type 提示类型 56 | * @param string $typeFix 兼容老插件 57 | * @return array 58 | */ 59 | public function set($value, $type = 'notice', $typeFix = 'notice') 60 | { 61 | $notice = is_array($value) ? array_values($value) : array($value); 62 | if (empty($type) && $typeFix) { 63 | $type = $typeFix; 64 | } 65 | 66 | Typecho_Cookie::set('__some_notice', Json::encode($notice), 67 | $this->widget('Widget_Options')->gmtTime + $this->widget('Widget_Options')->timezone + 86400); 68 | Typecho_Cookie::set('__some_notice_type', $type, 69 | $this->widget('Widget_Options')->gmtTime + $this->widget('Widget_Options')->timezone + 86400); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /var/Typecho/Widget/Helper/Form/Element/Fake.php: -------------------------------------------------------------------------------- 1 | name = $name; 34 | self::$uniqueId ++; 35 | 36 | /** 运行自定义初始函数 */ 37 | $this->init(); 38 | 39 | /** 初始化表单项 */ 40 | $this->input = $this->input($name, $options); 41 | 42 | /** 初始化表单值 */ 43 | if (NULL !== $value) { 44 | $this->value($value); 45 | } 46 | } 47 | 48 | /** 49 | * 自定义初始函数 50 | * 51 | * @access public 52 | * @return void 53 | */ 54 | public function init() 55 | {} 56 | 57 | /** 58 | * 初始化当前输入项 59 | * 60 | * @access public 61 | * @param string $name 表单元素名称 62 | * @param array $options 选择项 63 | * @return Typecho_Widget_Helper_Layout 64 | */ 65 | public function input($name = NULL, array $options = NULL) 66 | { 67 | $input = new Typecho_Widget_Helper_Layout('input'); 68 | $this->inputs[] = $input; 69 | return $input; 70 | } 71 | 72 | /** 73 | * 设置表单项默认值 74 | * 75 | * @access protected 76 | * @param string $value 表单项默认值 77 | * @return void 78 | */ 79 | protected function _value($value) 80 | { 81 | $this->input->setAttribute('value', $value); 82 | } 83 | } 84 | 85 | -------------------------------------------------------------------------------- /usr/themes/default/user/posts.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 6 |
7 | need('user/widget_info.php'); ?> 8 |
9 | posts->have()): ?> 10 | posts->next()): ?> 11 | 28 | 29 |
30 | posts->pageLink('上一页','prev');?> 31 | posts->getCurrentPage().'/'.$this->posts->getTotalPage();?> 32 | posts->pageLink('下一页','next');?> 33 |
34 | 35 |
36 |

37 |
38 | 39 |
40 |
41 | need('footer.php'); ?> 42 | -------------------------------------------------------------------------------- /var/Typecho/Widget/Helper/Form/Element/Select.php: -------------------------------------------------------------------------------- 1 | container($input->setAttribute('name', $name) 43 | ->setAttribute('id', $name . '-0-' . self::$uniqueId)); 44 | $this->label->setAttribute('for', $name . '-0-' . self::$uniqueId); 45 | $this->inputs[] = $input; 46 | 47 | foreach ($options as $value => $label) { 48 | $this->_options[$value] = new Typecho_Widget_Helper_Layout('option'); 49 | $input->addItem($this->_options[$value]->setAttribute('value', $value)->html($label)); 50 | } 51 | 52 | return $input; 53 | } 54 | 55 | /** 56 | * 设置表单元素值 57 | * 58 | * @access protected 59 | * @param mixed $value 表单元素值 60 | * @return void 61 | */ 62 | protected function _value($value) 63 | { 64 | foreach ($this->_options as $option) { 65 | $option->removeAttribute('selected'); 66 | } 67 | 68 | if (isset($this->_options[$value])) { 69 | $this->_options[$value]->setAttribute('selected', 'true'); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /admin/login.php: -------------------------------------------------------------------------------- 1 | hasLogin()) { 5 | $response->redirect($options->adminUrl); 6 | } 7 | $rememberName = htmlspecialchars(Typecho_Cookie::get('__some_remember_name')); 8 | Typecho_Cookie::delete('__some_remember_name'); 9 | 10 | $bodyClass = 'body-100'; 11 | 12 | include 'header.php'; 13 | ?> 14 |
15 | 43 |
44 | 47 | 52 | 55 | -------------------------------------------------------------------------------- /usr/themes/default/sidebar.php: -------------------------------------------------------------------------------- 1 | 2 | 41 | -------------------------------------------------------------------------------- /admin/common.php: -------------------------------------------------------------------------------- 1 | begin(); 19 | 20 | Typecho_Widget::widget('Widget_Options')->to($options); 21 | Typecho_Widget::widget('Widget_User')->to($user); 22 | Typecho_Widget::widget('Widget_Security')->to($security); 23 | Typecho_Widget::widget('Widget_Menu')->to($menu); 24 | 25 | /** 初始化上下文 */ 26 | $request = $options->request; 27 | $response = $options->response; 28 | 29 | /** 检测是否是第一次登录 */ 30 | $currentMenu = $menu->getCurrentMenu(); 31 | list($prefixVersion, $suffixVersion) = explode('/', $options->version); 32 | $params = parse_url($currentMenu[2]); 33 | $adminFile = basename($params['path']); 34 | 35 | if (!$user->logged && !Typecho_Cookie::get('__some_first_run') && !empty($currentMenu)) { 36 | 37 | if ('welcome.php' != $adminFile) { 38 | $response->redirect(Typecho_Common::url('welcome.php', $options->adminUrl)); 39 | } else { 40 | Typecho_Cookie::set('__some_first_run', 1); 41 | } 42 | 43 | } else { 44 | 45 | /** 检测版本是否升级 */ 46 | if ($user->pass('administrator', true) && !empty($currentMenu)) { 47 | 48 | $mustUpgrade = (!defined('Typecho_Common::VERSION') || version_compare(str_replace('/', '.', Typecho_Common::VERSION), 49 | str_replace('/', '.', $options->version), '>')); 50 | 51 | if ($mustUpgrade && 'upgrade.php' != $adminFile) { 52 | $response->redirect(Typecho_Common::url('upgrade.php', $options->adminUrl)); 53 | } else if (!$mustUpgrade && 'upgrade.php' == $adminFile) { 54 | $response->redirect($options->adminUrl); 55 | } else if (!$mustUpgrade && 'welcome.php' == $adminFile && $user->logged) { 56 | $response->redirect($options->adminUrl); 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /usr/themes/default/post.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | need('sidebar.php'); ?> 4 |
5 |
6 |
7 |
8 | options->title();?>   »   9 | category(); ?> 10 |
11 | 15 |

title() ?>

16 | 27 |
28 | text):?> 29 |
30 |
31 | content(); ?> 32 |
33 |
34 | 35 |
    36 | tags as $tag):?> 37 | 38 | 39 |
40 |
41 | need('comments.php'); ?> 42 | 43 | 44 |
45 | 46 | need('footer.php'); ?> 47 | 48 | -------------------------------------------------------------------------------- /var/Util/Session.php: -------------------------------------------------------------------------------- 1 | 2 | user->hasLogin()):?> 3 |
4 | 8 | widget('Widget_Stat');?> 9 | 27 |
28 | 29 |
30 | 34 |
35 | 36 | need('user/widget_login.php'); ?> 37 | 38 | -------------------------------------------------------------------------------- /var/Widget/Metas/List.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | class Widget_Metas_List extends Widget_Abstract_Metas 13 | { 14 | /** 15 | * 入口函数 16 | * 17 | * @access public 18 | * @return void 19 | */ 20 | public function execute() 21 | { 22 | $this->parameter->setDefault(array( 23 | 'sort' => 'count', 24 | 'ignoreZeroCount' => false, 25 | 'desc' => true, 26 | 'limit' => 0, 27 | 'type' =>'', 28 | ) 29 | ); 30 | $select = $this->select()->order($this->parameter->sort, 31 | $this->parameter->desc ? Typecho_Db::SORT_DESC : Typecho_Db::SORT_ASC); 32 | 33 | if($this->parameter->type && in_array($this->parameter->type, array('tag','category'))){ 34 | $select->where('type = ?', $this->parameter->type); 35 | } 36 | /** 忽略零数量 */ 37 | if ($this->parameter->ignoreZeroCount) { 38 | $select->where('count > 0'); 39 | } 40 | 41 | /** 总数限制 */ 42 | if ($this->parameter->limit) { 43 | $select->limit($this->parameter->limit); 44 | } 45 | 46 | /** 父级分类 */ 47 | if ($this->parameter->parent) { 48 | $select->where('parent = ?', $this->parameter->parent); 49 | } 50 | $this->db->fetchAll($select, array($this, 'push')); 51 | } 52 | 53 | /** 54 | * 按分割数输出字符串 55 | * 56 | * @access public 57 | * @param string $param 需要输出的值 58 | * @return void 59 | */ 60 | public function split() 61 | { 62 | $args = func_get_args(); 63 | array_unshift($args, $this->count); 64 | echo call_user_func_array(array('Typecho_Common', 'splitByCount'), $args); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /var/Widget/Users/Login.php: -------------------------------------------------------------------------------- 1 | 8 | // +---------------------------------------------------------------------- 9 | 10 | class Widget_Users_Login extends Widget_Abstract_Users implements Widget_Interface_Do 11 | { 12 | //用户登录 13 | public function action(){ 14 | // protect 15 | $this->security->protect(); 16 | 17 | /** 如果已经登录 */ 18 | if ($this->user->hasLogin()) { 19 | /** 直接返回 */ 20 | $this->response->redirect($this->options->index); 21 | } 22 | 23 | /** 初始化验证类 */ 24 | $validator = new Typecho_Validate(); 25 | $validator->addRule('name', 'required', _t('请输入用户名')); 26 | $validator->addRule('password', 'required', _t('请输入密码')); 27 | 28 | /** 截获验证异常 */ 29 | if ($error = $validator->run($this->request->from('name', 'password'))) { 30 | Typecho_Cookie::set('__some_remember_name', $this->request->name); 31 | 32 | /** 设置提示信息 */ 33 | $this->widget('Widget_Notice')->set($error); 34 | $this->response->goBack(); 35 | } 36 | 37 | /** 开始验证用户 **/ 38 | $valid = $this->user->login($this->request->name, $this->request->password, 39 | false, 1 == $this->request->remember ? $this->options->gmtTime + $this->options->timezone + 30*24*3600 : 0); 40 | 41 | /** 比对密码 */ 42 | if (!$valid) { 43 | /** 防止穷举,休眠3秒 */ 44 | sleep(3); 45 | 46 | Typecho_Cookie::set('__some_remember_name', $this->request->name); 47 | $this->widget('Widget_Notice')->set(_t('用户名或密码无效'), 'error'); 48 | $this->response->goBack('?referer=' . urlencode($this->request->referer)); 49 | } 50 | $this->widget('Widget_Notice')->set('已成功登录!','notice'); 51 | //登录积分 52 | Widget_Common::credits('login'); 53 | /** 跳转验证后地址 */ 54 | $this->response->redirect($this->request->get('redir',$this->options->index)); 55 | } 56 | } -------------------------------------------------------------------------------- /var/Widget/Contents/Related.php: -------------------------------------------------------------------------------- 1 | db->select('DISTINCT table.contents.cid', 'table.contents.title', 'table.contents.slug', 'table.contents.created', 'table.contents.authorId', 33 | 'table.contents.modified', 'table.contents.type', 'table.contents.status', 'table.contents.text', 'table.contents.commentsNum', 'table.contents.order', 34 | 'table.contents.template', 'table.contents.password', 'table.contents.allowComment', 'table.contents.allowPing', 'table.contents.allowFeed') 35 | ->from('table.contents'); 36 | } 37 | 38 | /** 39 | * 执行函数,初始化数据 40 | * 41 | * @access public 42 | * @return void 43 | */ 44 | public function execute() 45 | { 46 | $this->parameter->setDefault('limit=5'); 47 | 48 | if ($this->parameter->tags) { 49 | $tagsGroup = implode(',', Typecho_Common::arrayFlatten($this->parameter->tags, 'mid')); 50 | $this->db->fetchAll($this->select() 51 | ->join('table.relationships', 'table.contents.cid = table.relationships.cid') 52 | ->where('table.relationships.mid IN (' . $tagsGroup . ')') 53 | ->where('table.contents.cid <> ?', $this->parameter->cid) 54 | ->where('table.contents.status = ?', 'publish') 55 | ->where('table.contents.password IS NULL') 56 | ->where('table.contents.created < ?', $this->options->gmtTime) 57 | ->where('table.contents.type = ?', $this->parameter->type) 58 | ->order('table.contents.created', Typecho_Db::SORT_DESC) 59 | ->limit($this->parameter->limit), array($this, 'push')); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /var/Widget/Themes/Config.php: -------------------------------------------------------------------------------- 1 | user->pass('administrator'); 32 | 33 | if (!self::isExists()) { 34 | throw new Typecho_Widget_Exception(_t('外观配置功能不存在'), 404); 35 | } 36 | } 37 | 38 | /** 39 | * 配置功能是否存在 40 | * 41 | * @access public 42 | * @return boolean 43 | */ 44 | public static function isExists() 45 | { 46 | $options = Typecho_Widget::widget('Widget_Options'); 47 | $configFile = $options->themeFile($options->theme, 'functions.php'); 48 | 49 | if (file_exists($configFile)) { 50 | require_once $configFile; 51 | 52 | if (function_exists('themeConfig')) { 53 | return true; 54 | } 55 | } 56 | 57 | return false; 58 | } 59 | 60 | /** 61 | * 配置外观 62 | * 63 | * @access public 64 | * @return Typecho_Widget_Helper_Form 65 | */ 66 | public function config() 67 | { 68 | $form = new Typecho_Widget_Helper_Form($this->security->getIndex('/action/themes-edit?config'), 69 | Typecho_Widget_Helper_Form::POST_METHOD); 70 | themeConfig($form); 71 | $inputs = $form->getInputs(); 72 | 73 | if (!empty($inputs)) { 74 | foreach ($inputs as $key => $val) { 75 | $form->getInput($key)->value($this->options->{$key}); 76 | } 77 | } 78 | 79 | $submit = new Typecho_Widget_Helper_Form_Element_Submit(NULL, NULL, _t('保存设置')); 80 | $submit->input->setAttribute('class', 'btn primary'); 81 | $form->addItem($submit); 82 | return $form; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /var/Typecho/Widget/Helper/Form/Element/Radio.php: -------------------------------------------------------------------------------- 1 | $label) { 42 | $this->_options[$value] = new Typecho_Widget_Helper_Layout('input'); 43 | $item = $this->multiline(); 44 | $id = $this->name . '-' . $this->filterValue($value); 45 | $this->inputs[] = $this->_options[$value]; 46 | 47 | $item->addItem($this->_options[$value]->setAttribute('name', $this->name) 48 | ->setAttribute('type', 'radio') 49 | ->setAttribute('value', $value) 50 | ->setAttribute('id', $id)); 51 | 52 | $labelItem = new Typecho_Widget_Helper_Layout('label'); 53 | $item->addItem($labelItem->setAttribute('for', $id)->html($label)); 54 | $this->container($item); 55 | } 56 | 57 | return current($this->_options); 58 | } 59 | 60 | /** 61 | * 设置表单元素值 62 | * 63 | * @access protected 64 | * @param mixed $value 表单元素值 65 | * @return void 66 | */ 67 | protected function _value($value) 68 | { 69 | foreach ($this->_options as $option) { 70 | $option->removeAttribute('checked'); 71 | } 72 | 73 | if (isset($this->_options[$value])) { 74 | $this->value = $value; 75 | $this->_options[$value]->setAttribute('checked', 'true'); 76 | $this->input = $this->_options[$value]; 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /var/Widget/Init.php: -------------------------------------------------------------------------------- 1 | widget('Widget_Options'); 28 | 29 | /** 语言包初始化 */ 30 | if ($options->lang && $options->lang != 'zh_CN') { 31 | $dir = defined('__TYPECHO_LANG_DIR__') ? __TYPECHO_LANG_DIR__ : __TYPECHO_ROOT_DIR__ . '/usr/langs'; 32 | Typecho_I18n::setLang($dir . '/' . $options->lang . '.mo'); 33 | } 34 | 35 | /** cookie初始化 */ 36 | Typecho_Cookie::setPrefix($options->rootUrl); 37 | 38 | /** 初始化charset */ 39 | Typecho_Common::$charset = $options->charset; 40 | 41 | /** 初始化exception */ 42 | Typecho_Common::$exceptionHandle = 'Widget_ExceptionHandle'; 43 | 44 | /** 设置路径 */ 45 | if (defined('__TYPECHO_PATHINFO_ENCODING__')) { 46 | $pathInfo = $this->request->getPathInfo(__TYPECHO_PATHINFO_ENCODING__, $options->charset); 47 | } else { 48 | $pathInfo = $this->request->getPathInfo(); 49 | } 50 | 51 | Typecho_Router::setPathInfo($pathInfo); 52 | 53 | /** 初始化路由器 */ 54 | Typecho_Router::setRoutes($options->routingTable); 55 | 56 | /** 初始化插件 */ 57 | Typecho_Plugin::init($options->plugins); 58 | 59 | /** 初始化回执 */ 60 | $this->response->setCharset($options->charset); 61 | $this->response->setContentType($options->contentType); 62 | 63 | /** 默认时区 */ 64 | if (function_exists("ini_get") && !ini_get("date.timezone") && function_exists("date_default_timezone_set")) { 65 | @date_default_timezone_set('UTC'); 66 | } 67 | 68 | /** 初始化时区 */ 69 | Typecho_Date::setTimezoneOffset($options->timezone); 70 | 71 | /** 开始会话, 减小负载只针对后台打开session支持 */ 72 | // modified_by_jiangmuzi 2015.09.23 73 | // 开始会话 74 | @session_start(); 75 | // end modified 76 | 77 | /** 监听缓冲区 */ 78 | ob_start(); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /admin/profile.php: -------------------------------------------------------------------------------- 1 | 8 | 9 |
10 |
11 | 12 |
13 |
14 |

uid);?>

15 |

screenName(); ?>

16 |

name(); ?>

17 |

%s 篇日志, 并有 %s 条关于你的评论在 %s 个分类中.', 18 | $stat->myPublishedPostsNum, $stat->myPublishedCommentsNum, $stat->categoriesNum); ?>

19 |

logged > 0) { 21 | _e('最后登录: %s', Typecho_I18n::dateWord($user->logged + $options->timezone, $options->gmtTime + $options->timezone)); 22 | } 23 | ?>

24 |
25 | 26 |
27 |
28 |

29 | profileForm()->render(); ?> 30 |
31 | 32 | pass('contributor', true)): ?> 33 |
34 |
35 |

36 | optionsForm()->render(); ?> 37 |
38 | 39 | 40 |
41 | 42 |
43 |

44 | personalFormList(); ?> 45 | passwordForm()->render(); ?> 46 |
47 |
48 |
49 |
50 |
51 | 52 | bottom(); 57 | include 'footer.php'; 58 | ?> 59 | -------------------------------------------------------------------------------- /var/Typecho/Widget/Helper/Form/Element/Checkbox.php: -------------------------------------------------------------------------------- 1 | $label) { 42 | $this->_options[$value] = new Typecho_Widget_Helper_Layout('input'); 43 | $item = $this->multiline(); 44 | $id = $this->name . '-' . $this->filterValue($value); 45 | $this->inputs[] = $this->_options[$value]; 46 | 47 | $item->addItem($this->_options[$value]->setAttribute('name', $this->name . '[]') 48 | ->setAttribute('type', 'checkbox') 49 | ->setAttribute('value', $value) 50 | ->setAttribute('id', $id)); 51 | 52 | $labelItem = new Typecho_Widget_Helper_Layout('label'); 53 | $item->addItem($labelItem->setAttribute('for', $id)->html($label)); 54 | $this->container($item); 55 | } 56 | 57 | return current($this->_options); 58 | } 59 | 60 | /** 61 | * 设置表单元素值 62 | * 63 | * @access protected 64 | * @param mixed $value 表单元素值 65 | * @return void 66 | */ 67 | protected function _value($value) 68 | { 69 | $values = is_array($value) ? $value : array($value); 70 | 71 | foreach ($this->_options as $option) { 72 | $option->removeAttribute('checked'); 73 | } 74 | 75 | foreach ($values as $value) { 76 | if (isset($this->_options[$value])) { 77 | $this->_options[$value]->setAttribute('checked', 'true'); 78 | } 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /var/Widget/Abstract/Options.php: -------------------------------------------------------------------------------- 1 | db->select()->from('table.options'); 45 | } 46 | 47 | /** 48 | * 插入一条记录 49 | * 50 | * @access public 51 | * @param array $options 记录插入值 52 | * @return integer 53 | */ 54 | public function insert(array $options) 55 | { 56 | return $this->db->query($this->db->insert('table.options')->rows($options)); 57 | } 58 | 59 | /** 60 | * 更新记录 61 | * 62 | * @access public 63 | * @param array $options 记录更新值 64 | * @param Typecho_Db_Query $condition 更新条件 65 | * @return integer 66 | */ 67 | public function update(array $options, Typecho_Db_Query $condition) 68 | { 69 | return $this->db->query($condition->update('table.options')->rows($options)); 70 | } 71 | 72 | /** 73 | * 删除记录 74 | * 75 | * @access public 76 | * @param Typecho_Db_Query $condition 删除条件 77 | * @return integer 78 | */ 79 | public function delete(Typecho_Db_Query $condition) 80 | { 81 | return $this->db->query($condition->delete('table.options')); 82 | } 83 | 84 | /** 85 | * 获取记录总数 86 | * 87 | * @access public 88 | * @param Typecho_Db_Query $condition 计算条件 89 | * @return integer 90 | */ 91 | public function size(Typecho_Db_Query $condition) 92 | { 93 | return $this->db->fetchObject($condition->select(array('COUNT(name)' => 'num'))->from('table.options'))->num; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /usr/themes/default/user/messages.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 14 |
15 |
16 |
17 | options->title();?>   »   18 | getMetaTitle();?> 19 |
20 | messages->have()):?> 21 | messages->next()):?> 22 | messages->type=='comment'):?> 23 |
24 | messages->author->name();?> 25 | messages->dateWord();_e('回复了你的主题:');?> 26 | messages->title();?> 27 |
28 |
29 | messages->content();?> 30 |
31 | 32 | messages->type=='at'):?> 33 |
34 | messages->author->name();?> 35 | messages->dateWord();_e('回复中@你:');?> 36 | 37 |
38 |
39 | messages->content();?> 40 |
41 | 42 | 43 | 44 |
45 |

46 |
47 | 48 |
49 |
50 | need('footer.php'); ?> 51 | -------------------------------------------------------------------------------- /var/Typecho/I18n/GetTextMulti.php: -------------------------------------------------------------------------------- 1 | addFile($fileName); 38 | } 39 | 40 | /** 41 | * 增加一个语言文件 42 | * 43 | * @access public 44 | * @param string $fileName 语言文件名 45 | * @return void 46 | */ 47 | public function addFile($fileName) 48 | { 49 | $this->_handles[] = new Typecho_I18n_GetText($fileName, true); 50 | } 51 | 52 | /** 53 | * Translates a string 54 | * 55 | * @access public 56 | * @param string string to be translated 57 | * @return string translated string (or original, if not found) 58 | */ 59 | public function translate($string) 60 | { 61 | foreach ($this->_handles as $handle) { 62 | $string = $handle->translate($string, $count); 63 | if (-1 != $count) { 64 | break; 65 | } 66 | } 67 | 68 | return $string; 69 | } 70 | 71 | /** 72 | * Plural version of gettext 73 | * 74 | * @access public 75 | * @param string single 76 | * @param string plural 77 | * @param string number 78 | * @return translated plural form 79 | */ 80 | public function ngettext($single, $plural, $number) 81 | { 82 | foreach ($this->_handles as $handle) { 83 | $string = $handle->ngettext($single, $plural, $number, $count); 84 | if (-1 != $count) { 85 | break; 86 | } 87 | } 88 | 89 | return $string; 90 | } 91 | 92 | /** 93 | * 关闭所有句柄 94 | * 95 | * @access public 96 | * @return void 97 | */ 98 | public function __destruct() 99 | { 100 | foreach ($this->_handles as $handle) { 101 | /** 显示的释放内存 */ 102 | unset($handle); 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /var/Widget/Themes/List.php: -------------------------------------------------------------------------------- 1 | getThemes(); 53 | 54 | if ($themes) { 55 | $options = $this->widget('Widget_Options'); 56 | $siteUrl = $options->siteUrl; 57 | $adminUrl = $options->adminUrl; 58 | $activated = 0; 59 | $result = array(); 60 | 61 | foreach ($themes as $key => $theme) { 62 | $themeFile = $theme . '/index.php'; 63 | if (file_exists($themeFile)) { 64 | $info = Typecho_Plugin::parseInfo($themeFile); 65 | $info['name'] = $this->getTheme($theme, $key); 66 | 67 | if ($info['activated'] = ($options->theme == $info['name'])) { 68 | $activated = $key; 69 | } 70 | 71 | $screen = glob($theme . '/screen*.{jpg,png,gif,bmp,jpeg,JPG,PNG,GIF,BMG,JPEG}', GLOB_BRACE); 72 | if ($screen) { 73 | $info['screen'] = $options->themeUrl(basename(current($screen)), $info['name']); 74 | } else { 75 | $info['screen'] = Typecho_Common::url('noscreen.png', $options->adminStaticUrl('img')); 76 | } 77 | 78 | $result[$key] = $info; 79 | } 80 | } 81 | 82 | $clone = $result[$activated]; 83 | unset($result[$activated]); 84 | array_unshift($result, $clone); 85 | array_filter($result, array($this, 'push')); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /var/Typecho/Db/Adapter/Pdo/Mysql.php: -------------------------------------------------------------------------------- 1 | dsn) ? $config->dsn : 39 | "mysql:dbname={$config->database};host={$config->host};port={$config->port}", $config->user, $config->password); 40 | $pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true); 41 | $pdo->exec("SET NAMES '{$config->charset}'"); 42 | return $pdo; 43 | } 44 | 45 | /** 46 | * 对象引号过滤 47 | * 48 | * @access public 49 | * @param string $string 50 | * @return string 51 | */ 52 | public function quoteColumn($string) 53 | { 54 | return '`' . $string . '`'; 55 | } 56 | 57 | /** 58 | * 引号转义函数 59 | * 60 | * @param string $string 需要转义的字符串 61 | * @return string 62 | */ 63 | public function quoteValue($string) 64 | { 65 | return '\'' . str_replace(array('\'', '\\'), array('\'\'', '\\\\'), $string) . '\''; 66 | } 67 | 68 | /** 69 | * 合成查询语句 70 | * 71 | * @access public 72 | * @param array $sql 查询对象词法数组 73 | * @return string 74 | */ 75 | public function parseSelect(array $sql) 76 | { 77 | if (!empty($sql['join'])) { 78 | foreach ($sql['join'] as $val) { 79 | list($table, $condition, $op) = $val; 80 | $sql['table'] = "{$sql['table']} {$op} JOIN {$table} ON {$condition}"; 81 | } 82 | } 83 | 84 | $sql['limit'] = (0 == strlen($sql['limit'])) ? NULL : ' LIMIT ' . $sql['limit']; 85 | $sql['offset'] = (0 == strlen($sql['offset'])) ? NULL : ' OFFSET ' . $sql['offset']; 86 | 87 | return 'SELECT ' . $sql['fields'] . ' FROM ' . $sql['table'] . 88 | $sql['where'] . $sql['group'] . $sql['having'] . $sql['order'] . $sql['limit'] . $sql['offset']; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /var/Widget/Users/Favorites.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | class Widget_Users_Favorites extends Widget_Abstract_Favorites{ 13 | 14 | private $_srcId; 15 | private $_title; 16 | 17 | public function __construct($request, $response, $params = NULL){ 18 | parent::__construct($request, $response, $params); 19 | } 20 | 21 | public function execute(){} 22 | 23 | public function addFavorite() 24 | { 25 | $row = array( 26 | 'uid'=>$this->user->uid, 27 | 'type'=>$this->parameter->type, 28 | 'srcId'=>$this->_srcId, 29 | 'created'=>$this->options->gmtTime 30 | ); 31 | return $this->insert($row); 32 | } 33 | //要收藏的数据是否存在 34 | public function dataExists($type=null,$slug=null){ 35 | $this->parameter->type = empty($type) ? $this->request->type : $type; 36 | $this->parameter->slug = empty($slug) ? $this->request->slug : $slug; 37 | if(empty($this->parameter->type) || empty($this->parameter->slug)){ 38 | return true; 39 | } 40 | if($this->parameter->type=='tag'){ 41 | $row = $this->db->fetchRow($this->db->select()->from('table.metas')->where('type = ?','tag')->where('slug = ?',$this->parameter->slug)->limit(1)); 42 | if(empty($row)){ 43 | return true; 44 | } 45 | $this->_srcId = $row['mid']; 46 | $this->_title = '标签:'.$row['name']; 47 | } 48 | 49 | if($this->parameter->type=='post'){ 50 | $row = $this->db->fetchRow($this->db->select()->from('table.contents')->where('cid = ?',$this->parameter->slug)->limit(1)); 51 | if(empty($row)){ 52 | return true; 53 | } 54 | $this->_srcId = $row['cid']; 55 | $this->_title = '帖子:'.$row['title']; 56 | } 57 | 58 | return false; 59 | } 60 | 61 | public function deleteFavorite($fid){ 62 | $this->delete($this->db->sql()->where('fid = ? AND uid = ?',$fid,$this->user->uid)); 63 | } 64 | 65 | public function isFavorite($type,$slug){ 66 | if($this->dataExists($type,$slug)){ 67 | return 0; 68 | } 69 | $favorite = $this->favoriteExists($type, $this->_srcId); 70 | return $favorite ? $favorite['fid'] : 0; 71 | } 72 | public function getTitle(){ 73 | return $this->_title; 74 | } 75 | public function getSrcId(){ 76 | return $this->_srcId; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /usr/themes/default/user/ucenter.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 6 |
7 | need('user/widget_info.php'); ?> 8 |
9 |
ucenter()->screenName.'最近的主题');?>
10 | posts->have()): ?> 11 | posts->next()): ?> 12 | 29 | 30 | 31 |
32 |

33 |
34 | 35 |
36 | 37 |
38 |
ucenter()->screenName.'最近的回复');?>
39 | comments->have()): ?> 40 | comments->next()): ?> 41 |
comments->title(); ?> 42 | comments->dateWord(); ?> 43 |
44 |
comments->content(); ?>
45 | 46 | 47 |
48 |

49 |
50 | 51 |
52 |
53 | need('footer.php'); ?> 54 | -------------------------------------------------------------------------------- /var/Typecho/Db/Adapter.php: -------------------------------------------------------------------------------- 1 | database};host={$config->host};port={$config->port}", $config->user, $config->password); 39 | $pdo->exec("SET NAMES '{$config->charset}'"); 40 | return $pdo; 41 | } 42 | 43 | /** 44 | * 对象引号过滤 45 | * 46 | * @access public 47 | * @param string $string 48 | * @return string 49 | */ 50 | public function quoteColumn($string) 51 | { 52 | return '"' . $string . '"'; 53 | } 54 | 55 | /** 56 | * 合成查询语句 57 | * 58 | * @access public 59 | * @param array $sql 查询对象词法数组 60 | * @return string 61 | */ 62 | public function parseSelect(array $sql) 63 | { 64 | if (!empty($sql['join'])) { 65 | foreach ($sql['join'] as $val) { 66 | list($table, $condition, $op) = $val; 67 | $sql['table'] = "{$sql['table']} {$op} JOIN {$table} ON {$condition}"; 68 | } 69 | } 70 | 71 | $sql['limit'] = (0 == strlen($sql['limit'])) ? NULL : ' LIMIT ' . $sql['limit']; 72 | $sql['offset'] = (0 == strlen($sql['offset'])) ? NULL : ' OFFSET ' . $sql['offset']; 73 | 74 | return 'SELECT ' . $sql['fields'] . ' FROM ' . $sql['table'] . 75 | $sql['where'] . $sql['group'] . $sql['having'] . $sql['order'] . $sql['limit'] . $sql['offset']; 76 | } 77 | 78 | /** 79 | * 取出最后一次插入返回的主键值 80 | * 81 | * @param resource $resource 查询的资源数据 82 | * @param mixed $handle 连接对象 83 | * @return integer 84 | */ 85 | public function lastInsertId($resource, $handle) 86 | { 87 | /** 查看是否存在序列,可能需要更严格的检查 */ 88 | if ($handle->query('SELECT oid FROM pg_class WHERE relname = ' . $this->quoteValue($this->_lastTable . '_seq'))->fetchAll()) { 89 | return $handle->lastInsertId($this->_lastTable . '_seq'); 90 | } 91 | 92 | return 0; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /usr/themes/default/user/widget_info.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 | ucenter()->avatar(96,'avatar fl'); ?> 6 | 7 |

ucenter()->screenName();?>

8 | ucenter()->sign):?>

ucenter()->sign();?>

9 |
10 | options->title(); 12 | _e(_t('第 %s 位会员,',$this->ucenter()->uid)); 13 | _e('加入于:'.date('Y-m-d H:i:s',$this->ucenter()->created)); 14 | if($this->user->uid==$this->ucenter()->uid){ 15 | if($this->ucenter()->logged!=0): 16 | _e(',最后登录: %s', Typecho_I18n::dateWord($this->ucenter()->logged + $this->options->timezone, $this->options->gmtTime + $this->options->timezone)); 17 | else: 18 | _e(',第一次登录'); 19 | endif; 20 | } 21 | ?> 22 |
23 |
24 |
25 | ucenter()->url):?> 26 | ucenter()->url();?> 27 | 28 | ucenter()->location):?> 29 | ucenter()->location();?> 30 | 31 |
32 | ucenter()->intro):?> 33 |
34 | ucenter()->intro();?> 35 |
36 | 37 |
38 |
39 |
40 | ucenter()->screenName();?> 41 | user->uid==$this->ucenter()->uid):?> 42 | 43 | 44 | 45 | 46 | 47 | 48 |
49 |
50 | -------------------------------------------------------------------------------- /usr/themes/default/user/credits.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 14 |
15 |
16 |
17 | options->title();?>   »   18 | getMetaTitle();?> 19 |
20 |
21 |

22 |

user->credits();?> Credits

23 |
24 |
25 |
26 |
27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | credits->have()):?> 40 | credits->next()):?> 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
时间类型数额余额描述
credits->date('Y-m-d H:i:s');?>credits->name();?>credits->amount();?>credits->balance();?>credits->remark();?> credits->amount();?>
52 |
53 |
54 | credits->pageLink('上一页','prev');?> 55 | credits->getCurrentPage();?>/credits->getTotalPage();?> 56 | credits->pageLink('下一页','next');?> 57 |
58 |
59 |
60 | need('footer.php'); ?> 61 | -------------------------------------------------------------------------------- /usr/themes/default/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | <?php echo $this->getMetaTitle(' - ');$this->options->title(); ?> 10 | 11 | 12 | 13 | 14 | 18 | 19 | header(); ?> 20 | 25 | 26 | 27 | 30 |
31 |
32 |
33 | 34 |
35 | 39 |
40 |
41 |
42 | 43 | user->hasLogin()): ?> 44 | user->name(); ?> 45 | 46 | 47 | 48 | 49 | 50 | 51 |
52 |
53 |
54 |
55 |
56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /var/Typecho/Date.php: -------------------------------------------------------------------------------- 1 | timeStamp = $gmtTime + (self::$timezoneOffset - self::$serverTimezoneOffset); 54 | } 55 | 56 | /** 57 | * 设置当前期望的时区偏移 58 | * 59 | * @access public 60 | * @param integer $offset 61 | * @return void 62 | */ 63 | public static function setTimezoneOffset($offset) 64 | { 65 | self::$timezoneOffset = $offset; 66 | self::$serverTimezoneOffset = idate('Z'); 67 | } 68 | 69 | /** 70 | * 获取格式化时间 71 | * 72 | * @access public 73 | * @param string $format 时间格式 74 | * @return string 75 | */ 76 | public function format($format) 77 | { 78 | return date($format, $this->timeStamp); 79 | } 80 | 81 | /** 82 | * 获取国际化偏移时间 83 | * 84 | * @access public 85 | * @return string 86 | */ 87 | public function word() 88 | { 89 | return Typecho_I18n::dateWord($this->timeStamp, self::gmtTime() + (self::$timezoneOffset - self::$serverTimezoneOffset)); 90 | } 91 | 92 | /** 93 | * 获取单项数据 94 | * 95 | * @access public 96 | * @param string $name 名称 97 | * @return integer 98 | */ 99 | public function __get($name) 100 | { 101 | switch ($name) { 102 | case 'year': 103 | return date('Y', $this->timeStamp); 104 | case 'month': 105 | return date('m', $this->timeStamp); 106 | case 'day': 107 | return date('d', $this->timeStamp); 108 | default: 109 | return; 110 | } 111 | } 112 | 113 | /** 114 | * 获取GMT时间 115 | * 116 | * @access public 117 | * @return integer 118 | */ 119 | public static function gmtTime() 120 | { 121 | return self::$gmtTimeStamp ? self::$gmtTimeStamp : (self::$gmtTimeStamp = @gmmktime()); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /usr/themes/default/user/register.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 4 | 14 | 17 |
18 |
19 |
20 | options->title();?>   »   21 | getMetaTitle();?> 22 |
23 |
24 |
25 | options->allowRegister==1): ?> 26 |
27 |
28 | 29 | 30 |
31 |
32 | 33 | 34 |
35 |
36 | 37 | 38 |
39 |
40 | 41 | 42 |
43 |
44 | 45 |

46 |
47 |
48 | 49 | 50 |
51 |
52 | 53 | 54 |
55 |
56 | 57 |
58 |

社交帐号登录

59 |
60 | parseActiveSns();?> 61 |
62 |
63 | 64 |
65 |
66 | need('footer.php'); ?> 67 | -------------------------------------------------------------------------------- /var/Util/Connect/Connect.php: -------------------------------------------------------------------------------- 1 | 8 | // +---------------------------------------------------------------------- 9 | class Connect{ 10 | static public $sns = array(); 11 | 12 | static public function getSns($type){ 13 | if(isset(self::$sns[$type])){ 14 | return self::$sns[$type]; 15 | }else{ 16 | $options = Typecho_Widget::widget('Some_Oauth')->getSnsOptions(); 17 | if(!isset($options[$type])){ 18 | return false; 19 | } 20 | $option = $options[$type]; 21 | require_once 'Sdk/'.$type.'.php'; 22 | return self::$sns[$type] = new $type($option['id'],$option['key']); 23 | } 24 | } 25 | 26 | static public function getLoginUrl($type,$callback){ 27 | if($type=='qq'){ 28 | $login_url = self::getSns($type)->login_url($callback,'get_user_info,add_share'); 29 | }else{ 30 | $login_url = self::getSns($type)->login_url($callback); 31 | } 32 | return $login_url; 33 | } 34 | 35 | static public function getToken($type,$callback,$code){ 36 | $rs = self::getSns($type)->access_token($callback,$code); 37 | 38 | if(isset($rs['access_token']) && $rs['access_token']!=''){ 39 | self::setToken($type, $rs['access_token']); 40 | return $rs['access_token']; 41 | } 42 | return ''; 43 | } 44 | 45 | static public function setToken($type,$token){ 46 | self::getSns($type)->access_token = $token; 47 | } 48 | 49 | static public function getOpenId($type){ 50 | $openid = ''; 51 | if($type=='qq'){ 52 | $rs = self::getSns($type)->get_openid(); 53 | if(isset($rs['openid']) && $rs['openid']!=''){ 54 | $openid = $rs['openid']; 55 | } 56 | }elseif($type=='weibo'){ 57 | $rs = self::getSns($type)->get_uid(); 58 | if(isset($rs['uid']) && $rs['uid']!=''){ 59 | $openid = $rs['uid']; 60 | } 61 | } 62 | return $openid; 63 | } 64 | 65 | static public function getNickName($type,$openid){ 66 | $nickname = ''; 67 | if($type=='qq'){ 68 | $rs = self::getSns($type)->get_user_info($openid); 69 | $nickname = $rs['nickname']; 70 | }elseif($type=='weibo'){ 71 | $rs = self::getSns($type)->show_user_by_id($openid); 72 | $nickname = $rs['screen_name']; 73 | } 74 | 75 | return $nickname; 76 | } 77 | } -------------------------------------------------------------------------------- /var/Typecho/Cookie.php: -------------------------------------------------------------------------------- 1 | file}"); 44 | $this->_isSQLite2 = version_compare($pdo->getAttribute(PDO::ATTR_SERVER_VERSION), '3.0.0', '<'); 45 | return $pdo; 46 | } 47 | 48 | /** 49 | * @param resource $resource 50 | * @return array 51 | */ 52 | public function fetch($resource) 53 | { 54 | return Typecho_Common::filterSQLite2ColumnName(parent::fetch($resource)); 55 | } 56 | 57 | /** 58 | * @param resource $resource 59 | * @return object 60 | */ 61 | public function fetchObject($resource) 62 | { 63 | return (object) $this->fetch($resource); 64 | } 65 | 66 | /** 67 | * 对象引号过滤 68 | * 69 | * @access public 70 | * @param string $string 71 | * @return string 72 | */ 73 | public function quoteColumn($string) 74 | { 75 | return '"' . $string . '"'; 76 | } 77 | 78 | /** 79 | * 合成查询语句 80 | * 81 | * @access public 82 | * @param array $sql 查询对象词法数组 83 | * @return string 84 | */ 85 | public function parseSelect(array $sql) 86 | { 87 | if (!empty($sql['join'])) { 88 | foreach ($sql['join'] as $val) { 89 | list($table, $condition, $op) = $val; 90 | $sql['table'] = "{$sql['table']} {$op} JOIN {$table} ON {$condition}"; 91 | } 92 | } 93 | 94 | $sql['limit'] = (0 == strlen($sql['limit'])) ? NULL : ' LIMIT ' . $sql['limit']; 95 | $sql['offset'] = (0 == strlen($sql['offset'])) ? NULL : ' OFFSET ' . $sql['offset']; 96 | 97 | $query = 'SELECT ' . $sql['fields'] . ' FROM ' . $sql['table'] . 98 | $sql['where'] . $sql['group'] . $sql['having'] . $sql['order'] . $sql['limit'] . $sql['offset']; 99 | 100 | if ($this->_isSQLite2) { 101 | $query = Typecho_Common::filterSQLite2CountQuery($query); 102 | } 103 | 104 | return $query; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /var/Widget/Metas/Category/Admin.php: -------------------------------------------------------------------------------- 1 | 10 | * @license GNU General Public License 2.0 11 | */ 12 | class Widget_Metas_Category_Admin extends Widget_Metas_Category_List 13 | { 14 | /** 15 | * 执行函数 16 | * 17 | * @access public 18 | * @return void 19 | */ 20 | public function execute() 21 | { 22 | $select = $this->db->select('mid')->from('table.metas')->where('type = ?', 'category'); 23 | $select->where('parent = ?', $this->request->parent ? $this->request->parent : 0); 24 | 25 | $this->stack = $this->getCategories(Typecho_Common::arrayFlatten( 26 | $this->db->fetchAll($select->order('table.metas.order', Typecho_Db::SORT_ASC)), 'mid')); 27 | } 28 | 29 | /** 30 | * 向上的返回链接 31 | * 32 | * @access public 33 | * @return void 34 | */ 35 | public function backLink() 36 | { 37 | if (isset($this->request->parent)) { 38 | $category = $this->db->fetchRow($this->select() 39 | ->where('type = ? AND mid = ?', 'category', $this->request->parent)); 40 | 41 | if (!empty($category)) { 42 | $parent = $this->db->fetchRow($this->select() 43 | ->where('type = ? AND mid = ?', 'category', $category['parent'])); 44 | 45 | if ($parent) { 46 | echo ''; 47 | } else { 48 | echo ''; 49 | } 50 | 51 | echo '« '; 52 | _e('返回父级分类'); 53 | echo ''; 54 | } 55 | } 56 | } 57 | 58 | /** 59 | * 获取菜单标题 60 | * 61 | * @access public 62 | * @return string 63 | */ 64 | public function getMenuTitle() 65 | { 66 | if (isset($this->request->parent)) { 67 | $category = $this->db->fetchRow($this->select() 68 | ->where('type = ? AND mid = ?', 'category', $this->request->parent)); 69 | 70 | if (!empty($category)) { 71 | return _t('管理 %s 的子分类', $category['name']); 72 | } 73 | } else { 74 | return; 75 | } 76 | 77 | throw new Typecho_Widget_Exception(_t('分类不存在'), 404); 78 | } 79 | 80 | /** 81 | * 获取菜单标题 82 | * 83 | * @access public 84 | * @return string 85 | */ 86 | public function getAddLink() 87 | { 88 | if (isset($this->request->parent)) { 89 | return 'category.php?parent=' . $this->request->filter('int')->parent; 90 | } else { 91 | return 'category.php'; 92 | } 93 | } 94 | } 95 | 96 | -------------------------------------------------------------------------------- /usr/themes/default/page/home.php: -------------------------------------------------------------------------------- 1 | 8 | need('header.php'); ?> 9 | need('sidebar.php'); ?> 10 |
11 |
12 |
13 | listNodes(array('node'=>'','cateCurrent'=>'active','cate'=>'{name}')); ?> 14 | user->hasLogin()):?> 15 | 16 | 17 | 18 | 19 |
20 | widget('Widget_Contents_Post_Home@indexRecent', 'sort=lastComment&limit=30')->to($archives);?> 21 | have()):?> 22 | next()): ?> 23 | 42 | 43 | 44 | 45 |
46 |

还没有内容!

47 |
48 | 49 |
50 |
51 |
52 | options->title();_e(' / 节点导航');?> 53 |
54 | listNodes( 55 | array( 56 | 'node'=>'{name}', 57 | 'cateBefore'=>'
', 58 | 'cate'=>'{name}
', 59 | 'cateAfter'=>'
', 60 | ) 61 | ); 62 | ?> 63 | 64 |
65 |
66 | need('footer.php'); ?> 67 | -------------------------------------------------------------------------------- /usr/themes/default/user/favorite.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 | 6 | 62 | need('footer.php'); ?> 63 | -------------------------------------------------------------------------------- /var/Typecho/Widget/Helper/PageNavigator.php: -------------------------------------------------------------------------------- 1 | _total = $total; 86 | $this->_totalPage = ceil($total / $pageSize); 87 | $this->_currentPage = $currentPage; 88 | $this->_pageSize = $pageSize; 89 | $this->_pageTemplate = $pageTemplate; 90 | 91 | if (($currentPage > $this->_totalPage || $currentPage < 1) && $total > 0) { 92 | throw new Typecho_Widget_Exception('Page Not Exists', 404); 93 | } 94 | } 95 | 96 | /** 97 | * 设置页面占位符 98 | * 99 | * @access protected 100 | * @param string $holder 页面占位符 101 | * @return void 102 | */ 103 | public function setPageHolder($holder) 104 | { 105 | $this->_pageHolder = array('{' . $holder . '}', 106 | str_replace(array('{', '}'), array('%7B', '%7D'), $holder)); 107 | } 108 | 109 | /** 110 | * 设置锚点 111 | * 112 | * @access public 113 | * @param string $anchor 锚点 114 | * @return void 115 | */ 116 | public function setAnchor($anchor) 117 | { 118 | $this->_anchor = '#' . $anchor; 119 | } 120 | 121 | /** 122 | * 输出方法 123 | * 124 | * @access public 125 | * @return void 126 | */ 127 | public function render() 128 | { 129 | throw new Typecho_Widget_Exception(get_class($this) . ':' . __METHOD__, 500); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /var/Widget/Contents/Post/Date.php: -------------------------------------------------------------------------------- 1 | db = Typecho_Db::get(); 54 | 55 | /** 初始化常用组件 */ 56 | $this->options = $this->widget('Widget_Options'); 57 | } 58 | 59 | /** 60 | * 初始化函数 61 | * 62 | * @access public 63 | * @return void 64 | */ 65 | public function execute() 66 | { 67 | /** 设置参数默认值 */ 68 | $this->parameter->setDefault('format=Y-m&type=month&limit=0'); 69 | 70 | $resource = $this->db->query($this->db->select('created')->from('table.contents') 71 | ->where('type = ?', 'post') 72 | ->where('table.contents.status = ?', 'publish') 73 | ->where('table.contents.created < ?', $this->options->gmtTime) 74 | ->order('table.contents.created', Typecho_Db::SORT_DESC)); 75 | 76 | $offset = $this->options->timezone - $this->options->serverTimezone; 77 | $result = array(); 78 | while ($post = $this->db->fetchRow($resource)) { 79 | $timeStamp = $post['created'] + $offset; 80 | $date = date($this->parameter->format, $timeStamp); 81 | 82 | if (isset($result[$date])) { 83 | $result[$date]['count'] ++; 84 | } else { 85 | $result[$date]['year'] = date('Y', $timeStamp); 86 | $result[$date]['month'] = date('m', $timeStamp); 87 | $result[$date]['day'] = date('d', $timeStamp); 88 | $result[$date]['date'] = $date; 89 | $result[$date]['count'] = 1; 90 | } 91 | } 92 | 93 | if ($this->parameter->limit > 0) { 94 | $result = array_slice($result, 0, $this->parameter->limit); 95 | } 96 | 97 | foreach ($result as $row) { 98 | $row['permalink'] = Typecho_Router::url('archive_' . $this->parameter->type, $row, $this->widget('Widget_Options')->index); 99 | $this->push($row); 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /admin/theme-editor.php: -------------------------------------------------------------------------------- 1 | to($files); 7 | ?> 8 | 9 |
10 |
11 | 12 |
13 | 28 | 29 |
30 |
31 |
32 | 33 | 34 |

35 | currentIsWriteable()): ?> 36 | 37 | 38 | 39 | 40 | 41 | 42 |

43 |
44 |
45 |
    46 |
  • 模板文件
  • 47 | next()): ?> 48 | current): ?> class="current"> 49 | file(); ?> 50 | 51 |
52 |
53 |
54 |
55 |
56 | 57 | bottom($files); 61 | include 'footer.php'; 62 | ?> 63 | -------------------------------------------------------------------------------- /var/Widget/Security.php: -------------------------------------------------------------------------------- 1 | _options = $this->widget('Widget_Options'); 31 | $user = $this->widget('Widget_User'); 32 | 33 | $this->_token = $this->_options->secret; 34 | if ($user->hasLogin()) { 35 | $this->_token .= '&' . $user->authCode . '&' . $user->uid; 36 | } 37 | } 38 | 39 | /** 40 | * 获取token 41 | * 42 | * @param string $suffix 后缀 43 | * @return string 44 | */ 45 | public function getToken($suffix) 46 | { 47 | return md5($this->_token . '&' . $suffix); 48 | } 49 | 50 | /** 51 | * 生成带token的路径 52 | * 53 | * @param $path 54 | * @return string 55 | */ 56 | public function getTokenUrl($path) 57 | { 58 | $parts = parse_url($path); 59 | $params = array(); 60 | 61 | if (!empty($parts['query'])) { 62 | parse_str($parts['query'], $params); 63 | } 64 | 65 | $params['_'] = $this->getToken($this->request->getRequestUrl()); 66 | $parts['query'] = http_build_query($params); 67 | 68 | return Typecho_Common::buildUrl($parts); 69 | } 70 | 71 | /** 72 | * 保护提交数据 73 | * 74 | */ 75 | public function protect() 76 | { 77 | if ($this->request->get('_') != $this->getToken($this->request->getReferer())) { 78 | $this->response->goBack(); 79 | } 80 | } 81 | 82 | /** 83 | * 获取安全的后台路径 84 | * 85 | * @param string $path 86 | * @return string 87 | */ 88 | public function getAdminUrl($path) 89 | { 90 | return Typecho_Common::url($this->getTokenUrl($path), $this->_options->adminUrl); 91 | } 92 | 93 | /** 94 | * 获取安全的路由路径 95 | * 96 | * @param $path 97 | * @return string 98 | */ 99 | public function getIndex($path) 100 | { 101 | return Typecho_Common::url($this->getTokenUrl($path), $this->_options->index); 102 | } 103 | 104 | /** 105 | * 获取绝对路由路径 106 | * 107 | * @param $path 108 | * @return string 109 | */ 110 | public function getRootUrl($path) 111 | { 112 | return Typecho_Common::url($this->getTokenUrl($path), $this->_options->rootUrl); 113 | } 114 | 115 | /** 116 | * 输出后台安全路径 117 | * 118 | * @param $path 119 | */ 120 | public function adminUrl($path) 121 | { 122 | echo $this->getAdminUrl($path); 123 | } 124 | 125 | /** 126 | * 输出安全的路由路径 127 | * 128 | * @param $path 129 | */ 130 | public function index($path) 131 | { 132 | echo $this->getIndex($path); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /var/Widget/Abstract.php: -------------------------------------------------------------------------------- 1 | db = Typecho_Db::get(); 68 | 69 | /** 初始化常用组件 */ 70 | $this->options = $this->widget('Widget_Options'); 71 | $this->user = $this->widget('Widget_User'); 72 | $this->security = $this->widget('Widget_Security'); 73 | 74 | $this->_themeDir = rtrim($this->options->themeFile($this->options->theme), '/') . '/'; 75 | 76 | /** 加载皮肤函数 */ 77 | $functionsFile = $this->_themeDir . 'functions.php'; 78 | if (!$this->_invokeFromOutside && file_exists($functionsFile)) { 79 | require_once $functionsFile; 80 | } 81 | } 82 | 83 | /** 84 | * 查询方法 85 | * 86 | * @access public 87 | * @return Typecho_Db_Query 88 | */ 89 | abstract public function select(); 90 | 91 | /** 92 | * 获得所有记录数 93 | * 94 | * @access public 95 | * @param Typecho_Db_Query $condition 查询对象 96 | * @return integer 97 | */ 98 | abstract public function size(Typecho_Db_Query $condition); 99 | 100 | /** 101 | * 增加记录方法 102 | * 103 | * @access public 104 | * @param array $rows 字段对应值 105 | * @return integer 106 | */ 107 | abstract public function insert(array $rows); 108 | 109 | /** 110 | * 更新记录方法 111 | * 112 | * @access public 113 | * @param array $rows 字段对应值 114 | * @param Typecho_Db_Query $condition 查询对象 115 | * @return integer 116 | */ 117 | abstract public function update(array $rows, Typecho_Db_Query $condition); 118 | 119 | /** 120 | * 删除记录方法 121 | * 122 | * @access public 123 | * @param Typecho_Db_Query $condition 查询对象 124 | * @return integer 125 | */ 126 | abstract public function delete(Typecho_Db_Query $condition); 127 | 128 | } 129 | --------------------------------------------------------------------------------