<commit_before><?php
/**
 * rep2 - CfbNXy[W
 */

require_once './conf/conf.inc.php';

$_login->authorize(); //[UF

//=============================================================
// O
//=============================================================
// ANZXۗp.htaccessf[^fBNgɍ쐬
makeDenyHtaccess($_conf['pref_dir']);
makeDenyHtaccess($_conf['dat_dir']);
makeDenyHtaccess($_conf['idx_dir']);

//=============================================================

$me_url = P2Util::getMyUrl();
$me_dir_url = dirname($me_url);
$me_url_b = htmlspecialchars(rtrim($me_dir_url, '/') . '/?b=', ENT_QUOTES);

if ($_conf['ktai']) {

    //=========================================================
    // gїp CfbNX
    //=========================================================
    // urlw肪΁Â܂܃Xbhǂ݂֔΂
    if (!empty($_GET['url']) || !empty($_GET['nama_url'])) {
        header('Location: '.$me_dir_url.'/read.php?'.$_SERVER['QUERY_STRING']);
        exit;
    }
    if ($_conf['iphone']) {
        include P2_BASE_DIR . '/menu_i.php';
        exit;
    }
    require_once P2_LIB_DIR . '/index_print_k.inc.php';
    index_print_k();

} else {
    //=========================================
    // PCp ϐ
    //=========================================
    $title_page = "title.php";

    if (!empty($_GET['url']) || !empty($_GET['nama_url'])) {
        $htm['read_page'] = "read.php?".$_SERVER['QUERY_STRING'];
    } else {
        if (!empty($_conf['first_page'])) {
            $htm['read_page'] = $_conf['first_page'];
        } else {
            $htm['read_page'] = 'first_cont.php';
        }
    }

    $sidebar = !empty($_GET['sidebar']);

    $ptitle = "rep2";
    //======================================================
    // PCp HTMLvg
    //======================================================
    //P2Util::header_nocache();
    if ($_conf['doctype']) { 
        echo str_replace(
            array('Transitional', 'loose.dtd'),
            array('Frameset', 'frameset.dtd'),
            $_conf['doctype']);
    }
    echo <<<EOHEADER
<html lang="ja">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
    {$_conf['extra_headers_ht']}
    <title>{$ptitle}</title>
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
</head>\n
EOHEADER;

    if (!$sidebar) {
        echo <<<EOMENUFRAME
<frameset id="menuframe" cols="{$_conf['frame_menu_width']},*" border="1">
    <frame src="menu.php" id="menu" name="menu" scrolling="auto" frameborder="1">\n
EOMENUFRAME;
    }

    echo <<<EOMAINFRAME
    <frameset id="mainframe" rows="{$_conf['frame_subject_width']},{$_conf['frame_read_width']}" border="2">
        <frame src="{$title_page}" id="subject" name="subject" scrolling="auto" frameborder="1">
        <frame src="{$htm['read_page']}" id="read" name="read" scrolling="auto" frameborder="1">
    </frameset>\n
EOMAINFRAME;

    if (!$sidebar) {
        echo <<<EONOFRAMES
</frameset>
<noframes>
    <body>
        <h1>{$ptitle}</h1>
        <ul>
            <li>@gїpURL: <a href="{$me_url_b}k">{$me_url_b}k</a></li>
            <li>iPhonepURL: <a href="{$me_url_b}i">{$me_url_b}i</a></li>
        </ul>
    </body>
</noframes>\n
EONOFRAMES;
    }

    echo '</html>';
}

// {{{ makeDenyHtaccess()

/**
 * fBNgɁiANZXۂ̂߂́j .htaccess Ȃ΁AŐ<commit_msg>expack: - Hacked frame element attributes for IE8 beta.<commit_after><?php
/**
 * rep2 - CfbNXy[W
 */

require_once './conf/conf.inc.php';

$_login->authorize(); //[UF

