diff --git a/app/db_connector.php b/app/db_connector.php
index 1ceaef0..8d57fc9 100755
--- a/app/db_connector.php
+++ b/app/db_connector.php
@@ -1,5 +1,6 @@
getMessage();
}
-function get_images($pdo, $search='%', $sort='img_date', $sdir='DESC') {
- if ($sort != 'img_date' && $sdir != 'ASC') {
- if ($sort != 'img_title' && $sdir != 'DESC') {
- echo('Ey boss, database request is kinda f*cked up. Maybe you want to try that again, hey...
'.$sort.' '.$sdir);
- die();
+
+ function get_images($pdo, $search='%', $sort='img_date', $sdir='DESC') {
+ if ($sort != 'img_date' && $sdir != 'ASC') {
+ if ($sort != 'img_title' && $sdir != 'DESC') {
+ echo('Ey boss, database request is kinda f*cked up. Maybe you want to try that again, hey...
'.$sort.' '.$sdir);
+ die();
+ }
}
- }
- $params = array('search' => $search);
- $stmt = $pdo->prepare("SELECT * FROM images WHERE img_title LIKE CONCAT('%', :search ,'%') ORDER BY $sort $sdir;");
- $stmt->execute($params);
- // $stmt->debugDumpParams();
- $data = $stmt->fetchAll();
+ $params = array('search' => $search);
+ $stmt = $pdo->prepare("SELECT * FROM images WHERE img_title LIKE CONCAT('%', :search ,'%') ORDER BY $sort $sdir;");
+ $stmt->execute($params);
+ // $stmt->debugDumpParams();
+ $data = $stmt->fetchAll();
- $img_list = '
';
- foreach ($data as $block) {
- $img_list .= '- ';
- $img_list .= '

';
- $img_list .= ''.$block['img_title']."
";
- $img_list .= ''.$block['img_desc']."
";
- $img_list .= ' ';
- }
- $img_list .= '
';
- echo $img_list;
-}
-
-function get_audio($pdo, $search='%', $sort='aud_date', $sdir='DESC') {
- if ($sort != 'aud_date' && $sdir != 'ASC') {
- if ($sort != 'aud_title' && $sdir != 'DESC') {
- echo('Ey boss, database request is kinda f*cked up. Maybe you want to try that again, hey...
'.$sort.' '.$sdir);
- die();
+ $img_list = '';
+ foreach ($data as $block) {
+ $img_list .= '- ';
+ $img_list .= '

';
+ $img_list .= ''.$block['img_title']."
";
+ $img_list .= ''.$block['img_desc']."
";
+ $img_list .= ' ';
}
+ $img_list .= '
';
+ echo $img_list;
}
- $params = array('search' => $search);
- $stmt = $pdo->prepare("SELECT * FROM audio WHERE aud_title LIKE CONCAT('%', :search ,'%') ORDER BY $sort $sdir;");
- $stmt->execute($params);
- // $stmt->debugDumpParams();
- $data = $stmt->fetchAll();
- $aud_list = '';
- foreach ($data as $block) {
- $aud_list .= '- ';
- $aud_list .= '
';
- $aud_list .= '

';
- $aud_list .= '
';
- $aud_list .= '
';
- $aud_list .= ''.$block['aud_title']."
";
- $aud_list .= ''.$block['aud_desc']."
";
- $aud_list .= 'download
'; // TODO: mask dl link with helper class
- $aud_list .= ' ';
- }
- $aud_list .= '
';
- echo $aud_list;
-}
+ function get_audio($pdo, $search='%', $sort='aud_date', $sdir='DESC') {
+ if ($sort != 'aud_date' && $sdir != 'ASC') {
+ if ($sort != 'aud_title' && $sdir != 'DESC') {
+ echo('Ey boss, database request is kinda f*cked up. Maybe you want to try that again, hey...
'.$sort.' '.$sdir);
+ die();
+ }
+ }
+ $params = array('search' => $search);
+ $stmt = $pdo->prepare("SELECT * FROM audio WHERE aud_title LIKE CONCAT('%', :search ,'%') ORDER BY $sort $sdir;");
+ $stmt->execute($params);
+ // $stmt->debugDumpParams();
+ $data = $stmt->fetchAll();
-function get_album_cover($title) {
- // TODO: put actual code here, maybe steal from this lib https://github.com/wapmorgan/Mp3Info/blob/master/src/Mp3Info.php
- return "nopathyet";
-}
+ $aud_list = '';
+ foreach ($data as $block) {
+ $aud_list .= '- ';
+ $aud_list .= '
';
+ $aud_list .= '

';
+ $aud_list .= '
';
+ $aud_list .= '
';
+ $aud_list .= ''.$block['aud_title']."
";
+ $aud_list .= ''.$block['aud_desc']."
";
+ $aud_list .= '';
+ $aud_list .= ' ';
+ }
+ $aud_list .= '
';
+ echo $aud_list;
+ }
\ No newline at end of file
diff --git a/app/downloader.php b/app/downloader.php
index e69de29..8d70859 100755
--- a/app/downloader.php
+++ b/app/downloader.php
@@ -0,0 +1,32 @@
+