GDが使えない場合、PHP4の場合、allow_url_fopen が offデモ、適切に表示が出来るように変更
@@ -1,32 +1,27 @@ | ||
1 | 1 | <?php |
2 | - | |
2 | + check_php();//phpのバージョンチェック | |
3 | 3 | ini_set("display_errors",1); |
4 | 4 | |
5 | -if(check_php()){ | |
6 | - $benchmark = false; | |
7 | - $source = false; | |
8 | - $cache = true; | |
5 | + $benchmark = true; | |
6 | + $source = false; | |
7 | + $cache = true; | |
9 | 8 | include("scripts/trans.php"); |
10 | - $ini_array = parse_ini_file("scripts/html.ini",true); | |
11 | - ////////////////////////////////////////////////////////本文 | |
12 | - $document = document(); | |
9 | + $ini_array = parse_ini_file("scripts/html.ini",true); | |
10 | + $document = document(); | |
13 | 11 | $obj = new trans($document); |
14 | 12 | $content_name = "main"; |
15 | - | |
16 | - | |
17 | 13 | $documents = $obj->text2html(); |
18 | 14 | $source = $obj->source; |
19 | - ////////////////////////////////////////////////////////ナビゲーション | |
20 | - $navi = ""; | |
21 | - check_php();//phpのバージョンチェック | |
22 | - html_document1($ini_array,$documents); | |
23 | -} | |
24 | 15 | |
16 | + | |
17 | + html_document1($ini_array,$documents.$source); | |
18 | + | |
19 | + | |
25 | 20 | function document(){ |
26 | 21 | $document=<<<DOC |
27 | 22 | |
28 | 23 | <div> |
29 | - | |
24 | +引用:test | |
30 | 25 | text2htmlをダウンロードいただきありがとうございます。¶ |
31 | 26 | |
32 | 27 | プラグインとしても、単体でも使える「記法アプリです。」¶ |
@@ -452,7 +447,14 @@ | ||
452 | 447 | $result .= "<p>PHP{$version}では、エラーが発生します。php5を使ってください。</p>"; |
453 | 448 | |
454 | 449 | $keyword .= 'php='.urlencode($version); |
450 | + | |
451 | + echo<<<DOC | |
452 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html lang="ja" dir="ltr"><head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>Alart</title></head><body style="margin:0;"><div style="background:#fcc;padding:0.2em 3em;"><h1>てきでこ<span style="font-size:14px">text2html</span></h1><p>利用上の制約や、利用環境から、利用できないなどの問題がみつかりました。</p></div><div style="background:#fff;padding:0.2em 3em;">$result<div><div style="padding:2em;background:#eef;border:1px solid #aaf;"><a href="http://text2html.sourceforge.jp/skeleton.php?{$keyword}">もう少し詳しく</a></div></div><address><a href="http://text2html.sourceforge.jp/">http://text2html.sourceforge.jp/</a></address></div></body></html> | |
453 | +DOC; | |
454 | +exit; | |
455 | 455 | } |
456 | + | |
457 | + if(function_exists("gd_info")){ | |
456 | 458 | $version = gd_info(); |
457 | 459 | $version = $version["GD Version"]; |
458 | 460 |
@@ -460,8 +462,15 @@ | ||
460 | 462 | |
461 | 463 | $result .= "<p>GD{$version}は使えないかもしれません。GD2が使えるようにしてください。</p>"; |
462 | 464 | $keyword .= '&gd='.urlencode($version); |
465 | + | |
463 | 466 | |
464 | 467 | } |
468 | + }else{ | |
469 | + $result .= "<p>GDが使えません。このプログラムはGD2が必要です。</p>"; | |
470 | + $keyword .= '&gd=none'; | |
471 | + | |
472 | + | |
473 | + } | |
465 | 474 | |
466 | 475 | if(!function_exists("mb_convert_encoding")){ |
467 | 476 |