X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=skin%2Fkeitai.skin.php;h=fe6de67cd77e20c1406ac736c4415ed734a9bc0c;hb=303378153bd14e35b68d0b37f1fa3d62ebd2da05;hp=8204efab1bba01800973077a4c2096ced46d52cb;hpb=3b1e44b44d2e1507ea96d2a29077cd383befaf95;p=pukiwiki%2Fpukiwiki.git diff --git a/skin/keitai.skin.php b/skin/keitai.skin.php index 8204efa..fe6de67 100644 --- a/skin/keitai.skin.php +++ b/skin/keitai.skin.php @@ -1,6 +1,8 @@ ]+>' . preg_quote($_symbol_anchor, '#') . '#', '', $body); -// Replace IMG tags (= images) with character strings +// Shrink IMG tags (= images) with character strings // With ALT option $body = preg_replace('#(]+>)?(]+>)?]*alt="([^"]+)"[^>]*>(?(2))(?(1))#i', '[$3]', $body); // Without ALT option $body = preg_replace('#(]+>)?(]+>)?]+>(?(2))(?(1))#i', '[img]', $body); -// Page numbers, divided by this skin -$pageno = (isset($vars['p']) and is_numeric($vars['p'])) ? $vars['p'] : 0; +// ---- + +// Check content volume, Page numbers, divided by this skin $pagecount = ceil(strlen($body) / $max_size); -$lastpage = $pagecount - 1; +// Too large contents to edit +if ($edit && $pagecount > 1) + die('Unable to edit: Too large contents for your device'); + +// Get one page +$body = substr($body, $pageno * $max_size, $max_size); + +// ---- // Top navigation (text) bar + $navi = array(); $navi[] = '0.Top'; if ($rw) { $navi[] = '1.New'; $navi[] = '2.Edit'; - if ($is_read and $function_freeze) { + if ($is_read && $function_freeze) { if (! $is_freeze) { $navi[] = '3.Freeze'; } else { @@ -51,7 +59,7 @@ if ($rw) { } } } -$navi[] = '4.Menu'; +$navi[] = '4.Menu'; $navi[] = '5.Recent'; // Previous / Next block @@ -59,16 +67,29 @@ if ($pagecount > 1) { $prev = $pageno - 1; $next = $pageno + 1; if ($pageno > 0) { - $navi[] = '7.Prev'; + $navi[] = '7.Prev'; } $navi[] = $next . '/' . $pagecount . ' '; - if ($pageno < $lastpage) { - $navi[] = '8.Next'; + if ($pageno < $pagecount - 1) { + $navi[] = '8.Next'; } } $navi = join(' | ', $navi); -$body = substr($body, $pageno * $max_size, $max_size); + +// ---- +// Output HTTP headers +pkwk_headers_sent(); +if(TRUE) { + // Force Shift JIS encode for Japanese embedded browsers and devices + header('Content-Type: text/html; charset=Shift_JIS'); + $title = mb_convert_encoding($title, 'SJIS', SOURCE_ENCODING); + $body = mb_convert_encoding($body, 'SJIS', SOURCE_ENCODING); +} else { + header('Content-Type: text/html; charset=' . CONTENT_CHARSET); +} // Output ?><?php