Editor/Clips: Database class integration.

This commit is contained in:
Nate
2019-08-05 20:41:09 -06:00
parent d3c6182f85
commit b47615c389
5 changed files with 89 additions and 79 deletions
+6 -8
View File
@@ -44,7 +44,7 @@ require_once "header.php";
function isfile($filename) {
if (@filesize($filename) > 0) { return true; } else { return false; }
return @filesize($filename) > 0 ? true : false;
}
function space($count) {
@@ -157,12 +157,11 @@ echo "<div style='text-align: left; padding-top: 3px;'>\n";
echo "<div style='padding-bottom: 3px;'><a href='javascript:void(0);' onclick=\"window.open('clipoptions.php?id=".$row[id]."','clipwin','left=20,top=20,width=310,height=350,toolbar=0,resizable=0');\" style='text-decoration:none; cursor: pointer;' title=\"".$text['label-clip-library']."\"><img src='".PROJECT_PATH."resources/images/icon_gear.png' border='0' align='absmiddle' style='margin: 0px 2px 4px -1px;'>".$text['label-clip-library']."</a></div>\n";
$sql = "select * from v_clips order by clip_folder asc, clip_name asc";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
$database = new database;
$result = $database->select($sql, null, 'all');
unset($sql);
if ($result_count > 0) {
if (is_array($result) && @sizeof($result) != 0) {
$master_array = array();
foreach ($result as $row) {
$clip_folder = rtrim($row['clip_folder'], '/');
@@ -185,6 +184,7 @@ if ($result_count > 0) {
$master_array = array_merge_recursive($master_array, $folders);
}
unset($result, $row);
function parse_array($arr) {
if (is_array($arr)) {
@@ -216,7 +216,5 @@ if ($result_count > 0) {
echo "</div>\n";
//echo "<pre>".print_r($master_array, true)."</pre>";
require_once "footer.php";
?>