bashtube/webroot/index.shs

24 lines
635 B
Plaintext
Raw Normal View History

#!/bin/bash
source templates/head.sh
2021-01-28 22:56:24 +01:00
source ${cfg[namespace]}/templates/header.shs
2021-02-28 17:43:40 +01:00
declare -A strings
2021-03-18 23:14:46 +01:00
if [[ -s storage/faves ]]; then
strings[favourites]=""
else
strings[favourites]="No favorite videos found,<br>you can do it first! ^w^"
fi
IFS=$'\n'
for i in $(tac storage/faves); do
IFS=':'
array=($i)
if [[ ${array[1]} == '' ]]; then
break
fi
2021-02-28 18:17:35 +01:00
strings[favourites]+="<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
2021-02-28 18:17:35 +01:00
render_unsafe strings "${cfg[namespace]}/templates/themes/${cfg[template]}/index.t"