Example #1
0
<?php

/**
 * rep2 - 新着まとめ読みのキャッシュを読む
 */
require_once './conf/conf.inc.php';
$_login->authorize();
if (array_key_exists('ckey', $_GET) && is_string($_GET['ckey'])) {
    $ckey = MatomeCacheList::getKeyPrefix() . $_GET['ckey'];
    $cont = MatomeCacheDataStore::get($ckey);
} else {
    $cont = null;
}
if ($cont) {
    echo $cont;
} else {
    header('Content-Type: text/plain; charset=Shift_JIS');
    echo 'rep2 error: 新着まとめ読みのキャッシュがないよ';
}
/*
 * 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:
Example #2
0
{$_conf['k_input_ht']}
EOP;
        echo getFavSetListFormHtK('m_favlist_set', 'お気にスレ'), '<br>';
        echo getFavSetListFormHtK('m_favita_set', 'お気に板'), '<br>';
        echo getFavSetListFormHtK('m_rss_set', 'RSS'), '<br>';
        echo <<<EOP
<input type="submit" value="変更">
</form>
EOP;
    }
    // }}}
}
// {{{ 新着まとめ読みのキャッシュ表示
$matome_cache_list = MatomeCacheList::getList();
if ($matome_cache_list) {
    $ckeyprefixlen = strlen(MatomeCacheList::getKeyPrefix());
    $i = 0;
    if ($_conf['ktai']) {
        echo "<hr>\n<p>新着まとめ読みキャッシュ</p>\n";
    } else {
        echo "<tr><td colspan=\"2\">\n";
        echo "<fieldset>\n<legend>新着まとめ読みキャッシュ</legend>\n";
        echo "<ul id=\"matome_cache\">\n";
    }
    foreach ($matome_cache_list as $cache_key => $cache_info) {
        // PC・携帯共通変数
        $i++;
        $ckey = substr($cache_key, $ckeyprefixlen);
        $clink = 'read_new_cache.php?ckey=' . rawurlencode($ckey) . $_conf['k_at_a'];
        if ($cache_info['title']) {
            $ctitle = $cache_info['title'];
Example #3
0
 /**
  * デストラクタ
  *
  * 内容を保存し、古いキャッシュを削除する。
  * スレッド情報が空の場合は保存しない。
  *
  * @param void
  */
 public function __destruct()
 {
     if (!$this->_enabled) {
         return;
     }
     // ストリームを閉じる
     if ($this->_stream) {
         fclose($this->_stream);
     }
     // レスがあるなら
     if (count($this->_metaData['threads'])) {
         // 内容を保存する
         if ($this->_tempFile) {
             MatomeCacheList::add($this->_tempFile, $this->_metaData, true);
         } else {
             MatomeCacheList::add($this->_content, $this->_metaData, false);
         }
         // 古いキャッシュを削除する。
         if ($this->_maxNumEntries > 0) {
             MatomeCacheList::trim($this->_maxNumEntries);
         }
     }
     // 一時ファイルを削除する
     if ($this->_tempFile) {
         unlink($this->_tempFile);
     }
 }