Beispiel #1
0
 /**
  * 検索ワードを入力する要素を生成する
  *
  * @param array $extra_attributes
  * @param string $id_suffix
  * @param boolean $xhtml
  */
 public static function getWordField(array $extra_attributes = null, $id_suffix = null, $xhtml = false)
 {
     $slash = $xhtml ? ' /' : '';
     $name = 'rf[word]';
     $id = 'rf_word';
     if ($id_suffix !== null) {
         $id .= p2h($id_suffix);
     }
     $word = parent::getWord('p2h');
     $html = "<input type=\"text\" id=\"{$id}\" name=\"rf[word]\" value=\"{$word}\"";
     if ($extra_attributes) {
         foreach ($extra_attributes as $key => $value) {
             $key = p2h($key);
             $value = p2h($value);
             $html .= " {$key}=\"{$value}\"";
         }
     }
     $html .= "{$slash}>";
     return $html;
 }
Beispiel #2
0
 /**
  * 検索ワードを入力する要素を生成する
  *
  * @param array $extra_attributes
  * @param string $id_suffix
  * @param boolean $xhtml
  */
 public static function getWordField(array $extra_attributes = null, $id_suffix = null, $xhtml = false)
 {
     $slash = $xhtml ? ' /' : '';
     $name = 'rf[word]';
     $id = 'rf_word';
     if ($id_suffix !== null) {
         $id .= htmlspecialchars($id_suffix, ENT_QUOTES, 'Shift_JIS');
     }
     $word = parent::getWord('htmlspecialchars', array(ENT_QUOTES, 'Shift_JIS'));
     $html = "<input type=\"text\" id=\"{$id}\" name=\"rf[word]\" value=\"{$word}\"";
     if ($extra_attributes) {
         foreach ($extra_attributes as $key => $value) {
             $key = htmlspecialchars($key, ENT_QUOTES, 'Shift_JIS');
             $value = htmlspecialchars($value, ENT_QUOTES, 'Shift_JIS');
             $html .= " {$key}=\"{$value}\"";
         }
     }
     $html .= "{$slash}>";
     return $html;
 }
