Subversion Repositories cheapmusic

Rev

Rev 104 | Rev 109 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 104 Rev 107
Line 69... Line 69...
69
 
69
 
70
        return;
70
        return;
71
    }
71
    }
72
 
72
 
73
    $_SESSION["discogs"] .= "<div class=\"container-fluid bg-secondary\">";
73
    $_SESSION["discogs"] .= "<div class=\"container-fluid bg-secondary\">";
74
    $_SESSION["discogs"] .= "<h4 class=\"text-center py-2\">" . ($str == "***RANDOM***" ? "Random " : "Matching ") . "Albums</h4>";
74
    $_SESSION["discogs"] .= "<h2 class=\"text-center py-2\">" . ($str == "***RANDOM***" ? "Random " : "Matching ") . "Albums</h2>";
75
    $_SESSION["discogs"] .= "<form method=\"post\" action=\"/index.php\">";
75
    $_SESSION["discogs"] .= "<form method=\"post\" action=\"/index.php\">";
76
    $_SESSION["discogs"] .= "<input type=\"hidden\" name=\"sessionTab\" value=\"" . MySessionHandler::getSessionTab() . "\">";
76
    $_SESSION["discogs"] .= "<input type=\"hidden\" name=\"sessionTab\" value=\"" . MySessionHandler::getSessionTab() . "\">";
77
    $_SESSION["discogs"] .= "<input id=\"discogsTitle\" type=\"hidden\" name=\"discogsTitle\" value=\"\">";
77
    $_SESSION["discogs"] .= "<input id=\"discogsTitle\" type=\"hidden\" name=\"discogsTitle\" value=\"\">";
78
    $_SESSION["discogs"] .= "<input id=\"discogsArtist\" type=\"hidden\" name=\"discogsArtist\" value=\"\">";
78
    $_SESSION["discogs"] .= "<input id=\"discogsArtist\" type=\"hidden\" name=\"discogsArtist\" value=\"\">";
79
    $_SESSION["discogs"] .= "<input id=\"discogsBarcode\" type=\"hidden\" name=\"discogsBarcode\" value=\"\">";
79
    $_SESSION["discogs"] .= "<input id=\"discogsBarcode\" type=\"hidden\" name=\"discogsBarcode\" value=\"\">";
Line 197... Line 197...
197
    $str .= "</div>";
197
    $str .= "</div>";
198
    if (empty($thumbnail) || preg_match("/spacer.gif$/", $thumbnail)) {
198
    if (empty($thumbnail) || preg_match("/spacer.gif$/", $thumbnail)) {
199
        $thumbnail = "images/no-image-available.jpg";
199
        $thumbnail = "images/no-image-available.jpg";
200
    }
200
    }
201
    $str .= "<div class=\"card-body bg-light mx-auto p-0 m-0\">";
201
    $str .= "<div class=\"card-body bg-light mx-auto p-0 m-0\">";
202
    $str .= "<img class=\"btn responsive-image p-0 m-0\" src=\"" . $thumbnail . "\" data-toggle=\"modal\" data-target=\"#masterModal" . $cnt . "\" title=\"Album Information\" data-toggle2=\"tooltip\" alt=\"Discogs Cover Thumbnail\">";
202
    $str .= "<img class=\"btn responsive-image p-0 m-0 lazyload\" src=\"data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=\" data-src=\"" . $thumbnail . "\" data-toggle=\"modal\" data-target=\"#masterModal" . $cnt . "\" title=\"Album Information\" data-toggle2=\"tooltip\" alt=\"Discogs Cover Thumbnail\">";
203
    $str .= "</div>";
203
    $str .= "</div>";
204
    $str .= "<div class=\"card-footer bg-dark p-0 m-0\">";
204
    $str .= "<div class=\"card-footer bg-dark p-0 m-0\">";
205
    $str .= "<div class=\"container clearfix p-0 m-0\">";
205
    $str .= "<div class=\"container clearfix p-0 m-0\">";
206
    $str .= "<span class=\"float-left\">";
206
    $str .= "<span class=\"float-left\">";
207
    $str .= "<button type=\"button\" class=\"btn btn-primary m-1 btn-sm\" data-toggle=\"modal\" data-target=\"#masterModal" . $cnt . "\" title=\"Album Information\" data-toggle2=\"tooltip\"><i class=\"fas fa-info\"></i></button>";