//=============================================================
// O
//=============================================================
// ANZXۗp.htaccessf[^fBNgɍ쐬
makeDenyHtaccess($_conf['pref_dir']);
makeDenyHtaccess($_conf['dat_dir']);
makeDenyHtaccess($_conf['idx_dir']);

//=============================================================

$me_url = P2Util::getMyUrl();
$me_dir_url = dirname($me_url);
$me_url_b = htmlspecialchars(rtrim($me_dir_url, '/') . '/?b=', ENT_QUOTES);

if ($_conf['ktai']) {

    //=========================================================
    // gїp CfbNX
    //=========================================================
    // urlw肪΁Â܂܃Xbhǂ݂֔΂
    if (!empty($_GET['url']) || !empty($_GET['nama_url'])) {
        header('Location: '.$me_dir_url.'/read.php?'.$_SERVER['QUERY_STRING']);
        exit;
    }
    if ($_conf['iphone']) {
        include P2_BASE_DIR . '/menu_i.php';
        exit;
    }
    require_once P2_LIB_DIR . '/index_print_k.inc.php';
    index_print_k();

} else {
    //=========================================
    // PCp ϐ
    //=========================================
    $title_page = "title.php";

    if (!empty($_GET['url']) || !empty($_GET['nama_url'])) {
        $htm['read_page'] = "read.php?".$_SERVER['QUERY_STRING'];
    } else {
        if (!empty($_conf['first_page'])) {
            $htm['read_page'] = $_conf['first_page'];
        } else {
            $htm['read_page'] = 'first_cont.php';
        }
    }

    $sidebar = !empty($_GET['sidebar']);

    if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8') !== false) {
        $htm['border_style_h'] = '';
        $htm['border_style_v'] = '';
    } else {
        $htm['border_style_h'] = 'border="2"';
        $htm['border_style_v'] = 'border="1"';
    }

    $ptitle = "rep2";
    //======================================================
    // PCp HTMLvg
    //======================================================
    //P2Util::header_nocache();
    if ($_conf['doctype']) { 
        echo str_replace(
            array('Transitional', 'loose.dtd'),
            array('Frameset', 'frameset.dtd'),
            $_conf['doctype']);
    }
    echo <<<EOHEADER
<html lang="ja">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
    {$_conf['extra_headers_ht']}
    <title>{$ptitle}</title>
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
</head>\n
EOHEADER;

    if (!$sidebar) {
        echo <<<EOMENUFRAME
<frameset id="menuframe" cols="{$_conf['frame_menu_width']},*" {$htm['border_style_v']}>
    <frame src="menu.php" id="menu" name="menu" scrolling="auto">\n
EOMENUFRAME;
    }

    echo <<<EOMAINFRAME
    <frameset id="mainframe" rows="{$_conf['frame_subject_width']},{$_conf['frame_read_width']}" {$htm['border_style_h']}>
        <frame src="{$title_page}" id="subject" name="subject" scrolling="auto">
        <frame src="{$htm['read_page']}" id="read" name="read" scrolling="auto">
    </frameset>\n
EOMAINFRAME;

    if (!$sidebar) {
        echo <<<EONOFRAMES
</frameset>
<noframes>
    <body>
        <h1>{$ptitle}</h1>
        <ul>
            <li>@gїpURL: <a href="{$me_url_b}k">{$me_url_b}k</a></li>
            <li>iPhonepURL: <a href="{$me_url_b}i">{$me_url_b}i</a></li>
        </ul>
    </body>
</noframes>\n
EONOFRAMES;
    }

    echo '</html>';
}

// {{{ makeDenyHtaccess()

/**
 * fBNgɁiANZXۂ̂߂́j .htaccess Ȃ΁AŐ
{'fraction_non_alphanumeric': 0.33190087380031513, 'fraction_numerical': 0.003867640739149119, 'mean_word_length': 3.6671122994652405, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '552509', 'n_tokens_mistral': 2516, 'n_tokens_neox': 2410, 'n_words': 329}