2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // $Id: keitai.skin.php,v 1.5 2005/01/08 04:07:11 henoheno Exp $
5 // Skin for Embedded devices
7 // Prohibit direct access
8 if (! defined('UI_LANG')) die('UI_LANG is not set');
10 global $max_size, $accesskey, $menubar;
13 // Force Shift JIS encode for Japanese embedded browsers and devices
15 header('Content-Type: text/html; charset=Shift_JIS');
16 $title = mb_convert_encoding($title, 'SJIS', SOURCE_ENCODING);
17 $body = mb_convert_encoding($body, 'SJIS', SOURCE_ENCODING);
19 // Make 1KByte spare (for header, etc)
20 $max_size = --$max_size * 1024;
22 // IMG ¥¿¥°(²èÁü)¤òʸ»úÎó¤ËÃÖ´¹
24 $body = preg_replace('#(<div[^>]+>)?(<a[^>]+>)?<img[^>]*alt="([^"]+)"[^>]*>(?(2)</a>)(?(1)</div>)#i', '[$3]', $body);
26 $body = preg_replace('#(<div[^>]+>)?(<a[^>]+>)?<img[^>]+>(?(2)</a>)(?(1)</div>)#i', '[img]', $body);
28 // Page numbers, divided by this skin
29 $pageno = (isset($vars['p']) and is_numeric($vars['p'])) ? $vars['p'] : 0;
30 $pagecount = ceil(strlen($body) / $max_size);
31 $lastpage = $pagecount - 1;
33 // Top navigation (text) bar
35 $navi[] = '<a href="' . $link['top'] . '" ' . $accesskey . '="0">0.Top</a>';
36 $navi[] = '<a href="' . $link['new'] . '" ' . $accesskey . '="1">1.New</a>';
37 $navi[] = '<a href="' . $link['edit'] . '" ' . $accesskey . '="2">2.Edit</a>';
38 if ($is_read and $function_freeze) {
40 $navi[] = '<a href="' . $link['freeze'] . '" ' . $accesskey . '="3">3.Freeze</a>';
42 $navi[] = '<a href="' . $link['unfreeze'] . '" ' . $accesskey . '="3">3.Unfreeze</a>';
45 $navi[] = '<a href="' . $script . '?' . $menubar . '" ' . $accesskey . '="4">4.Menu</a>';
46 $navi[] = '<a href="' . $link['recent'] . '" ' . $accesskey . '="5">5.Recent</a>';
53 $navi[] = "<a href=\"$script?cmd=read&page=$r_page&p=$prev\" $accesskey=\"7\">7.Prev</a>";
55 $navi[] = "$next/$pagecount ";
56 if ($pageno < $lastpage) {
57 $navi[] = "<a href=\"$script?cmd=read&page=$r_page&p=$next\" $accesskey=\"8\">8.Next</a>";
61 $navi = join(' | ', $navi);
62 $body = substr($body, $pageno * $max_size, $max_size);
65 ?><html><head><title><?php
67 ?></title></head><body><?php