//画像表示ページ $num = intval($_REQUEST["num"]); $p = intval($_REQUEST["p"]); $url = urlencode(wp_get_fullurl(htmlspecialchars($_REQUEST['url']))); $echostring .= '<br />'; $echostring .= '<center><img src="' . $myurl . '?view=image&url=' . $url . '"/></center>'; $echostring .= '<hr />'; $echostring .= $ackeychar[0] . '<a href="' . $myurl . '?view=content&num=' . $num . '&p=' . $p . '&start=0' . $ses_param . '" accesskey="0">記事へ戻る</a><br/>'; break; } $echostring .= '<hr />'; if (empty($hidefooter)) { $echostring .= '<center><a href="http://www.nyaos.net/pukiwiki/pukiwiki.php?%A5%B1%A1%BC%A5%BF%A5%A4%A4%C7WordPress%A4%F2%B1%DC%CD%F7">WP-Ktai ver ' . $Version . '</a></center>'; } $echostring .= '</body>'; $echostring .= '</html>'; if ($do_redir) { preg_match_all("{<(?:img|a)[^>]*(?:href|src)=([\"'])((http://|https://|/)[^\\1]*?)\\1[^>]*>}i", $echostring, $post_links_temp); for ($i = 0; $i < count($post_links_temp[0]); $i++) { $link_test = wp_get_fullurl($post_links_temp[2][$i]); $test = parse_url($link_test); if (!strstr($link_test, $siteurl)) { $src[] = $post_links_temp[0][$i]; $t_url = $myurl . '?view=redir&url=' . urlencode(preg_replace('|&|', ';ampchar;', $link_test)); $target[] = str_replace($post_links_temp[2][$i], $t_url, $post_links_temp[0][$i]); } } $echostring = str_replace($src, $target, $echostring); } header('Content-Type: text/html; charset=Shift_JIS'); echo mb_convert_encoding($echostring, 'sjis', 'auto');
function the_enclosure_rss($echo = true) { if (!empty($GLOBALS['post']->post_password)) { // if there's a password return _echo('', $echo); } $content = get_the_content($more_link_text, $stripteaser, $more_file); $content = apply_filters('the_content', $content); $content = wp_convert_rss_charset($content); $post_links = array(); preg_match('#(http://[^/]*)#', XOOPS_URL, $my_host); $my_host = $my_host[0]; preg_match_all("{href=([\"'])((http://|https://|/)[^\\1]*?)\\1}i", $content, $post_links_temp); foreach ($post_links_temp[2] as $link_test) { $link_test = wp_get_fullurl($link_test); $test = parse_url($link_test); if (isset($test['query'])) { $post_links[] = $link_test; } elseif ($test['path'] != '/' && $test['path'] != '') { $post_links[] = $link_test; } } $output = ''; foreach ($post_links as $url) { if ($headers = wp_get_http_headers($url)) { $len = (int) $headers['content-length']; $type = addslashes($headers['content-type']); $allowed_types = array('video', 'audio'); if (in_array(substr($type, 0, strpos($type, "/")), $allowed_types)) { $output .= "<enclosure url='" . trim(htmlspecialchars($url)) . "' length='" . trim($len) . "' type='" . trim($type) . "'/>\n"; } } } return _echo($output, $echo); }