Changeset 986
- Timestamp:
- 2007년 10월 20일 20시 59분 41초 (5 years ago)
- Location:
- trunk/reference-skin
- Files:
-
- 3 edited
-
footer.php (modified) (1 diff)
-
header.php (modified) (1 diff)
-
skin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/reference-skin/footer.php
r980 r986 1 <?php2 if (isset($board) && $board->use_trackback && isset($post) && $GLOBALS['controller'] == 'post') {3 ?>4 <!--5 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"6 xmlns:dc="http://purl.org/dc/elements/1.1/"7 xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">8 <rdf:Description9 rdf:about="<?=full_url_for($post)?>"10 dc:title="<?=$post->title?>"11 dc:identifier="<?=full_url_for($post)?>"12 trackback:ping="<?=full_url_for($post, 'trackback')?>" />13 </rdf:RDF>14 -->15 <?php16 } -
trunk/reference-skin/header.php
r982 r986 1 <?php2 global $controller, $action;3 4 if (isset($board))5 $admin = $account->has_perm('admin', $board);6 $guest = $account->is_guest();7 if ($guest) {8 $link_login = url_with_referer_for($board, 'login');9 $link_signup = url_with_referer_for('account', 'signup');10 } else {11 $link_logout = url_with_referer_for('account', 'logout');12 $link_account = url_with_referer_for('account', 'edit');13 if ($account->is_admin()) {14 $link_admin = url_for('admin');15 } else {16 $link_admin = null;17 }18 }19 20 // for write.php21 if ($controller == 'post' && $action == 'edit' ||22 $controller == 'board' && $action == 'post') {23 if ($board->use_category)24 $categories = $board->get_categories();25 else26 $categories = null;27 $notice_checked = $post->notice ? 'checked="checked"' : '';28 $secret_checked = $post->secret ? 'checked="checked"' : '';29 $editing = $action == 'edit';30 $post->author = $post->name;31 $additional_fields = array();32 foreach ($extra_attributes as $attr) {33 $attr->name = htmlspecialchars($attr->name);34 $attr->output = $attr->render($post->get_attribute($attr->key));35 $additional_fields[] = $attr;36 }37 if ($post->exists()) {38 $attachments = $post->get_attachments();39 } else {40 $attachments = array();41 }42 $uploadable = $board->use_attachment;43 $upload_limit = get_upload_size_limit();44 }45 46 // for list.php47 if (isset($categories)) {48 foreach ($categories as $k => $c) {49 if (isset($post) && $post->category_id == $c->id) {50 $categories[$k]->selected = 'selected="selected"';51 } else {52 $categories[$k]->selected = '';53 }54 $categories[$k]->url = url_for($board, '', array('category' => $c->id));55 $categories[$k]->post_count = $c->get_post_count();56 }57 } else {58 $categories = null;59 }60 $manage_url = url_for($board, 'manage');61 62 // for view.php63 if (isset($post) && !$board->use_trackback) {64 $post->trackback_url = null;65 $trackbacks = array();66 }67 if (isset($trackbacks)) {68 foreach ($trackbacks as $k => $v) {69 if ($admin)70 $trackbacks[$k]->delete_url = url_for($v, 'delete');71 else72 $trackbacks[$k]->delete_url = null;73 }74 }75 if (isset($newer_post)) {76 if (!$newer_post->exists()) {77 $newer_post = null;78 } else {79 $newer_post->url = url_for($newer_post);80 $newer_post->title = htmlspecialchars($newer_post->title);81 }82 }83 if (isset($older_post)) {84 if (!$older_post->exists()) {85 $older_post = null;86 } else {87 $older_post->url = url_for($older_post);88 $older_post->title = htmlspecialchars($older_post->title);89 }90 }91 if (isset($attachments)) {92 foreach ($attachments as $k => $v) {93 $attachments[$k]->filename = shorten_path(htmlspecialchars($v->filename));94 $attachments[$k]->url = htmlspecialchars(url_for($v));95 $attachments[$k]->size = human_readable_size($v->get_size());96 if ($v->is_image()) {97 $attachments[$k]->thumbnail_url = url_for($v).'?thumbnail=1';98 } else {99 $attachments[$k]->thumbnail_url = null;100 }101 }102 }103 if (isset($comments)) {104 function flatten_comments($comments, $parent = 0, $depth = 0) {105 $_comments = array();106 foreach ($comments as $comment) {107 if ($comment->parent == $parent) {108 $comment->depth = $depth;109 $_comments[] = $comment;110 $children = flatten_comments($comments, $comment->id, $depth + 1);111 $_comments = array_merge($_comments, $children);112 }113 }114 return $_comments;115 }116 $comments = flatten_comments($comments);117 }118 if (isset($post) && $post->exists() && $account->has_perm('comment', $post)) {119 $comment_url = url_for($post, 'comment');120 }121 if ($controller == 'comment') {122 $comment_url = url_for($controller, $action);123 if ($action == 'edit') {124 $comment_author = $comment->name;125 $comment_body = $comment->body;126 }127 }128 if (isset($comment_url) && !isset($comment_author)) {129 $comment_author = cookie_get('name');130 $comment_body = "";131 }132 if (!isset($signature)) $signature = '';133 ?> -
trunk/reference-skin/skin.php
r982 r986 1 1 <?php 2 $template_engine = ' default';2 $template_engine = 'standard'; 3 3 $options = array('get_body_in_the_list' => false, 'build_comment_tree' => false); 4 5 if (!defined('MODERN_SKIN')) {6 define('MODERN_SKIN', 1);7 8 function modern_common_filter(&$post) {9 $post->author = $post->name;10 $post->title = htmlspecialchars($post->title);11 $board = $post->get_board();12 if ($board->use_category) {13 if (!$post->category_id) {14 $post->category = new UncategorizedPosts($board);15 } else {16 $post->category = $post->get_category();17 }18 $post->category->name = htmlspecialchars($post->category->name);19 $post->category->url = url_for($board, '', array('category' => $post->category->id));20 } else {21 $post->category = null;22 }23 }24 function modern_list_filter(&$post) {25 modern_common_filter($post);26 $post->url = url_for($post, '', get_search_params());27 $post->date = date('Y-m-d', $post->created_at);28 }29 add_filter('PostList', 'modern_list_filter', 32768);30 31 function modern_view_filter(&$post) {32 modern_common_filter($post);33 $board = $post->get_board();34 $post->date = date('Y-m-d H:i:s', $post->created_at);35 if ($board->use_trackback) {36 $post->trackback_url = full_url_for($post, 'trackback');37 }38 $post->edited = $post->is_edited();39 if ($post->edited) {40 $editor = $post->get_editor();41 if (!$editor->is_guest()) $editor->name = htmlspecialchars($editor->name);42 $post->edited_by = $editor->name;43 $post->edited_at = date('Y-m-d H:i:s', $post->edited_at);44 }45 }46 add_filter('PostView', 'modern_view_filter', 32768);47 48 function modern_comment_filter(&$comment) {49 global $account;50 $comment->author = $comment->name;51 $comment->date = date('Y-m-d H:i:s', $comment->created_at);52 if ($account->has_perm('reply', $comment)) {53 $comment->reply_url = url_for($comment, 'reply');54 } else {55 $comment->reply_url = null;56 }57 if ($account->has_perm('delete', $comment)) {58 $comment->delete_url = url_for($comment, 'delete');59 } else {60 $comment->delete_url = null;61 }62 if ($account->has_perm('edit', $comment)) {63 $comment->edit_url = url_for($comment, 'edit');64 } else {65 $comment->edit_url = null;66 }67 }68 add_filter('PostViewComment', 'modern_comment_filter', 32768);69 }70 4 ?>
Note: See TracChangeset
for help on using the changeset viewer.
