本文整理汇总了PHP中P2Util::isHost2chs方法的典型用法代码示例。如果您正苦于以下问题:PHP P2Util::isHost2chs方法的具体用法?PHP P2Util::isHost2chs怎么用?PHP P2Util::isHost2chs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类P2Util
的用法示例。
在下文中一共展示了P2Util::isHost2chs方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isEnable
/**
* IDストーカーに対応しているか調べる
* $boardがなければloadも実行される
*/
function isEnable()
{
if ($this->host) {
if (!P2Util::isHost2chs($this->host)) {
return false;
}
}
return preg_match('/plus$/', $this->bbs);
}
示例2: setBbsNonameName
/**
* @access protected
* @return void
*/
function setBbsNonameName()
{
if (P2Util::isHost2chs($this->thread->host)) {
require_once P2_LIB_DIR . '/SettingTxt.php';
$SettingTxt = new SettingTxt($this->thread->host, $this->thread->bbs);
if (array_key_exists('BBS_NONAME_NAME', $SettingTxt->setting_array)) {
$this->BBS_NONAME_NAME = $SettingTxt->setting_array['BBS_NONAME_NAME'];
}
}
}
示例3: isEnable
/**
* 必死チェッカーに対応しているか調べる
* $boardがなければloadも実行される
*/
function isEnable()
{
if ($this->host) {
if (!P2Util::isHost2chs($this->host)) {
return false;
}
}
if (!isset($this->boards)) {
$this->load();
}
$this->enabled = in_array($this->bbs, $this->boards) ? true : false;
return $this->enabled;
}
示例4: ShowThreadK
/**
* @constructor
*/
function ShowThreadK(&$aThread)
{
parent::ShowThread($aThread);
global $_conf;
$this->url_handlers = array(array('this' => 'plugin_link2ch'), array('this' => 'plugin_linkMachi'), array('this' => 'plugin_linkJBBS'), array('this' => 'plugin_link2chKako'), array('this' => 'plugin_link2chSubject'), array('this' => 'plugin_linkReadCgi'));
if ($_conf['k_use_picto']) {
$this->url_handlers[] = array('this' => 'plugin_viewImage');
}
$_conf['link_youtube'] and $this->url_handlers[] = array('this' => 'plugin_linkYouTube');
$_conf['link_niconico'] and $this->url_handlers[] = array('this' => 'plugin_linkNicoNico');
$this->url_handlers[] = array('this' => 'plugin_linkURL');
if (!$_conf['k_bbs_noname_name'] and P2Util::isHost2chs($this->thread->host)) {
require_once P2_LIB_DIR . '/SettingTxt.php';
$st = new SettingTxt($this->thread->host, $this->thread->bbs);
if (!empty($st->setting_array['BBS_NONAME_NAME'])) {
$this->BBS_NONAME_NAME = $st->setting_array['BBS_NONAME_NAME'];
}
}
}
示例5: getMotoThread
/**
* 元スレURLを返す
*
* @param bool $force_pc trueなら携帯モードでもPC用の元スレURLを返す
* @param string $ls レス表示番号or範囲。nullならlsプロパティを使う
* 掲示板によっては無視される場合もある
* @return string 元スレURL
*/
public function getMotoThread($force_pc = false, $ls = null)
{
global $_conf;
if ($force_pc) {
$mobile = false;
} elseif ($_conf['iphone']) {
$mobile = false;
} elseif ($_conf['ktai']) {
$mobile = true;
} else {
$mobile = false;
}
if ($ls === null) {
$ls = $this->ls;
}
// 2ch系
if (P2Util::isHost2chs($this->host)) {
// PC
if (!$mobile) {
$motothre_url = "http://{$this->host}/test/read.cgi/{$this->bbs}/{$this->key}/{$ls}";
// 携帯
} else {
if (P2Util::isHostBbsPink($this->host)) {
//$motothre_url = "http://{$this->host}/test/r.i/{$this->bbs}/{$this->key}/{$ls}";
$motothre_url = "http://speedo.ula.cc/test/r.so/{$this->host}/{$this->bbs}/{$this->key}/{$ls}";
} else {
$mail = rawurlencode($_conf['my_mail']);
// c.2chはl指定に非対応なので、代わりにn
$ls = substr($ls, 0, 1) == 'l' ? 'n' : $ls;
$motothre_url = "http://c.2ch.net/test/--3!mail={$mail}/{$this->bbs}/{$this->key}/{$ls}";
}
}
// まちBBS
} elseif (P2Util::isHostMachiBbs($this->host)) {
if ($mobile) {
$motothre_url = "http://{$this->host}/bbs/read.pl?IMODE=TRUE&BBS={$this->bbs}&KEY={$this->key}";
} else {
$motothre_url = "http://{$this->host}/bbs/read.cgi/{$this->bbs}/{$this->key}/{$ls}";
}
// まちびねっと
} elseif (P2Util::isHostMachiBbsNet($this->host)) {
$motothre_url = "http://{$this->host}/test/read.cgi?bbs={$this->bbs}&key={$this->key}";
if ($mobile) {
$motothre_url .= '&imode=true';
}
// JBBSしたらば
} elseif (P2Util::isHostJbbsShitaraba($this->host)) {
list($host, $category) = explode('/', P2Util::adjustHostJbbs($this->host), 2);
$bbs_cgi = $mobile ? 'i.cgi' : 'read.cgi';
$motothre_url = "http://{$host}/bbs/{$bbs_cgi}/{$category}/{$this->bbs}/{$this->key}/{$ls}";
// その他
} else {
$motothre_url = "http://{$this->host}/test/read.cgi/{$this->bbs}/{$this->key}/{$ls}";
}
return $motothre_url;
}
示例6: explodeDatLine
/**
* datlineをexplodeする
*
* @access public
* @param string $aline
* @return array
*/
function explodeDatLine($aline)
{
global $_conf;
if (!($aline = rtrim($aline))) {
return array();
}
$stripped = false;
if ($_conf['strip_tags_trusted_dat'] || !P2Util::isTrustedHost($this->host)) {
require_once P2_LIB_DIR . '/HTML/StripTags.php';
$HTML_StripTags = new HTML_StripTags();
$aline = $HTML_StripTags->cleanup($aline);
$stripped = true;
}
if ($this->dat_type == '2ch_old') {
$parts = explode(',', $aline);
} else {
$parts = explode('<>', $aline);
}
if (!$stripped && P2Util::isHost2chs($this->host)) {
// iframe を削除。2chが正常化して必要なくなったらこのコードは外したい。2005/05/19
isset($parts[3]) and $parts[3] = preg_replace('{<(iframe|script)( .*?)?>.*?</\\1>}i', '', $parts[3]);
}
return $parts;
}
示例7: array
$post_backup_key = PostDataStore::getKeyForBackup($host, $bbs, $key, !empty($_REQUEST['newthread']));
$post_config_key = PostDataStore::getKeyForConfig($host, $bbs);
// 設定を保存
PostDataStore::set($post_config_key, array('beres' => !empty($_REQUEST['beres']), 'p2res' => !empty($_REQUEST['p2res'])));
//================================================================
// 書き込み処理
//================================================================
// 書き込みを一時的に保存
PostDataStore::set($post_backup_key, $post_cache);
// ポスト実行
if (!empty($_POST['p2res']) && empty($_POST['newthread'])) {
// 公式p2で書き込み
$posted = postIt2($host, $bbs, $key, $FROM, $mail, $MESSAGE);
} else {
// cookie 読み込み
$cookie_key = $_login->user_u . '/' . P2Util::normalizeHostName(P2Util::isHostBbsPink($host) ? 'www.bbspink.com' : P2Util::isHost2chs($host) ? 'www.2ch.net' : $host);
// 忍法帳対応
if ($p2cookies = CookieDataStore::get($cookie_key)) {
if (is_array($p2cookies)) {
if (array_key_exists('expires', $p2cookies)) {
// 期限切れなら破棄
if (time() > strtotime($p2cookies['expires'])) {
CookieDataStore::delete($cookie_key);
$p2cookies = null;
}
}
} else {
CookieDataStore::delete($cookie_key);
$p2cookies = null;
}
} else {
示例8: sb_print_k
//.........这里部分代码省略.........
$htm['ita'] = $ita_name_hd;
}
// torder(info) =================================================
/*
if ($aThread->fav) { //お気にスレ
$torder_st = "<b>{$aThread->torder}</b>";
} else {
$torder_st = $aThread->torder;
}
$torder_ht = "<a id=\"to{$i}\" class=\"info\" href=\"info.php?{$host_bbs_key_q}{$_conf['k_at_a']}\">{$torder_st}</a>";
*/
$torder_ht = $aThread->torder;
// title =================================================
$rescount_q = '&rescount=' . $aThread->rescount;
// dat倉庫 or 殿堂なら
if ($aThreadList->spmode == 'soko' || $aThreadList->spmode == 'palace') {
$rescount_q = '';
$offline_q = '&offline=true';
$anum_ht = '';
// subject.txt にない場合
} elseif (!$aThread->isonline) {
$offline_q = '&offline=true';
}
// タイトル未取得なら
$ttitle_ht = $aThread->ttitle_ht;
if (strlen($ttitle_ht) == 0) {
// 見かけ上のタイトルなので携帯対応URLである必要はない
$ttitle_ht = p2h($aThread->getMotoThread(true, ''));
}
// 全角英数カナスペースを半角に
if (!empty($_conf['mobile.save_packet'])) {
$ttitle_ht = mb_convert_kana($ttitle_ht, 'rnsk');
}
if ($_conf['iphone']) {
$htm['rnum'] = "<span class=\"num count\">{$rescount_ht}</span>";
if ($aThread->similarity) {
$htm['sim'] .= sprintf(' <span class="num score">%0.1f%%</span>', $aThread->similarity * 100);
}
} else {
$htm['rnum'] = "({$rescount_ht})";
if ($aThread->similarity) {
$htm['sim'] .= sprintf(' %0.1f%%', $aThread->similarity * 100);
}
}
$thre_url = "{$_conf['read_php']}?{$host_bbs_key_q}";
if ($_conf['iphone']) {
$thre_url .= '&ttitle_en=' . UrlSafeBase64::encode($aThread->ttitle);
}
$thre_url .= "{$rescount_q}{$offline_q}{$_conf['k_at_a']}{$anum_ht}";
// オンリー>>1
$onlyone_url = "{$_conf['read_php']}?{$host_bbs_key_q}&one=true&k_continue=1{$_conf['k_at_a']}";
if ($only_one_bool) {
$one_ht = "<a href=\"{$onlyone_url}\">>>1</a>";
}
// >>1のみ, >>1から
if (P2Util::isHost2chs($aThreadList->host) && !$aThread->isKitoku()) {
switch ($_conf['mobile.sb_show_first']) {
case 1:
$thre_url = $onlyone_url;
break;
case 2:
$thre_url .= '&ls=1-';
break;
default:
$thre_url .= '&ls=l' . $_conf['mobile.rnum_range'];
}
}
// アクセスキー
/*
$access_ht = '';
if ($aThread->torder >= 1 and $aThread->torder <= 9) {
$access_ht = " {$_conf['accesskey']}=\"{$aThread->torder}\"";
}
*/
//====================================================================================
// スレッド一覧 table ボディ HTMLプリント <tr></tr>
//====================================================================================
//ボディ
if ($_conf['iphone']) {
// information bubble用の隠しスレッド情報。
// torderの指示子が"%d"でないのはmerge_favitaのため
$thre_info = sprintf('[%s] %s (%01.1fレス/日)', $aThread->torder, date('y/m/d H:i', $aThread->key), $aThread->dayres);
if ($htm['ita'] !== '') {
$htm['ita'] = "<span class=\"ita\">{$htm['ita']}</span>";
}
echo <<<EOP
<li><a href="{$thre_url}"><span class="info">{$thre_info}</span> {$htm['unum']} <span class="{$classtitle}">{$ttitle_ht}</span> {$htm['rnum']} {$htm['sim']} {$htm['ita']}</a></li>
EOP;
} else {
echo <<<EOP
<div>{$htm['unum']}{$aThread->torder}.<a href="{$thre_url}">{$ttitle_ht}</a> {$htm['rnum']} {$htm['sim']} {$htm['ita']}</div>
EOP;
}
}
if ($_conf['iphone']) {
echo '</ul>';
}
}
示例9: date
* for subject.php
*/
//===============================================================
// HTML表示用変数
//===============================================================
$newtime = date("gis");
$norefresh_q = "&norefresh=1";
// {{{ ページタイトル部分URL設定
$p2_subject_url = "{$_conf['subject_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}{$_conf['k_at_a']}";
// 通常 板
if (!$aThreadList->spmode) {
// 検索語あり
if (isset($GLOBALS['word']) && strlen($GLOBALS['word']) > 0 || !empty($GLOBALS['wakati_words'])) {
$ptitle_url = $p2_subject_url;
// 2ch系
} elseif (P2Util::isHost2chs($aThreadList->host)) {
if (P2Util::isHostBbsPink($aThreadList->host)) {
//$ptitle_url = "http://{$aThreadList->host}/{$aThreadList->bbs}/i/";
$ptitle_url = "http://speedo.ula.cc/test/p.so/{$aThreadList->host}/{$aThreadList->bbs}/";
} else {
$ptitle_url = "http://c.2ch.net/test/-/{$aThreadList->bbs}/i";
}
// その他
} else {
$ptitle_url = "http://{$aThreadList->host}/{$aThreadList->bbs}/";
// 特別なパターン index2.html
// match登録よりheadなげて聞いたほうがよさそうだが、ワンレスポンス増えるのが困る
if (!strcasecmp($aThreadList->host, 'livesoccer.net')) {
$ptitle_url .= 'index2.html';
}
}
示例10:
// ログありなしフラグセット
if (file_exists($aThread->keydat) or file_exists($aThread->keyidx)) {
$existLog = true;
}
//=================================================================
// HTMLプリント
//=================================================================
if (!$_conf['ktai']) {
$target_read_at = ' target="read"';
$target_sb_at = ' target="subject"';
} else {
$target_read_at = '';
$target_sb_at = '';
}
$motothre_url = $aThread->getMotoThread();
if (P2Util::isHost2chs($aThread->host)) {
$motothre_org_url = $aThread->getMotoThread(true);
} else {
$motothre_org_url = $motothre_url;
}
if ($title_msg) {
$hc['title'] = $title_msg;
} else {
$hc['title'] = "info - {$hc['ttitle_name']}";
}
$hs = array_map('htmlspecialchars', $hc);
if ($_GET['i']) {
P2Util::header_nocache();
echo $_conf['doctype'];
echo <<<EOHEADER
<html>
示例11: _getMaruKakikoHtml
/**
* 2ch●書き込み
*
* @return string HTML
*/
function _getMaruKakikoHtml($host)
{
global $_conf;
$maru_kakiko_ht = '';
if (P2Util::isHost2chs($host) and file_exists($_conf['sid2ch_php'])) {
$maru_kakiko_ht = sprintf('<span>2ch●ID: <input id="maru_kakiko" name="maru_kakiko" type="checkbox" value="1"%s></span>', $_conf['maru_kakiko'] ? ' checked' : '');
}
return $maru_kakiko_ht;
}
示例12: sb_print_k
//.........这里部分代码省略.........
*/
$torder_ht = $aThread->torder;
// title =========================================================
$rescount_qs = array('rc' => $aThread->rescount);
$offline_qs = array();
// dat倉庫 or 殿堂なら
if ($aThreadList->spmode == 'soko' || $aThreadList->spmode == 'palace') {
$rescount_qs = array();
$offline_qs = array('offline' => '1');
$anum_ht = '';
}
// タイトル未取得なら
if (!$aThread->ttitle_ht) {
// 見かけ上のタイトルなので携帯対応URLである必要はない
//if (P2Util::isHost2chs($aThread->host)) {
// $aThread->ttitle_ht = "http://c.2ch.net/z/-/{$aThread->bbs}/{$aThread->key}/";
//} else {
$aThread->ttitle_ht = "http://{$aThread->host}/test/read.cgi/{$aThread->bbs}/{$aThread->key}/";
//}
}
// 全角英数カナスペースを半角に
if ($_conf['k_save_packet']) {
$aThread->ttitle_ht = mb_convert_kana($aThread->ttitle_ht, 'rnsk');
}
// 総レス数
if (UA::isIPhoneGroup()) {
$rescount_ht = '<font class="sbnum"> ' . $aThread->rescount . '</font>';
} else {
$rescount_ht = ' (' . $aThread->rescount . ')';
}
$similarity_ht = '';
if ($aThread->similarity) {
$similarity_ht = sprintf(' %0.1f%%', $aThread->similarity * 100);
}
// 新規スレ
if ($aThread->new) {
$classtitle_q = ' class="thre_title_new"';
} else {
$classtitle_q = ' class="thre_title"';
}
$thre_url = UriUtil::buildQueryUri($_conf['read_php'], array_merge(array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, UA::getQueryKey() => UA::getQueryValue()), $rescount_qs, $offline_qs)) . $anum_ht;
// オンリー>>1
$onlyone_url = UriUtil::buildQueryUri($_conf['read_php'], array_merge(array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'onlyone' => '1', 'k_continue' => '1', UA::getQueryKey() => UA::getQueryValue()), $rescount_qs));
if ($onlyone_bool) {
$one_ht = "<a href=\"{$onlyone_url}\">>>1</a>";
}
if (P2Util::isHost2chs($aThreadList->host) and !$aThread->isKitoku()) {
if ($GLOBALS['_conf']['k_sb_show_first'] == 1) {
$thre_url = $onlyone_url;
} elseif ($GLOBALS['_conf']['k_sb_show_first'] == 2) {
$thre_url .= '&ls=1-';
}
}
// アクセスキー
/*
$access_ht = "";
if ($aThread->torder >= 1 and $aThread->torder <= 9) {
$access_ht = " {$_conf['accesskey_for_k']}=\"{$aThread->torder}\"";
}
*/
if (UA::isIPhoneGroup()) {
// お気にマーク設定
$favvalue = !empty($aThread->fav) ? 0 : 1;
$favtitle = $favvalue ? 'お気にスレに追加' : 'お気にスレから外す';
$itaj_hs = htmlspecialchars($aThread->itaj, ENT_QUOTES);
$favmark = !empty($aThread->fav) ? '★' : '+';
if ($favmark == '★') {
$favmark = '<img src="iui/icon_del.png">';
} else {
$favmark = '<img src="iui/icon_add.png">';
}
$sid_qs = array();
$sid_q = '';
if (defined('SID') && strlen(SID)) {
$sid_qs[session_name()] = session_id();
$sid_q = hs('&' . session_name() . '=' . session_id());
}
$setFavUri = UriUtil::buildQueryUri('info_i.php', array_merge(array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'ttitle_en' => base64_encode($aThread->ttitle), 'setfav' => $favvalue), $sid_qs));
$setFavUri_hs = hs($setFavUri);
}
//====================================================================================
// スレッド一覧 table ボディ HTMLプリント <tr></tr>
//====================================================================================
if (UA::isIPhoneGroup()) {
?>
<li><?php
echo "<span class=\"plus\" id=\"{$aThread->torder}\" ><a href=\"{$setFavUri_hs}\" target=\"info\" onClick=\"return setFavJsNoStr('host={$aThread->host}{$bbs_q}{$key_q}{$ttitle_en_q}{$sid_q}', '{$favvalue}', {$STYLE['info_pop_size']}, 'read', 'this',{$aThread->torder});\" title=\"{$favtitle}\">{$favmark}</a></span>";
// ボディ
echo <<<EOP
<a href="{$thre_url}" class="ttitle">{$unum_new_ht}{$aThread->ttitle_ht}{$ita_name_ht}{$rescount_ht}{$similarity_ht}</a>{$unum_ht}</li>
EOP;
} else {
echo <<<EOP
<div>
{$unum_ht}{$aThread->torder}.<a href="{$thre_url}">{$aThread->ttitle_ht}{$rescount_ht}{$similarity_ht}</a>{$ita_name_ht}
</div>
EOP;
}
}
}
示例13: _getP2SambaErrorMsgHtml
/**
* p2 sambaに引っかかっていたら、エラーメッセージHTMLを返す
*
* @return string|null
*/
function _getP2SambaErrorMsgHtml($host, $bbs)
{
global $_conf;
$kisei_second = 10;
$samba24 = null;
if (P2Util::isHost2chs($host)) {
if (!empty($_POST['maru_kakiko']) and file_exists($_conf['sid2ch_php'])) {
// samba24スルー
} else {
if ($r = P2Util::getSamba24TimeCache($host, $bbs)) {
$kisei_second = $r;
$samba24 = true;
}
}
}
//if (_isSambaDeny($kisei_second)) { // 確認時間でチェックする場合
if (_isDenyWithUpdateLastPostTime($kisei_second)) {
// 試行時間でチェックする場合
$samba24_msg = $samba24 ? '2chのsamba24設定 ' : '';
return sprintf('p2 samba規制: 連続投稿はできません。(%s%d秒)', hs($samba24_msg), $kisei_second);
}
return null;
}
示例14: isTrustedHost
/**
* host が 信頼できる掲示板サイトなら true を返す
*
* @access public
* @return boolean
*/
function isTrustedHost($host)
{
return P2Util::isHost2chs($host) || P2Util::isHostBbsPink($host) || P2Util::isHostMachiBbs($host) || P2Util::isHostJbbsShitaraba($host);
}
示例15: unset
unset($post_cache['submit']);
if (!empty($_POST['newthread'])) {
unset($post[$key_k]);
$location_ht = "{$_conf['subject_php']}?host={$host}&bbs={$bbs}{$_conf['k_at_a']}";
} else {
unset($post[$subject_k]);
$location_ht = "{$_conf['read_php']}?host={$host}&bbs={$bbs}&key={$key}&ls={$rescount}-&refresh=1&nt={$newtime}{$_conf['k_at_a']}";
if (!$_conf['iphone']) {
$location_ht .= "#r{$rescount}";
}
}
if (P2Util::isHostJbbsShitaraba($host)) {
$post[$dir_k] = $dir;
}
// {{{ 2chで●ログイン中ならsid追加
if (!empty($_POST['maru']) and P2Util::isHost2chs($host) && file_exists($_conf['sid2ch_php'])) {
// ログイン後、24時間以上経過していたら自動再ログイン
if (file_exists($_conf['idpw2ch_php']) && filemtime($_conf['sid2ch_php']) < time() - 60 * 60 * 24) {
require_once P2_LIB_DIR . '/login2ch.inc.php';
login2ch();
}
include $_conf['sid2ch_php'];
$post['sid'] = $SID2ch;
}
// }}}
if (!empty($_POST['p2_post_confirm_cookie'])) {
$post_ignore_keys = array_merge($post_param_keys, $post_internal_keys, $post_optional_keys, $post_p2_flag_keys);
foreach ($_POST as $k => $v) {
if (!array_key_exists($k, $post) && !in_array($k, $post_ignore_keys)) {
$post[$k] = $v;
}