Exemplo n.º 1
0
var url_v = document.forms["urlform"].elements["url_text"].value;
if (url_v == "" || url_v == "{$ini_url_text}") {
\talert("{$explanation}");
\treturn false;
}
EOP;
$htm['urlform'] = <<<EOP
\t<form id="urlform" method="GET" action="{$_conf['read_php']}" target="read">
\t\t\t2chのスレURLを直接指定
\t\t\t<input id="url_text" type="text" value="{$defurl}" name="url" size="62" onFocus="this.select()">
\t\t\t<input type="submit" name="btnG" value="表\示" onClick='{$onClick_ht}'>
\t</form>

EOP;
// }}}
$bookmarkletUrl = "javascript:location='" . dirname(UriUtil::getMyUri()) . "/" . $_conf['read_php'] . "?url='+escape(location);";
//=============================================================
// HTMLプリント
//=============================================================
P2View::printDoctypeTag();
?>
<html lang="ja">
<head>
<?php 
P2View::printExtraHeadersHtml();
?>
	<title>rep2</title>
<?php 
P2View::printIncludeCssHtml('style');
//P2View::printIncludeCssHtml('first_cont');
?>
Exemplo n.º 2
0
/**
 * p2 - 携帯用インデックスをHTMLプリントする関数
 *
 * @access  public
 * @return  void
 */
function index_print_k()
{
    global $_conf, $_login;
    $menuKLinkHtmls = getIndexMenuKLinkHtmls(getIndexMenuKIni());
    $ptitle = $_conf['p2name'] . 'iPhone';
    // ログインユーザ情報
    $auth_user_ht = sprintf('<p>ログインユーザ: %s - %s</p>', hs($_login->user_u), date('Y/m/d (D) G:i:s'));
    // p2ログイン用URL
    $login_url = rtrim(dirname(UriUtil::getMyUri()), '/') . '/';
    $login_url_pc = UriUtil::buildQueryUri($login_url, array(UA::getQueryKey() => 'pc'));
    $login_url_k = UriUtil::buildQueryUri($login_url, array(UA::getQueryKey() => 'k', 'user' => $_login->user_u));
    // 前回のログイン情報
    if ($_conf['login_log_rec'] && $_conf['last_login_log_show']) {
        if (false !== ($log = P2Util::getLastAccessLog($_conf['login_log_file']))) {
            $log_hs = array_map('htmlspecialchars', $log);
            $htm['last_login'] = <<<EOP
<font color="#888888">
前回のログイン情報 - {$log_hs['date']}<br>
ユーザ:   {$log_hs['user']}<br>
IP:     {$log_hs['ip']}<br>
HOST:   {$log_hs['host']}<br>
UA:     {$log_hs['ua']}<br>
REFERER: {$log_hs['referer']}
</font>
EOP;
        }
    }
    // 古いセッションIDがキャッシュされていることを考慮して、ユーザ情報を付加しておく
    // (リファラを考慮して、つけないほうがいい場合もあるので注意)
    $narabikae_uri = UriUtil::buildQueryUri('edit_indexmenui.php', array('user' => $_login->user_u, UA::getQueryKey() => UA::getQueryValue()));
    require_once P2_LIB_DIR . '/BrdCtl.php';
    $search_form_htm = BrdCtl::getMenuKSearchFormHtml('menu_i.php');
    $body_at = P2View::getBodyAttrK();
    $hr = P2View::getHrHtmlK();
    //=========================================================
    // 携帯用 HTML出力
    //=========================================================
    P2Util::headerNoCache();
    P2View::printDoctypeTag();
    ?>
<html>
<head>
<?php 
    P2View::printExtraHeadersHtml();
    ?>
<script type="text/javascript"> 
<!-- 
window.onload = function() { 
setTimeout(scrollTo, 100, 0, 1); 
} 
// --> 
</script> 
<style type="text/css" media="screen">@import "./iui/iui.css";</style>
    <title><?php 
    eh($ptitle);
    ?>
</title>
</head>
<body>
    <div class="toolbar">
<h1 id="pageTitle"><?php 
    eh($ptitle);
    ?>
</h1>
    <a class="button" href="<?php 
    eh($narabikae_uri);
    ?>
">並替</a>
    </div>
    <ul id="home">
    <li class="group">メニュー</li>
<?php 
    P2Util::printInfoHtml();
    foreach ($menuKLinkHtmls as $v) {
        ?>
<li><?php 
        echo $v;
        ?>
</li><?php 
    }
    ?>
<li class="group">検索</li>
<?php 
    echo $search_form_htm;
    ?>
</ul>
<br>
</body>
</html>
<?php 
}
Exemplo n.º 3
0
Arquivo: info_i.php Projeto: poppen/p2
/**
 * スレタイとURLのコピペ用のフォームHTMLを取得する
 *
 * @return  string  HTML
 */
