$_rows = $query->fetchAll();
    $check_rows = sizeof($_rows);
    if ($check_rows > 0 and $checkss == md5($playlist_id . session_id() . $global_config['sitekey'])) {
        foreach ($_rows as $row) {
            $arr_catid = explode(',', $row['listcatid']);
            foreach ($arr_catid as $catid_i) {
                $db->query('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_' . $catid_i . ' SET playlist_id = 0 WHERE id =' . $row['id']);
            }
            $db->query('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_rows SET playlist_id = 0 WHERE id =' . $row['id']);
        }
        $check_del_playlist_id = true;
    } elseif ($check_rows > 0) {
        $contents = 'ERR_ROWS_' . $playlist_id . '_' . md5($playlist_id . session_id() . $global_config['sitekey']) . '_' . sprintf($lang_module['delplaylist_msg_rows'], $check_rows);
    } else {
        $check_del_playlist_id = true;
    }
    if ($check_del_playlist_id) {
        $query = 'DELETE FROM ' . NV_PREFIXLANG . '_' . $module_data . '_playlists WHERE playlist_id=' . $playlist_id;
        if ($db->exec($query)) {
            nv_fix_playlist();
            if (is_file(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $module_upload . '/playlists/' . $image)) {
                nv_deletefile(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $module_upload . '/playlists/' . $image);
            }
            $contents = 'OK_' . $playlist_id;
        }
    }
    $nv_Cache->delMod($module_name);
}
include NV_ROOTDIR . '/includes/header.php';
echo $contents;
include NV_ROOTDIR . '/includes/footer.php';
Beispiel #2
0
    $result = $db->query($sql);
    $_id_array_exit = array();
    while (list($_id) = $result->fetch(3)) {
        $_id_array_exit[] = $_id;
    }
    $id_array = array_map('intval', $nv_Request->get_array('idcheck', 'post'));
    foreach ($id_array as $id) {
        if (!in_array($id, $_id_array_exit)) {
            try {
                $db->query('INSERT INTO ' . NV_PREFIXLANG . '_' . $module_data . '_playlist (playlist_id, id, playlist_sort) VALUES (' . $playlist_id . ', ' . $id . ', 0)');
            } catch (PDOException $e) {
                trigger_error($e->getMessage());
            }
        }
    }
    nv_fix_playlist($playlist_id);
    nv_del_moduleCache($module_name);
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&playlist_id=' . $playlist_id);
    die;
}
$select_options = array();
foreach ($array_playlist as $xplaylist_id => $playlistname) {
    $select_options[NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&playlist_id=' . $xplaylist_id] = $playlistname;
}
$xtpl = new XTemplate('playlist.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('GLANG', $lang_global);
$xtpl->assign('NV_BASE_ADMINURL', NV_BASE_ADMINURL);
$xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
$xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
$xtpl->assign('MODULE_NAME', $module_name);