<?php require_once 'music.php'?> <?php require_once 'utils.php'?> <?php require_once 'functions.php'?> <?php function html_music($music) { echo '<div class="music_container">'; echo ' <div class="music_image_root" onmouseenter="showPlayButton(this)" onmouseleave="hidePlayButton(this)">'; echo ' <img class="cover_img" src="'. $music->cover .'"/>'; echo ' <img class="play_img" audiosrc="' . $music->path . '" src="./res/play_cover.png" onclick="playMusic(this)" onmouseenter="showPlayButtonSelf(this)" onmouseleave="hidePlayButtonSelf(this)"/>'; echo ' </div>'; echo ' <a href="booth.php?id=' . $music->uid . '" class="music_title">' . $music->title . '</a>'; echo '</div>' ; } function html_music_wide($music, $index=0) { echo '<div class="music_container_wide">'; echo '<font class="music_index"> ' . $index .'</font>'; echo '<div class="music_image_root" onmouseenter="showPlayButton(this)" onmouseleave="hidePlayButton(this)"> '; echo ' <img class="cover_img" src="' .$music->cover. '"> '; echo ' <img class="play_img" audiosrc="' . $music->path .'" src="./res/play_cover.png" onclick="playMusic(this)" onmouseenter="showPlayButtonSelf(this)" onmouseleave="hidePlayButtonSelf(this)" style="display: none; cursor: auto;"> '; echo '</div>'; echo '<a href="booth.php?id=' . $music->uid .'" class="music_title">' . $music->title . '</a>'; echo '</div> '; } function html_tag($tag) { echo '<a href="search.php?page=0&type=tag&value=' . $tag->uid. '" class="tag_link">' . $tag->name . '</a>'; } function get_html_tag($tag) { return '<a href="search.php?page=0&type=tag&value=' . $tag->uid. '" class="tag_link">' . $tag->name . '</a>'; } function html_music_player($music) { if($music == null) return ; $tags = fetch_music_tags($music->uid) ; $html_tags = ""; foreach($tags as $tag){ $html_tags = $html_tags . get_html_tag($tag); } echo '<img class="music_cover" src=" ' . $music->cover . ' " />' ; echo '<audio id="music_player" src="' . $music->path . '" controls="controls">'; echo ' Sorry, your browser do not support audio.'; echo '</audio>' ; if(isLogin()){ echo '<label class="key">ID:</label>'; echo '<label class="value">' . $music->uid . '</label><br/>'; } echo '<label class="key">Name:</label>'; echo '<label class="value">' . $music->title . '</label><br/>'; echo '<label class="key">Date:</label>'; echo '<label id="music_time" class="value" timestamp="' . $music->time . '" ></label><br/>'; echo '<label class="key">Tags:</label>'; echo $html_tags; echo '<br/>'; echo '<label class="key">Music File:</label>'; echo '<label class="value"><a href="' . $music->path . '">Download</a></label><br/>'; if($music->project != ""){ echo '<label class="key">Project File:</label>'; echo '<label class="value"><a href=" ' . $music->project . '">Download</a></label>'; } } function html_paginate_link($url, $pagei) { echo '<a href="' . $url . '&page=' . $pagei . '">' . ($pagei + 1) . '</a>'; } function html_paginate_link_current($url, $pagei) { echo '<a class="current" href="' . $url . '&page=' . $pagei . '">' . ($pagei + 1) . '</a>'; } function html_album($album) { echo '<div class="album_container">'; echo ' <div class="album_image_root"> '; echo ' <img class="cover_img" src="'. $album->cover .'"> '; echo ' </div>'; echo ' <a href="album.php?id='. $album->uid .'" class="album_title">' . $album->title . '</a>'; echo '</div>'; } ?>