$last) { $pagenum = $last; } $limit = 'LIMIT ' .($pagenum - 1) * $page_rows .',' .$page_rows; $sqlxrr = "SELECT `ID`, `artist`, `title`, `duration`, `date_played`, `artist_played` FROM `songs` WHERE `enabled`='1' AND `song_type`='0' ORDER BY `artist` ASC $limit"; $xrrresult = mysqli_query($db_conx, $sqlxrr); $textline1 = "$rows Tracks"; $textline2 = "Page $pagenum of $last"; // Paginatie Links $paginationCtrls = ''; if($last != 1){ if ($pagenum > 1) { $previous = $pagenum - 1; $paginationCtrls .= ''; for($i = $pagenum-3; $i < $pagenum; $i++){ if($i > 0){ $paginationCtrls .= ''.$i.''; } } } $paginationCtrls .= ''.$pagenum.''; for($i = $pagenum+1; $i <= $last; $i++){ $paginationCtrls .= ''.$i.''; if($i >= $pagenum+3){ break; } } if ($pagenum != $last) { $next = $pagenum + 1; $paginationCtrls .= ''; } } // ---------------------------------------------------------------- // 4. LIJSTWEERGAVE (Requestlist opbouw) // ---------------------------------------------------------------- $requestlist = ''; if ($xrrresult && mysqli_num_rows($xrrresult) > 0) { while($xrrrow = mysqli_fetch_assoc($xrrresult)) { $ttsongID = $xrrrow['ID']; $ttartist = stripslashes($xrrrow['artist']); $tttitle = stripslashes($xrrrow['title']); $mmss = function_exists('convertTime') ? convertTime($xrrrow['duration']) : '0:00'; $artistcut = preg_replace('/\s+?(\S+)?$/', '', substr($ttartist . ' ', 0, 42)). ''; $titlecut = preg_replace('/\s+?(\S+)?$/', '', substr($tttitle . ' ', 0, 24)). '...'; // **GECORRIGEERD PAD:** Relatief aan de root $artist_pic_check = 'assets/pictures/'.$ttartist.'.jpg'; $artist_pic = (file_exists($artist_pic_check) && $ttartist != '') ? 'assets/pictures/'.$ttartist.'.jpg' : 'assets/img/noimg.jpg'; // --- REQUEST KNOP LOGICA --- $reqbtn = ''; if(defined('ALLOWREQS') && ALLOWREQS == 'YES'){ $req_interval_hours = defined('REQINT') ? REQINT : 1; $sqlcheckreq = mysqli_query($db_conx, "SELECT * FROM `requests` WHERE `songID`='".$ttsongID."' AND `requested` > NOW() - INTERVAL ".$req_interval_hours." HOUR"); if(mysqli_num_rows($sqlcheckreq)) { $reqbtn = '
'; }else{ $reqbtn = ' '; } }elseif(defined('ALLOWREQS') && ALLOWREQS == 'NO'){ $reqbtn = ''; } // --- LIKE KNOP LOGICA --- $likesong = ''; if(defined('ALLOWLIKES') && ALLOWLIKES == 'YES'){ $sqlchecklikes = mysqli_query($db_conx, "SELECT * FROM `songlikes` WHERE `usrip`='".$reqIP."' AND `likes`='".$ttsongID."' LIMIT 1"); if(mysqli_num_rows($sqlchecklikes)) { $likesong = ''; }else{ $likesong = '