function _getCopypaFormHtml($url, $ttitle_name_hs)
{
    global $_conf;
    $url_hs = htmlspecialchars($url, ENT_QUOTES);
    $me_url = UriUtil::getMyUri();
    // $_SERVER['REQUEST_URI']
    $htm = <<<EOP
<form action="{$me_url}">
 <textarea name="copy" rows="5" cols="50">{$ttitle_name_hs}&#10;{$url_hs}</textarea>
</form>
EOP;
    // <input type="text" name="url" value="{$url_hs}">
    // <textarea name="msg_txt">{$msg_txt}</textarea><br>
    return $htm;
}
Exemplo n.º 4
0
 /**
  * HTMLポップアップ変換
  *
  * @access  private
  * @param   array|string  $url
  * @param   array|string  $attr
  * @return  string  HTML
  */
 function iframePopup($url, $str, $attr = '', $mode = NULL)
 {
     global $_conf;
     // リンク用URLとポップアップ用URL
     if (is_array($url)) {
         $link_url = $url[0];
         $pop_url = $url[1];
     } else {
         $link_url = $url;
         $pop_url = $url;
     }
     // リンク文字列とポップアップの印
     if (is_array($str)) {
         $link_str = $str[0];
         $pop_str = $str[1];
     } else {
         $link_str = $str;
         $pop_str = NULL;
     }
     $pop_url_sid = UriUtil::addSIDToUri($pop_url);
     // リンクの属性
     if (is_array($attr)) {
         $attrFor = $attr;
         $attr = '';
         foreach ($attrFor as $key => $value) {
             $attr .= sprintf(' %s="%s"', hs($key), hs($value));
         }
     } elseif ($attr !== '' && substr($attr, 0, 1) != ' ') {
         $attr = ' ' . $attr;
     }
     // リンクの属性にHTMLポップアップ用のイベントハンドラを加える
     $pop_attr = $attr;
     $pop_attr .= " onmouseover=\"showHtmlPopUp('" . hs($pop_url_sid) . "', event, " . hs($_conf['iframe_popup_delay']) . ")\"";
     $pop_attr .= " onmouseout=\"offHtmlPopUp()\"";
     // 最終調整
     if (is_null($mode)) {
         $mode = $_conf['iframe_popup'];
     }
     if ($mode == 2 && !is_null($pop_str)) {
         $mode = 3;
     } elseif ($mode == 3 && is_null($pop_str)) {
         global $skin, $STYLE;
         $custom_pop_img = "skin/{$skin}/pop.png";
         if (file_exists($custom_pop_img)) {
             $pop_img = htmlspecialchars($custom_pop_img, ENT_QUOTES);
             $x = $STYLE['iframe_popup_mark_width'];
             $y = $STYLE['iframe_popup_mark_height'];
         } else {
             $pop_img = 'img/pop.png';
             $y = $x = 12;
         }
         $pop_str = "<img src=\"{$pop_img}\" width=\"{$x}\" height=\"{$y}\" hspace=\"2\" vspace=\"0\" border=\"0\" align=\"top\">";
     }
     /*
     if (preg_match('{^http}', $link_url)) {
         $class_snap = ' class="snap_preview"';
     } else {
         $class_snap = '';
     }
     */
     // (p)IDポップアップで同じURLの連続呼び出しなら(p)にしない
     if (!empty($_GET['idpopup']) and isset($_SERVER['QUERY_STRING'])) {
         if (basename(UriUtil::getMyUri()) . '?' . $_SERVER['QUERY_STRING'] == $link_url) {
             $mode = 0;
         }
     }
     $link_url_hs = hs($link_url);
     // リンク作成
     switch ($mode) {
         // マーク無し
         case 1:
             return "<a href=\"{$link_url_hs}\"{$pop_attr}>{$link_str}</a>";
             // (p)マーク
         // (p)マーク
         case 2:
             return "(<a href=\"{$link_url_hs}\"{$pop_attr}>p</a>)<a href=\"{$link_url_hs}\"{$attr}>{$link_str}</a>";
             // [p]画像、サムネイルなど
         // [p]画像、サムネイルなど
         case 3:
             return "<a href=\"{$link_url_hs}\"{$pop_attr}>{$pop_str}</a><a href=\"{$link_url_hs}\"{$attr}>{$link_str}</a>";
             // ポップアップしない
         // ポップアップしない
         default:
             return "<a href=\"{$link_url_hs}\"{$attr}>{$link_str}</a>";
     }
 }
