Beispiel #1
0
/**
 * 外部アプリ等でスレッドを開くボタン
 *
 * @param string $icon
 * @param string $label (fallback)
 * @param Thread $aThread
 * @return string
 */
function toolbar_i_action_thread_button($icon, $label, Thread $aThread)
{
    global $_conf;
    $type = _toolbar_i_client_type();
    $pattern = $_conf["expack.tba.{$type}.thread_uri"];
    if (!$pattern) {
        return toolbar_i_disabled_button($icon, $label);
    }
    $url = $aThread->getMotoThread(true, '');
    $uri = p2h(strtr($pattern, array('$time' => time(), '$host' => rawurlencode($aThread->host), '$bbs' => rawurlencode($aThread->bbs), '$key' => rawurlencode($aThread->key), '$ls' => rawurlencode($aThread->ls), '$url' => $url, '$eurl' => rawurlencode($url), '$path' => preg_replace('!^https?://!', '', $url))), false);
    $title = $_conf["expack.tba.{$type}.thread_title"];
    if ($title !== '') {
        $label = p2h($title, false);
    }
    return _toolbar_i_button($icon, $label, $uri);
}
Beispiel #2
0
if (file_exists($aThread->keydat) or file_exists($aThread->keyidx)) {
    $existLog = true;
} else {
    $existLog = false;
}
//=================================================================
// HTMLプリント
//=================================================================
if ($_conf['ktai']) {
    $target_read_at = '';
    $target_sb_at = '';
} else {
    $target_read_at = ' target="read"';
    $target_sb_at = ' target="sbject"';
}
$motothre_url = $aThread->getMotoThread();
if (P2Util::isHost2chs($aThread->host)) {
    $motothre_org_url = $aThread->getMotoThread(true);
} else {
    $motothre_org_url = $motothre_url;
}
if (isset($title_msg)) {
    $hc['title'] = $title_msg;
} else {
    $hc['title'] = "info - {$hc['ttitle_name']}";
}
$hd = array_map('htmlspecialchars', $hc);
P2Util::header_nocache();
echo $_conf['doctype'];
echo <<<EOHEADER
<html>