diff --git a/templates/themes/default/watch.t b/templates/themes/default/watch.t index f98c038..7e6b82e 100644 --- a/templates/themes/default/watch.t +++ b/templates/themes/default/watch.t @@ -12,7 +12,8 @@
{{.view_count}} views
{{.like_count}} likes, {{.dislike_count}} dislikes.
-{{.fav}} + {{.fav}} + {{.sub}}

diff --git a/templates/themes/default/watch_flash.t b/templates/themes/default/watch_flash.t index f98c038..7e6b82e 100644 --- a/templates/themes/default/watch_flash.t +++ b/templates/themes/default/watch_flash.t @@ -12,7 +12,8 @@
{{.view_count}} views
{{.like_count}} likes, {{.dislike_count}} dislikes.
-{{.fav}} + {{.fav}} + {{.sub}}

diff --git a/webroot/index.shs b/webroot/index.shs index 4629c09..1980ee5 100755 --- a/webroot/index.shs +++ b/webroot/index.shs @@ -11,5 +11,7 @@ for i in $(tac storage/faves); do if [[ ${array[1]} == '' ]]; then break fi - storage[favourites]+="

${array[@]:2:999}

Favourited by ${array[0]}
"; + strings[favourites]+="

${array[@]:2:999}

Favourited by ${array[0]}
"; done + +render_unsafe strings "${cfg[namespace]}/templates/themes/${cfg[template]}/index.t" diff --git a/webroot/watch.shs b/webroot/watch.shs index ede7756..475cebd 100755 --- a/webroot/watch.shs +++ b/webroot/watch.shs @@ -57,18 +57,18 @@ if [[ "${get_data[v]}" ]]; then strings[fav]="Remove from favourites
" fi fi - if [[ $(grep $(session_get_username "${cookies[sh_session]}") storage/subscribed | grep "$channel_id") == '' ]]; then + if [[ $(grep $(session_get_username "${cookies[sh_session]}") storage/subscribed | grep "${strings[channel_id]}") == '' ]]; then if [[ ${cfg[template]} == 'default' ]]; then - strings[fav]="Subscribe to $uploader!
" + strings[sub]="Subscribe to ${strings[uploader]}!
" fi else if [[ ${cfg[template]} == 'default' ]]; then - strings[fav]="Unsubscribe from $uploader
" + strings[sub]="Unsubscribe from ${strings[uploader]}
" fi fi else if [[ ${cfg[template]} == 'default' ]]; then - strings[fav]="Log in to add this video to your favourites and/or subscribe to this channel!
" + strings[fav]="Log in to add this video to your favourites and/or subscribe to this channel!
" fi fi strings[description]=$(echo "$video" | jq -r '.description' | sed -E 's/$/
/g') diff --git a/webroot/watch_flash.shs b/webroot/watch_flash.shs index 177006f..b5d7cc0 100755 --- a/webroot/watch_flash.shs +++ b/webroot/watch_flash.shs @@ -50,20 +50,20 @@ if [[ "${get_data[v]}" ]]; then if [[ ${cookies[sh_session]} ]]; then if [[ $(grep $(session_get_username "${cookies[sh_session]}") storage/faves | grep "${get_data[v]}") == '' ]]; then if [[ ${cfg[template]} == 'default' ]]; then - echo "Add to favourites
" + strings[fav]="Add to favourites
" fi else if [[ ${cfg[template]} == 'default' ]]; then - echo "Remove from favourites
" + strings[fav]="Remove from favourites
" fi fi - if [[ $(grep $(session_get_username "${cookies[sh_session]}") storage/subscribed | grep "$channel_id") == '' ]]; then + if [[ $(grep $(session_get_username "${cookies[sh_session]}") storage/subscribed | grep "${strings[channel_id]}") == '' ]]; then if [[ ${cfg[template]} == 'default' ]]; then - echo "Subscribe to $uploader!
" + strings[sub]="Subscribe to $uploader!
" fi else if [[ ${cfg[template]} == 'default' ]]; then - echo "Unsubscribe from $uploader
" + strings[sub]="Unsubscribe from $uploader
" fi fi else