本文整理汇总了PHP中P2Util::mkTrip方法的典型用法代码示例。如果您正苦于以下问题:PHP P2Util::mkTrip方法的具体用法?PHP P2Util::mkTrip怎么用?PHP P2Util::mkTrip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类P2Util
的用法示例。
在下文中一共展示了P2Util::mkTrip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fixed_name_convert_trip
/**
* コテハンの'#'より後をトリップに変換する
*
* @param string $name 生のコテハン
* @return string トリップ変換済みのコテハン
*/
function fixed_name_convert_trip($name)
{
$pos = strpos($name, '#');
if ($pos === false) {
return $name;
}
return substr($name, 0, $pos) . '◆' . P2Util::mkTrip(substr($name, $pos + 1));
}
示例2:
<?php
/**
* rep2expack - トリップ・メーカー for Ajax
*/
require_once __DIR__ . '/../init.php';
$_login->authorize();
// ユーザ認証
echo P2Util::mkTrip($_GET['tk']);
/*
* Local Variables:
* mode: php
* coding: cp932
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/
// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker:
示例3: printArticlesHtmlK
/**
* レス記事をHTML表示する 携帯用
*
* @access public
* @param array
* @return void
*/
function printArticlesHtmlK($datlines)
{
global $_conf;
$hr = P2View::getHrHtmlK();
$n = 0;
foreach ($datlines as $aline) {
$n++;
if ($n < $this->resrange['start'] or $n > $this->resrange['to']) {
continue;
}
$aline = rtrim($aline);
$ResArticle = $this->lineToRes($aline, $n);
$daytime_hs = hs($ResArticle->daytime);
$ttitle = html_entity_decode($ResArticle->ttitle, ENT_COMPAT, 'Shift_JIS');
$ttitle_hs = hs($ttitle);
$msg_ht = $ResArticle->msg;
// 大きさ制限
if (empty($_GET['k_continue'])) {
if ($_conf['ktai_res_size'] && strlen($msg_ht) > $_conf['ktai_res_size']) {
$msg_ht = substr($msg_ht, 0, $_conf['ktai_ryaku_size']);
// 末尾に<br>があれば取り除く(不完全なものも含めて)
$brtag = '<br>';
for ($i = 0; $i < strlen($brtag); $i++) {
if (substr($msg_ht, -1) == $brtag[strlen($brtag) - $i - 1]) {
$msg_ht = substr($msg_ht, 0, strlen($msg_ht) - 1);
}
}
$msg_ht .= ' ' . P2View::tagA(UriUtil::buildQueryUri('read_res_hist.php', array('from' => $ResArticle->order, 'end' => $ResArticle->order, 'k_continue' => '1', UA::getQueryKey() => UA::getQueryValue())), hs('略'));
}
}
// 番号
$res_ht = "[{$ResArticle->order}]";
// 名前
$array = explode('#', $ResArticle->name, 2);
if (count($array) == 2) {
$name_ht = sprintf('%s◆%s', $array[0], P2Util::mkTrip($array[1]));
} else {
$name_ht = hs($ResArticle->name);
}
$res_ht .= $name_ht . ':';
// メール
if ($ResArticle->mail) {
$res_ht .= hs($ResArticle->mail) . ':';
}
// 日付とID
$res_ht .= "{$daytime_hs}<br>\n";
// 板名
$res_ht .= P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $ResArticle->host, 'bbs' => $ResArticle->bbs, UA::getQueryKey() => UA::getQueryValue())), hs($ResArticle->itaj)) . ' / ';
if ($ResArticle->key) {
if (empty($ResArticle->resnum) || $ResArticle->resnum == 1) {
$ls_qs = array();
$footer_anchor = '#footer';
} else {
$lf = max(1, $ResArticle->resnum - 0);
$ls_qs = array('ls' => "{$lf}-");
$footer_anchor = "#r{$lf}";
}
$time = time();
$ttitle_qs = array_merge(array('host' => $ResArticle->host, 'bbs' => $ResArticle->bbs, 'key' => $ResArticle->key, UA::getQueryKey() => UA::getQueryValue(), 'nt' => time()), $ls_qs);
$res_ht .= P2View::tagA(UriUtil::buildQueryUri($_conf['read_php'], $ttitle_qs) . $footer_anchor, "{$ttitle_hs} ");
} else {
$res_ht .= "{$ttitle_hs}\n";
}
// 削除
// $res_ht = "<dt><input name=\"checked_hists[]\" type=\"checkbox\" value=\"{$ResArticle->order},,,,{$daytime_hs}\"> ";
$from_q = isset($_GET['from']) ? '&from=' . intval($_GET['from']) : '';
$dele_ht = "[<a href=\"read_res_hist.php?checked_hists[]={$ResArticle->order},,,," . hs(urlencode($ResArticle->daytime)) . "{$from_q}{$_conf['k_at_a']}\">削除</a>]";
$res_ht .= $dele_ht;
$res_ht .= '<br>';
// 内容
$res_ht .= "{$msg_ht}{$hr}\n";
if ($_conf['k_save_packet']) {
$res_ht = mb_convert_kana($res_ht, 'rnsk');
}
echo $res_ht;
}
}