Exemplo n.º 1
0
                $r_msg = json_encode($result);
                // 成功
            }
        }
        break;
        // }}}
        // {{{ ImageCaceh2 ON/OFF
    // }}}
    // {{{ ImageCaceh2 ON/OFF
    case 'ic2':
        if (isset($_REQUEST['switch'])) {
            if (!class_exists('ImageCache2_Switch', false)) {
                include P2EX_LIB_DIR . '/ImageCache2/Switch.php';
            }
            $switch = (bool) $_REQUEST['switch'];
            if (ImageCache2_Switch::set($switch, !empty($_REQUEST['mobile']))) {
                if ($switch) {
                    $r_msg = '1';
                    // ONにした
                } else {
                    $r_msg = '2';
                    // OFFにした
                }
            } else {
                $r_msg = '0';
                // 失敗
            }
        }
        break;
        // }}}
}
Exemplo n.º 2
0
     <a href="setting.php">ログイン管理</a><br>
     <a href="editpref.php">設定管理</a><br>
     <a href="import.php" onclick="return OpenSubWin('import.php', 600, 380, 0, 0);">datのインポート</a><br>
     <a href="http://find.2ch.net/" target="_blank" title="2ch公式検索">find.2ch.net</a>
    </div>
</div>

EOP;
//==============================================================
// ■ImageCache2
//==============================================================
if ($_conf['expack.ic2.enabled']) {
    if (!class_exists('ImageCache2_Switch', false)) {
        include P2EX_LIB_DIR . '/ImageCache2/Switch.php';
    }
    if (ImageCache2_Switch::get()) {
        $ic2sw = array('inline', 'none');
    } else {
        $ic2sw = array('none', 'inline');
    }
    echo <<<EOP
<div class="menu_cate"><b class="menu_cate" onclick="showHide('c_ic2');">ImageCache2</b>
    (<a href="#" id="ic2_switch_on" onclick="return ic2_menu_switch(0);" style="display:{$ic2sw[0]};font-weight:bold;">ON</a><a href="#" id="ic2_switch_off" onclick="return ic2_menu_switch(1);" style="display:{$ic2sw[1]};font-weight:bold;">OFF</a>)<br>
    <div class="itas" id="c_ic2">
     <a href="iv2.php" target="_blank">画像キャッシュ一覧</a><br>
     <a href="ic2_setter.php">アップローダ</a>
        (<a href="#" onclick="return OpenSubWin('ic2_setter.php?popup=1', 480, 320, 1, 1);">p</a>)<br>
     <a href="ic2_getter.php">ダウンローダ</a>
        (<a href="#" onclick="return OpenSubWin('ic2_getter.php?popup=1', 480, 320, 1, 1);">p</a>)<br>
     <a href="ic2_manager.php">データベース管理</a>
    </div>
Exemplo n.º 3
0
 /**
  * スレッド表示オブジェクトにImageCache2で使う変数をアサインする
  */
 public static function initImageCache($aShowThread)
 {
     global $_conf;
     $dpr = 1.0;
     if (!$_conf['ktai']) {
         $aShowThread->thumb_id_suffix = '-' . strtr(microtime(), '. ', '--');
         $aShowThread->thumbnailer = new ImageCache2_Thumbnailer(ImageCache2_Thumbnailer::SIZE_PC);
     } else {
         $preview_size = ImageCache2_Thumbnailer::SIZE_PC;
         $thumb_size = ImageCache2_Thumbnailer::SIZE_MOBILE;
         if ($_conf['iphone'] && !empty($_SESSION['device_pixel_ratio'])) {
             $dpr = $_SESSION['device_pixel_ratio'];
             if ($dpr === 1.5) {
                 $preview_size |= ImageCache2_Thumbnailer::DPR_1_5;
                 $thumb_size |= ImageCache2_Thumbnailer::DPR_1_5;
             } elseif ($dpr === 2.0) {
                 $preview_size |= ImageCache2_Thumbnailer::DPR_2_0;
                 $thumb_size |= ImageCache2_Thumbnailer::DPR_2_0;
             } else {
                 $dpr = 1.0;
             }
         }
         $aShowThread->inline_prvw = new ImageCache2_Thumbnailer($preview_size);
         $aShowThread->thumbnailer = new ImageCache2_Thumbnailer($thumb_size);
     }
     if ($aShowThread->thumbnailer->ini['General']['automemo']) {
         $aShowThread->img_memo = ImageCache2_DataObject_Images::staticUniform($aShowThread->thread->ttitle, 'CP932');
         $aShowThread->img_memo_query = '&amp;memo=' . rawurlencode($aShowThread->img_memo);
         $aShowThread->img_memo_query .= '&amp;' . $_conf['detect_hint_q_utf8'];
     } else {
         $aShowThread->img_memo = null;
         $aShowThread->img_memo_query = '';
     }
     $aShowThread->img_dpr = $dpr;
     if ($dpr === 1.5 || $dpr === 2.0) {
         $aShowThread->img_dpr_query = '&amp;d=' . $dpr;
     } else {
         $aShowThread->img_dpr_query = '';
     }
     self::loadClass('ImageCache2_Switch', 'ImageCache2/Switch.php');
     if (!ImageCache2_Switch::get($_conf['ktai'])) {
         $GLOBALS['pre_thumb_limit'] = 0;
         $GLOBALS['pre_thumb_limit_k'] = 0;
         $GLOBALS['pre_thumb_unlimited'] = false;
         $GLOBALS['pre_thumb_ignore_limit'] = false;
         $_conf['expack.ic2.newres_ignore_limit'] = false;
         $_conf['expack.ic2.newres_ignore_limit_k'] = false;
     }
 }
Exemplo n.º 4
0
<?php

/**
 * rep2expack - RSS Parser
 */
require_once P2EX_LIB_DIR . '/rss/common.inc.php';
// {{{ ImageCache2との連携判定
if ($GLOBALS['_conf']['expack.rss.with_imgcache'] && (!$GLOBALS['_conf']['ktai'] && $GLOBALS['_conf']['expack.ic2.enabled'] % 2 == 1 || $GLOBALS['_conf']['ktai'] && $GLOBALS['_conf']['expack.ic2.enabled'] >= 2)) {
    if (!class_exists('ImageCache2_Switch', false)) {
        require P2EX_LIB_DIR . '/ImageCache2/Switch.php';
    }
    if (ImageCache2_Switch::get($GLOBALS['_conf']['ktai'])) {
        if (!function_exists('rss_get_image')) {
            require P2EX_LIB_DIR . '/rss/getimage.inc.php';
        }
        define('P2_RSS_IMAGECACHE_AVAILABLE', 1);
    } else {
        define('P2_RSS_IMAGECACHE_AVAILABLE', 0);
    }
} else {
    define('P2_RSS_IMAGECACHE_AVAILABLE', 0);
}
// }}}
// {{{ p2GetRSS()
/**
 * RSSをダウンロードし、パース結果を返す
 */
function p2GetRSS($remotefile, $atom = 0)
{
    global $_conf;
    $refresh = !empty($_GET['refresh']) || !empty($_POST['refresh']);