Exemplo n.º 5
0
Arquivo: info.php Projeto: poppen/p2
/**
 * スレタイとURLのコピペ用のフォームHTMLを取得する
 *
 * @return  string  HTML
 */
function _getCopypaFormHtml($url, $ttitle_name_hs)
{
    global $_conf;
    $url_hs = htmlspecialchars($url, ENT_QUOTES);
    $me_url = UriUtil::getMyUri();
    // $_SERVER['REQUEST_URI']
    if (UA::isK()) {
        $htm = <<<EOP
<form action="{$me_url}">
 <textarea name="copy" rows="5" cols="50">{$ttitle_name_hs}&#10;{$url_hs}</textarea>
</form>
EOP;
    } else {
        //  onMouseover="select();"
        $htm = <<<EOP
<div title="コピペ用フォーム">
<form action="{$me_url}" style="display:inline">
 <textarea name="copy" cols="56" onMouseover="select();">{$ttitle_name_hs}&#10;{$url_hs}</textarea>
</form>
</div>
EOP;
    }
    // <input type="text" name="url" value="{$url_hs}">
    // <textarea name="msg_txt">{$msg_txt}</textarea><br>
    return $htm;
}
Exemplo n.º 6
0
Arquivo: index.php Projeto: poppen/p2
/**
 * GETクエリーでurlの指定があれば、そのままスレッド読みへ飛ばす
 *
 * @return  void|exit
 */
function _locationReadPhpIfGetUrl()
{
    global $_conf;
    if (!empty($_GET['url']) || !empty($_GET['nama_url'])) {
        header(sprintf('Location: %s/%s?%s', dirname(UriUtil::getMyUri()), $_conf['read_php'], $_SERVER['QUERY_STRING']));
        exit;
    }
}
Exemplo n.º 7
0
Arquivo: Login.php Projeto: poppen/p2
 /**
  * 認証を行う
  *
  * @access  public
  * @return  void
  */
 function authorize()
 {
     global $_conf, $_p2session;
     // 認証チェック
     if (!$this->authCheck()) {
         // ログイン失敗
         require_once P2_LIB_DIR . '/login_first.inc.php';
         printLoginFirst($this);
         exit;
     }
     // 以下、ログインOKなら
     // {{{ ログアウトの指定があれば
     if (!empty($_REQUEST['logout'])) {
         // セッションをクリア(アクティブ、非アクティブを問わず)
         Session::unSession();
         // 補助認証をクリア
         $this->clearCookieAuth();
         $mobile =& Net_UserAgent_Mobile::singleton();
         if (isset($_SERVER['HTTP_X_UP_SUBNO'])) {
             $this->removeRegistedAuthCarrier('EZWEB');
         } elseif ($mobile->isSoftBank()) {
             $this->removeRegistedAuthCarrier('SOFTBANK');
             /* docomoはログイン画面が表示されるので、補助認証情報を自動破棄しない
                } elseif ($mobile->isDoCoMo()) {
                    $this->removeRegistedAuthCarrier('DOCOMO');
                */
         }
         // $user_u_q = empty($_conf['ktai']) ? '' : '?user='******'/') . '/';
         // . $user_u_q;
         header('Location: ' . $url);
         exit;
     }
     // }}}
     // {{{ セッションが利用されているなら、セッション変数の更新
     if (isset($_p2session)) {
         // ユーザ名とパスXを更新
         $_SESSION['login_user'] = $this->user_u;
         $_SESSION['login_pass_x'] = $this->pass_x;
     }
     // }}}
     // 要求があれば、補助認証を登録
     $this->registCookie();
     $this->registKtaiId();
     // 認証後はセッションを閉じる
     session_write_close();
 }