$prev_st = '前';
$next_st = '次';
$shinchaku_st = '新着';
$moto_thre_st = '元';
$siml_thre_st = '似';
$latest_st = '新';
$dores_st = '書';
$find_st = '索';
$motothre_url = $aThread->getMotoThread(false, '1-10');
$ttitle_en = UrlSafeBase64::encode($aThread->ttitle);
$ttitle_en_q = '&amp;ttitle_en=' . $ttitle_en;
$bbs_q = '&amp;bbs=' . $aThread->bbs;
$key_q = '&amp;key=' . $aThread->key;
$host_bbs_key_q = 'host=' . $aThread->host . $bbs_q . $key_q;
$offline_q = '&amp;offline=1';
$hd['word'] = ResFilter::getWord('htmlspecialchars', array(ENT_QUOTES, 'Shift_JIS'));
$do_filtering = $hd['word'] === null ? false : true;
//=================================================================
// ヘッダ
//=================================================================
// お気にマーク設定
$favmark = $aThread->fav ? '<span class="fav">★</span>' : '<span class="fav">+</span>';
$favdo = $aThread->fav ? 0 : 1;
// レスナビ設定 =====================================================
$rnum_range = $_conf['mobile.rnum_range'];
$latest_show_res_num = $_conf['mobile.rnum_range'];
// 最新XX
$read_navi_range = '';
$read_navi_previous = '';
$read_navi_previous_btm = '';
$read_navi_next = '';
Beispiel #4
0
 /**
  * $lsを分解してstartとtoとnofirstを求める
  */
 public function lsToPoint()
 {
     global $_conf;
     $start = 1;
     $to = false;
     $nofirst = false;
     // nを含んでいる場合は、>>1を表示しない($nofirst)
     if (strpos($this->ls, 'n') !== false) {
         $nofirst = true;
         $this->ls = str_replace('n', '', $this->ls);
     }
     // 範囲指定で分割
     $n = explode('-', $this->ls);
     // 範囲指定がなければ
     if (sizeof($n) == 1) {
         // l指定があれば
         if (substr($n[0], 0, 1) == "l") {
             $ln = intval(substr($n[0], 1));
             if ($_conf['ktai']) {
                 if ($ln > $_conf['mobile.rnum_range']) {
                     $ln = $_conf['mobile.rnum_range'];
                 }
             }
             $start = $this->rescount - $ln + 1;
             if ($start < 1) {
                 $start = 1;
             }
             $to = $this->rescount;
             // all指定なら
         } elseif ($this->ls == "all") {
             $start = 1;
             $to = $this->rescount;
         } else {
             // レス番指定
             if (intval($this->ls) > 0) {
                 $this->ls = intval($this->ls);
                 $start = $this->ls;
                 $to = $this->ls;
                 $nofirst = true;
                 // 指定がない or 不正な場合は、allと同じ表示にする
             } else {
                 $start = 1;
                 $to = $this->rescount;
             }
         }
         // 範囲指定があれば
     } else {
         if (!($start = intval($n[0]))) {
             $start = 1;
         }
         if (!($to = intval($n[1]))) {
             $to = $this->rescount;
         }
     }
     // 新着まとめ読みの表示数制限
     if (isset($GLOBALS['rnum_all_range']) and $GLOBALS['rnum_all_range'] > 0) {
         /*
         ■携帯の新着まとめ読みが、ちょっきしで終わった時に、の「続きor更新」判定問題
         
         リミット < スレの表示範囲
         次リミットは 0
         スレの表示範囲を終える前にリミット数消化
         →続き
         
         リミット > スレの表示範囲
         次リミットは +
         リミット数が残っている間に、スレの表示範囲を終えた
         →更新
         
         リミット = スレの表示範囲
         次リミットは 0
         スレの表示範囲丁度でリミットを消化した
         →続き? 更新?
         続きの場合も更新の場合もある。逐次処理のため、
         他のスレの残り新着数があるかどうかが不明で判定できない。
         */
         // リミットがスレの表示範囲より小さい場合は、スレの表示範囲をリミットに合わせる
         $limit_to = $start + $GLOBALS['rnum_all_range'] - 1;
         if ($limit_to < $to) {
             $to = $limit_to;
             // スレの表示範囲丁度でリミットを消化した場合
         } elseif ($limit_to == $to) {
             $GLOBALS['limit_to_eq_to'] = TRUE;
         }
         // 次のリミットは、今回のスレの表示範囲分を減らした数
         $GLOBALS['rnum_all_range'] = $GLOBALS['rnum_all_range'] - ($to - $start) - 1;
         //print_r("$start, $to, {$GLOBALS['rnum_all_range']}");
     } else {
         // 携帯用
         if ($_conf['ktai']) {
             // 表示数制限
             /*
             if ($start + $_conf['mobile.rnum_range'] -1 <= $to) {
                 $to = $start + $_conf['mobile.rnum_range'] -1;
             }
             */
             // 次X件では、前一つを含み、実質+1となるので、1つおまけする
             if ($start + $_conf['mobile.rnum_range'] <= $to) {
                 $to = $start + $_conf['mobile.rnum_range'];
             }
             if (ResFilter::getWord() !== null) {
                 $start = 1;
                 $to = $this->rescount;
                 $nofirst = false;
             }
         }
     }
     $this->resrange = compact('start', 'to', 'nofirst');
     return $this->resrange;
 }
Beispiel #5
0
}
// スレが板サーバになければ
if ($aThread->diedat) {
    echo '<div class="info">';
    if ($aThread->getdat_error_msg_ht) {
        echo $aThread->getdat_error_msg_ht;
    } else {
        echo $aThread->getDefaultGetDatErrorMessageHTML();
    }
    echo "<p><a href=\"{$motothre_url}\" target=\"_blank\">{$motothre_url}</a></p>";
    echo '</div>';
}
// フィルタヒット数
if ($do_filtering) {
    $htm['rf_field_names'] = array(ResFilter::FIELD_NUMBER => 'レス番号', ResFilter::FIELD_HOLE => '全体', ResFilter::FIELD_MESSAGE => '本文', ResFilter::FIELD_NAME => '名前', ResFilter::FIELD_MAIL => 'メール', ResFilter::FIELD_DATE => '日付', ResFilter::FIELD_ID => 'ID');
    $hd['word'] = ResFilter::getWord('p2h');
    echo "<div class=\"hits\">{$htm['rf_field_names'][$resFilter->field]}に&quot;{$hd['word']}&quot;を";
    echo $resFilter->match == ResFilter::MATCH_ON ? '含む' : '含まない';
    if ($resFilter->include & ResFilter::INCLUDE_REFERENCES) {
        echo '+参照';
    }
    if ($resFilter->include & ResFilter::INCLUDE_REFERENCED) {
        echo '+逆参照';
    }
    echo ': <span id="searching">n</span>hit!</div>';
}
// }}}
if ($_GET['showbl']) {
    echo '<div class="hits">' . p2h($aThread->resrange['start']) . 'へのレス</div>';
}
echo '</div>';