25 lines
638 B
Bash
Executable file
25 lines
638 B
Bash
Executable file
#!/bin/bash
|
|
source templates/head.sh
|
|
source ${cfg[namespace]}/templates/header.shs
|
|
|
|
echo "<form action='${r[url]}/search.shs'>
|
|
<input name='q' type='text'>
|
|
<input type='submit' value='Search'>
|
|
</form>
|
|
|
|
<h1>All user's favourites:</h1>"
|
|
|
|
echo "<div style='display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));'>"
|
|
|
|
IFS=$'\n'
|
|
for i in $(tac storage/faves); do
|
|
IFS=':'
|
|
array=($i)
|
|
if [[ ${array[1]} == '' ]]; then
|
|
break
|
|
fi
|
|
echo "<div><a href='watch?v=${array[1]}'><img src='https://i.ytimg.com/vi/${array[1]}/mqdefault.jpg'><br><b>${array[@]:2:999}</b></a><br>Favourited by ${array[0]}</div>";
|
|
done
|
|
|
|
echo "</div>"
|