"; $search = array ("/[\n\r]+/i","/\"/i"); $replace = array ("
","""); $albums_txt_file = "albums.txt"; $form_tag = "
"; $table_tag = ""; include $php_base_dir."check_session.php"; if ($action == "save") { load_album_list (); f_change (); $albums = f_sort ($albums, "date"); f_save (); load_album_list (); album_list (); } else if ($action == "delete_album") { load_album_list (); f_delete (); f_save (); load_album_list (); album_list (); } else if ($action == "save_album") { load_album_list (); load_album (); p_change (); p_save (); load_album (); show_album (); } else if ($action == "move_photo") { load_album_list (); load_album (); p_move (); p_save (); load_album (); show_album (); } else if ($action == "delete_photo") { load_album_list (); load_album (); p_delete (); p_save (); load_album (); show_album (); } else if ($album) { load_album_list (); load_album (); show_album (); } else if ($action == "session_logout") { $_SESSION["sd"] = ""; include $php_base_dir."check_session.php"; } else if ($action == "do_thumbs") { load_album_list (); do_thumbs (); album_list (); } else { load_album_list (); album_list (); } #======================================== function is_x_element_l_key ($x, $l, $key) { $count = count ($l); $answer = 0; for ($i = 0 ; $i < $count && $answer == 0 ; $i++) { if ($x == $l[$i][$key]) { $answer = 1; } } return $answer; } #======================================== function do_thumbs () { global $php_base_dir, $albums, $thumb_dir; if (!file_exists ($php_base_dir."albums/thumbs_$thumb_dir")) { mkdir ($php_base_dir."albums/thumbs_$thumb_dir"); } $handle = opendir($php_base_dir."albums/$thumb_dir"); # ?>
$album, "title" => $album, "cols" => 4); $rows++; } } } # print_r ($albums); # ?>

\n"; ($filled) ? $filled = "" : $filled = "filled"; cover_box ($filled); title_box ("left", $filled); print "\n"; } ?>
valign=middle bgcolor=>
Titel: ">
Datum: .. Keen Datum? >
Cover:
Fotoen: ">
Kolonnen: Album aktiv? >

">
bgcolor= width=140>">" border=0> bgcolor= width=140> 
>


>
no album.txt file in album directory"; # include "../fanfare_footer.php"; exit; # } $count = count($album_txt); $row = 0; for ($i = 0 ; $i < $count ; $i += 3) { $photos[$row]["image"] = chop($album_txt[$i]); $photos[$row]["text"] = chop($album_txt[$i+1]); $photos[$row]["rowspan"] = chop($album_txt[$i+2]); $row++; } if ($photos[$row-1]["image"] == "") { unset ($photos[$row-1]); $rows = $row-1; } else { $rows = $row; } $handle = opendir($php_base_dir."albums/thumbs_".$album); $i = 0; while ($filename = readdir($handle)) { if (preg_match("/.*_s\..*$/i",$filename)) { $physical_photos_list[$i] = $filename; $i++; if (!(is_x_element_l_key ($filename, $photos, "image"))) { # print "

yeppa: $filename

"; $photos[$rows]["image"] = $filename; $rows++; } } } } #======================================== function show_album () { global $baseURL, $album, $albums, $photos, $meint, $form_tag, $physical_photos_list; global $dominante, $mediante, $tonique; $rows = count ($photos); # print_r ($albums); $i = 0; while ($i < count ($albums) && $album != $albums[$i]["dir"]) { $i++; } $albums_here = $albums[$i]; $cols = $albums_here["cols"]; if ($cols == "") { $cols = 3; } ?>


>

 

% >Positioun
".$photos[$i]["image"]; ?>
" vspace=5 border=0>

"; ?>>iwwer 2 Reie spaanen

row = $row, column = $column, "; # print "spanned_cols = $spanned_cols

"; if (!(is_x_element_l ($photos[$i]["image"], $physical_photos_list))) { print $form_tag; ?>

align=right>

 

align=right>
> Foto vu Positioun op Positioun réckelen?

 


>

misc = $misc"; if ($misc == "misc") { $time = 0; } else { $time = strtotime ("$year-$month-$day"); # echo "time = $time
"; } $albums[$num]["date"] = $time; $albums[$num]["title"] = preg_replace($search,$replace,stripslashes($title)); $albums[$num]["cover"] = $cover; $albums[$num]["paparazzi"] = preg_replace($search,$replace,stripslashes($paparazzi)); $albums[$num]["cols"] = $cols; $albums[$num]["active"] = $active; # ?>

"; # print_r ($albums[$row]); # echo ""; # print $albums[$row]["dir"]." - ".$albums[$row]["title"]."
"; } fclose ($handle); } #======================================== function f_sort ($list, $key) { $new_list_misc = array(); $rows = count ($list); while (0 < $rows) { $highest = 0; for ($row = 1 ; $row < $rows ; $row++) { if ($list[$highest][$key] < $list[$row][$key]) { $highest = $row; } } if ($list[$highest][$key] != 0) { $new_list[] = $list[$highest]; } else { $new_list_misc[] = $list[$highest]; } unset ($list[$highest]); $list = array_values ($list); $rows--; } return array_merge ($new_list, $new_list_misc); } #======================================== function p_change () { global $photos, $search, $replace; $rows = count($photos); for ($row = 0 ; $row < $rows ; $row++) { $txt = "text".$row; $photos[$row]["text"] = preg_replace($search,$replace,stripslashes($_REQUEST[$txt])); $txt = "rowspan".$row; $photos[$row]["rowspan"] = $_REQUEST[$txt]; } } #======================================== function p_move () { global $photos, $move_from, $move_to; $rows = count($photos); if ($move_to < $move_from) { $moving_photo = $photos[$move_from]; for ($row = $move_from ; $move_to < $row ; $row--) { $photos[$row] = $photos[$row-1]; } $photos[$move_to] = $moving_photo; } else { $moving_photo = $photos[$move_from]; for ($row = $move_from ; $row < $move_to ; $row++) { $photos[$row] = $photos[$row+1]; } $photos[$move_to] = $moving_photo; } } #======================================== function p_save () { global $photos, $album; $rows = count($photos); $handle = fopen ($album.".txt" , "w"); for ($row = 0 ; $row < $rows ; $row++) { fwrite ($handle , $photos[$row]["image"]."\n"); fwrite ($handle , $photos[$row]["text"]."\n"); fwrite ($handle , $photos[$row]["rowspan"]."\n"); # print $photos[$row]["image"]." - ".$photos[$row]["text"]."
"; } fclose ($handle); } #======================================== function p_delete () { global $photos, $num; unset ($photos[$num]); $photos = array_values ($photos); } #======================================== function xxx_album () { global $album, $php_base_dir; $handle = opendir($php_base_dir."albums/".$album); while ($filename = readdir($handle)) { if (preg_match("/.*_s\..*$/i",$filename)) { print "

$filename

\n"; } } print "

".$album."

"; } include "../fanfare_footer.php"; ?>