1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

读取NFO信息的php代码。

本帖由 小叶2006-02-16 发布。版面名称:后端开发

  1. 小叶

    小叶 New Member

    注册:
    2005-09-04
    帖子:
    17,941
    赞:
    33
    PHP:
    <?php
    $nfo 
    =$_GET['nfo'];
    $nfodata file_get_contents($nfo.".nfo");
    require_once(
    "nfo2html.php");
    $nfodata nfo2html($nfodata);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>nfo file</title>
        <style type="text/css">
            @font-face {
                font-family: nfo;
                font-style:  normal;
                font-weight: normal;
                src: url(/nfo.eot);
            }
            .nfo {
                padding: 12px;
                font-family: nfo, courier new;
                font-size: 11px;
                line-height: 1em;
            }
        </style>
    </head>
    <body>
        <pre class="nfo"><?=str_replace("\r"""$nfodata)?></pre>
        <div class="nfo" style="background-color: #000; color: #fff"><?=str_replace("\n""<br />"str_replace(" ""&nbsp;"$nfodata))?></div>
    </body>
    </html>
     
  2. Henry

    Henry New Member

    注册:
    2005-09-04
    帖子:
    1,166
    赞:
    4
    where is nfo2html.php ?
     
  3. 小叶

    小叶 New Member

    注册:
    2005-09-04
    帖子:
    17,941
    赞:
    33
    少了个文件。。抱歉。。
     
  4. 小叶

    小叶 New Member

    注册:
    2005-09-04
    帖子:
    17,941
    赞:
    33
    nfo2html.php

    PHP:
    <?php
    /**
    * NFO TO HTML
    *
    * Special thanks to ibic@9down
    * @author: andot([email protected]) & legend([email protected])
    * @link: http://www.ugia.cn/?p=55, http://www.ugia.cn/?p=49
    * @description: convert .nfo file to html
    * @version: 2.0
    */
    /* Copyright 2005 andot & legend (email : [email protected] & [email protected])
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    */
    $conv_table = array(
    /* 0*/ 0x00000x263a0x263b0x26650x2666,
    /* 5*/ 0x26630x26600x20220x25d80x0000,
    /* 10*/ 0x00000x26420x26400x00000x266b,
    /* 15*/ 0x263c0x25ba0x25c40x21950x203c,
    /* 20*/ 0x00b60x00a70x25ac0x21a80x2191,
    /* 25*/ 0x21930x21920x21900x221f0x2194,
    /* 30*/ 0x25b20x25bc0x00000x00000x0022,
    /* 35*/ 0x00000x00000x00000x00000x0027,
    /* 40*/ 0x00000x00000x00000x00000x0000,
    /* 45*/ 0x00000x00000x00000x00000x0000,
    /* 50*/ 0x00000x00000x00000x00000x0000,
    /* 55*/ 0x00000x00000x00000x00000x0000,
    /* 60*/ 0x003c0x00000x00000x00000x0000,
    /* 65*/ 0x00000x00000x00000x00000x0000,
    /* 70*/ 0x00000x00000x00000x00000x0000,
    /* 75*/ 0x00000x00000x00000x00000x0000,
    /* 80*/ 0x00000x00000x00000x00000x0000,
    /* 85*/ 0x00000x00000x00000x00000x0000,
    /* 90*/ 0x00000x00000x00000x00000x0000,
    /* 95*/ 0x00000x00000x00000x00000x0000,
    /*100*/ 0x00000x00000x00000x00000x0000,
    /*105*/ 0x00000x00000x00000x00000x0000,
    /*110*/ 0x00000x00000x00000x00000x0000,
    /*115*/ 0x00000x00000x00000x00000x0000,
    /*120*/ 0x00000x00000x00000x00000x0000,
    /*125*/ 0x00000x00000x23020x00c70x00fc,
    /*130*/ 0x00e90x00e20x00e40x00e00x00e5,
    /*135*/ 0x00e70x00ea0x00eb0x00e80x00ef,
    /*140*/ 0x00ee0x00ec0x00c40x00c50x00c9,
    /*145*/ 0x00e60x00c60x00f40x00f60x00f2,
    /*150*/ 0x00fb0x00f90x00ff0x00d60x00dc,
    /*155*/ 0x00a20x00a30x00a50x20a70x0192,
    /*160*/ 0x00e10x00ed0x00f30x00fa0x00f1,
    /*165*/ 0x00d10x00aa0x00ba0x00bf0x2310,
    /*170*/ 0x00ac0x00bd0x00bc0x00a10x00ab,
    /*175*/ 0x00bb0x25910x25920x25930x2502,
    /*180*/ 0x25240x25610x25620x25560x2555,
    /*185*/ 0x25630x25510x25570x255d0x255c,
    /*190*/ 0x255b0x25100x25140x25340x252c,
    /*195*/ 0x251c0x25000x253c0x255e0x255f,
    /*200*/ 0x255a0x25540x25690x25660x2560,
    /*205*/ 0x25500x256c0x25670x25680x2564,
    /*210*/ 0x25650x25590x25580x25520x2553,
    /*215*/ 0x256b0x256a0x25180x250c0x2588,
    /*220*/ 0x25840x258c0x25900x25800x03b1,
    /*225*/ 0x03b20x03930x03c00x03a30x03c3,
    /*230*/ 0x03bc0x03c40x03a60x03b80x2126,
    /*235*/ 0x03b40x221e0x00f80x03b50x2229,
    /*240*/ 0x22610x00b10x22650x22640x2320,
    /*245*/ 0x23210x00f70x22480x00b00x00b7,
    /*250*/ 0x02d90x221a0x207f0x00b20x25a0,
    /*255*/ 0x00a0
    );
    /*
    function nfo2html($str) {
    global $conv_table;
    for ($i = 0; $i < strlen($str); $i ++) {
    $asc = ord($str[$i]);
    $output .= ($conv_table[$asc]) ? "&#".$conv_table[$asc].";" : $str[$i];
    }
    return $output;
    }
    */
    function nfo2html($str) {
    global 
    $conv_table;
    $str str_replace("&""&"$str);
    for (
    $i 0$i 256$i++) {
    if (
    $conv_table[$i] != 0) {
    $str str_replace(chr($i), "&#".$conv_table[$i].";"$str);
    }
    }
    return 
    $str;
    }
    ?>
     
  5. greatqsh

    greatqsh New Member

    注册:
    2005-09-16
    帖子:
    142
    赞:
    1
    有错误!!!:mummy:
     
  6. wm_chief

    wm_chief New Member

    注册:
    2005-09-05
    帖子:
    17,890
    赞:
    46
    哦,有啥用