Esempio n. 1
0
        $space['spacename'] = $spacename;
        $space['spacedescription'] = $spacedescription;
    }
} elseif ($op == 'getspaceinfo') {
    space_merge($space, 'field_home');
} elseif ($op == 'getpersonalnv') {
    space_merge($space, 'field_home');
    getuserdiydata($space);
    $personalnv = isset($_G['blockposition']['nv']) ? $_G['blockposition']['nv'] : '';
    if ($personalnv && !empty($_GET['show'])) {
        $personalnv['nvhidden'] = 0;
    }
}
if (submitcheck('blocksubmit')) {
    $blockname = getstr($_GET['blockname'], 15, 0, 1);
    if (check_ban_block($blockname, $space)) {
        space_merge($space, 'field_home');
        $blockdata = unserialize($space['blockposition']);
        $title = getstr($_POST['blocktitle'], 50, 1, 1);
        $blockdata['parameters'][$blockname]['title'] = $title;
        if (in_array($blockname, array('block1', 'block2', 'block3', 'block4', 'block5'))) {
            $content = censor(getstr($_POST['content'], 1000, 1, 0, 0, 1));
            $blockdata['parameters'][$blockname]['content'] = stripslashes($content);
        } elseif ($blockname == 'profile') {
            $blockdata['parameters'][$blockname]['banavatar'] = in_array($_G['gp_avatar'], array('big', 'middle', 'small')) ? $_G['gp_avatar'] : 'middle';
        } elseif ($blockname == 'statistic') {
            $blockdata['parameters'][$blockname]['bancredits'] = $_G['gp_credits'] ? 0 : 1;
            $blockdata['parameters'][$blockname]['banfriends'] = $_G['gp_friends'] ? 0 : 1;
            $blockdata['parameters'][$blockname]['banthreads'] = $_G['gp_threads'] ? 0 : 1;
            $blockdata['parameters'][$blockname]['banblogs'] = $_G['gp_blogs'] ? 0 : 1;
            $blockdata['parameters'][$blockname]['banalbums'] = $_G['gp_albums'] ? 0 : 1;
Esempio n. 2
0
function formatdata($data, $position, $space)
{
    $list = array();
    foreach ((array) $data['block']['frame`frame1']['column`frame1_' . $position] as $blockname => $blockdata) {
        if (strpos($blockname, 'block`') === false || empty($blockdata) || !isset($blockdata['attr']['name'])) {
            continue;
        }
        $name = $blockdata['attr']['name'];
        if (check_ban_block($name, $space)) {
            $list[$name] = getblockhtml($name, $data['parameters'][$name]);
        }
    }
    return $list;
}