function nyxInGetGalleriesSelectBox($name, $parent_id, $nestLevel, $showRoot, $default_selection, $admin) { //On the Admin Page, Ajax onChange is hidden. global $nyxIn; if ($nestLevel == 0) { ?> <select name="<?php echo $name; ?> " <?php if ($admin == 0) { ?> onChange="nyxIn_Ajax_Views('g', this.value, '')"<?php } ?> > <?php } if ($showRoot == 1) { echo "<option value='0'>Home</option>\n"; $nestLevel++; } $query = $nyxIn['db']->query("SELECT * FROM " . $nyxIn['db_prefix'] . "galleries WHERE parent_id='{$parent_id}' AND deleted_status='0' ORDER BY order_int, name") or die($nyxIn['db']->error); while ($row = $query->fetch_object()) { echo "<option value='" . $row->id . "'"; if ($row->id == $default_selection) { echo " selected='selected'"; } echo ">" . str_repeat("-", $nestLevel) . $row->name . "</option>\n"; nyxInGetGalleriesSelectBox("", $row->id, $nestLevel + 1, 0, $default_selection, $admin); } if ($nestLevel == 0 || $showRoot == 1 && $nestLevel == 1) { echo "</select>\n"; } }
if ($fail == 0) { foreach ($organized_images as $key => $image_id) { $nyxIn['db']->query("UPDATE " . $nyxIn['db_prefix'] . "images SET order_int='{$key}' WHERE id={$image_id}") or die($nyxIn['db']->error); } } } } ?> <div id="nyxIn_Admin_Content"> <?php require "admin/failure_check.php"; ?> <h3>Select a Gallery</h3> <form method="post" action="?admin=1&nyxIn_Admin_Menu=gallery_organization&nyxIn_Admin_Action=select_gallery"> <?php nyxInGetGalleriesSelectBox("gallery_id", 0, 0, 1, $gallery_id, 1); ?> <input type="submit" value="Organize"> </form> <?php if ($gallery_id == 0) { $nyxIn_Var_galleries_name = "Home"; } else { $nyxIn_Query_SelectMetadataFrom_galleries = $nyxIn['db']->query("SELECT * FROM " . $nyxIn['db_prefix'] . "galleries WHERE id='{$gallery_id}' AND deleted_status='0'") or die($nyxIn['db']->error); $nyxIn_Obj_galleries = $nyxIn_Query_SelectMetadataFrom_galleries->fetch_object(); $nyxIn_Var_galleries_name = $nyxIn_Obj_galleries->name; } ?> <form method="post" action="?admin=1&nyxIn_Admin_Menu=gallery_organization&nyxIn_Admin_Action=organize_gallery"> <h3>Organizing <u><?php echo $nyxIn_Var_galleries_name;
if ($nyxIn_Var_galleries_locked_status == 1) { if (isset($_POST['password'])) { $nyxIn_Frm_gallery_password = $_POST['password']; } else { $nyxIn_Frm_gallery_password = 0; } if (nyxInVerifyPassword($nyxIn_Var_images_gallery_id, $nyxIn_Frm_gallery_password) == true) { $nyxIn_Var_has_access_to_gallery = 1; } else { $nyxIn_Var_has_access_to_gallery = 0; } } else { $nyxIn_Var_has_access_to_gallery = 1; } if ($nyxIn_Var_has_access_to_gallery == 1) { ?> <p>Quick Navigate: <?php nyxInGetGalleriesSelectBox("nyxIn-gallery_quickswitch", 0, 0, 1, $nyxIn_Var_images_gallery_id, 0); ?> </p> <?php nyxInFormatTitle($nyxIn_Var_images_gallery_id, 1); echo "<img src='" . $nyxIn['dir'] . "/uploads/{$nyxIn_Var_images_safename}' width='100%'>"; echo "Views: {$nyxIn_Var_images_views}"; echo "<br>"; echo "Filesize: {$nyxIn_Var_images_filename} bytes"; if (!$nyxIn_Var_images_description == "") { echo "<p class='galleryDescription'>{$nyxIn_Var_images_description}</p>"; } } else { }
<?php // [nyxIn/views/g.php] // // This file is the view for the gallery page. // $nyxIn_Frm_ajaxed_id = $_POST['id']; ?> <p>Quick Navigate: <?php nyxInGetGalleriesSelectBox("nyxIn-gallery_quickswitch", 0, 0, 1, $nyxIn_Frm_ajaxed_id, 0); ?> </p> <?php if (!$nyxIn_Frm_ajaxed_id == 0) { $nyxIn_Query_SelectMetadataFrom_galleries = $nyxIn['db']->query("SELECT * FROM " . $nyxIn['db_prefix'] . "galleries WHERE id=" . $nyxIn_Frm_ajaxed_id . " AND deleted_status='0'") or die($nyxIn['db']->error); $nyxIn_Obj_galleries = $nyxIn_Query_SelectMetadataFrom_galleries->fetch_object(); $nyxIn_Var_galleries_id = $nyxIn_Obj_galleries->id; $nyxIn_Var_galleries_description = $nyxIn_Obj_galleries->description; $nyxIn_Var_galleries_locked_status = $nyxIn_Obj_galleries->locked_status; $nyxIn_Var_galleries_password = $nyxIn_Obj_galleries->password; nyxInFormatTitle($nyxIn_Var_galleries_id, 0); if ($nyxIn_Var_galleries_locked_status == 1) { if (isset($_POST['password'])) { $nyxIn_Frm_gallery_password = $_POST['password']; } else { $nyxIn_Frm_gallery_password = 0; } if (nyxInVerifyPassword($nyxIn_Var_galleries_id, $nyxIn_Frm_gallery_password) == true) { $nyxIn_Var_has_access_to_gallery = 1; } else { $nyxIn_Var_has_access_to_gallery = 0;
</form> <h3>Rename Gallery</h3> <form method="post" action="?admin=1&nyxIn_Admin_Menu=galleries_management&nyxIn_Admin_Action=rename_gallery"> <p>Rename <?php nyxInGetGalleriesSelectBox("to_rename", 0, 0, 0, 0, 1); ?> to <input type="text" name="new_name"> <input type="submit" value="Rename Gallery"></p> </form> <h3>Move Gallery</h3> <form method="post" action="?admin=1&nyxIn_Admin_Menu=galleries_management&nyxIn_Admin_Action=move_gallery"> <p>Move <?php nyxInGetGalleriesSelectBox("to_move", 0, 0, 0, 0, 1); ?> under <?php nyxInGetGalleriesSelectBox("move_to", 0, 0, 1, 0, 1); ?> <input type="submit" value="Move Gallery"></p> </form> <h3>Delete Gallery</h3> <form method="post" action="?admin=1&nyxIn_Admin_Menu=galleries_management&nyxIn_Admin_Action=delete_gallery"> <p>Remove <?php nyxInGetGalleriesSelectBox("to_delete", 0, 0, 0, 0, 1); ?> <input type="submit" value="Delete Gallery"> </p> <p>All child galleries and images will be deleted.<p> </form> </div> <?php } else { require "admin/permission_error.php"; }