コード例 #1
0
function block_setting($blockclass, $script, $values = array())
{
    global $_G;
    $return = array();
    $obj = block_script($blockclass, $script);
    if (!is_object($obj)) {
        return $return;
    }
    return block_makeform($obj->getsetting(), $values);
}
コード例 #2
0
function block_setting($script, $values = array())
{
    global $_G;
    $return = array();
    if (!($obj = block_script($script))) {
        return $return;
    }
    return block_makeform($obj->getsetting(), $values);
}
コード例 #3
0
function get_push_item($block, $blockstyle, $id, $idtype, $blockclass = '', $script = '')
{
    $item = array();
    $obj = null;
    if (empty($blockclass) || empty($script)) {
        if ($idtype == 'tids') {
            $obj = block_script('forum', 'thread');
        } elseif ($idtype == 'gtids') {
            $obj = block_script('group', 'groupthread');
        } elseif ($idtype == 'aids') {
            $obj = block_script('portal', 'article');
        } elseif ($idtype == 'picids') {
            $obj = block_script('space', 'pic');
        } elseif ($idtype == 'blogids') {
            $obj = block_script('space', 'blog');
        }
    } else {
        list($blockclass) = explode('_', $blockclass);
        $obj = block_script($blockclass, $script);
    }
    if ($obj && is_object($obj)) {
        $paramter = array($idtype => intval($id));
        if (isset($block['param']['picrequired'])) {
            $paramter['picrequired'] = $block['param']['picrequired'];
        }
        $return = $obj->getData($blockstyle, $paramter);
        if ($return['data']) {
            $item = array_shift($return['data']);
        }
    }
    return $item;
}
コード例 #4
0
         $item['fields'] = unserialize($item['fields']);
     }
 } else {
     $_GET['id'] = intval($_GET['id']);
     $script = '';
     if ($_GET['idtype'] == 'tids') {
         $script = 'thread';
     } elseif ($_GET['idtype'] == 'aids') {
         $script = 'article';
     } elseif ($_GET['idtype'] == 'picids') {
         $script = 'pic';
     } elseif ($_GET['idtype'] == 'blogids') {
         $script = 'blog';
     }
     $obj = null;
     if ($_GET['id'] && $script && ($obj = block_script($script))) {
         $paramter = array($_GET['idtype'] => $_GET['id']);
         $return = $obj->getData($thestyle, $paramter);
         if ($return['data']) {
             $item = $return['data'][0];
         }
     }
 }
 if ($item['picflag'] == '1') {
     $item['pic'] = $item['pic'] ? $_G['setting']['attachurl'] . $item['pic'] : '';
 } elseif ($item['picflag'] == '2') {
     $item['pic'] = $item['pic'] ? $_G['setting']['ftp']['attachurl'] . $item['pic'] : '';
 }
 $item['picflag'] = '0';
 $item['startdate'] = $item['startdate'] ? dgmdate($item['startdate']) : dgmdate(TIMESTAMP);
 $item['enddate'] = $item['enddate'] ? dgmdate($item['enddate']) : '';