207
    $str .= "<button type=\"button\" class=\"btn btn-primary m-1 btn-sm\" data-toggle=\"modal\" data-target=\"#masterModal" . $cnt . "\" title=\"Album Information\" aria-label=\"Album Information\" data-toggle2=\"tooltip\"><i class=\"fas fa-info\"></i></button>";
208
 
208
 
209
    if (isset($master->{'videos'})) {
209
    if (isset($master->{'videos'})) {
210
        $str .= "<button type=\"button\" class=\"btn btn-primary m-1 btn-sm\" data-toggle=\"modal\" data-target=\"#videoModal" . $cnt . "\" title=\"Videos\" data-toggle2=\"tooltip\"><i class=\"fas fa-video\"></i></button>";
210
        $str .= "<button type=\"button\" class=\"btn btn-primary m-1 btn-sm\" data-toggle=\"modal\" data-target=\"#videoModal" . $cnt . "\" title=\"Videos\" aria-label=\"Music videos\" data-toggle2=\"tooltip\"><i class=\"fas fa-video\"></i></button>";
211
        //$str .= "<i role=\"button\" class=\"fab fa-youtube fa-2x btn-youtube btn m-1 btn-sm\" data-toggle=\"modal\" data-target=\"#videoModal" . $cnt . "\" title=\"Videos\" data-toggle2=\"tooltip\"></i>";
211
        //$str .= "<i role=\"button\" class=\"fab fa-youtube fa-2x btn-youtube btn m-1 btn-sm\" data-toggle=\"modal\" data-target=\"#videoModal" . $cnt . "\" title=\"Videos\" data-toggle2=\"tooltip\"></i>";
212
        $modal .= "<div id=\"videoModal" . $cnt . "\" class=\"modal\">";
212
        $modal .= "<div id=\"videoModal" . $cnt . "\" class=\"modal\">";
213
        $modal .= "<div class=\"modal-dialog\">";
213
        $modal .= "<div class=\"modal-dialog\">";
214
        $modal .= "<div class=\"modal-content\">";
214
        $modal .= "<div class=\"modal-content\">";
215
        $modal .= "<div class=\"modal-header bg-primary\">";
215
        $modal .= "<div class=\"modal-header bg-primary\">";
216
        $modal .= "<h4 class=\"modal-title mx-auto\">" . (string)$master->{'title'} . " by ";
216
        $modal .= "<p class=\"modal-title mx-auto display-5\">" . (string)$master->{'title'} . " by ";
217
        if (count($artists) < 5) {
217
        if (count($artists) < 5) {
218
            $modal .= join(", ", $artists);
218
            $modal .= join(", ", $artists);
219
        }
219
        }
220
        else {
220
        else {
221
            $modal .= "Various Artists";
221
            $modal .= "Various Artists";
222
        }
222
        }
223
        $modal .= "</h4>";
223
        $modal .= "</p>";
224
        $modal .= "<button type=\"button\" class=\"close\" data-dismiss=\"modal\"><i class=\"fas fa-window-close btn-dismiss\"></i></button>";
224
        $modal .= "<button type=\"button\" class=\"close\" data-dismiss=\"modal\"><i class=\"fas fa-window-close btn-dismiss\"></i></button>";
225
        $modal .= "</div>";
225
        $modal .= "</div>";
226
 
226
 
227
        $modal .= "<div class=\"modal-body bg-white mx-auto\">";
227
        $modal .= "<div class=\"modal-body bg-white mx-auto\">";
228
        $modal .= "<h4><i class=\"fab fa-youtube youtube\"></i> Videos</h4>";
228
        $modal .= "<p class=\"display-5\"><i class=\"fab fa-youtube youtube\"></i> Videos</p>";
229
        $modal .= "<ul class=\"list-group\">";
229
        $modal .= "<ul class=\"list-group\">";
230
 
230
 
231
        foreach ($master->{'videos'} as $video) {
231
        foreach ($master->{'videos'} as $video) {
232
            $modal .= "<li class=\"list-group-item\"><a href=\"" . $video->uri . "\" target=\"_blank\" class=\"btn btn-info text-left\" role=\"button\">" . $video->title . " [" . gmdate('H:i:s', $video->duration) . "]</a></li>";
232
            $modal .= "<li class=\"list-group-item\"><a href=\"" . $video->uri . "\" target=\"_blank\" rel=\"nofollow noreferrer noopener\" class=\"btn btn-info text-left\" role=\"button\">" . $video->title . " [" . gmdate('H:i:s', $video->duration) . "]</a></li>";
233
            // bugbug too many videos don't run embedded
233
            // bugbug too many videos don't run embedded
234
            // $videoParam = basename($video->uri);
234
            // $videoParam = basename($video->uri);
235
            // $videoIdx = strpos($videoParam, "=") + 1;
235
            // $videoIdx = strpos($videoParam, "=") + 1;
236
            // $str .= "<iframe width=\"280\" height=\"158\" src=\"https://www.youtube-nocookie.com/embed/" . substr($videoParam, $videoIdx) . "?rel=0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>";
236
            // $str .= "<iframe width=\"280\" height=\"158\" src=\"https://www.youtube-nocookie.com/embed/" . substr($videoParam, $videoIdx) . "?rel=0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>";
237
            
237
            
238
        }
238
        }
239
 
239
 
240
        $modal .= "</ul>";
240
        $modal .= "</ul>";
241
        $modal .= "</div>";
241
        $modal .= "</div>";
242
        $modal .= "<div class=\"modal-footer bg-white justify-content-between\">";
242
        $modal .= "<div class=\"modal-footer bg-white justify-content-between\">";
243
        $modal .= "<span class=\"font-weight-lighter small\">Data provided by <a href=\"" . (string)$master->{'uri'} . "\" target=\"_blank\">Discogs</a></span>";
243
        $modal .= "<span class=\"font-weight-lighter small\">Data provided by <a href=\"" . (string)$master->{'uri'} . "\" target=\"_blank\" rel=\"nofollow noreferrer noopener\">Discogs</a></span>";
244
        $modal .= "<span class=\"float-right\"><button type=\"button\" class=\"btn btn-danger\" data-dismiss=\"modal\">Close</button></span>";
244
        $modal .= "<span class=\"float-right\"><button type=\"button\" class=\"btn btn-danger\" data-dismiss=\"modal\">Close</button></span>";
245
        $modal .= "</div>";
245
        $modal .= "</div>";
246
        $modal .= "</div>";
246
        $modal .= "</div>";
247
        $modal .= "</div>";
247
        $modal .= "</div>";
248
        $modal .= "</div>";
248
        $modal .= "</div>";
Line 276... Line 276...
276
            'barcode' => $barcode,
276
            'barcode' => $barcode,
277
            'thumbnail' => $thumbnail,
277
            'thumbnail' => $thumbnail,
278
            'url' => (string)$master->{'uri'}
278
            'url' => (string)$master->{'uri'}
279
        );
279
        );
