diff --git a/Pages/profile.php b/Pages/profile.php index f7aac43..c531d27 100644 --- a/Pages/profile.php +++ b/Pages/profile.php @@ -8,6 +8,11 @@ use App\Wrappers\TwigWrapper; require_once __DIR__ . "/../vendor/autoload.php"; +if(!$_SESSION[SessionElement::IS_LOGGED_IN->value]) +{ + header("Location: /login"); + die(); +} $db = new DatabaseInteractions(); @@ -40,24 +45,30 @@ $yourTuneSets = $db->RunSelect( ) AS TunesInSet" ]) ->join( - join: 'LEFT', + join: 'INNER', spec: 'TuneSetTunes AS T_TST', cond: 'T.ID=T_TST.TuneSetID' ) ->join( - join: 'LEFT', + join: 'INNER', spec: 'Tunes AS T_T', cond: 'T_TST.TuneID=T_T.ID' ) ->where(cond: 'T.CreatedBy LIKE :__user_id__') + ->groupBy(spec: [ + 'T.ID', + ]) ->orderBy(spec: [ 'T_TST.Order ASC', ]) ->bindValue(name: '__user_id__', value: SessionWrapper::Get(target: SessionElement::USER_ID)) ); -for($i = 0; $i < sizeof($yourTuneSets); $i++) - $yourTuneSets[$i]["TunesInSet"] = json_decode($yourTuneSets[$i]["TunesInSet"], true); +for($i = 0, $iMax = count($yourTuneSets); $i < $iMax; $i++) +{ + $yourTuneSets[$i]["TunesInSet"] = json_decode($yourTuneSets[$i]["TunesInSet"], true, 512, JSON_THROW_ON_ERROR); +} + $yourLikedTunes = $db->RunSelect( queryBuilder: SQLQueryBuilderWrapper::SELECT( diff --git a/Pages/tune-set/uuid.php b/Pages/tune-set/uuid.php index 1787c76..c2f670a 100644 --- a/Pages/tune-set/uuid.php +++ b/Pages/tune-set/uuid.php @@ -34,9 +34,11 @@ $tunesInSet = $db->RunSelect( spec: 'Tunes AS T_T', cond: 'T.TuneID=T_T.ID', ) + ->where(cond: 'T.TuneSetID LIKE :__tune_set_id__') ->orderBy(spec: [ 'T.Order ASC', ]) + ->bindValue(name: '__tune_set_id__', value: $_GET["tune-set-id"]) ); TwigWrapper::RenderTwig( diff --git a/Public/Static/Assets/Images/Logos/Musescore.png b/Public/Static/Assets/Images/Logos/Musescore.png new file mode 100644 index 0000000..6ce5d57 Binary files /dev/null and b/Public/Static/Assets/Images/Logos/Musescore.png differ diff --git a/Templates/Pages/tune/uuid.html.twig b/Templates/Pages/tune/uuid.html.twig index c865e14..da1c430 100644 --- a/Templates/Pages/tune/uuid.html.twig +++ b/Templates/Pages/tune/uuid.html.twig @@ -45,13 +45,6 @@
-
-

{{ "Audio"|translate }}

-

-                        
-                        
-                    
-

{{ "Tune Overview"|translate }}

@@ -64,6 +57,23 @@
{{ TuneDetails.Parts|json_encode }}
+

{{ "Links"|translate }}

+ +
+ +
+

{{ "Audio"|translate }}

+

+                        
+