本文整理汇总了PHP中geti函数的典型用法代码示例。如果您正苦于以下问题:PHP geti函数的具体用法?PHP geti怎么用?PHP geti使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了geti函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _getCookieLocationUri
/**
* @return string
*/
function _getCookieLocationUri()
{
$qs = array('check_regist_cookie' => '1', 'regist_cookie' => intval(geti($_REQUEST['regist_cookie'])), UA::getQueryKey() => UA::getQueryValue());
if (defined('SID') && strlen(SID)) {
$qs[session_name()] = session_id();
}
return $next_uri = UriUtil::buildQueryUri('login.php', $qs);
}
开发者ID:poppen,项目名称:p2,代码行数:11,代码来源:cookie.php
示例2: setPalace
/**
* スレを殿堂入りにセットする関数
*
* $set は、0(解除), 1(追加), top, up, down, bottom
*
* @access public
* @return boolean
*/
function setPalace($host, $bbs, $key, $set)
{
global $_conf;
$idxfile = P2Util::getKeyIdxFilePath($host, $bbs, $key);
// 既に key.idx データがあるなら読み込む
if (file_exists($idxfile) and $lines = file($idxfile)) {
$l = rtrim($lines[0]);
$data = explode('<>', $l);
}
if (false === FileCtl::make_datafile($_conf['palace_file'], $_conf['palace_perm'])) {
return false;
}
if (false === ($pallines = file($_conf['palace_file']))) {
return false;
}
$newlines = array();
$before_line_num = 0;
// {{{ 最初に重複要素を削除しておく
if (!empty($pallines)) {
$i = -1;
foreach ($pallines as $l) {
$i++;
$l = rtrim($l);
$lar = explode('<>', $l);
// 重複回避
if ($lar[1] == $key && $lar[11] == $bbs) {
$before_line_num = $i;
// 移動前の行番号をセット
continue;
// keyのないものは不正データなのでスキップ
} elseif (!$lar[1]) {
continue;
} else {
$newlines[] = $l;
}
}
}
// }}}
if (!empty($GLOBALS['brazil'])) {
//$newlines = _removeLargePallistData($newlines);
}
// 新規データ設定
if ($set) {
$newdata = implode('<>', array(geti($data[0]), $key, geti($data[2]), geti($data[3]), geti($data[4]), geti($data[5]), geti($data[6]), geti($data[7]), geti($data[8]), geti($data[9]), $host, $bbs));
require_once P2_LIB_DIR . '/getSetPosLines.func.php';
$rec_lines = getSetPosLines($newlines, $newdata, $before_line_num, $set);
} else {
$rec_lines = $newlines;
}
if (false === FileCtl::filePutRename($_conf['palace_file'], $rec_lines ? implode("\n", $rec_lines) . "\n" : '')) {
trigger_error(sprintf('p2 error: %s(), FileCtl::filePutRename() failed.', __FUNCTION__), E_USER_WARNING);
return false;
}
return true;
}
开发者ID:poppen,项目名称:p2,代码行数:63,代码来源:setPalace.func.php
示例3: foreach
}
// }}}
// カテゴリをHTML表示
if ($get['view'] == 'cate' or isset($_REQUEST['word']) && !strlen($GLOBALS['word'])) {
//echo "板リスト{$hr}";
if ($brd_menus) {
foreach ($brd_menus as $a_brd_menu) {
$aShowBrdMenuK->printCate($a_brd_menu->categories);
}
}
}
// カテゴリの板をHTML表示
if (isset($_GET['cateid'])) {
if ($brd_menus) {
foreach ($brd_menus as $a_brd_menu) {
$aShowBrdMenuK->printIta($a_brd_menu->categories);
}
}
$modori_url_ht = P2View::tagA(UriUtil::buildQueryUri($_conf['menu_k_php'], array('view' => 'cate', 'nr' => '1', UA::getQueryKey() => UA::getQueryValue())), '板リスト') . '<br>';
}
P2Util::printInfoHtml();
// フッタをHTML表示
echo geti($GLOBALS['list_navi_ht']);
?>
<p><a id="backButton"class="button" href="<?php
eh($index_uri);
?>
">TOP</a></p>
</body></html>
<?php
exit;
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:menu_i.php
示例4: define
define('P2_READ_FILTER_WRAPPER', 1);
require_once './conf/conf.inc.php';
require_once P2_LIB_DIR . '/Thread.php';
require_once P2_LIB_DIR . '/ThreadRead.php';
$_login->authorize();
// ユーザ認証
//=====================================================
// 変数の設定
//=====================================================
$host = geti($_GET['host']);
$bbs = geti($_GET['bbs']);
$key = geti($_GET['key']);
$rc = geti($_GET['rc']);
$ttitle_en = geti($_GET['ttitle_en']);
$resnum = geti($_GET['resnum']);
$field = geti($_GET['field']);
$itaj = P2Util::getItaName($host, $bbs);
if (!$itaj) {
$itaj = $bbs;
}
$ttitle_name = base64_decode($ttitle_en);
$GLOBALS['popup_filter'] = 1;
// 対象レスの対象フィールドから、検索ワードを取得する
$_GET['word'] = _getReadFilterWord($host, $bbs, $key, $resnum, $field);
// read.phpに処理を渡す
include $_conf['read_php'];
//===========================================================================
// 関数(このファイル内でのみ利用)
//===========================================================================
/**
* 対象レスの対象フィールドから、検索ワードを取得する
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:read_filter.php
示例5: _setFavToKeyIdx
/**
* @access private
* @return array 読み込んだkeyデータ
*/
function _setFavToKeyIdx($host, $bbs, $key, $setfav)
{
$idxfile = P2Util::getKeyIdxFilePath($host, $bbs, $key);
// FileCtl::mkdirFor($idxfile);
$data = array();
// 既にidxデータがあるなら読み込む
if (file_exists($idxfile) and $lines = file($idxfile)) {
$l = rtrim($lines[0]);
$data = explode('<>', $l);
}
// スレッド.idx 記録
if ($setfav == '0' || $setfav == '1') {
// お気にスレから外した結果、idxの意味がなくなれば削除する
if ($setfav == '0' and empty($data[3]) && empty($data[4]) && geti($data[9]) <= 1) {
@unlink($idxfile);
} else {
P2Util::recKeyIdx($idxfile, array(geti($data[0]), $key, geti($data[2]), geti($data[3]), geti($data[4]), geti($data[5]), $setfav, geti($data[7]), geti($data[8]), geti($data[9]), $host, $bbs, geti($data[12])));
}
}
return $data;
}
开发者ID:poppen,项目名称:p2,代码行数:25,代码来源:setFav.func.php
示例6: array
/**
* p2 - デザイン用 設定ファイル
*
* 黒板風スキン
*
* コメント冒頭の() 内はデフォルト値
* 設定は style/*_css.inc と連動
*/
// ("2") リンクに下線を(つける:0, つけない:1, スレタイトル一覧だけつけない:2)
$STYLE['a_underline_none'] = "2";
// {{{ フォント
// Mac用フォントファミリー
if (strstr(geti($_SERVER['HTTP_USER_AGENT']), 'Mac')) {
// ブラウザが Macで Safari等の WebKitを使っているものなら
if (strstr(geti($_SERVER['HTTP_USER_AGENT']), "AppleWebKit")) {
// ("Hiragino Kaku Gothic Pro") 基本のフォント for Safari
$STYLE['fontfamily'] = array("Comic Sans MS", "Hiragino Maru Gothic Pro");
// ("") 基本ボールド用フォント for Safari(普通の太字より太くしたい場合は"Hiragino Kaku Gothic Std")
$STYLE['fontfamily_bold'] = array("Arial Black", "Hiragino Kaku Gothic Std");
} else {
// ("ヒラギノ角ゴ Pro W3") 基本のフォント
$STYLE['fontfamily'] = array("Comic Sans MS", "ヒラギノ丸ゴ Pro W4");
// ("ヒラギノ角ゴ Pro W6") 基本ボールド用フォント(普通に太字にしたい場合は指定しない(""))
$STYLE['fontfamily_bold'] = array("Arial Black", "ヒラギノ角ゴ Std W8");
}
}
// }}}
/**
* 色彩の設定
*
开发者ID:poppen,项目名称:p2,代码行数:30,代码来源:blackboard.php
示例7: _detectThread
/**
* スレッドを指定する
*
* @return array|false
*/
function _detectThread()
{
global $_conf;
$ls = null;
$url = null;
// スレURLの直接指定
if (($url = geti($_GET['nama_url'])) || ($url = geti($_GET['url']))) {
$url = trim($url);
// 2ch or pink http://choco.2ch.net/test/read.cgi/event/1027770702/
if (preg_match('{http://([^/]+\\.(2ch\\.net|bbspink\\.com|machibbs\\.com|machi\\.to))/test/read\\.cgi/([^/]+)/([0-9]+)/?([^/]+)?}', $url, $matches)) {
$host = $matches[1];
$bbs = $matches[3];
$key = $matches[4];
$ls = geti($matches[5]);
// c-docomo c-au c-other http://c-au.2ch.net/test/--3!mail=sage/operate/1159594301/519-n
} elseif (preg_match('{http://((c-docomo|c-au|c-other)\\.2ch\\.net)/test/([^/]+)/([^/]+)/([0-9]+)/?([^/]+)?}', $url, $m)) {
require_once P2_LIB_DIR . '/BbsMap.php';
if ($mapped_host = BbsMap::get2chHostByBbs($m[4])) {
$host = $mapped_host;
$bbs = $m[4];
$key = $m[5];
$ls = geti($m[6]);
}
// 2ch, pink, vip2ch.com 過去ログhtml - http://pc.2ch.net/mac/kako/1015/10153/1015358199.html
} elseif (preg_match('{(http://([^/]+\\.(2ch\\.net|bbspink\\.com|vip2ch\\.com))(/[^/]+)?/([^/]+)/kako/\\d+(/\\d+)?/(\\d+)).html}', $url, $matches)) {
$host = $matches[2];
$bbs = $matches[5];
$key = $matches[7];
$kakolog_uri = $matches[1];
$_GET['kakolog'] = $kakolog_uri;
// 新まちBBS http://tohoku.machi.to/bbs/read.cgi/touhoku/1179407635/l50
} elseif (preg_match('{http://([^/]+\\.(2ch\\.net|bbspink\\.com|machibbs\\.com|machi\\.to))/bbs/read\\.cgi/([^/]+)/([0-9]+)/?([^/]+)?}', $url, $matches)) {
$host = $matches[1];
$bbs = $matches[3];
$key = $matches[4];
$ls = geti($matches[5]);
// (旧)まちBBS http://kanto.machibbs.com/bbs/read.pl?BBS=kana&KEY=1034515019
} elseif (preg_match('{http://([^/]+\\.machibbs\\.com|[^/]+\\.machi\\.to)/bbs/read\\.(pl|cgi)\\?BBS=([^&]+)&KEY=([0-9]+)(&START=([0-9]+))?(&END=([0-9]+))?[^\\"]*}', $url, $matches)) {
$host = $matches[1];
$bbs = $matches[3];
$key = $matches[4];
$ls = geti($matches[6]) . '-' . geti($matches[8]);
// したらばJBBS(旧まちBBSと類似形式)
} elseif (preg_match('{http://((jbbs\\.livedoor\\.jp|jbbs\\.livedoor.com|jbbs\\.shitaraba\\.com)(/[^/]+)?)/bbs/read\\.(pl|cgi)\\?BBS=([^&]+)&KEY=([0-9]+)(&START=([0-9]+))?(&END=([0-9]+))?[^"]*}', $url, $matches)) {
$host = $matches[1];
$bbs = $matches[5];
$key = $matches[6];
$ls = geti($matches[8]) . '-' . geti($matches[10]);
// したらばJBBS(2ch類似形式) http://jbbs.livedoor.com/bbs/read.cgi/computer/2999/1081177036/-100
} elseif (preg_match('{http://(jbbs\\.livedoor\\.jp|jbbs\\.livedoor.com|jbbs\\.shitaraba\\.com)/bbs/read\\.cgi/(\\w+)/(\\d+)/(\\d+)/((\\d+)?-(\\d+)?)?[^"]*}', $url, $matches)) {
$host = $matches[1] . '/' . $matches[2];
$bbs = $matches[3];
$key = $matches[4];
$ls = geti($matches[5]);
// チャットちゃんねる http://cha2.net/cgi-bin/test/read.cgi/anitoku/1241688251/l50
} elseif (preg_match('{http://(cha2\\.net)/cgi-bin/test/read\\.cgi/(\\w+)/(\\d+)/?([^/]+)?}', $url, $matches)) {
$host = $matches[1];
$bbs = $matches[2];
$key = $matches[3];
$ls = geti($matches[4]);
// 外部板 read.cgi 形式 http://ex14.vip2ch.com/test/read.cgi/operate/1161701941/
} elseif (preg_match('{http://([^/]+)/test/read\\.cgi/(\\w+)/(\\d+)/?([^/]+)?}', $url, $matches)) {
$host = $matches[1];
$bbs = $matches[2];
$key = $matches[3];
$ls = geti($matches[4]);
}
} else {
!empty($_GET['host']) and $host = $_GET['host'];
// "pc.2ch.net"
!empty($_POST['host']) and $host = $_POST['host'];
isset($_GET['bbs']) and $bbs = $_GET['bbs'];
// "php"
isset($_POST['bbs']) and $bbs = $_POST['bbs'];
isset($_GET['key']) and $key = $_GET['key'];
// "1022999539"
isset($_POST['key']) and $key = $_POST['key'];
!empty($_GET['ls']) and $ls = $_GET['ls'];
// "all"
!empty($_POST['ls']) and $ls = $_POST['ls'];
}
if (empty($host) || !isset($bbs) || !isset($key)) {
$err = $_conf['read_php'] . ' スレッドの指定が変です。';
$msg = null;
if ($url) {
if (preg_match('/^http/', $url)) {
$msg = sprintf('<a href="%1$s">%1$s</a>', hs($url));
} else {
$msg = hs($url);
}
}
p2die($err, $msg);
}
if (P2Validate::host($host) || P2Validate::bbs($bbs) || P2Validate::key($key)) {
p2die('不正な引数です');
//.........这里部分代码省略.........
开发者ID:poppen,项目名称:p2,代码行数:101,代码来源:read.php
示例8: getMd5CryptPassForCid
/**
* md5_encrypt, md5_decrypt のための password(salt) を得る
* (クッキーのcidの生成に利用している)
*
* @static
* @access private
* @return string
*/
function getMd5CryptPassForCid()
{
//return md5($_SERVER['SERVER_NAME'] . $_SERVER['HTTP_USER_AGENT'] . $_SERVER['SERVER_SOFTWARE']);
//$seed = $_SERVER['SERVER_NAME'] . $_SERVER['SERVER_SOFTWARE'];
$seed = $_SERVER['SERVER_SOFTWARE'];
require_once P2_LIB_DIR . '/HostCheck.php';
// ローカルチェックをして、HostCheck::isAddrDocomo() などでホスト名を引く機会を減らす
$notK = (bool) (HostCheck::isAddrLocal() || HostCheck::isAddrPrivate());
// 携帯判定された場合は、 IPチェックなし
if (!$notK and UA::isK(geti($_SERVER['HTTP_USER_AGENT'])) || HostCheck::isAddrDocomo() || HostCheck::isAddrAu() || HostCheck::isAddrSoftBank() || HostCheck::isAddrWillcom() || HostCheck::isAddrJigWeb() || HostCheck::isAddrJig() || HostCheck::isAddrIbis()) {
} elseif (!empty($_COOKIE['ignore_cip'])) {
} else {
$now_ips = explode('.', $_SERVER['REMOTE_ADDR']);
$seed .= $now_ips[0];
}
return md5($seed);
}
开发者ID:poppen,项目名称:p2,代码行数:25,代码来源:Login.php
示例9: _printCss
<?php
// p2 - スタイルシートを外部スタイルシートとして出力する
/*
<link rel="stylesheet" type="text/css" href="css.php?css=style&user=nanashi&skin=">
<link rel="stylesheet" type="text/css" href="css.php?css=read&user=nanashi&skin=">
*/
require_once './conf/conf.inc.php';
//$_login->authorize(); // ユーザ認証
// 妥当なCSSファイル指定か検証して取得する
if (!isset($_GET['css']) or !($cssFilePath = _getValidCssFilePath($_GET['css']))) {
exit;
}
// CSS出力
_printCss($cssFilePath, geti($_GET['skin']));
exit;
//===============================================================================
// 関数(このファイル内でのみ利用)
//===============================================================================
/**
* @return void CSS出力
*/
function _printCss($cssFilePath, $skin = null)
{
global $_conf, $STYLE, $MYSTYLE;
/*
// クエリにユニークキーを埋め込んでいるいるので、キャッシュさせてよい
// ノーマルp2ではまだ含んでないよ
$now = time();
header('Expires: ' . http_date($now + 3600));
header('Last-Modified: ' . http_date($now));
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:css.php
示例10: _isThreTateSugi
/**
* スレ立てしすぎならtrueを返す
*/
function _isThreTateSugi()
{
global $_conf;
if (!file_exists($_conf['p2_res_hist_dat_secu']) or !($lines = file($_conf['p2_res_hist_dat_secu']))) {
return false;
}
$lines = array_reverse($lines);
$count = 0;
$check_time = 60 * 60 * 1;
// 1h
$limit = 6;
foreach ($lines as $v) {
// $from, $mail, date("y/m/d H:i"), $message, $ttitle, $host, $bbs, $key, $resnum, $_SERVER['REMOTE_ADDR']
$e = explode('<>', $v);
$key = geti($e[7]);
$time_str = '20' . $e[2];
// $e[2] -> 07/12/21 09:27
//echo '<br>';
// チェックする時間
if (strtotime($time_str) < time() - $check_time) {
break;
}
// スレ立てなら
if (!$key) {
++$count;
if ($count > $limit) {
return true;
}
}
}
return false;
}
开发者ID:poppen,项目名称:p2,代码行数:35,代码来源:post.php
示例11: geti
<?php
/* vim: set fileencoding=cp932 ai et ts=4 sw=4 sts=0 fdm=marker: */
/* mi: charset=Shift_JIS */
// p2 - 携帯版レスフィルタリング
require_once './conf/conf.inc.php';
require_once P2_LIB_DIR . '/P2Validate.php';
$_login->authorize();
// ユーザ認証
// {{{ スレッド情報
$host = geti($_GET['host']);
$bbs = geti($_GET['bbs']);
$key = geti($_GET['key']);
$ttitle_hc = P2Util::htmlEntityDecodeLite(base64_decode(geti($_GET['ttitle_en'])));
$ttitle_back_ht = isset($_SERVER['HTTP_REFERER']) ? '<a href="' . hs($_SERVER['HTTP_REFERER']) . '" title="戻る">' . hs($ttitle_hc) . '</a>' : hs($ttitle_hc);
if (P2Validate::host($host) || P2Validate::bbs($bbs) || P2Validate::key($key)) {
p2die('不正な引数です');
}
// }}}
// {{{ 前回フィルタ値読み込み
$cachefile = $_conf['pref_dir'] . '/p2_res_filter.txt';
$res_filter = array();
if (file_exists($cachefile) and $res_filter_cont = file_get_contents($cachefile)) {
$res_filter = unserialize($res_filter_cont);
}
$field = array('whole' => '', 'msg' => '', 'name' => '', 'mail' => '', 'date' => '', 'id' => '', 'beid' => '', 'belv' => '');
$match = array('on' => '', 'off' => '');
$method = array('and' => '', 'or' => '', 'just' => '', 'regex' => '', 'similar' => '');
$field[$res_filter['field']] = ' selected';
$match[$res_filter['match']] = ' selected';
$method[$res_filter['method']] = ' selected';
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:read_filter_k.php
示例12: p2die
require_once './conf/conf.inc.php';
require_once P2_LIB_DIR . '/DataPhp.php';
require_once P2_LIB_DIR . '/P2Validate.php';
$_login->authorize();
// ユーザ認証
//==================================================
// 変数
//==================================================
if (empty($_GET['host'])) {
p2die('host が指定されていません');
}
$host = $_GET['host'];
$bbs = geti($_GET['bbs']);
$key = geti($_GET['key']);
$rescount = (int) geti($_GET['rescount'], 1);
$popup = (int) geti($_GET['popup'], 0);
if (!($itaj = P2Util::getItaName($host, $bbs))) {
$itaj = $bbs;
}
$ttitle_en = isset($_GET['ttitle_en']) ? $_GET['ttitle_en'] : '';
$ttitle_hs = null;
if (strlen($ttitle_en)) {
$ttitle_hs = hs(P2Util::htmlEntityDecodeLite(base64_decode($ttitle_en)));
}
if (P2Validate::host($host) || $bbs && P2Validate::bbs($bbs) || $key && P2Validate::key($key)) {
p2die('不正な引数です');
}
$keyidx = P2Util::getKeyIdxFilePath($host, $bbs, $key);
// フォームのオプション読み込み
require_once P2_LIB_DIR . '/post_options_loader.inc.php';
// 表示指定
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:post_form_i.php
示例13: recAccessLog
/**
* アクセス(ログイン)情報をログに記録する
*
* @access public
* @return boolean
*/
function recAccessLog($logfile, $maxline = 100, $format = 'dataphp')
{
global $_conf, $_login;
// ログファイルの中身を取得する
$lines = array();
if (file_exists($logfile)) {
if ($format == 'dataphp') {
$lines = DataPhp::fileDataPhp($logfile);
} else {
$lines = file($logfile);
}
}
if ($lines) {
// 制限行調整
while (sizeof($lines) > $maxline - 1) {
array_pop($lines);
}
} else {
$lines = array();
}
$lines = array_map('rtrim', $lines);
// 変数設定
$date = date('Y/m/d (D) G:i:s');
$user = isset($_login->user_u) ? $_login->user_u : "";
// 新しいログ行を設定
$newdata = implode('<>', array($date, $_SERVER['REMOTE_ADDR'], P2Util::getRemoteHost(), geti($_SERVER['HTTP_USER_AGENT']), geti($_SERVER['HTTP_REFERER']), '', $user));
//$newdata = htmlspecialchars($newdata, ENT_QUOTES);
// まずタブを全て外して
$newdata = str_replace("\t", "", $newdata);
// <>をタブに変換して
$newdata = str_replace("<>", "\t", $newdata);
// 新しいデータを一番上に追加
@array_unshift($lines, $newdata);
$cont = implode("\n", $lines) . "\n";
FileCtl::make_datafile($logfile, $_conf['p2_perm']);
// 書き込み処理
if ($format == 'dataphp') {
if (!DataPhp::writeDataPhp($logfile, $cont, $_conf['p2_perm'])) {
return false;
}
} else {
if (false === file_put_contents($logfile, $cont, LOCK_EX)) {
trigger_error("file_put_contents(" . $logfile . ")", E_USER_WARNING);
return false;
}
}
return true;
}
开发者ID:poppen,项目名称:p2,代码行数:54,代码来源:P2Util.php
示例14: geti
<?php
/**
* p2 - 2ch●ログイン管理
*/
require_once './conf/conf.inc.php';
require_once P2_LIB_DIR . '/P2Validate.php';
$_login->authorize();
// ユーザ認証
//================================================================
// 変数
//================================================================
$login2chID = geti($_POST['login2chID']);
$login2chPW = geti($_POST['login2chPW']);
$autoLogin2ch = intval(geti($_POST['autoLogin2ch']));
// 2ch ID (メアド)
if ($login2chID and P2Validate::mail($login2chID)) {
P2Util::pushInfoHtml('<p>p2 error: 使用できないID文字列が含まれています</p>');
$login2chID = null;
}
// 正確な許可文字列は不明
if ($login2chPW and P2Validate::login2chPW($login2chPW)) {
P2Util::pushInfoHtml('<p>p2 error: 使用できないパスワード文字列が含まれています</p>');
$login2chPW = null;
}
//===============================================================
// ログインなら、IDとPWを登録保存して、ログインする
//===============================================================
if ($login2chID && $login2chPW) {
P2Util::saveIdPw2ch($login2chID, $login2chPW, $autoLogin2ch);
require_once P2_LIB_DIR . '/login2ch.func.php';
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:login2ch.php
示例15: die
<?php
/*
ファイルをブラウザで編集する
*/
require_once './conf/conf.inc.php';
$_login->authorize();
// ユーザ認証
// 引数エラー
if (!isset($_POST['path'])) {
die('Error: path が指定されていません');
}
// 変数
$path = geti($_POST['path']);
$modori_url = geti($_POST['modori_url']);
$encode = geti($_POST['encode']);
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 36;
$cols = isset($_POST['cols']) ? intval($_POST['cols']) : 128;
isset($_POST['filecont']) and $filecont = $_POST['filecont'];
// 前処理
// 書き込めるファイルを限定する
_checkWritableFiles($path);
// void|exit
// メイン
if (isset($filecont)) {
if (_setFile($path, $filecont, $encode)) {
P2Util::pushInfoHtml("saved, OK.");
}
}
// 表示
_printEditFileHtml($path, $encode);
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:editfile.php
示例16: printHeadMetasHtml
/**
* @static
* @access public
* @return void HTML出力
*/
function printHeadMetasHtml($frameset = false)
{
$metas = array(array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=Shift_JIS'), array('name' => 'ROBOTS', 'content' => 'NOINDEX, NOFOLLOW'));
/*
// 省略
if (UA::isPC() || UA::isIPhoneGroup()) {
$metas[] = array(
'http-equiv' => 'Content-Style-Type',
'content' => 'text/css'
);
$metas[] = array(
'http-equiv' => 'Content-Script-Type',
'content' => 'text/javascript'
);
}
*/
if (!$frameset) {
if (UA::isIPhoneGroup() || UA::isIPhoneGroup(geti($_SERVER['HTTP_USER_AGENT']))) {
?>
<link rel="apple-touch-icon" href="img/p2iphone.png"><?php
// <meta name="viewport" content="width=device-width, initial-scale=1.0">
// initial-scale=1.0, maximum-scale=1.0
// initial-scale=1.0 とすると、縦→横と向きを変えた時に、拡大率が大きい状態になってしまう。
$metas[] = array('name' => 'viewport', 'content' => 'width=device-width');
// <meta name="format-detection" content="telephone=no">
$metas[] = array('name' => 'format-detection', 'content' => 'telephone=no');
}
}
foreach ($metas as $meta) {
$attrs = array();
foreach ($meta as $k => $v) {
$attrs[] = hs($k) . '="' . hs($v) . '"';
}
printf('<meta %s>' . "\n", implode(' ', $attrs));
}
}
开发者ID:poppen,项目名称:p2,代码行数:41,代码来源:P2View.php
示例17: _getMaeATag
/**
* ナビ 前
*
* @return string HTML
*/
function _getMaeATag($aThreadList, $disp_navi, $word_qs)
{
global $_conf;
$mae_atag = '';
if ($disp_navi['from'] > 1) {
$qs = array('host' => $aThreadList->host, 'bbs' => $aThreadList->bbs, 'spmode' => $aThreadList->spmode, 'norefresh' => '1', 'from' => $disp_navi['mae_from'], 'sb_view' => geti($_REQUEST['sb_view']), UA::getQueryKey() => UA::getQueryValue());
$qs = array_merge($word_qs, $qs);
$mae_atag = P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], $qs), hs('前'));
}
return $mae_atag;
}
开发者ID:poppen,项目名称:p2,代码行数:16,代码来源:sb_footer_k.inc.php
示例18: date
require_once P2_LIB_DIR . '/P2Validate.php';
require_once P2_LIB_DIR . '/subject.funcs.php';
$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('HEAD');
$_login->authorize();
// ユーザ認証
//============================================================
// 変数設定
//============================================================
$newtime = date('gis');
$abornoff_st = 'あぼーん解除';
$deletelog_st = 'ログを削除';
$sb_disp_from = (int) geti($_GET['from'], geti($_POST['from'], 1));
// {{{ ホスト、板、モード設定
$host = geti($_GET['host'], geti($_POST['host']));
$bbs = geti($_GET['bbs'], geti($_POST['bbs']));
$spmode = geti($_GET['spmode'], geti($_POST['spmode']));
if (!$host || !strlen($bbs) and !$spmode) {
p2die('必要な引数が指定されていません');
}
if ($host && P2Validate::host($host) || strlen($bbs) && P2Validate::bbs($bbs) || $spmode && P2Validate::spmode($spmode)) {
p2die('不正な引数です');
}
// }}}
// {{{ p2_setting, sb_keys 設定
if ($spmode) {
$p2_setting_txt = $_conf['pref_dir'] . '/p2_setting_' . $spmode . '.txt';
$sb_keys_b_txt = null;
$sb_keys_txt = null;
} else {
$idx_bbs_dir_s = P2Util::idxDirOfHostBbs($host, $bbs);
$p2_setting_txt = $idx_bbs_dir_s . 'p2_setting.txt';
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:subject_i.php
示例19: printLoginFirst
//.........这里部分代码省略.........
}
// }}}
// {{{ SoftBank 端末シリアル番号認証
} elseif ($mobile->isSoftBank()) {
/**
* パケット対応機 要ユーザID通知ONの設定
* @link http://creation.mb.softbank.jp/web/web_ua_about.html
*/
if (($SN = $mobile->getSerialNumber()) !== null) {
if (file_exists($_conf['auth_jp_file'])) {
include $_conf['auth_jp_file'];
if (isset($registed_jp) && $registed_jp == $SN) {
$auth_sub_input_ht = '端末ID OK : ユーザ名だけでログインできます。<br>';
}
}
}
if ($auth_sub_input_ht == '') {
$auth_sub_input_ht = <<<EOP
<input type="hidden" name="ctl_regist_jp" value="1">
<input type="checkbox" name="regist_jp" value="1" checked>端末IDで認証を登録<br>
EOP;
}
// }}}
// {{{ Cookie認証
} else {
$regist_cookie_checked = ' checked';
if (isset($_POST['submit_new']) || isset($_POST['submit_member'])) {
if ($_POST['regist_cookie'] != '1') {
$regist_cookie_checked = '';
}
}
$ignore_cip_checked = '';
if (isset($_POST['submit_newuser']) || isset($_POST['submit_userlogin'])) {
if (geti($_POST['ignore_cip']) == '1') {
$ignore_cip_checked = ' checked';
}
} else {
if (geti($_COOKIE['ignore_cip']) == '1') {
$ignore_cip_checked = ' checked';
}
}
$auth_sub_input_ht = '<input type="hidden" name="ctl_regist_cookie" value="1">' . sprintf('<input type="checkbox" id="regist_cookie" name="regist_cookie" value="1"%s><label for="regist_cookie">ログイン情報をCookieに保存する(推奨)</label><br>', $regist_cookie_checked) . sprintf('<input type="checkbox" id="ignore_cip" name="ignore_cip" value="1"%s><label for="ignore_cip">Cookie認証時にIPの同一性をチェックしない</label><br>', $ignore_cip_checked);
}
// }}}
// ログインフォームからの指定
if (!empty($GLOBALS['brazil'])) {
$add_mail = '.,@-';
} else {
$add_mail = '';
}
if (preg_match("/^[0-9A-Za-z_{$add_mail}]+\$/", $_login->user_u)) {
$hd['form_login_id'] = htmlspecialchars($_login->user_u, ENT_QUOTES);
} elseif (!empty($_POST['form_login_id']) && preg_match("/^[0-9A-Za-z_{$add_mail}]+\$/", $_POST['form_login_id'])) {
$hd['form_login_id'] = htmlspecialchars($_POST['form_login_id'], ENT_QUOTES);
} else {
$hd['form_login_id'] = '';
}
if (!empty($_POST['form_login_pass']) && preg_match('/^[0-9A-Za-z_]+$/', $_POST['form_login_pass'])) {
$hd['form_login_pass'] = htmlspecialchars($_POST['form_login_pass'], ENT_QUOTES);
} else {
$hd['form_login_pass'] = '';
}
// docomoの固有端末認証
$docomo_auth_ht = '';
if ($mobile->isDoCoMo()) {
if (file_exists($_conf['auth_imodeid_file']) && empty($_SERVER['HTTPS'])) {
开发者ID:unpush,项目名称:p2-php,代码行数:67,代码来源:login_first.inc.php
示例20: array
} else {
P2Util::pushInfoHtml("<p>×リストを空にできませんでした</p>");
}
}
// }}}
// {{{ リスト読み込み
$formdata = array();
if (file_exists($path)) {
$lines = file($path);
$i = 0;
foreach ($lines as $line) {
$lar = explode("\t", rtrim($line, "\r\n"));
if (strlen($lar[0]) == 0) {
continue;
}
$ar = array('cond' => $lar[0], 'word' => $lar[0], 'ht' => geti($lar[1]), 'hn' => geti($lar[2], 0), 're' => '', 'ic' => '', 'bbs' => '', 'tt' => '');
// 板縛り
if (preg_match('!<bbs>(.+?)</bbs>!', $ar['word'], $matches)) {
$ar['bbs'] = $matches[1];
}
$ar['word'] = preg_replace('!<bbs>(.*)</bbs>!', '', $ar['word']);
// タイトル縛り
if (preg_match('!<title>(.+?)</title>!', $ar['word'], $matches)) {
$ar['tt'] = $matches[1];
}
$ar['word'] = preg_replace('!<title>(.*)</title>!', '', $ar['word']);
// 正規表現
if (preg_match('/^<(mb_ereg|preg_match|regex)(:[imsxeADSUXu]+)?>(.*)$/', $ar['word'], $m)) {
$ar['word'] = $m[3];
$ar['re'] = ' checked';
// 大文字小文字を無視
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:edit_aborn_word.php
注:本文中的geti函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论