2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // $Id: tdiary.skin.php,v 1.3 2004/12/31 01:08:47 henoheno Exp $
8 //define('TDIARY_THEME', '3minutes');
9 //define('TDIARY_THEME', 'aoikuruma');
10 //define('TDIARY_THEME', 'bill');
11 //define('TDIARY_THEME', 'black-lingerie');
12 //define('TDIARY_THEME', 'black_mamba');
13 //define('TDIARY_THEME', 'blog');
14 //define('TDIARY_THEME', 'bubble');
15 //define('TDIARY_THEME', 'cards');
16 //define('TDIARY_THEME', 'cat');
17 //define('TDIARY_THEME', 'christmas');
18 //define('TDIARY_THEME', 'clover');
19 //define('TDIARY_THEME', 'dot');
20 //define('TDIARY_THEME', 'gear');
21 //define('TDIARY_THEME', 'gingham-gray');
22 //define('TDIARY_THEME', 'green-border'); // With frogs
23 //define('TDIARY_THEME', 'himawari');
24 //define('TDIARY_THEME', 'hatena');
25 //define('TDIARY_THEME', 'kaeru');
26 //define('TDIARY_THEME', 'loose-leaf');
27 //define('TDIARY_THEME', 'petith');
28 //define('TDIARY_THEME', 'piyo-family');
29 //define('TDIARY_THEME', 'plum');
30 //define('TDIARY_THEME', 'puppy');
31 //define('TDIARY_THEME', 'snowy');
32 if (! defined('TDIARY_THEME')) define('TDIARY_THEME', 'loose-leaf'); // Default
34 // Show someting with <div class="calendar"> design
35 // 1 = Show reload URL
37 // NULL = Show nothing
38 if (! defined('TDIARY_CALENDAR_DESIGN'))
39 define('TDIARY_CALENDAR_DESIGN', NULL);
42 // Prohibit direct access
43 if (! defined('UI_LANG')) die('UI_LANG is not set');
44 if (! isset($_LANG)) die('$_LANG is not set');
47 $theme = TDIARY_THEME;
49 die('Theme is not specified. Set "TDIARY_THEME" correctly');
51 $theme = rawurlencode($theme); // Supress all nasty letters
52 $theme_css = SKIN_DIR . 'theme/' . $theme . '/' . $theme . '.css';
53 if (! file_exists($theme_css)) {
54 echo 'tDiary theme wrapper: ';
55 echo 'Theme not found: ' . htmlspecialchars($theme_css) . '<br/>';
56 echo 'You can get tdiary-theme from: ';
57 echo 'http://sourceforge.net/projects/tdiary/';
62 if (defined('TDIARY_SIDEBAR_POSITION')) {
63 $sidebar = TDIARY_SIDEBAR_POSITION;
65 // Themes including sidebar CSS < (AllTheme / 2)
66 // $ grep div.sidebar */*.css | cut -d: -f1 | cut -d/ -f1 | sort | uniq
68 // 75 list-sidebar.txt
70 $sidebar = 'another'; // Default: Show as an another page below
72 case '3minutes': /*FALLTHROUGH*/
82 case 'book2-feminine':
136 case 'smoking_black':
137 case 'smoking_white':
144 case 'tinybox_green':
147 $sidebar = 'bottom'; // This is the default position of tDiary's.
151 // Adjust sidebar's default position
153 case 'autumn': /*FALLTHROUGH*/
159 case 'tinybox': // For MSIE with narrow window width, seems meanless
160 case 'tinybox_green': // The same
161 $sidebar = 'top'; // Assuming sidebar is above of the body
164 case '3minutes': /*FALLTHROUGH*/
182 case 'moo': // For MSIE, strict seems meanless
185 case 's-blue': // For MSIE, strict seems meanless
194 $sidebar = 'strict'; // Strict separation between sidebar and main needed
197 case 'babypink': /*FALLTHROUGH*/
211 case 'smoking_black':
212 $sidebar = 'another'; // Show as an another page below
217 // Check menu (sidebar) is ready and $menubar is there
218 $menu = (arg_check('read') && is_page($GLOBALS['menubar']) &&
219 exist_plugin_convert('menu'));
221 $menu_body = preg_replace('#<h2 ([^>]*)>(.*?)</h2>#',
222 '<h3 $1><span class="sanchor"></span> $2</h3>',
223 do_plugin_convert('menu'));
226 // Adjust reverse-link default design manually
227 $disable_reverse_link = FALSE;
229 case 'hatena': /*FALLTHROUGH*/
232 $disable_reverse_link = TRUE;
236 $lang = $_LANG['skin'];
239 // Decide charset for CSS
240 $css_charset = 'iso-8859-1';
242 case 'ja': $css_charset = 'Shift_JIS'; break;
246 pkwk_common_headers();
247 header('Cache-control: no-cache');
248 header('Pragma: no-cache');
249 header('Content-Type: text/html; charset=' . CONTENT_CHARSET);
253 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
254 <html lang="<?php echo LANG ?>">
256 <meta http-equiv="content-type" content="text/html; charset=<?php echo CONTENT_CHARSET ?>" />
257 <meta http-equiv="content-style-type" content="text/css" />
258 <?php if (! $is_read) { ?> <meta name="robots" content="NOINDEX,NOFOLLOW" /><?php } ?>
259 <?php if (PKWK_ALLOW_JAVASCRIPT && isset($javascript)) { ?> <meta http-equiv="Content-Script-Type" content="text/javascript" /><?php } ?>
261 <title><?php echo "$title - $page_title" ?></title>
263 <link rel="stylesheet" href="skin/theme/base.css" type="text/css" media="all" />
264 <link rel="stylesheet" href="skin/theme/<?php echo $theme ?>/<?php echo $theme ?>.css" type="text/css" media="all" />
265 <link rel="stylesheet" href="skin/tdiary.css.php?charset=<?php echo $css_charset ?>" type="text/css" media="screen" charset="<?php echo $css_charset ?>" />
266 <link rel="stylesheet" href="skin/tdiary.css.php?charset=<?php echo $css_charset ?>&media=print" type="text/css" media="print" charset="<?php echo $css_charset ?>" />
268 <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $link['rss'] ?>" /><?php // RSS auto-discovery ?>
270 <?php if (PKWK_ALLOW_JAVASCRIPT && $trackback_javascript) { ?> <script type="text/javascript" src="skin/trackback.js"></script><?php } ?>
272 <?php echo $head_tag ?>
274 <body><!-- Theme:<?php echo htmlspecialchars($theme) . ' Sidebar:' . $sidebar ?> -->
276 <?php if ($menu && $sidebar == 'strict') { ?>
278 <div class="sidebar">
280 <?php echo $menu_body ?>
282 </div><!-- class="sidebar" -->
284 <div class="pkwk_body">
286 <?php } // if ($menu && $sidebar == 'strict') ?>
288 <!-- Navigation buttuns -->
289 <div class="adminmenu">
291 function _navigator($key, $value = '', $javascript = ''){
292 $lang = $GLOBALS['_LANG']['skin'];
293 $link = $GLOBALS['_LINK'];
294 if (! isset($lang[$key])) { echo 'LANG NOT FOUND'; return FALSE; }
295 if (! isset($link[$key])) { echo 'LINK NOT FOUND'; return FALSE; }
296 if (! PKWK_ALLOW_JAVASCRIPT) $javascript = '';
298 echo '<span class="adminmenu"><a href="' . $link[$key] . '" ' . $javascript . '>' .
299 (($value === '') ? $lang[$key] : $value) .
305 <?php _navigator('top') ?>
307 <?php if ($is_page) { ?>
308 <?php _navigator('edit') ?>
309 <?php if ($is_read && $function_freeze) { ?>
310 <?php (! $is_freeze) ? _navigator('freeze') : _navigator('unfreeze') ?>
312 <?php _navigator('diff') ?>
313 <?php if ($do_backup) { ?>
314 <?php _navigator('backup') ?>
316 <?php if ((bool)ini_get('file_uploads')) { ?>
317 <?php _navigator('upload') ?>
319 <?php _navigator('reload') ?>
323 <?php _navigator('new') ?>
324 <?php _navigator('list') ?>
325 <?php if (arg_check('list')) { ?>
326 <?php _navigator('filelist') ?>
328 <?php _navigator('search') ?>
329 <?php _navigator('recent') ?>
330 <?php _navigator('help') ?>
332 <?php if ($trackback) { ?>
333 <?php _navigator('trackback', $lang['trackback'] . '(' . tb_count($_page) . ')',
334 ($trackback_javascript == 1) ? 'onClick="OpenTrackback(this.href); return false"' : '') ?>
336 <?php if ($referer) { ?>
337 <?php _navigator('refer') ?>
341 <h1><?php echo $page_title ?></h1>
343 <div class="calendar">
344 <?php if ($is_page && TDIARY_CALENDAR_DESIGN !== NULL) { ?>
345 <?php if(TDIARY_CALENDAR_DESIGN) { ?>
346 <a href="<?php echo $link['reload'] ?>"><span class="small"><?php echo $link['reload'] ?></span></a>
348 <?php require_once(PLUGIN_DIR . 'topicpath.inc.php'); echo plugin_topicpath_inline(); ?>
354 <?php if ($menu && $sidebar == 'top') { ?>
355 <!-- Sidebar compat top -->
356 <div class="sidebar">
358 <?php echo $menu_body ?>
360 </div><!-- class="sidebar" -->
361 <?php } // if ($menu && $sidebar == 'top') ?>
364 <?php if ($menu && ($sidebar == 'top' || $sidebar == 'bottom')) { ?>
365 <div class="pkwk_body">
367 <?php } // if ($menu && $sidebar == 'top') ?>
374 <h2><span class="date"></span> <span class="title"><?php
375 if ($disable_reverse_link === TRUE) {
377 echo htmlspecialchars($_page);
379 echo $page; // Search, or something message
385 echo htmlspecialchars($_page);
391 <div class="section">
393 // For read and preview: tDiary have no <h2> inside body
394 $body = preg_replace('#<h2 ([^>]*)>(.*?)<a class="anchor_super" ([^>]*)>.*?</a></h2>#',
395 '<h3 $1><a $3><span class="sanchor">_</span></a> $2</h3>', $body);
396 $body = preg_replace('#<h2 ([^>]*)>(.*?)</h2>#',
397 '<h3 $1><span class="sanchor">_</span> $2</h3>', $body);
402 // Edit, preview, search, etc
403 echo preg_replace('/(<form) (action="' . preg_quote($script, '/') .
404 ')/', '$1 class="update" $2', $body);
408 </div><!-- class="body" -->
410 <?php if ($notes) { ?>
411 <div class="comment"><!-- Design for tDiary "Comments" -->
412 <div class="caption"> </div>
413 <div class="commentbody"><br/>
415 $notes = preg_replace('#<span class="small">(.*?)</span>#', '<p>$1</p>', $notes);
416 echo preg_replace('#<a (id="notefoot_[^>]*)>(.*?)</a>#',
417 '<div class="commentator"><a $1><span class="canchor"></span> ' .
418 '<span class="commentator">$2</span></a>' .
419 '<span class="commenttime"></span></div>', $notes);
425 <?php if ($attaches) { ?>
426 <div class="comment">
427 <div class="caption"> </div>
428 <div class="commentshort">
429 <?php echo $attaches ?>
434 <?php if ($related) { ?>
435 <div class="comment">
436 <div class="caption"> </div>
437 <div class="commentshort">
438 Link: <?php echo $related ?>
443 <!-- Design for tDiary "Today's referrer" -->
444 <div class="referer"><?php if ($lastmodified) echo 'Last-modified: ' . $lastmodified; ?></div>
446 </div><!-- class="day" -->
451 <?php if ($menu && $sidebar == 'another') { ?>
452 </div><!-- class="main" -->
453 </div><!-- class="pkwk_body" -->
455 <!-- Sidebar another -->
456 <div class="pkwk_body">
458 <div class="calendar"></div>
461 <h2><span class="date"></span><span class="title"> </span></h2>
463 <div class="section">
464 <?php echo $menu_body ?>
467 <div class="referer"></div>
470 </div><!-- class="pkwk_body" -->
472 <div class="pkwk_body">
474 <?php } // if ($menu && $sidebar == 'another') ?>
477 <?php if ($menu && ($sidebar == 'top' || $sidebar == 'bottom')) { ?>
478 </div><!-- class="main" -->
479 </div><!-- class="pkwk_body" -->
483 <?php if ($menu && $sidebar == 'bottom') { ?>
484 <!-- Sidebar compat bottom -->
485 <div class="sidebar">
487 <?php echo $menu_body ?>
489 </div><!-- class="sidebar" -->
490 <?php } // if ($menu && $sidebar == 'bottom') ?>
493 <!-- Copyright etc -->
495 Modified by <a href="<?php echo $modifierlink ?>"><?php echo $modifier ?></a><br />
496 <?php echo S_COPYRIGHT ?><br />
497 Powered by PHP <?php echo PHP_VERSION ?><br />
498 HTML convert time to <?php echo $taketime ?> sec.
502 <?php if ($menu && ($sidebar != 'top' && $sidebar != 'bottom')) { ?>
503 </div><!-- class="main" -->
504 </div><!-- class="pkwk_body" -->