280
        $wl = base64_encode(json_encode($wlArr));
280
        $wl = base64_encode(json_encode($wlArr));
281
        $str .= "  <button type=\"button\" class=\"btn btn-primary m-1 btn-sm\" onclick=\"addWishlist('" . $_SESSION['sessData']['userID'] . "',this," . $cnt . ",'" . $wl . "');\" title=\"Add to Wishlist\" data-toggle=\"tooltip\"><i class=\"fas fa-bookmark\"></i></button>";
281
        $str .= "  <button type=\"button\" class=\"btn btn-primary m-1 btn-sm\" onclick=\"addWishlist('" . $_SESSION['sessData']['userID'] . "',this," . $cnt . ",'" . $wl . "');\" title=\"Add to Wishlist\" aria-label=\"Add to Wishlist\" data-toggle=\"tooltip\"><i class=\"fas fa-bookmark\"></i></button>";
282
    }
282
    }
283
 
283
 
284
    $searchTitle = 'Searching for:<br><br><strong>' . (string)$master->{'title'} . ' by ' . (empty($searchArtists) ? 'Various Artists' : $searchArtists) . '</strong>';
284
    $searchTitle = 'Searching for:<br><br><strong>' . (string)$master->{'title'} . ' by ' . (empty($searchArtists) ? 'Various Artists' : $searchArtists) . '</strong>';
285
    if (!empty($barcode)) {
285
    if (!empty($barcode)) {
286
        $searchTitle .= " (" . displayBarcode($barcode) . ")";
286
        $searchTitle .= " (" . displayBarcode($barcode) . ")";
287
    }
287
    }
288
 
288
 
289
    $str .= "  <button type=\"submit\" name=\"submit\" value=\"discogsSearch\" class=\"btn btn-primary m-1 btn-sm\" onclick=\"document.getElementById('discogsTitle').value = '" . addslashes((string)$master->{'title'}) . "';document.getElementById('discogsArtist').value = '" . addslashes($searchArtists) . "';document.getElementById('discogsBarcode').value = '" . $barcode . "';progressBar('" . sanitizeInput2($searchTitle) . "');\" title=\"Search for Store Offers\" data-toggle=\"tooltip\"><i class=\"fas fa-search\"></i></button>";
