:::

6-7 blocks/snews_block_focus.php

<?php
function snews_block_focus($options)
{
    include_once XOOPS_ROOT_PATH . "/modules/snews/function_block.php";

    $json      = file_get_contents(XOOPS_URL . "/uploads/snews/focus.json");
    $all_focus = json_decode($json, true);
    $keys      = array_rand($all_focus, $options[0]);

    if (is_array($keys)) {
        foreach ($keys as $k) {
            $all_focus[$k]['content'] = word_cut($all_focus[$k]['content'], $options[1]);
            $block[]                  = $all_focus[$k];
        }
    } else {
        $all_focus[$keys]['content'] = word_cut($all_focus[$keys]['content'], $options[1]);
        $block[]                     = $all_focus[$keys];
    }

    return $block;
}

function snews_block_focus_edit($options)
{
    $form = _MB_SNEWS_BLOCK_OPT0 . "
    <input type='text' name='options[0]' value='{$options[0]}'>
    <br>
    " . _MB_SNEWS_BLOCK_OPT1 . "<input type='text' name='options[1]' value='{$options[1]}'>
    ";
    return $form;
}

 


:::

搜尋

QR Code 區塊

https%3A%2F%2Fwww.tad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D44%26tbdsn%3D1472

書籍目錄

展開 | 闔起

線上使用者

29人線上 (6人在瀏覽線上書籍)

會員: 0

訪客: 29

更多…