Ejemplo n.º 1
0
function save_current_volume()
{
    //Get current volume
    $level = get_volume();
    //Open (and create if non existent) to write (only) the file
    $sound_file = fopen('saved_volume.txt', 'r+');
    //Cursor at the beginning of the file
    fseek($sound_file, 0);
    //Save the value in the file
    fputs($sound_file, $level);
    //Close the file
    fclose($sound_file);
    return $level;
}
Ejemplo n.º 2
0
    clearCache($_template, $_cache_id);
} elseif ($_template && $_cache_id && isCached($_template, $_cache_id)) {
    $_assigns['url_base'] = $url_base;
    display($_template, $_cache_id, 0, $_assigns);
    exit;
}
// Read list
require_once PATH_INCLUDE . 'novel.inc.php';
$list = parse_novel_list($CNF_FILE_LIST);
//$DEBUG = '<pre>' . var_export($list, true) . '</pre>';
// Fetch page
if ($novel_id) {
    $novel = get_novel($list, $novel_id);
    //$DEBUG = '<pre>' . var_export($novel, true) . '</pre>';
    if ($volume_id) {
        $volume = get_volume($novel, $volume_id);
        //$DEBUG = '<pre>' . var_export($volume, true) . '</pre>';//exit($DEBUG);
        if (!$text_vert_mode) {
            $chapter_id = $chapter_id ? $chapter_id : 0;
            if (!$volume || $chapter_id >= count($volume['chapters'])) {
                //header("Location: {$url_base}{$novel_id}/{$volume_id}/");
                header('HTTP/1.0 404 Not Found');
                display_errordoc(404);
                exit;
            }
            $chapter = get_chapter($volume, $chapter_id);
            process_chapter_text($novel, $volume, $chapter);
            //$DEBUG = '<pre>' . var_export($chapter, true) . '</pre>';//exit($DEBUG);
        } else {
            // Check whether pages is cached
            $refresh_pages = false;
Ejemplo n.º 3
0
<?php

if (isset($_GET[debug])) {
    //Debug mode
    include 'mock-up/debug.html';
} else {
    if (isset($_GET[level])) {
        //Debug mode
        echo get_volume();
    } else {
        include 'mock-up/ihm.html';
    }
}
Ejemplo n.º 4
0
 $goods['integral'] = $goods['integral'] / $shop_config_integral * 100;
 if ($goods['give_integral'] == -1) {
     if ($goods['is_promote'] == 1 && $goods['promote_start_date'] < gmtime() && $goods['promote_end_date'] > gmtime()) {
         $goods['give_integral'] = intval($goods['promote_price']);
     } else {
         $goods['give_integral'] = intval($goods['shop_price']);
     }
 }
 if ($goods['rank_integral'] == -1) {
     if ($goods['is_promote'] == 1 && $goods['promote_start_date'] < gmtime() && $goods['promote_end_date'] > gmtime()) {
         $goods['rank_integral'] = $goods['promote_price'];
     } else {
         $goods['rank_integral'] = $goods['shop_price'];
     }
 }
 $goods['volume'] = get_volume($goods_id);
 //查询商品的优惠价格
 $goods['shop_atr'] = $goods['shop_price'] + $atr_price;
 //不是促销商品的总价格(加上属性价格)
 $goods['promote_atr'] = $goods['promote_price'] + $atr_price;
 //促销商品的总价格(加上属性价格)
 //	$result['linked_goods']=get_linked_goods($goods_id);//获取指定商品的关联商品
 $result['goods'] = $goods;
 $result['goods_gallery'] = $goods_gallery;
 $result['goods_attr'] = $goods_attr;
 $result['user_rank_info'] = get_rank_info($user_id);
 //$result['user_rank_prices']=get_user_rank_prices($goods_id, $goods['shop_price'],$user_id);
 $result['user_rank_prices'] = get_user_rank_prices($goods_id, $goods_price, $user_id, $atr_price, $goods['promote_price']);
 foreach ($user_rank_prices as $key => $value) {
 }
 $result['is_collect_goods'] = is_collect_goods($goods_id, $user_id);
Ejemplo n.º 5
0
$VOL_DOWN = "down";
$action = $_POST["volume"];
//Mute the sound sytem:
if ($action == $VOL_MUTE) {
    dprint('muting');
    /* while `#amixer set Master mute` work fine,
         `#amixer set Master unmute` does not work at all.
         A tweak is then needed, that is to save the sound level in a cookie,
         before muting, and reading this same cookie to unmute.
       */
    save_current_volume();
    $output = set_volume(0);
}
//Unmute the sounds system:
if ($action == $VOL_UNMUTE) {
    if (get_volume() == 0) {
        dprint('unmuting');
        set_volume($_COOKIE['level']);
    } else {
        dprint("skipped");
    }
}
//Set the volume level:
if ($action == $VOL_SET) {
    if (isset($_POST["level"])) {
        //Is the level variable also set?
        dprint('set ' . $_POST["level"]);
        set_volume($_POST["level"]);
    }
}
//Set the sound level 5% louder: