Exemplo n.º 1
0
function analytics_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            $_REQUEST = str_replace('"', "'", $_REQUEST);
            $analytics_input = substr($_REQUEST['analytics_id'], 0, 14);
            // Shorten input to 14 characters (max length of Analytics IDs)
            if (strlen($analytics_input) > '14') {
                $msg = "Error! The value entered was more than 14 characters in length. Please try again.";
            }
            misc_data_update('analytics_id', mysql_real_escape_string($analytics_input));
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        define('modulename', 'analytics');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_analytics');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('msg', $msg);
        // Error messages
        $main_smarty->assign('settings', get_analytics_settings());
        $main_smarty->assign('tpl_center', analytics_tpl_path . 'settings');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
Exemplo n.º 2
0
<?php

include_once 'analytics_settings.php';
// tell pligg what pages this modules should be included in
// pages are <script name> minus .php
// index.php becomes 'index' and upcoming.php becomes 'upcoming'
$do_not_include_in_pages = array();
$include_in_pages = array('all');
if (do_we_load_module()) {
    if (is_object($main_smarty)) {
        $main_smarty->plugins_dir[] = analytics_plugins_path;
        $main_smarty->assign('settings', get_analytics_settings());
        module_add_action_tpl('tpl_pligg_head_end', analytics_tpl_path . 'analytics.tpl');
        module_add_action_tpl('tpl_header_admin_main_links', analytics_tpl_path . 'admin_link.tpl');
    }
}
$include_in_pages = array('module');
if (do_we_load_module()) {
    $moduleName = $_REQUEST['module'];
    if ($moduleName == 'analytics') {
        module_add_action('module_page', 'analytics_showpage', '');
        include_once mnmmodules . 'analytics/analytics_main.php';
    }
}
//
// Read module settings
//
function get_analytics_settings()
{
    return array('analytics_id' => get_misc_data('analytics_id'));
}