Esempio n. 1
1
function del_users($select)
{
	global $users_filename;
	$users = array();
	$users_content = get_file_content($users_filename);
	if ($users_content !== NULL) $users = unserialize($users_content);
	$users = del_id($users, $select);
	$users_content = serialize($users);
	put_file_content($users_filename, $users_content);
	clean_user();
}
Esempio n. 2
1
function cleaner()
{
	global $data_filename, $max_entries;
	if ($max_entries == 0) return false;
	$data = array();
	$data_content = get_file_content($data_filename);
	if ($data_content !== NULL) $data = unserialize($data_content);
	while (count($data) >= $max_entries) $data = del_id($data, array(0));
	$data_content = serialize($data);
	put_file_content($data_filename, $data_content);
	return true;
}
Esempio n. 3
1
function get_tit($idtap)
{
    global $wpdb, $idphim;
    $idtap = del_id($idtap);
    $fivesdrafts = $wpdb->get_row("SELECT episode_id, episode_name, episode_type, episode_url\n\tFROM wp_film_episode\n\tWHERE episode_id='" . $idtap . "'");
    $tap = $fivesdrafts->episode_name;
    return $tap;
}
Esempio n. 4
1
            }
        }
    }
    header('Location: admin.php');
}
function add_database($db)
{
    if ($fd = fopen('../private/bde.csv', 'a+')) {
        foreach ($_POST as &$value) {
            $value = htmlspecialchars($value);
        }
        if (!isset($db[$_POST['id']]) && flock($fd, LOCK_EX | LOCK_NB)) {
            fputcsv($fd, create_dbo($_POST['location'], $_POST['name'], $_POST['categories'], $_POST['price'], $_POST['description'], $_POST['id']), ';');
            flock($fd, LOCK_UN);
        } else {
            $new = create_dbo($_POST['location'], $_POST['name'], $_POST['categories'], $_POST['price'], $_POST['description'], $_POST['id']);
            modify_item($db, $new, $_POST['id']);
        }
        fclose($fd);
    }
    header('Location: admin.php');
}
if (isset($_POST['submit'])) {
    if ($_POST['submit'] == 'add_db') {
        add_database(get_database());
    } else {
        if ($_POST['submit'] == 'del_db') {
            del_id(get_database(), $_POST['id']);
        }
    }
}