function catbody($title, $page, $body) { global $script, $script_ssl, $vars, $arg, $defaultpage, $whatsnew, $help_page, $hr; global $attach_link, $related_link, $cantedit, $function_freeze; global $search_word_color, $_msg_word, $foot_explain, $note_hr, $head_tags; global $trackback, $trackback_javascript, $referer, $javascript; global $nofollow, $non_list; global $_LANG, $_LINK, $_IMAGE; global $pkwk_dtd; // XHTML 1.1, XHTML1.0, HTML 4.01 Transitional... global $page_title; // Title of this site global $do_backup; // Do backup or not global $modifier; // Site administrator's web page global $modifierlink; // Site administrator's name global $owneraddr; // Site owner address global $ownertel; // Site owner tel global $headcopy; // Site headcopy global $menuadmin; // Menu Administrate Page global $style_type, $style_name, $logo_image, $logo_header; global $keywords, $description, $accesstag, $ga_tracking_id, $killer_fg, $killer_bg, $noindex, $accesstag_moved; //for skin by hokuken global $qhm_adminmenu; // Site administration menu 20 JUN 2007 global $custom_meta; // Insert meta tag for specific meta tag global $adcode; // AD code (exp. Google Adwords, Analytics ... ) 25 JLY 2007 by hokuken.com global $nowindow; // Disable including external_link.js global $killer_page2; // for Killer page Design 2 global $no_qhm_licence; // qhm licence global $include_skin_file_path; //orignal skin setting global $qhm_access_key; global $reg_exp_host; global $unload_confirm, $check_login; global $enable_wp_theme, $enable_wp_theme_name, $wp_add_css; //WordPress用のテーマ global $mobile_redirect, $googlemaps_apikey; global $other_plugins, $other_plugin_categories; global $default_script, $init_scripts; global $enable_smart_style, $smart_name; // smart phone global $is_update; global $enable_fitvids; // body部分以外は、元々の$script を使う(通常のリンク設定)を使う // 結果、$body内は、script_sslを使ったリンクになるが、ナビ、メニューなどは、元の$scriptを必ず使う $script = $init_scripts['normal']; $script_ssl = $init_scripts['ssl']; if (!file_exists(SKIN_FILE) || !is_readable(SKIN_FILE)) { die_message('SKIN_FILE is not found'); } $_LINK = $_IMAGE = array(); // Add JavaScript header when ... if ($trackback && $trackback_javascript) { $javascript = 1; } // Set something If you want if (!PKWK_ALLOW_JAVASCRIPT) { unset($javascript); } $_page = isset($vars['page']) ? $vars['page'] : ''; $r_page = rawurlencode($_page); //QHM Template $qt = get_qt(); if (!$qt->set_page) { $qt->set_page($_page); } //QHM Messages $qm = get_qm(); // Set $_LINK for skin $_LINK['add'] = "{$script}?cmd=add&page={$r_page}"; $_LINK['backup'] = "{$script}?cmd=backup&page={$r_page}"; $_LINK['copy'] = "{$script}?plugin=template&refer={$r_page}"; $_LINK['diff'] = "{$script}?cmd=diff&page={$r_page}"; $_LINK['edit'] = "{$script}?cmd=edit&page={$r_page}"; $_LINK['filelist'] = "{$script}?cmd=filelist"; $_LINK['freeze'] = "{$script}?cmd=freeze&page={$r_page}"; $_LINK['help'] = "{$script}?" . rawurlencode($help_page); $_LINK['list'] = "{$script}?cmd=list"; $_LINK['new'] = "{$script}?plugin=newpage&refer={$r_page}"; $_LINK['rdf'] = "{$script}?cmd=rss&ver=1.0"; $_LINK['recent'] = "{$script}?" . rawurlencode($whatsnew); $_LINK['refer'] = "{$script}?plugin=referer&page={$r_page}"; $_LINK['reload'] = "{$script}?{$r_page}"; $_LINK['rename'] = "{$script}?plugin=rename&refer={$r_page}"; $_LINK['delete'] = "{$script}?plugin=delete&page={$r_page}"; $_LINK['rss'] = "{$script}?cmd=rss"; $_LINK['rss10'] = "{$script}?cmd=rss&ver=1.0"; // Same as 'rdf' $_LINK['rss20'] = "{$script}?cmd=rss&ver=2.0"; $_LINK['search'] = "{$script}?cmd=search"; $_LINK['top'] = dirname($script . 'dummy.php') . '/'; if ($trackback) { $tb_id = tb_get_id($_page); $_LINK['trackback'] = "{$script}?plugin=tb&__mode=view&tb_id={$tb_id}"; } $_LINK['unfreeze'] = "{$script}?cmd=unfreeze&page={$r_page}"; $_LINK['upload'] = "{$script}?plugin=attach&pcmd=upload&page={$r_page}"; $_LINK['menuadmin'] = "{$script}?" . rawurlencode($menuadmin); //Hokuken.com original $_LINK['qhm_adminmenu'] = qhm_get_script_path() . "?cmd=qhmauth"; $_LINK['qhm_logout'] = "{$script}?cmd=qhmlogout"; $_LINK['qhm_setting'] = "{$script}?cmd=qhmsetting"; $_LINK['edit_menu'] = "{$script}?cmd=edit&page=MenuBar"; $_LINK['edit_menu2'] = "{$script}?cmd=edit&page=MenuBar2"; $_LINK['edit_navi'] = "{$script}?cmd=edit&page=SiteNavigator"; $_LINK['edit_navi2'] = "{$script}?cmd=edit&page=SiteNavigator2"; $_LINK['edit_header'] = "{$script}?cmd=edit&page=SiteHeader"; $_LINK['yetlist'] = "{$script}?cmd=yetlist"; // Compat: Skins for 1.4.4 and before $link_add =& $_LINK['add']; $link_new =& $_LINK['new']; // New! $link_edit =& $_LINK['edit']; $link_diff =& $_LINK['diff']; $link_top =& $_LINK['top']; $link_list =& $_LINK['list']; $link_filelist =& $_LINK['filelist']; $link_search =& $_LINK['search']; $link_whatsnew =& $_LINK['recent']; $link_backup =& $_LINK['backup']; $link_help =& $_LINK['help']; $link_trackback =& $_LINK['trackback']; // New! $link_rdf =& $_LINK['rdf']; // New! $link_rss =& $_LINK['rss']; $link_rss10 =& $_LINK['rss10']; // New! $link_rss20 =& $_LINK['rss20']; // New! $link_freeze =& $_LINK['freeze']; $link_unfreeze =& $_LINK['unfreeze']; $link_upload =& $_LINK['upload']; $link_template =& $_LINK['copy']; $link_refer =& $_LINK['refer']; // New! $link_rename =& $_LINK['rename']; $link_delete =& $_LINK['delete']; $link_menuadmin =& $_LINK['menuadmin']; //Hokuken.com original $link_copy =& $_LINK['copy']; $link_qhm_adminmenu =& $_LINK['qhm_adminmenu']; //Hokuken.com original $link_qhm_logout =& $_LINK['qhm_logout']; //Hokuken.com original $link_qhm_setting =& $_LINK['qhm_setting']; //Hokuken.com original $link_edit_menu =& $_LINK['edit_menu']; //Hokuken.com original $link_edit_menu2 =& $_LINK['edit_menu2']; $link_edit_navi =& $_LINK['edit_navi']; //Hokuken.com original $link_edit_navi2 =& $_LINK['edit_navi2']; //Hokuken.com original $link_edit_header =& $_LINK['edit_header']; //Hokuken.com original $link_yetlist =& $_LINK['yetlist']; //Hokuken.com original // Init flags $is_page = is_pagename($_page) && $_page != $whatsnew; $is_read = arg_check('read') && is_page($_page); $is_freeze = is_freeze($_page); // Last modification date (string) of the page $lastmodified = $is_read ? format_date(get_filetime($_page)) . ' ' . get_pg_passage($_page, FALSE) : ''; // List of attached files to the page $attaches = $attach_link && $is_read && exist_plugin_action('attach') ? attach_filelist() : ''; // List of related pages $related = $related_link && $is_read ? make_related($_page) : ''; // List of footnotes ksort($foot_explain, SORT_NUMERIC); $notes = !empty($foot_explain) ? $note_hr . join("\n", $foot_explain) : ''; // Tags will be inserted into <head></head> $head_tag = !empty($head_tags) ? join("\n", $head_tags) . "\n" : ''; // 1.3.x compat // Last modification date (UNIX timestamp) of the page $fmt = $is_read ? get_filetime($_page) + LOCALZONE : 0; // Search words if ($search_word_color && isset($vars['word'])) { $body = '<div class="small">' . $_msg_word . htmlspecialchars($vars['word']) . '</div>' . $hr . "\n" . $body; // BugTrack2/106: Only variables can be passed by reference from PHP 5.0.5 // with array_splice(), array_flip() $words = preg_split('/\\s+/', $vars['word'], -1, PREG_SPLIT_NO_EMPTY); $words = array_splice($words, 0, 10); // Max: 10 words $words = array_flip($words); $keys = array(); foreach ($words as $word => $id) { $keys[$word] = strlen($word); } arsort($keys, SORT_NUMERIC); $keys = get_search_words(array_keys($keys), TRUE); $id = 0; foreach ($keys as $key => $pattern) { $s_key = htmlspecialchars($key); $pattern = '/' . '<textarea[^>]*>.*?<\\/textarea>' . '|' . '<[^>]*>' . '|' . '&[^;]+;' . '|' . '(' . $pattern . ')' . '/sS'; $decorate_Nth_word = create_function('$matches', 'return (isset($matches[1])) ? ' . '\'<strong class="word' . $id . '">\' . $matches[1] . \'</strong>\' : ' . '$matches[0];'); $body = preg_replace_callback($pattern, $decorate_Nth_word, $body); $notes = preg_replace_callback($pattern, $decorate_Nth_word, $notes); ++$id; } } //----------------------------------------------------------------------- // // customized by hokuken for QHM (2009/1/28) // //----------------------------------------------------------------------- //----------------- 携帯の場合の処理 -------------------------------------- if (preg_match('/keitai.skin.php$/', SKIN_FILE)) { require LIB_DIR . 'qhm_init.php'; require LIB_DIR . 'qhm_init_main.php'; require SKIN_FILE; return; } //------------------- IF UA is mobile, end here ----------------------- //---------- KILLERPAGE: でもKILLERPAGE2:に統合 いつか消したい -------------- if ($killer_fg != '') { //load common setting and output header require LIB_DIR . 'qhm_init.php'; $killer_page2['fg'] = $killer_fg; $killer_page2['bg'] = $killer_bg; $killer_page2['width'] = 700; $killer_page2['padding'] = 60; $killer_page2['bg_body'] = '#fff'; $killer_page2['fg_body'] = '#000'; require LIB_DIR . 'qhm_init_killer.php'; $longtaketime = getmicrotime() - MUTIME; $taketime = sprintf('%01.03f', $longtaketime); $qt->setv('taketime', $taketime); } //--------------------------- いつか消したい end here ---------------- /////////////////////////////////////////////////////////////////// // // Main // //common setting require LIB_DIR . 'qhm_init.php'; $qt->enable_cache = $qt->getv('editable') ? false : $qt->enable_cache; $qt->set_encode($shiftjis || $eucjp ? true : false); if ($shiftjis) { $output_encode = 'Shift_JIS'; } else { if ($eucjp) { $output_encode = 'EUC-JP'; } else { $output_encode = CONTENT_CHARSET; } } define('WORDPRESS_CHARSET', $output_encode); //output common header (available change encode) $qt->setv('meta_content_type', qhm_output_dtd($pkwk_dtd, CONTENT_CHARSET, $output_encode)); //------- KILLERPAGE2: セールスレター型デザイン ------------------- if (isset($killer_page2['fg']) != '') { require LIB_DIR . 'qhm_init_killer.php'; //JQuery Include $jquery_script = ''; $jquery_cookie_script = ''; if ($qt->getv('jquery_include')) { $jquery_script = '<script type="text/javascript" src="js/jquery.js"></script>'; $jquery_cookie_script = '<script type="text/javascript" src="js/jquery.cookie.js"></script>'; } $bootstrap_style = $bootstrap_script = ''; if ($qt->getv('bootstrap_script')) { $bootstrap_style = $qt->getv('bootstrap_style'); $bootstrap_script = $qt->getv('bootstrap_script'); } $qt->setv('jquery_script', $bootstrap_style . $jquery_script . $bootstrap_script); $qt->setv('jquery_cookie_script', $jquery_cookie_script); $longtaketime = getmicrotime() - MUTIME; $taketime = sprintf('%01.03f', $longtaketime); $qt->setv('taketime', $taketime); $qt->read('skin/killerpage2/pukiwiki.skin.php'); return; } //------------------------------------------------------------- // ---- include main design skin file ---- if (isset($_SESSION['temp_skin']) && strlen($_SESSION['temp_skin']) > 0) { $style_type = $_SESSION['temp_style_type']; } //pluginでデザインが指定されている場合 if ($include_skin_file_path != '') { $style_name = $include_skin_file_path; } require LIB_DIR . 'qhm_init_main.php'; // meta:GENERATOR $generator_tag = '<meta name="GENERATOR" content="Quick Homepage Maker; version=' . QHM_VERSION . '; haik=' . (is_bootstrap_skin() ? 'true' : 'false') . '" />' . "\n"; $qt->prependv_once('generator_tag', 'beforescript', $generator_tag); //------------------------------------------------- // ogp タグを挿入 //------------------------------------------------- if (exist_plugin('ogp')) { plugin_ogp_set_template($body); } //独自のテンプレートファイルをチェック $skin_file = SKIN_DIR . "{$style_name}/pukiwiki.skin.php"; if ($qt->getv('layout_name')) { $layout_file = $qt->getv('layout_name') . '.skin.php'; $layout_path = SKIN_DIR . "{$style_name}/{$layout_file}"; if (file_exists($layout_path)) { $skin_file = $layout_path; } } else { $layout_prefix = 'content'; if ($_page === $defaultpage) { $layout_prefix = 'default'; } else { if (is_qblog()) { $layout_prefix = 'article'; } } $layout_name = isset($style_config["{$layout_prefix}_layout"]) ? $style_config["{$layout_prefix}_layout"] : ""; $layout_path = SKIN_DIR . "{$style_name}/{$layout_name}.skin.php"; if (file_exists($layout_path)) { $skin_file = $layout_path; } } if (!file_exists($skin_file)) { $skin_file = SKIN_FILE; //デフォルトの位置 } // Read design config for customize $style_config = read_skin_config($style_name); $skin_custom_vars = get_skin_custom_vars($style_name); $custom_css = make_custom_css($style_name); $qt->prependv('beforescript', $custom_css); if (isset($style_config['bootstrap']) && $style_config['bootstrap'] !== false) { $qt->setv('jquery_include', true); } // Default Eyecatch if (isset($skin_custom_vars['default_eyecatch']) && $skin_custom_vars['default_eyecatch'] && $qt->getv('main_visual') === '' && exist_plugin('eyecatch')) { $bg_image = $color = ''; if (isset($skin_custom_vars['eyecatch_bgimage'])) { $bg_image = $skin_custom_vars['eyecatch_bgimage']; $bg_image = is_url($bg_image, TRUE, TRUE) || file_exists(get_file_path($bg_image)) ? $bg_image : ''; } if (isset($skin_custom_vars['enable_eyecatch_bgimage']) && !$skin_custom_vars['enable_eyecatch_bgimage']) { $bg_image = ''; } if (isset($skin_custom_vars['eyecatch_color'])) { $color = 'color=' . $skin_custom_vars['eyecatch_color']; } if (is_qblog()) { $title_copy = $qblog_title; } else { if (isset($skin_custom_vars['eyecatch_title_type']) && trim($skin_custom_vars['eyecatch_title_type']) == 'site') { $title_copy = $page_title; } else { if ($_page === $defaultpage) { $title_copy = $page_title; } else { $title_copy = get_page_title($_page); } } } $content = <<<EOD ! {$title_copy} EOD; plugin_eyecatch_convert($bg_image, $color, '__default', $content); } if ($qt->getv('no_eyecatch')) { $qt->setv('main_visual', "<!-- no eyecatch -->"); } // Determine emptiness of eyecatch $qt->setv('eyecatch_is_empty', $qt->getv('no_eyecatch') || $qt->getv('main_visual') === ''); if (isset($skin_custom_vars['palette_color']) && trim($skin_custom_vars['palette_color'])) { $qt->setv('palette_color', trim($skin_custom_vars['palette_color'])); $qt->setv('palette_color_class', 'haik-palette-' . trim($skin_custom_vars['palette_color'])); } //JQuery Include $jquery_script = ''; $jquery_cookie_script = ''; if ($qt->getv('jquery_include')) { $jquery_script = '<script type="text/javascript" src="js/jquery.js"></script>'; $jquery_cookie_script = '<script type="text/javascript" src="js/jquery.cookie.js"></script>'; } if ($qt->getv('bootstrap_script')) { $bootstrap_script = $qt->getv('bootstrap_script'); } $qt->setv('jquery_script', $jquery_script . $bootstrap_script); $qt->setv('jquery_cookie_script', $jquery_cookie_script); $longtaketime = getmicrotime() - MUTIME; $taketime = sprintf('%01.03f', $longtaketime); $qt->setv('taketime', $taketime); //UniversalAnalytics Tracking Code if ($code = $qt->getv('ga_universal_analytics')) { $qt->appendv('beforescript', $code); } //------------------------------------------------------------------ // WordPressデザイン if ($enable_wp_theme && ($vars['cmd'] != 'qhmsetting' && $vars['plugin'] != 'qhmsetting')) { define('TEMPLATEPATH', 'skin/wordpress/' . $enable_wp_theme_name); include LIB_DIR . 'wp_adapter.php'; wp_load_functions(); $skin_file = get_wp_skin_file(); } //------------------------------------------------------------------- //------------------------------------------------------------------- // プレビュー用のskinファイルを表示 $tmpfilename = ''; if (isset($_SESSION['temp_skin']) && strlen($_SESSION['temp_skin']) > 0) { $tmpfilename = $skin_file = tempnam(realpath(CACHEQHM_DIR), 'qhmdesign'); file_put_contents($skin_file, $_SESSION['temp_skin']); $qt->setv('default_css', $bootstrap_css . $_SESSION['temp_css']); $qt->setv('style_path', $_SESSION['temp_style_path']); } //------------------------------------------------------------------- //skinファイルを読み込んで、表示 $qt->read($skin_file, $_page); // 一時ファイルの削除 if (file_exists($tmpfilename) && strpos(basename($tmpfilename), 'qhmdesign') === 0) { unlink($tmpfilename); } }
function auth_catbody($title, $contents, $retry = false) { global $script, $default_script, $admin_email; $qm = get_qm(); // Output HTTP headers pkwk_common_headers(); header('Cache-control: no-cache'); header('Pragma: no-cache'); header('Content-Type: text/html; charset=' . CONTENT_CHARSET); // Output HTML DTD, <html>, and receive content-type if (isset($pkwk_dtd)) { $meta_content_type = pkwk_output_dtd($pkwk_dtd); } else { $meta_content_type = pkwk_output_dtd(); } $qv = QHM_VERSION; $pv = S_VERSION; $server_port = SERVER_PORT; $script_name = SCRIPT_NAME; $http_host = $_SERVER['HTTP_HOST']; $script_url = qhm_get_script_path(); $dispjs = 'scriptErr.visibility = "hidden";'; if ($default_script != '') { $s_notice_msg = $qm->replace('ss_authform.ntc_set_script', $script_url . '?plugin=qhmsetting&phase=script&mode=form'); $dispjs = <<<EOD \t\t\tscriptErr.style.border = '2px solid #66AACC'; \t\t\tscriptErr.style.backgroundColor = '#EEEEFF'; \t\t\tscriptErr.innerHTML = '<p>{$s_notice_msg}</p>'; EOD; } $s_err_msg = $qm->replace('ss_authform.err_set_script', $script_url . '?plugin=qhmsetting&phase=script&mode=form'); $jumphome_label = $qm->m['ss_authform']['jump_home']; $licence_msg = $qm->replace('ss_authform.licence', $qv, $pv); $error_login = ''; if ($retry && $admin_email != '') { $error_login = $qm->replace('ss_authform.err_login', $script . '?plugin=qhmpw') . ' '; } echo <<<EOD <head> {$meta_content_type} <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="robots" content="NOINDEX, NOFOLLOW" /> <title>{$title}</title> <script type="text/javascript"> <!-- window.onload = function() { \tvar scriptErr = document.getElementById('scripterror'); \t// wrong script \tif (location.hostname != '{$http_host}' \t\t\t|| location.port != '{$server_port}' \t\t\t|| location.pathname != '{$script_name}' ) { \t\tvar href = location.href.replace(location.search, ''); \t\tif(! href.match(/\\.php\$/)){ \t\t\thref += 'index.php'; \t\t} \t\tif (href == '{$script}') { \t\t\t{$dispjs} \t\t} \t\telse { \t\t\tscriptErr.style.border = '2px solid #FF3300'; \t\t\tscriptErr.style.backgroundColor = '#FFEEEE'; \t\t\tscriptErr.innerHTML = '<p style="color:red">{$s_err_msg}</p>'; \t\t} \t} \telse { \t\tscriptErr.visibility = "hidden"; \t} \t// wrong session save path \treturn false; } //--> </script> <style> .wrapper { margin: 0 auto; width: 300px; } .box { border:1px #ccc solid; padding:1em; color:#666; margin-top:15px; font-size:14px; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; box-shadow: 2px 2px 8px #ccc; -moz-box-shadow: 2px 2px 8px #ccc; -webkit-box-shadow: 2px 2px 8px #ccc; } .box input[type=text], .box input[type=password] { margin: 0; font-size: 18px; border: 1px solid #999; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; padding: 3px; width: 260px; } .title { font-size:24px; font-weight: normal; color: #666; text-align:center; } body{ font-family: Arial, sans-serif; } label { display:block; margin-top: 1em; } input[type=submit], input[type=button] { border-style:none; display: inline-block; color: #fff; text-decoration: none; -moz-border-radius: 6px; -webkit-border-radius: 6px; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.6); -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.6); text-shadow: 0 -1px 1px rgba(0,0,0,0.25); border-bottom: 1px solid rgba(0,0,0,0.25); position: relative; cursor: pointer; font-size: 18px; padding: 4px 14px 4px; background-color: #2981e4; margin: 1em 0 1em; } input[type=submit]:hover { background-color: #2575cf; } #footer { text-align:right;font-size:12px;color:#999 } #footer a { font-size:12px;color:#666 } </style> </head> <body> <div class="wrapper"> <h2 class="title">QHM {$title}</h2> {$contents} <div id="scripterror"></div> <div id="footer"> <p style="text-align:right;">{$error_login}<a href="{$script_url}" style="">{$jumphome_label}</a></p> <p style="">{$licence_msg}</p> </div> </div> </body> </html> EOD; }