function nyxIsFreeGallery($gallery_id) { global $nyxIn; if ($gallery_id == 0) { return true; } 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_parent_id = $nyxIn_Obj_galleries->parent_id; $nyxIn_Var_galleries_locked_status = $nyxIn_Obj_galleries->locked_status; if ($nyxIn_Var_galleries_locked_status == 1) { return false; } else { nyxIsFreeGallery($nyxIn_Var_galleries_parent_id); } } }
</table> <br> <h4>Top 15 Most Viewed Images</h4> <table width="100%"> <tr> <?php if ($nyxIn['preferences']['display_moderated_only'] == 0) { $nyxIn_Query_SelectTop15 = $nyxIn['db']->query("SELECT * FROM " . $nyxIn['db_prefix'] . "images AS i," . $nyxIn['db_prefix'] . "galleries AS g WHERE i.deleted_status='0' AND i.gallery_id=g.id AND g.password_status='0' ORDER BY views DESC") or die($nyxIn['db']->error); } else { if ($nyxIn['preferences']['display_moderated_only'] == 1) { $nyxIn_Query_SelectTop15 = $nyxIn['db']->query("SELECT * FROM " . $nyxIn['db_prefix'] . "images AS i," . $nyxIn['db_prefix'] . "galleries AS g WHERE i.deleted_status='0' AND i.gallery_id=g.id AND g.locked_status='0' AND i.moderation_status=1 ORDER BY views DESC") or die($nyxIn['db']->error); } } $nyxIn_ViewOrder = 0; while ($row = $nyxIn_Query_SelectTop15->fetch_object()) { if (nyxIsFreeGallery($row->gallery_id) == true) { $views = $row->views; $safename = $row->safename . "_thumb." . $row->fileextension; ?> <td width="20%" valign="top"> <p class="top15">#<?php echo $nyxIn_ViewOrder + 1; ?> </p> <span class="ajaxed" onClick="nyxIn_Ajax_Views('i', <?php echo $row->id; ?> ,'')"> <img src="<?php echo $nyxIn['dir']; ?>