function multibox_admin_showpage()
{
    global $main_smarty, $the_template, $db;
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        define('pagename', 'multibox_admin');
        $main_smarty->assign('pagename', pagename);
        define('modulename', 'multibox_admin');
        $main_smarty->assign('modulename', modulename);
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $main_smarty->display(multibox_admin_tpl_path . '/blank.tpl');
        $main_smarty = do_sidebar($main_smarty);
        $sql = "SELECT * FROM " . table_totals;
        $results = $db->get_results($sql);
        $main_smarty->assign('results', object_2_array($results));
        if (isset($_REQUEST['action'])) {
            $main_smarty->assign('action', $_REQUEST['action']);
            totals_regenerate();
            $sql = "SELECT * FROM " . table_totals;
            $results = $db->get_results($sql);
            $main_smarty->assign('new_results', object_2_array($results));
        }
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        $main_smarty->assign('tpl_center', multibox_admin_tpl_path . 'multibox_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        echo "Page Forbidden";
    }
}
Beispiel #2
0
            }
        }
        if ($action == "dodiscard" or $action == "dopublished" or $action == "donew") {
            if ($link = $db->get_row("SELECT * FROM " . table_links . " WHERE link_id = {$id}")) {
                $xaction = substr($action, 2, 100);
                $link = new Link();
                $link->id = $id;
                $link->read();
                $link->published_date = time();
                $link->status = $xaction;
                $link->store_basic();
                $main_smarty->assign('action', $xaction);
                $main_smarty->assign('story_url', getmyurl('story', $id));
                $main_smarty->assign('admin_modify_url', getmyurl('admin_modify', $id));
                $db->query("UPDATE " . table_links . " set link_status='" . $xaction . "' WHERE link_id={$id}");
                totals_regenerate();
                // pagename
                define('pagename', 'linkadmin');
                $main_smarty->assign('pagename', pagename);
                // show the template
                $main_smarty->assign('tpl_center', '/admin/submission_update');
                $main_smarty->display($template_dir . '/admin/admin.tpl');
            } else {
                echo 'Error: link not found';
            }
        }
    } else {
        //no request
    }
} else {
    //	echo "<br />We're sorry, but you do not have administrative privileges on this site.<br />If you wish to be promoted, please contact the site administrator.<br />";