289
    $str .= "  <button type=\"submit\" name=\"submit\" value=\"discogsSearch\" class=\"btn btn-primary m-1 btn-sm\" onclick=\"document.getElementById('discogsTitle').value = '" . addslashes((string)$master->{'title'}) . "';document.getElementById('discogsArtist').value = '" . addslashes($searchArtists) . "';document.getElementById('discogsBarcode').value = '" . $barcode . "';progressBar('" . sanitizeInput2($searchTitle) . "');\" title=\"Search for Store Offers\" aria-label=\"Search for Store Offers\" data-toggle=\"tooltip\"><i class=\"fas fa-search\"></i></button>";
290
    $str .= "</span>";
290
    $str .= "</span>";
291
    $str .= "</div>";
291
    $str .= "</div>";
292
    $str .= "<span id=\"wishlistAdd" . $cnt . "\"></span>";
292
    $str .= "<span id=\"wishlistAdd" . $cnt . "\"></span>";
293
    $str .= "</div>";
293
    $str .= "</div>";
294
 
294
 
295
    $modal .= "<div id=\"masterModal" . $cnt . "\" class=\"modal\">";
295
    $modal .= "<div id=\"masterModal" . $cnt . "\" class=\"modal\">";
296
    $modal .= "<div class=\"modal-dialog\">";
296
    $modal .= "<div class=\"modal-dialog\">";
297
    $modal .= "<div class=\"modal-content\">";
297
    $modal .= "<div class=\"modal-content\">";
298
    $modal .= "<div class=\"modal-header bg-primary\">";
298
    $modal .= "<div class=\"modal-header bg-primary\">";
299
    $modal .= "<h4 class=\"modal-title mx-auto\">" . (string)$master->{'title'} . " by ";
299
    $modal .= "<p class=\"modal-title mx-auto display-5\">" . (string)$master->{'title'} . " by ";
300
    if (count($artists) < 5) {
300
    if (count($artists) < 5) {
301
        $modal .= join(", ", $artists);
301
        $modal .= join(", ", $artists);
302
    }
302
    }
303
    else {
303
    else {
304
        $modal .= "Various Artists";
304
        $modal .= "Various Artists";
305
    }
305
    }
306
    $modal .= "</h4>";
306
    $modal .= "</p>";
307
    $modal .= "<button type=\"button\" class=\"close\" data-dismiss=\"modal\"><i class=\"fas fa-window-close btn-dismiss\"></i></button>";
307
    $modal .= "<button type=\"button\" class=\"close\" data-dismiss=\"modal\"><i class=\"fas fa-window-close btn-dismiss\"></i></button>";
308
    $modal .= "</div>";
308
    $modal .= "</div>";
309
 
309
 
310
    $modal .= "<div class=\"modal-body bg-white mx-auto\">";
310
    $modal .= "<div class=\"modal-body bg-white mx-auto\">";
311
 
311
 
Line 374... Line 374...
374
    }
374
    }
375
 
375
 
376
    $modal .= "</table>";
376
    $modal .= "</table>";
377
    $modal .= "</div>";
377
    $modal .= "</div>";
378
    $modal .= "<div class=\"modal-footer bg-white justify-content-between\">";
378
    $modal .= "<div class=\"modal-footer bg-white justify-content-between\">";
379
    $modal .= "<span class=\"font-weight-lighter small\">Data provided by <a href=\"" . (string)$master->{'uri'} . "\" target=\"_blank\">Discogs</a></span>";
379
    $modal .= "<span class=\"font-weight-lighter small\">Data provided by <a href=\"" . (string)$master->{'uri'} . "\" target=\"_blank\" rel=\"nofollow noreferrer noopener\">Discogs</a></span>";
380
    $modal .= "<span class=\"float-right\"><button type=\"button\" class=\"btn btn-danger\" data-dismiss=\"modal\">Close</button></span>";
380
    $modal .= "<span class=\"float-right\"><button type=\"button\" class=\"btn btn-danger\" data-dismiss=\"modal\">Close</button></span>";
381
    $modal .= "</div>";
381
    $modal .= "</div>";
382
    $modal .= "</div>";
382
    $modal .= "</div>";
383
    $modal .= "</div>";
383
    $modal .= "</div>";
384
    $modal .= "</div>";
384
    $modal .= "</div>";