2 /////////////////////////////////////////////////
3 // PukiWiki - Yet another WikiWikiWeb clone.
5 // $Id: keitai.skin.php,v 1.4 2004/12/06 13:10:59 henoheno Exp $
8 // Prohibit direct access
9 if (! defined('UI_LANG')) exit;
11 global $max_size, $accesskey, $menubar;
14 // Force Shift JIS encode for Japanese embedded browsers and devices
16 header('Content-Type: text/html; charset=Shift_JIS');
17 $title = mb_convert_encoding($title, 'SJIS', SOURCE_ENCODING);
18 $body = mb_convert_encoding($body, 'SJIS', SOURCE_ENCODING);
20 // Make 1KByte spare (for header, etc)
21 $max_size = --$max_size * 1024;
23 // IMG ¥¿¥°(²èÁü)¤òʸ»úÎó¤ËÃÖ´¹
25 $body = preg_replace('#(<div[^>]+>)?(<a[^>]+>)?<img[^>]*alt="([^"]+)"[^>]*>(?(2)</a>)(?(1)</div>)#i', '[$3]', $body);
27 $body = preg_replace('#(<div[^>]+>)?(<a[^>]+>)?<img[^>]+>(?(2)</a>)(?(1)</div>)#i', '[img]', $body);
29 // Page numbers, divided by this skin
30 $pageno = (isset($vars['p']) and is_numeric($vars['p'])) ? $vars['p'] : 0;
31 $pagecount = ceil(strlen($body) / $max_size);
32 $lastpage = $pagecount - 1;
34 // Top navigation (text) bar
36 $navi[] = '<a href="' . $link['top'] . '" ' . $accesskey . '="0">0.Top</a>';
37 $navi[] = '<a href="' . $link['new'] . '" ' . $accesskey . '="1">1.New</a>';
38 $navi[] = '<a href="' . $link['edit'] . '" ' . $accesskey . '="2">2.Edit</a>';
39 if ($is_read and $function_freeze) {
41 $navi[] = '<a href="' . $link['freeze'] . '" ' . $accesskey . '="3">3.Freeze</a>';
43 $navi[] = '<a href="' . $link['unfreeze'] . '" ' . $accesskey . '="3">3.Unfreeze</a>';
46 $navi[] = '<a href="' . $script . '?' . $menubar . '" ' . $accesskey . '="4">4.Menu</a>';
47 $navi[] = '<a href="' . $link['recent'] . '" ' . $accesskey . '="5">5.Recent</a>';
54 $navi[] = "<a href=\"$script?cmd=read&page=$r_page&p=$prev\" $accesskey=\"7\">7.Prev</a>";
56 $navi[] = "$next/$pagecount ";
57 if ($pageno < $lastpage) {
58 $navi[] = "<a href=\"$script?cmd=read&page=$r_page&p=$next\" $accesskey=\"8\">8.Next</a>";
62 $navi = join(' | ', $navi);
63 $body = substr($body, $pageno * $max_size, $max_size);
66 ?><html><head><title><?php
68 ?></title></head><body><?php