Exemplo n.º 8
0
Arquivo: title.php Projeto: poppen/p2
        login2ch();
    }
}
//=========================================================
// プリント設定
//=========================================================
// 最新版チェック
if ($_conf['updatan_haahaa']) {
    $newversion_found_html = _checkUpdatan();
} else {
    $newversion_found_html = '';
}
// ログインユーザ情報
$htm['auth_user'] = "******" . date("Y/m/d (D) G:i") . '</p>' . "\n";
// (携帯)ログイン用URL
$url = rtrim(dirname(UriUtil::getMyUri()), '/') . '/' . '?user='******'&b=k';
$htm['ktai_url'] = '<p>携帯ログイン用URL <a href="' . hs($url) . '" target="_blank">' . hs($url) . '</a></p>' . "\n";
// 前回のログイン情報
if ($_conf['login_log_rec'] && $_conf['last_login_log_show']) {
    if (false !== ($log = P2Util::getLastAccessLog($_conf['login_log_file']))) {
        $htm['log'] = array_map('htmlspecialchars', $log);
        $htm['last_login'] = <<<EOP
<div id="last_login">
前回のログイン情報 - {$htm['log']['date']}<br>
ユーザ:     {$htm['log']['user']}<br>
IP:         {$htm['log']['ip']}<br>
HOST:       {$htm['log']['host']}<br>
UA:         {$htm['log']['ua']}<br>
REFERER:    {$htm['log']['referer']}
<div>
EOP;
Exemplo n.º 9
0
/**
 * 自動更新 meta refreshタグ
 *
 * @return  void
 */
function _printMetaRereshHtml()
{
    global $_conf;
    if ($_conf['menu_refresh_time']) {
        $refresh_time_s = $_conf['menu_refresh_time'] * 60;
        $qs = array('shownew' => 1, UA::getQueryKey() => UA::getQueryValue());
        if (defined('SID') && strlen(SID)) {
            $qs[session_name()] = session_id();
        }
        $refresh_url = UriUtil::buildQueryUri(UriUtil::getMyUri(), $qs);
        ?>
<meta http-equiv="refresh" content="<?php 
        eh($refresh_time_s);
        ?>
;URL=<?php 
        eh($refresh_url);
        ?>
">
        <?php 
    }
}
Exemplo n.º 10
0
Arquivo: P2Util.php Projeto: poppen/p2
 function getMyUrl($with_get = false, $add_get = null, $add_sid = false, $sepa = '&')
 {
     return UriUtil::getMyUri($with_get, $add_get, $add_sid, $sepa);
 }
Exemplo n.º 11
0
<body onLoad="top.document.title=self.document.title;"<?php 
echo P2View::getBodyAttrK();
?>
>
<?php 
// PC用表示
if (UA::isPC() || UA::isIPhoneGroup()) {
    ?>
<p id="pan_menu"><a href="<?php 
    eh($_conf['editpref_php']);
    ?>
">設定管理</a> &gt; <?php 
    eh($ptitle);
    ?>
 (<a href="<?php 
    eh(UriUtil::getMyUri(false, null, $add_sid = true));
    ?>
">リロード</a>)</p>
<?php 
}
// PC用表示
if (UA::isPC()) {
    $htm['form_submit'] = <<<EOP
        <tr class="group">
            <td colspan="3" align="center">
                <input type="submit" name="submit_save" value="変更を保存する">
                <input type="submit" name="submit_default" value="デフォルトに戻す" onClick="if (!window.confirm('ユーザ設定をデフォルトに戻してもよろしいですか?(やり直しはできません)')) {return false;}"><br>
            </td>
        </tr>

EOP;