$myts =& MyTextSanitizer::getInstance();
// GPCS vars
$max_col = 4;
$cid = empty($_GET['cid']) ? 0 : intval($_GET['cid']);
$pos = empty($_GET['pos']) ? 0 : intval($_GET['pos']);
$num = empty($_GET['num']) ? 20 : intval($_GET['num']);
$txt = empty($_GET['txt']) ? '' : $myts->stripSlashesGPC(trim($_GET['txt']));
// Database actions
if (!empty($_POST['action']) && $_POST['action'] == 'delete' && isset($_POST['ids']) && is_array($_POST['ids'])) {
    // remove records
    // Ticket Check
    if (!$xoopsGTicket->check()) {
        redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
    }
    foreach ($_POST['ids'] as $lid) {
        myalbum_delete_photos("lid=" . intval($lid));
    }
    redirect_header("photomanager.php?num={$num}&cid={$cid}", 2, _ALBM_DELETINGPHOTO);
    exit;
} else {
    if (isset($_POST['update']) && isset($_POST['ids']) && is_array($_POST['ids'])) {
        // batch update
        // Ticket Check
        if (!$xoopsGTicket->check()) {
            redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
        }
        // set clause for text table
        if (!empty($_POST['new_desc_text'])) {
            $set_for_text = "description='" . $myts->makeTareaData4Save($_POST['new_desc_text']) . "'";
        }
        // set clause for photos table
Exemplo n.º 2
0
            // anti-CSRF (Double Check)
            if (!xoops_refcheck()) {
                die("XOOPS_URL is not included in your REFERER");
            }
            // Delete
            $cid = intval($_POST['delcat']);
            //get all categories under the specified category
            $children = $cattree->getAllChildId($cid);
            $whr = "cid IN (";
            foreach ($children as $child) {
                $whr .= "{$child},";
                xoops_notification_deletebyitem($myalbum_mid, 'category', $child);
            }
            $whr .= "{$cid})";
            xoops_notification_deletebyitem($myalbum_mid, 'category', $cid);
            myalbum_delete_photos($whr);
            $xoopsDB->query("DELETE FROM {$table_cat} WHERE {$whr}") or die("DB error: DELETE cat table");
            redirect_header('index.php', 2, _ALBM_CATDELETED);
            exit;
        } else {
            if (!empty($_POST['batch_update'])) {
                // Batch update
            }
        }
    }
}
//
// Form Part
//
xoops_cp_header();
include './mymenu.php';
Exemplo n.º 3
0
        @chmod($thumbs_dir, 0777);
    }
}
if (!empty($_POST['submit'])) {
    ob_start();
    $result = $xoopsDB->query("SELECT lid , ext , res_x , res_y FROM {$table_photos} ORDER BY lid LIMIT {$start} , {$size}") or die("DB Error");
    $record_counter = 0;
    while (list($lid, $ext, $w, $h) = $xoopsDB->fetchRow($result)) {
        $record_counter++;
        echo $record_counter + $start - 1 . ") ";
        printf(_AM_FMT_CHECKING, "{$lid}.{$ext}");
        // Check if the main image exists
        if (!is_readable("{$photos_dir}/{$lid}.{$ext}")) {
            echo _AM_MB_PHOTONOTEXISTS . "   ";
            if ($removerec) {
                myalbum_delete_photos("lid='{$lid}'");
                echo _AM_MB_RECREMOVED . "<br />\n";
            } else {
                echo _AM_MB_SKIPPED . "<br />\n";
            }
            continue;
        }
        // Check if the file is normal image
        if (!in_array(strtolower($ext), $myalbum_normal_exts)) {
            if ($forceredo || !is_readable("{$thumbs_dir}/{$lid}.gif")) {
                myalbum_create_thumb("{$photos_dir}/{$lid}.{$ext}", $lid, $ext);
                echo _AM_MB_CREATEDTHUMBS . "<br />\n";
            } else {
                echo _AM_MB_SKIPPED . "<br />\n";
            }
            continue;