Example #1
0
/**
* Main
*/
$display = '';
$mode = '';
if (isset($_POST['save'])) {
    $mode = 'save';
}
if (isset($_POST['cancel'])) {
    $mode = 'cancel';
}
$T = new Template($_MG_CONF['template_path'] . '/admin');
$T->set_file('admin', 'administration.thtml');
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'mg_navigation' => MG_navigation(), 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['pi_version']));
if ($mode == 'save' && SEC_checkToken()) {
    $T->set_var(array('admin_body' => MG_saveConfig(), 'mg_navigation' => MG_navigation()));
} elseif ($mode == 'cancel') {
    echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
    exit;
} elseif ($mode == $LANG_MG01['continue']) {
    COM_setMessage(2);
    echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
    exit;
} else {
    $T->set_var(array('admin_body' => MG_editConfig(), 'title' => $LANG_MG01['system_options'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" style="border:none;" alt="?" />', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#System_Options'));
}
$T->parse('output', 'admin');
$display = COM_siteHeader('menu', '');
$display .= $T->finish($T->get_var('output'));
$display .= COM_siteFooter();
echo $display;
Example #2
0
     if ($_MG_CONF['discard_original'] != 1) {
         $display = MG_siteHeader();
         $display .= MG_errorHandler($LANG_MG01['remove_error']);
         $display .= MG_siteFooter();
         echo $display;
         exit;
     }
     $T = new Template($_MG_CONF['template_path'] . '/admin');
     $T->set_file(array('admin' => 'administration.thtml'));
     $B = new Template($_MG_CONF['template_path'] . '/admin');
     $B->set_file(array('admin' => 'thumbs.thtml'));
     $B->set_var('site_url', $_CONF['site_url']);
     $B->set_var('site_admin_url', $_CONF['site_admin_url']);
     $B->set_var(array('lang_title' => $LANG_MG01['remove_originals'], 's_form_action' => $_MG_CONF['admin_url'] . 'maint.php?mode=remove&amp;step=two', 'lang_next' => $LANG_MG01['next'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_help' => $LANG_MG01['remove_help'], 'lang_details' => $LANG_MG01['remove_details']));
     $B->parse('output', 'admin');
     $T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'admin_body' => $B->finish($B->get_var('output')), 'mg_navigation' => MG_navigation(), 'title' => $LANG_MG01['discard_originals'], 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['version'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" style="border:none;" alt="?"/>', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#Discard_Original_Images'));
     $T->parse('output', 'admin');
     $display = COM_siteHeader();
     $display .= $T->finish($T->get_var('output'));
     $display .= COM_siteFooter();
     echo $display;
     exit;
     break;
 case 'two':
     $sql = "SELECT * FROM {$_TABLES['mg_media_albums']} as ma INNER JOIN " . $_TABLES['mg_media'] . " as m " . " ON ma.media_id=m.media_id WHERE m.media_type=0";
     $result = DB_query($sql);
     $nRows = DB_numRows($result);
     if ($nRows > 0) {
         $session_id = MG_beginSession('droporiginal', $_MG_CONF['admin_url'] . 'index.php', $LANG_MG01['discard_originals']);
         for ($x = 0; $x < $nRows; $x++) {
             $row = DB_fetchArray($result);
Example #3
0
/**
* Main
*/
$mode = isset($_REQUEST['mode']) ? COM_applyFilter($_REQUEST['mode']) : '';
$display = '';
$mode = '';
if (isset($_POST['mode'])) {
    $mode = $_POST['mode'];
} else {
    if (isset($_GET['mode'])) {
        $mode = $_GET['mode'];
    }
}
$T = new Template($_MG_CONF['template_path'] . '/admin');
$T->set_file(array('admin' => 'administration.thtml'));
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'mg_navigation' => MG_navigation(), 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['pi_version']));
if ($mode == $LANG_MG01['delete'] && !empty($LANG_MG01['delete'])) {
    $T->set_var(array('admin_body' => MG_massDeleteAlbums(0)));
    echo COM_refresh($_MG_CONF['admin_url'] . '/index.php?msg=15');
} elseif ($mode == $LANG_MG01['cancel']) {
    echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
    exit;
} else {
    $T->set_var(array('admin_body' => MG_massDelete(), 'title' => $LANG_MG01['mass_delete_help'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" border="0" alt="?">', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#Batch_Delete_Albums'));
}
$T->parse('output', 'admin');
$display = COM_siteHeader();
$display .= $T->finish($T->get_var('output'));
$display .= COM_siteFooter();
echo $display;
exit;
Example #4
0
        // Insert default configuration
        COM_errorLog("Media Gallery: Restoring system defaults", 1);
        for ($i = 1; $i <= count($_SQL_DEF); $i++) {
            DB_query(current($_SQL_DEF));
            if (DB_error()) {
                COM_errorLog("Error inserting Media Gallery Defaults: " . curent($_SQL_DEF), 1);
            }
            next($_SQL_DEF);
        }
        COM_errorLog("Media Gallery: Success - default data added to Media Gallery tables", 1);
        echo COM_refresh($_MG_CONF['admin_url'] . 'index.php?msg=9');
        exit;
    default:
        $T = new Template($_MG_CONF['template_path'] . '/admin');
        $T->set_file(array('admin' => 'administration.thtml'));
        $B = new Template($_MG_CONF['template_path'] . '/admin');
        $B->set_file(array('admin' => 'thumbs.thtml'));
        $B->set_var('site_url', $_CONF['site_url']);
        $B->set_var('site_admin_url', $_CONF['site_admin_url']);
        // display the album list...
        $B->set_var(array('lang_title' => $LANG_MG01['reset_defaults'], 's_form_action' => $_MG_CONF['admin_url'] . 'resetdefaults.php?step=two', 'lang_next' => $LANG_MG01['next'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_details' => $LANG_MG01['reset_defaults_details']));
        $B->parse('output', 'admin');
        $T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'admin_body' => $B->finish($B->get_var('output')), 'mg_navigation' => MG_navigation(), 'title' => $LANG_MG01['reset_defaults'], 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['pi_version'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" style="border:none;" alt="?"/>', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#Reset_System_Options'));
        $T->parse('output', 'admin');
        $display = COM_siteHeader();
        $display .= $T->finish($T->get_var('output'));
        $display .= COM_siteFooter();
        echo $display;
        exit;
        break;
}
Example #5
0
}
/**
* Main
*/
$mode = isset($_REQUEST['mode']) ? COM_applyFilter($_REQUEST['mode']) : '';
$display = '';
$mode = '';
if (isset($_POST['mode'])) {
    $mode = $_POST['mode'];
} else {
    if (isset($_GET['mode'])) {
        $mode = $_GET['mode'];
    }
}
$T = new Template($_MG_CONF['template_path'] . '/admin');
$T->set_file(array('admin' => 'administration.thtml'));
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'mg_navigation' => MG_navigation(), 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['pi_version']));
if ($mode == $LANG_MG01['save'] && !empty($LANG_MG01['save'])) {
    $T->set_var(array('admin_body' => MG_staticSortMediaSave(), 'mg_navigation' => MG_navigation()));
} elseif ($mode == $LANG_MG01['cancel']) {
    echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
    exit;
} else {
    $T->set_var(array('admin_body' => MG_staticSortMediaOptions(), 'title' => $LANG_MG01['static_sort_media'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" border="0" alt="?">', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#Static_Sort_Media'));
}
$T->parse('output', 'admin');
$display = COM_siteHeader();
$display .= $T->finish($T->get_var('output'));
$display .= COM_siteFooter();
echo $display;
exit;
Example #6
0
}
$memory_limit = MG_return_bytes(ini_get('memory_limit'));
if ($tc_installed == 0) {
    $noCache = 1;
    $cacheCheck = '<div style="background-color:#ffff00;color:#000000;vertical-align:middle;padding:5px;"><img src="redX.png" alt="error" style="padding:5px;vertical-align:middle;">&nbsp;' . $LANG_MG00['tc_error'] . '</div>';
} else {
    $noCache = 0;
    $cacheCheck = '<div style="vertical-align:middle;padding:5px;"><img src="check.png" alt="OK" style="padding:5px;vertical-align:middle;">' . $LANG_MG00['tc_ok'] . '</div>';
}
if ($memory_limit < 50331648) {
    $noMemory = 1;
    $memoryCheck = '<div style="background-color:#ffff00;color:#000000;vertical-align:middle;padding:5px;"><img src="redX.png" alt="error" style="padding:5px;vertical-align:middle;">&nbsp;' . $LANG_MG00['ml_error'] . '</div>';
} else {
    $noMemory = 0;
    $memoryCheck = '<div style="vertical-align:middle;padding:5px;"><img src="check.png" alt="OK" style="padding:5px;vertical-align:middle;">' . $LANG_MG00['ml_ok'] . '</div>';
}
$T = new Template($_MG_CONF['template_path'] . '/admin');
$T->set_file(array('admin' => 'success.thtml'));
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'cache_check' => $cacheCheck, 'memory_check' => $memoryCheck, 'mg_navigation' => MG_navigation(), 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['pi_version'], 'thank_you' => $LANG_MG00['thank_you'], 'support' => $LANG_MG00['support'], 'success_upgrade' => $LANG_MG00['success_upgrade']));
if ($noCache) {
    $T->set_var('need_cache', $LANG_MG00['need_cache']);
}
if ($noMemory) {
    $T->set_var('need_memory', $LANG_MG00['need_memory']);
}
$T->parse('output', 'admin');
$display = COM_siteHeader();
$display .= $T->finish($T->get_var('output'));
$display .= COM_siteFooter();
echo $display;
exit;
Example #7
0
}
if (isset($_POST['mode'])) {
    $mode = $_POST['mode'];
    if ($mode == $LANG_MG01['save'] && !empty($LANG_MG01['save'])) {
        // save the album...
        // OK, we have a save, now we need to see what we are saving...
        if (isset($_POST['action'])) {
            $action = COM_applyFilter($_POST['action']);
            if ($action == 'moderate') {
                $display .= MG_saveModeration($album_id, $_MG_CONF['admin_url'] . 'index.php');
                echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
                exit;
                echo $display;
                exit;
            }
        }
    } else {
        echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
        exit;
    }
} else {
    $T = new Template($_MG_CONF['template_path'] . '/admin');
    $T->set_file(array('admin' => 'administration.thtml'));
    $T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'admin_body' => MG_userModerate(-1, $_MG_CONF['admin_url'] . 'queue.php'), 'mg_navigation' => MG_navigation(), 'title' => $LANG_MG01['media_queue'], 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['pi_version']));
    $T->parse('output', 'admin');
    $display = COM_siteHeader();
    $display .= $T->finish($T->get_var('output'));
    $display .= COM_siteFooter();
    echo $display;
    exit;
}
Example #8
0
function MG_adminBox($mode)
{
    global $_MG_CONF, $LANG_MG08;
    $retval = '';
    if ($mode == 'install') {
        $retval .= '<h3>' . $LANG_MG08['success'] . '</h3><br />' . $LANG_MG08['review'] . '<br /><br />';
    }
    $retval .= $LANG_MG08['support'] . '<br /><br />';
    return $retval;
}
// main menu for media gallery administration
$display = '';
if (isset($_GET['mode'])) {
    $mode = COM_applyFilter($_GET['mode']);
} else {
    $mode = '';
}
USES_lib_admin();
$T = new Template($_MG_CONF['template_path'] . '/admin');
$T->set_file(array('admin' => 'administration.thtml'));
$T->set_var(array('site_url' => $_MG_CONF['site_url'], 'site_admin_url' => $_CONF['site_admin_url'], 'mg_navigation' => MG_navigation(), 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['pi_version'], 'admin_body' => plugin_showstats_mediagallery(0), 'title' => $LANG_MG00['admin']));
$T->parse('output', 'admin');
$display = COM_siteHeader();
$msg = COM_getMessage();
if ($msg > 0) {
    $display .= COM_showMessageText($LANG_MG09[$msg], 'mediagallery');
}
$display .= $T->finish($T->get_var('output'));
$display .= COM_siteFooter();
echo $display;
exit;