num; // ページ番号を取得します。 $page_no = $_GET["page_no"]; // print $page_no; if( preg_match( "/([0-9][0-9])([0-9][0-9])/", $page_no, $ms ) == FALSE ) { print "エラー"; } // 章番号とページ番号。 $chapter_no = $ms[1]; $page_no = $ms[2]; // この章の情報を取得します。 $current_xml = @simplexml_load_file( $chapter_no.".xml" ); // 読み込めなかったらエラー。 if( $current_xml == FALSE ) { Error404( $dots ); } // ページ番号がおかしかったらエラー。 if ( ( 0 + $page_no ) <= 0 || $current_xml->num < ( 0 + $page_no ) ) { Error404( $dots ); } // ひとつ前の章番号とページ番号を取得します。 $chapter_before_no = $chapter_no; $page_before_no = 0 + $page_no - 1; if( $page_before_no == 0 ) { $chapter_before_no = 0 + $chapter_no; --$chapter_before_no; if( $chapter_before_no !== -1 ) { $chapter_before_no = add_zero( $chapter_before_no ); $temp_xml = simplexml_load_file( $chapter_before_no.".xml" ); $page_before_no = 0 + $temp_xml->num; } } $page_before_no = add_zero( $page_before_no ); // ひとつ先の章番号とページ番号を取得します。 $chapter_next_no = $chapter_no; $page_next_no = 0 + $page_no + 1; if( $page_next_no > ( 0 + $current_xml->num ) ) { $chapter_next_no = 0 + $chapter_no; ++$chapter_next_no; if( $chapter_next_no <= $CHAPTER_MAX ) { $chapter_next_no = add_zero( $chapter_next_no ); $page_next_no = 1; } else { $chapter_next_no = -1; } } $page_next_no = add_zero( $page_next_no ); // この章のタイトルを取得します。 $title = $current_xml->title; $title = mb_convert_encoding( $title, "SJIS", "UTF-8" ); // この章の本文を取得します。 $text = $current_xml->pages[0]->page[0 + $page_no - 1]->text; $text = fromxml( $text ); $text = substr( $text, 1 ); // 本文の単語を置き換えます。 $word_xml = simplexml_load_file( "word.xml" ); $words = word_xml_convert_to_words( $word_xml ); $words = words_sort( $words ); $text = words_replace( $text, $words, 'Word/' ); $text = nl2br( $text ); // Amazon広告を取得します。 // $amazon_best_seller = get_random_amazon_ad(); // $amazons = $amazon_best_seller->AMAZON_BEST_SELLERS; // $search_index_title = $amazon_best_seller->BROWSE_NODE_LIST->TITLE; // $amazons = replace_now_printing( $amazons ); ?> Machician - <?= $title ?>(<?= 0 + $page_no ?>)
KAB-studio > Machician > ()
Machician - ()
<< << □ >> >>
 検索
"; } */ ?>