diff --git a/www/boris/ajouter_video_youtube.sh b/www/boris/ajouter_video_youtube.sh index 0351278..efe2ee6 100755 --- a/www/boris/ajouter_video_youtube.sh +++ b/www/boris/ajouter_video_youtube.sh @@ -1,90 +1,3 @@ #!/bin/bash -######################################################################## -# Author: Fred (support@qo-op.com) -# Version: 0.1 -# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) -######################################################################## -# SCRIPT INTERACTIF POUR AJOUTER UN FICHIER à ASTROPORT/KODI -# -# 1. CAT: film, serie, anime -# 2. TMDB: ID de la fiche sur https://www.themoviedb.org/ -# 3. TITLE: Titre de la vidéo -# 4. YEAR: Année de la vidéo -# 5. RES: Résolution 1080p, 4K, SD, 720, HD -# 6. SAISON: Pour les séries et animes, c'est le numéro de saison. -# Pour un film, le champ SAISON est utilisé pour renseigner la Saga -# 7. GENRES: Action, Aventure, Fantastique, Animation, etc (choix multiple). -# 8. GROUPES: Permet de regrouper des films. (choix multiple) -# -# https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films -######################################################################## -YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 -HOME=/home/$YOU -######################################################################## -MY_PATH="`dirname \"$0\"`" # relative -MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized -ME="${0##*/}" -######################################################################## - -######################################################################## -IPFSNODEID=$(ipfs id -f='\n') -[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) || XZUID=$(cat /etc/hostname) - - -######################################################################## -# CASE ## YOUTUBE -######################################################################## - -#YTURL=$(zenity --entry --width 300 --title "Lien ou identifiant à copier" --text "Indiquez le lien (URL) ou l'ID de la vidéo" --entry-text="") -YTURL=$1 -[[ $YTURL == "" ]] && exit 1 - -# Create TEMP directory to copy $YID_$TITLE.$FILE_EXT -YTEMP="/tmp/$(date -u +%s%N | cut -b1-13)" -mkdir -p ${YTEMP} - -# youtube-dl $YTURL -echo "VIDEO $YTURL" -/usr/local/bin/youtube-dl -f '[height=720]/best' \ ---write-info-json --write-annotations \ ---no-mtime -o "${YTEMP}/%(id)s_%(title)s.%(ext)s" $YTURL - -# Get filename, extract ID, make destination dir and move copy. -YFILE=$(ls -t ${YTEMP} | head -n 1) -FILE_NAME="$(basename "${YFILE}")" -FILE_EXT="${FILE_NAME##*.}" - -YID=$(echo "${FILE_NAME}" | cut -d "_" -f 1) -YNAME=$(echo "${FILE_NAME}" | cut -d "_" -f 2-) -TMDB="${YID}" - -FILE_PATH="$HOME/astroport/youtube/$YID" -echo "Creating directory $FILE_PATH" -mkdir -p -v --mode=775 $FILE_PATH || echo "Directory creation failed :-(" -echo "Moving files there..." -mv -f ${YTEMP}/* ${FILE_PATH}/ - -## CORRECT PARAMETERS to Make Kodi compatible YASTRXBIAN FILE -TITLE="${YNAME%.*}" -GENRES="[Youtube]" -GROUPES="_IPNSKEY_" -FILE_RES=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "${FILE_PATH}/${FILE_NAME}" | cut -d "x" -f 2) -RES=${FILE_RES%?}0p - -## CREATE "~/astroport/${CAT}/${TMDB}/ajouter_video.txt" (with film CAT !!!) -URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri) -echo "film;${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/youtube/${TMDB}/ajouter_video.txt -# _IPFSREPFILEID_ is replaced later - -rm -Rf ${YTEMP} - - -######################################################################## -# ADD $FILE to IPFS / ASTROPORT / KODI -######################################################################## -./new_youtube_video_in_astroport.sh "$HOME/astroport/youtube/${TMDB}/" "${FILE_NAME}" > /tmp/youtube_${TMDB}.log 2>&1 -######################################################################## -######################################################################## - -exit 0 +../../ajouter_video.sh $1 1 diff --git a/www/boris/conf.php b/www/boris/conf.php index e086028..a4a412e 100644 --- a/www/boris/conf.php +++ b/www/boris/conf.php @@ -1,10 +1,23 @@ '; var_dump($output); echo ''; - $ipfsNodeId = $output[0]; - $indexHTML = file_get_contents('http://' . HOST . '/ipns/' . $ipnsHash . '/index.html'); + $indexHTML = @file_get_contents('http://' . HOST . '/ipns/' . $ipnsHash . '/index.html'); - // $indexHTML = file_get_contents('http://' . HOST . '/ipns/' . $ipfsNodeId . '/.' . $ipfsNodeId . '/KEY/'); - - - - $re = '!/ipns/[^/]+/([^/]+)/!isU'; - - preg_match($re, $indexHTML, $matches); - - $ipnsHiddenHash = $matches[1]; - - $indexHTML = file_get_contents('http://' . HOST . '/ipns/' . $ipnsHash . '/' . $ipnsHiddenHash . '/video.json'); - - if (isset($indexHTML)) { - - return json_decode($indexHTML); - } + if (empty($indexHTML)) { + + return []; + + } else { + + // $indexHTML = @file_get_contents('http://' . HOST . '/ipns/' . $ipfsNodeId . '/.' . $ipfsNodeId . '/KEY/'); + + $re = '!/ipns/[^/]+/([^/]+)/!isU'; + + preg_match($re, $indexHTML, $matches); + + $ipnsHiddenHash = $matches[1]; + + $indexHTML = @file_get_contents('http://' . HOST . '/ipns/' . $ipnsHash . '/' . $ipnsHiddenHash . '/video.json'); + + if (empty($indexHTML)) { + + return []; + + } else { + + return json_decode($indexHTML); + } + } } + + +function getTagsListFromTagStr ($str) { + + if (substr($str, 0, 1) == "[") { + + $str = substr($str, 1); + $str = substr($str, 0, -1); + + preg_match_all('/"([^"]+)"/isU', $str, $matches, PREG_PATTERN_ORDER); + $tags = $matches[1]; + + } else { + + $tags = explode('|', $str); + } + + if ((count($tags) == 1) and empty($tags[0])) { + + return array(); + + } else { + + return $tags; + } +} + +function separateTags ($tags, $stations) { + + return [ + array_diff($tags, $stations), + array_intersect($tags, $stations) + ]; + +} + +function isStation ($tag) { + + global $stations; + + return in_array($tag, $stations); +} + +function buildRequestedURI ($uri, $params, $escapeHTML = false) { + + $URL = $uri; + $first = true; + + foreach ($params as $k => $v) { + + if ($first) { + + $URL .= '?'; + $first = false; + + } else { + + if ($escapeHTML) { + + $URL .= '&'; + + } else { + + $URL .= '&'; + } + } + + $URL .= $k . '=' . htmlspecialchars($v); + } + + return $URL; +} + +function handleVideoID ($videoID) { + + preg_match('/^((?P([a-zA-Z0-9-]+\.)?[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+)_)?(?P.+)$/is', $videoID, $matches); + + $ndd = empty($matches['ndd']) ? 'www.youtube.com' : strrev($matches['ndd']); + $id = $matches['id']; + + return [ + $ndd, + $id + ]; +} + +function canReadVideoFormat ($mimeType) { + + return ($mimeType == 'video/mp4'); +} diff --git a/www/boris/get_PIN.sh b/www/boris/get_PIN.sh new file mode 100755 index 0000000..cee68aa --- /dev/null +++ b/www/boris/get_PIN.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 + +ls /home/$YOU/.zen/PIN | cat + + diff --git a/www/boris/get_astrxbian_index.sh b/www/boris/get_astrxbian_index.sh index c31e7c5..017b39f 100755 --- a/www/boris/get_astrxbian_index.sh +++ b/www/boris/get_astrxbian_index.sh @@ -5,10 +5,17 @@ # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ######################################################################## PREFIX="$1" -FILTER="$2" [[ $PREFIX == "" ]] && PREFIX="*" +FILTER="$2" YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 -# Filter no ipns link -[[ ! $FILTER ]] && cat /home/$YOU/.zen/{ipfs,ipfs_swarm}/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | sort | uniq | tail -n +2 && exit 0 -cat /home/$YOU/.zen/{ipfs,ipfs_swarm}/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | grep "$FILTER" | sort | uniq | tail -n +2 +if [[ ! $FILTER ]]; then + # We use `grep -Ev "];;` to filter out videos without an ipns link + MY_VIDEOS=`cat /home/$YOU/.zen/ipfs/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | tail -n +2` + SWARM_VIDEOS=`cat /home/$YOU/.zen/ipfs_swarm/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | tail -n +2` + (echo "$SWARM_VIDEOS" && echo "$MY_VIDEOS") | tac +else + MY_VIDEOS=`cat /home/$YOU/.zen/ipfs/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | tail -n +2 | grep "$FILTER"` + SWARM_VIDEOS=`cat /home/$YOU/.zen/ipfs_swarm/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | tail -n +2 | grep "$FILTER"` + (echo "$SWARM_VIDEOS" && echo "$MY_VIDEOS") | tac +fi diff --git a/www/boris/get_xzuid.sh b/www/boris/get_xzuid.sh new file mode 100755 index 0000000..02bc224 --- /dev/null +++ b/www/boris/get_xzuid.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 + +cat /home/$YOU/.zen/ipfs/.12D*/_xbian.zuid + diff --git a/www/boris/inc/header.php b/www/boris/inc/header.php index e232883..4131c23 100644 --- a/www/boris/inc/header.php +++ b/www/boris/inc/header.php @@ -1,15 +1,17 @@ - Astroport "<?php echo STATION_NAME; ?> + Astroport "<?php echo STATION_NAME; ?>" - +
diff --git a/www/boris/menu.php b/www/boris/menu.php new file mode 100644 index 0000000..9f48e08 --- /dev/null +++ b/www/boris/menu.php @@ -0,0 +1,18 @@ +id() . '
'; + + +$videosList = array(); +exec("/bin/bash -c './get_astrxbian_index.sh'", $videos); +// exec("/bin/bash -c './get_youtube_videos.sh'", $videos); +// echo file_get_contents("http://youtube2.com/ipns/12D3KooWHLLohhFqwTs3Ccego51w1Q2WUQ8JmhSMWtsZnQpMigHY/.12D3KooWHLLohhFqwTs3Ccego51w1Q2WUQ8JmhSMWtsZnQpMigHY/FASTRXBIAN"); + +// echo shell_exec('whoami'); // Pour savoir quel utilisateur système exécute les scripts PHP + +$videos = array_reverse($videos); diff --git a/www/boris/styles/astroport/9gag_logo.png b/www/boris/styles/astroport/9gag_logo.png new file mode 120000 index 0000000..5697e13 --- /dev/null +++ b/www/boris/styles/astroport/9gag_logo.png @@ -0,0 +1 @@ +../default/9gag_logo.png \ No newline at end of file diff --git a/www/boris/styles/astroport/decoration.css b/www/boris/styles/astroport/decoration.css index b51a66f..8c0176c 100644 --- a/www/boris/styles/astroport/decoration.css +++ b/www/boris/styles/astroport/decoration.css @@ -1,9 +1,16 @@ :root { --rouge: hsl(0, 98.8%, 33.5%); + --rouge-fonce: hsl(0, 75%, 33.5%); + + --noir-complet: black; --noir-fonce: hsl(0, 30%, 2.1%); --noir-moyen: hsl(0, 15%, 3.1%); --noir-clair: hsl(0, 5%, 7.1%); + + --blanc: hsla(0, 0%, 100%, 1); + --blanc-fort: hsla(0, 0%, 100%, 0.75); + --blanc-semi-transparent: hsla(0, 0%, 100%, 0.25); } @@ -31,7 +38,90 @@ header span { color: white; } -#videosList li { +#pinFilter ul li a { + + background-color: var(--blanc); +} + +#pinFilter ul li.selected a { + + background-color: var(--rouge); +} + + +ul#tagsList, +ul#narrowingTags { + + list-style: none; + margin-left: 0; + padding-left: 0; +} + +ul#tagsList li, +ul#narrowingTags li { + + display: inline-block; +} + +ul#tagsList a, +ul#tagsList a:visited { + + text-decoration: none; + color: var(--rouge-fonce); +} + +#narrowingTags a, +#narrowingTags a:visited { + + text-decoration: none; + color: inherit; +} + +#narrowingTags li { + + border-radius: 1rem; +} + +#narrowingTags li.selected { + + background-color: var(--rouge-fonce); + color: var(--blanc); + border: 0.125rem solid var(--noir-clair); +} + +#tagsList, +#narrowingTags { + + display: flex; + flex-direction: row; + flex-wrap: wrap; +} + +#tagsList li.station, +#narrowingTags li.station { + + order: 1; +} + +#tagsList li.station, +#narrowingTags li.station { + + background-image: url("logo.png"); + background-repeat: no-repeat; + background-position: left middle; + background-size: contain; + padding-left: 2em; + order: 1; +} + +#narrowingTags li.selectable { + + background-color: var(--noir-fonce); + color: var(--rouge-fonce); + border: 0.125rem solid var(--noir-clair); +} + +#videosList > li { background: var(--noir-clair); border-color: var(--rouge); @@ -45,6 +135,35 @@ header span { color: white; font-weight: bold; text-decoration: none; + word-break: break-all; +} + +#videosList .thumbnail { + + background-color: var(--noir-complet); +} + +#videosList > li ul.tags li a, +#videosList > li ul.tags li a:visited { + + text-decoration: none; +} + +#videosList > li ul.tags li.selectable a, +#videosList > li ul.tags li.selectable a:visited { + + color: var(--blanc-semi-transparent); +} + +#videosList > li ul.tags li.selectable a:hover { + + color: var(--blanc-fort); +} + +#videosList > li ul.tags li.selected a, +#videosList > li ul.tags li.selected a:visited { + + color: var(--blanc-fort); } article { diff --git a/www/boris/styles/astroport/font-awesome/address-book.svg b/www/boris/styles/astroport/font-awesome/address-book.svg new file mode 120000 index 0000000..5faeceb --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/address-book.svg @@ -0,0 +1 @@ +../../default/font-awesome/address-book.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/anchor.svg b/www/boris/styles/astroport/font-awesome/anchor.svg new file mode 120000 index 0000000..3abe343 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/anchor.svg @@ -0,0 +1 @@ +../../default/font-awesome/anchor.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/arrow-down.svg b/www/boris/styles/astroport/font-awesome/arrow-down.svg new file mode 120000 index 0000000..cd7668c --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/arrow-down.svg @@ -0,0 +1 @@ +../../default/font-awesome/arrow-down.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/bars.svg b/www/boris/styles/astroport/font-awesome/bars.svg new file mode 120000 index 0000000..340d9df --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/bars.svg @@ -0,0 +1 @@ +../../default/font-awesome/bars.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/book.svg b/www/boris/styles/astroport/font-awesome/book.svg new file mode 120000 index 0000000..cdaac5b --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/book.svg @@ -0,0 +1 @@ +../../default/font-awesome/book.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/bookmark.svg b/www/boris/styles/astroport/font-awesome/bookmark.svg new file mode 120000 index 0000000..ff0da29 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/bookmark.svg @@ -0,0 +1 @@ +../../default/font-awesome/bookmark.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/bullhorn.svg b/www/boris/styles/astroport/font-awesome/bullhorn.svg new file mode 120000 index 0000000..ebe3194 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/bullhorn.svg @@ -0,0 +1 @@ +../../default/font-awesome/bullhorn.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/cloud.svg b/www/boris/styles/astroport/font-awesome/cloud.svg new file mode 120000 index 0000000..9419ced --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/cloud.svg @@ -0,0 +1 @@ +../../default/font-awesome/cloud.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/film.svg b/www/boris/styles/astroport/font-awesome/film.svg new file mode 120000 index 0000000..b1e1a1a --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/film.svg @@ -0,0 +1 @@ +../../default/font-awesome/film.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/film.white.90x90.png b/www/boris/styles/astroport/font-awesome/film.white.90x90.png new file mode 100644 index 0000000..631a324 Binary files /dev/null and b/www/boris/styles/astroport/font-awesome/film.white.90x90.png differ diff --git a/www/boris/styles/astroport/font-awesome/film.white.png b/www/boris/styles/astroport/font-awesome/film.white.png new file mode 100644 index 0000000..4b21ca8 Binary files /dev/null and b/www/boris/styles/astroport/font-awesome/film.white.png differ diff --git a/www/boris/styles/astroport/font-awesome/film.white.svg b/www/boris/styles/astroport/font-awesome/film.white.svg new file mode 120000 index 0000000..f9ac018 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/film.white.svg @@ -0,0 +1 @@ +../../default/font-awesome/film.white.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/hdd.svg b/www/boris/styles/astroport/font-awesome/hdd.svg new file mode 100755 index 0000000..cead9cf --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/hdd.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/laptop.svg b/www/boris/styles/astroport/font-awesome/laptop.svg new file mode 120000 index 0000000..79c545e --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/laptop.svg @@ -0,0 +1 @@ +../../default/font-awesome/laptop.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/play-circle.svg b/www/boris/styles/astroport/font-awesome/play-circle.svg new file mode 120000 index 0000000..c632edf --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/play-circle.svg @@ -0,0 +1 @@ +../../default/font-awesome/play-circle.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/play.svg b/www/boris/styles/astroport/font-awesome/play.svg new file mode 120000 index 0000000..4df8f07 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/play.svg @@ -0,0 +1 @@ +../../default/font-awesome/play.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/qrcode.svg b/www/boris/styles/astroport/font-awesome/qrcode.svg new file mode 120000 index 0000000..a980d47 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/qrcode.svg @@ -0,0 +1 @@ +../../default/font-awesome/qrcode.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/save.svg b/www/boris/styles/astroport/font-awesome/save.svg new file mode 120000 index 0000000..695b989 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/save.svg @@ -0,0 +1 @@ +../../default/font-awesome/save.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/share-alt-square.svg b/www/boris/styles/astroport/font-awesome/share-alt-square.svg new file mode 120000 index 0000000..18f89f6 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/share-alt-square.svg @@ -0,0 +1 @@ +../../default/font-awesome/share-alt-square.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/share-alt.svg b/www/boris/styles/astroport/font-awesome/share-alt.svg new file mode 120000 index 0000000..bbe051d --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/share-alt.svg @@ -0,0 +1 @@ +../../default/font-awesome/share-alt.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/share-square.svg b/www/boris/styles/astroport/font-awesome/share-square.svg new file mode 120000 index 0000000..9fbde50 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/share-square.svg @@ -0,0 +1 @@ +../../default/font-awesome/share-square.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/share.svg b/www/boris/styles/astroport/font-awesome/share.svg new file mode 120000 index 0000000..78f7434 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/share.svg @@ -0,0 +1 @@ +../../default/font-awesome/share.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/sliders-h.svg b/www/boris/styles/astroport/font-awesome/sliders-h.svg new file mode 120000 index 0000000..06f6151 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/sliders-h.svg @@ -0,0 +1 @@ +../../default/font-awesome/sliders-h.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/tag.svg b/www/boris/styles/astroport/font-awesome/tag.svg new file mode 120000 index 0000000..b5ab4cc --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/tag.svg @@ -0,0 +1 @@ +../../default/font-awesome/tag.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/tags.svg b/www/boris/styles/astroport/font-awesome/tags.svg new file mode 120000 index 0000000..3101859 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/tags.svg @@ -0,0 +1 @@ +../../default/font-awesome/tags.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/tv.svg b/www/boris/styles/astroport/font-awesome/tv.svg new file mode 120000 index 0000000..ad8ce43 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/tv.svg @@ -0,0 +1 @@ +../../default/font-awesome/tv.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/unlink.svg b/www/boris/styles/astroport/font-awesome/unlink.svg new file mode 120000 index 0000000..e87dc7e --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/unlink.svg @@ -0,0 +1 @@ +../../default/font-awesome/unlink.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/upload.svg b/www/boris/styles/astroport/font-awesome/upload.svg new file mode 120000 index 0000000..fefa5ef --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/upload.svg @@ -0,0 +1 @@ +../../default/font-awesome/upload.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/user-alt.svg b/www/boris/styles/astroport/font-awesome/user-alt.svg new file mode 120000 index 0000000..e3ea154 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/user-alt.svg @@ -0,0 +1 @@ +../../default/font-awesome/user-alt.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/user-astronaut.svg b/www/boris/styles/astroport/font-awesome/user-astronaut.svg new file mode 120000 index 0000000..4547c06 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/user-astronaut.svg @@ -0,0 +1 @@ +../../default/font-awesome/user-astronaut.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/user-friends.svg b/www/boris/styles/astroport/font-awesome/user-friends.svg new file mode 120000 index 0000000..a55e162 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/user-friends.svg @@ -0,0 +1 @@ +../../default/font-awesome/user-friends.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/user-tag.svg b/www/boris/styles/astroport/font-awesome/user-tag.svg new file mode 120000 index 0000000..f523e33 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/user-tag.svg @@ -0,0 +1 @@ +../../default/font-awesome/user-tag.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/user.svg b/www/boris/styles/astroport/font-awesome/user.svg new file mode 120000 index 0000000..69b3c6d --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/user.svg @@ -0,0 +1 @@ +../../default/font-awesome/user.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/wallet.svg b/www/boris/styles/astroport/font-awesome/wallet.svg new file mode 120000 index 0000000..661c4d8 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/wallet.svg @@ -0,0 +1 @@ +../../default/font-awesome/wallet.svg \ No newline at end of file diff --git a/www/boris/styles/astroport/font-awesome/wrench.svg b/www/boris/styles/astroport/font-awesome/wrench.svg new file mode 120000 index 0000000..b44dc89 --- /dev/null +++ b/www/boris/styles/astroport/font-awesome/wrench.svg @@ -0,0 +1 @@ +../../default/font-awesome/wrench.svg \ No newline at end of file diff --git a/www/boris/styles/crowdbunker/decoration.css b/www/boris/styles/crowdbunker/decoration.css index 9b5a31e..05054a2 100644 --- a/www/boris/styles/crowdbunker/decoration.css +++ b/www/boris/styles/crowdbunker/decoration.css @@ -46,7 +46,7 @@ header .usp strong { } -#videosList li { +#videosList > li { background: var(--canard); border-color: var(--pink); diff --git a/www/boris/styles/default/9gag_logo.png b/www/boris/styles/default/9gag_logo.png new file mode 100644 index 0000000..3f2b247 Binary files /dev/null and b/www/boris/styles/default/9gag_logo.png differ diff --git a/www/boris/styles/default/font-awesome/address-book.svg b/www/boris/styles/default/font-awesome/address-book.svg new file mode 100755 index 0000000..f652f5a --- /dev/null +++ b/www/boris/styles/default/font-awesome/address-book.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/anchor.svg b/www/boris/styles/default/font-awesome/anchor.svg new file mode 100755 index 0000000..792266b --- /dev/null +++ b/www/boris/styles/default/font-awesome/anchor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/arrow-down.svg b/www/boris/styles/default/font-awesome/arrow-down.svg new file mode 100755 index 0000000..61b4db7 --- /dev/null +++ b/www/boris/styles/default/font-awesome/arrow-down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/bars.svg b/www/boris/styles/default/font-awesome/bars.svg new file mode 100755 index 0000000..87d79f9 --- /dev/null +++ b/www/boris/styles/default/font-awesome/bars.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/book.svg b/www/boris/styles/default/font-awesome/book.svg new file mode 100755 index 0000000..d27fdae --- /dev/null +++ b/www/boris/styles/default/font-awesome/book.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/bookmark.svg b/www/boris/styles/default/font-awesome/bookmark.svg new file mode 100755 index 0000000..d1c8e4a --- /dev/null +++ b/www/boris/styles/default/font-awesome/bookmark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/bullhorn.svg b/www/boris/styles/default/font-awesome/bullhorn.svg new file mode 100755 index 0000000..9c86370 --- /dev/null +++ b/www/boris/styles/default/font-awesome/bullhorn.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/cloud.svg b/www/boris/styles/default/font-awesome/cloud.svg new file mode 100755 index 0000000..38d2dc5 --- /dev/null +++ b/www/boris/styles/default/font-awesome/cloud.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/film.svg b/www/boris/styles/default/font-awesome/film.svg new file mode 100755 index 0000000..f120aee --- /dev/null +++ b/www/boris/styles/default/font-awesome/film.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/film.white.svg b/www/boris/styles/default/font-awesome/film.white.svg new file mode 100755 index 0000000..10f1e9c --- /dev/null +++ b/www/boris/styles/default/font-awesome/film.white.svg @@ -0,0 +1 @@ + diff --git a/www/boris/styles/default/font-awesome/hdd.svg b/www/boris/styles/default/font-awesome/hdd.svg new file mode 100755 index 0000000..cead9cf --- /dev/null +++ b/www/boris/styles/default/font-awesome/hdd.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/laptop.svg b/www/boris/styles/default/font-awesome/laptop.svg new file mode 100755 index 0000000..b68aab3 --- /dev/null +++ b/www/boris/styles/default/font-awesome/laptop.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/play-circle.svg b/www/boris/styles/default/font-awesome/play-circle.svg new file mode 100755 index 0000000..ea10397 --- /dev/null +++ b/www/boris/styles/default/font-awesome/play-circle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/play.svg b/www/boris/styles/default/font-awesome/play.svg new file mode 100755 index 0000000..d7fa87f --- /dev/null +++ b/www/boris/styles/default/font-awesome/play.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/qrcode.svg b/www/boris/styles/default/font-awesome/qrcode.svg new file mode 100755 index 0000000..c92fa7c --- /dev/null +++ b/www/boris/styles/default/font-awesome/qrcode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/save.svg b/www/boris/styles/default/font-awesome/save.svg new file mode 100755 index 0000000..44298e3 --- /dev/null +++ b/www/boris/styles/default/font-awesome/save.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/share-alt-square.svg b/www/boris/styles/default/font-awesome/share-alt-square.svg new file mode 100755 index 0000000..7d48e45 --- /dev/null +++ b/www/boris/styles/default/font-awesome/share-alt-square.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/share-alt.svg b/www/boris/styles/default/font-awesome/share-alt.svg new file mode 100755 index 0000000..2f3151d --- /dev/null +++ b/www/boris/styles/default/font-awesome/share-alt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/share-square.svg b/www/boris/styles/default/font-awesome/share-square.svg new file mode 100755 index 0000000..f66404d --- /dev/null +++ b/www/boris/styles/default/font-awesome/share-square.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/share.svg b/www/boris/styles/default/font-awesome/share.svg new file mode 100755 index 0000000..e7e262b --- /dev/null +++ b/www/boris/styles/default/font-awesome/share.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/sliders-h.svg b/www/boris/styles/default/font-awesome/sliders-h.svg new file mode 100755 index 0000000..e5d7fd7 --- /dev/null +++ b/www/boris/styles/default/font-awesome/sliders-h.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/tag.svg b/www/boris/styles/default/font-awesome/tag.svg new file mode 100755 index 0000000..6793a2e --- /dev/null +++ b/www/boris/styles/default/font-awesome/tag.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/tags.svg b/www/boris/styles/default/font-awesome/tags.svg new file mode 100755 index 0000000..192075b --- /dev/null +++ b/www/boris/styles/default/font-awesome/tags.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/tv.svg b/www/boris/styles/default/font-awesome/tv.svg new file mode 100755 index 0000000..4e33e61 --- /dev/null +++ b/www/boris/styles/default/font-awesome/tv.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/unlink.svg b/www/boris/styles/default/font-awesome/unlink.svg new file mode 100755 index 0000000..8cba9f8 --- /dev/null +++ b/www/boris/styles/default/font-awesome/unlink.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/upload.svg b/www/boris/styles/default/font-awesome/upload.svg new file mode 100755 index 0000000..1c880b5 --- /dev/null +++ b/www/boris/styles/default/font-awesome/upload.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/user-alt.svg b/www/boris/styles/default/font-awesome/user-alt.svg new file mode 100755 index 0000000..024cb44 --- /dev/null +++ b/www/boris/styles/default/font-awesome/user-alt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/user-astronaut.svg b/www/boris/styles/default/font-awesome/user-astronaut.svg new file mode 100755 index 0000000..631f168 --- /dev/null +++ b/www/boris/styles/default/font-awesome/user-astronaut.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/user-friends.svg b/www/boris/styles/default/font-awesome/user-friends.svg new file mode 100755 index 0000000..2e43c59 --- /dev/null +++ b/www/boris/styles/default/font-awesome/user-friends.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/user-tag.svg b/www/boris/styles/default/font-awesome/user-tag.svg new file mode 100755 index 0000000..ec1a1e7 --- /dev/null +++ b/www/boris/styles/default/font-awesome/user-tag.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/user.svg b/www/boris/styles/default/font-awesome/user.svg new file mode 100755 index 0000000..591873a --- /dev/null +++ b/www/boris/styles/default/font-awesome/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/wallet.svg b/www/boris/styles/default/font-awesome/wallet.svg new file mode 100755 index 0000000..f584229 --- /dev/null +++ b/www/boris/styles/default/font-awesome/wallet.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/font-awesome/wrench.svg b/www/boris/styles/default/font-awesome/wrench.svg new file mode 100755 index 0000000..378cf6c --- /dev/null +++ b/www/boris/styles/default/font-awesome/wrench.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/boris/styles/default/layout.css b/www/boris/styles/default/layout.css index 8337363..2ee23dc 100644 --- a/www/boris/styles/default/layout.css +++ b/www/boris/styles/default/layout.css @@ -1,4 +1,3 @@ - body { margin: 0; @@ -42,6 +41,87 @@ main { margin: auto; } +body.home main { + + display: grid; + grid-gap: 1rem 1rem; + grid-auto-flow: row; + grid-template-columns: 998px auto; + grid-template-areas: "c m"; +} + +body.home main > #menu { + + grid-area: m; +} + +body.home main > ul#videosList { + + grid-area: c; +} + + +aside#menu > div { + + position: sticky; + top: 2rem; +} + +#pinFilter ul { + + margin: 0; + padding: 0; + list-style: none; + font-size: 3rem; + display: flex; +} + +#pinFilter ul li a span { + + display: none; +} + +#pinFilter ul li a { + + display: inline-block; + height: 3rem; + width: 3rem; + border: 1px solid red; + background-repeat: no-repeat; +} + +#pinFilter ul li#filter_pinned a { + + background-image: url("font-awesome/hdd.svg"); + background-position: center center; + background-size: 2.5rem; +} + +#pinFilter ul li#filter_notpinned a { + + background-image: url("font-awesome/cloud.svg"); + background-position: center center; + background-size: 2.5rem; +} + +#pinFilter ul li#filter_both a { + + background-image: url("font-awesome/hdd.svg"), + url("font-awesome/cloud.svg"); + background-position: bottom 0.25rem left 0.25rem, + top 0.25rem right 0.25rem; + background-size: 1.75rem, + 1.75rem; + +} + +#tagsList li, +#narrowingTags li { + + padding: 0.125rem 0.5rem; + margin: 0.25rem 0.25rem; +} + #videosList { display: grid; @@ -53,20 +133,59 @@ main { margin: 0; padding: 0; justify-content: center; + align-content: start } -#videosList li { +#videosList > li { border-radius: 0.25rem; border-width: 1px; overflow: hidden; } +#videosList .thumbnail { + + text-align: center; + height: 180px; + margin-top: 0; + display: flex; + justify-content: center; + align-items: center; +} + +#videosList .thumbnail img { + + max-height: 180px; + width: auto; +} + #videosList .video-title { padding: 0.5rem 1rem; } +#videosList > li ul.tags { + + padding: 0; + margin: 0; + list-style: none; +} + +#videosList > li ul.tags li { + + display: inline-block; +} + +#videosList > li ul.tags li:after { + + content: ", "; +} + +#videosList > li ul.tags li:last-of-type:after { + + content: ""; +} + article { border-radius: 0.25rem; diff --git a/www/boris/swarm_files.php b/www/boris/swarm_files.php index c6b2af2..b2e871c 100644 --- a/www/boris/swarm_files.php +++ b/www/boris/swarm_files.php @@ -54,9 +54,7 @@ foreach ($swarm as $peer) { foreach ($videos as $v) { list($a, $b, $c, $videoName, $e, $g, $h, $m, $videoURI) = explode(";", $v); - - - $videoURL = /* 'http://'. HOST. */ $videoURI; + $mimeType = guessTypeFromFilename($videoURL); if ($mimeType == 'video/mp4') { @@ -64,12 +62,12 @@ foreach ($swarm as $peer) { echo '
  • - ' . $videoName . '
    + ' . $videoName . '
    ('. $mimeType . ')
  • '; diff --git a/www/boris/youtube.php b/www/boris/youtube.php index 95fc63b..a7e608d 100644 --- a/www/boris/youtube.php +++ b/www/boris/youtube.php @@ -8,47 +8,101 @@ require_once('functions.php'); // echo 'IPFS id : ' . $ipfs->id() . '
    '; + +$uriParams = []; + $videosList = array(); -exec("/bin/bash -c './get_astrxbian_index.sh'", $videos); +$search = isset($_GET['search']) ? urldecode($_GET['search']) : ""; +exec("/bin/bash -c './get_astrxbian_index.sh \"*\" \"". $search . "\"'", $videos); +exec("/bin/bash -c './get_PIN.sh'", $pinnedVideos); +$videos = array_unique($videos); + // exec("/bin/bash -c './get_youtube_videos.sh'", $videos); // echo file_get_contents("http://youtube2.com/ipns/12D3KooWHLLohhFqwTs3Ccego51w1Q2WUQ8JmhSMWtsZnQpMigHY/.12D3KooWHLLohhFqwTs3Ccego51w1Q2WUQ8JmhSMWtsZnQpMigHY/FASTRXBIAN"); // echo shell_exec('whoami'); // Pour savoir quel utilisateur système exécute les scripts PHP +// echo '
    '; var_dump($videos); echo '
    '; exit; -$videos = array_reverse($videos); $i = 0; +$div = 9; +$r = rand(0, ($div - 1)); +$j = 0; +$tagsMenu = array(); +$narrowingTags = array(); +$show = isset($_GET['show']) ? $_GET['show'] : 'pinned'; + +if (isset($_GET['tags']) and !empty($_GET['tags'])) { + + $tagFilter = explode('|', $_GET['tags']); + +} else { + + $tagFilter = array(); +} foreach ($videos as $v) { - - ++$i; - if ($i > 10) { - break; - } - list($contentType, $videoID, $year, $videoName, $saison, $tags, $ipnsHash, $definition, $videoURI) = explode(";", $v); + list($contentType, $videoID, $year, $filename, $saison, $tagsStr, $ipnsHash, $definition, $videoURI) = explode(";", $v); + + list($videoSource, $videoID) = handleVideoID($videoID); + + $ipfsHash = preg_replace('!^/ipfs/([^/]+)/.*$!isU', '$1', $videoURI); $mimeType = guessTypeFromFilename($videoURI); - $duration = NULL; - $thumbURL = ''; - if ($mimeType == 'video/mp4') { + $videoTags = getTagsListFromTagStr($tagsStr); + + if (canReadVideoFormat($mimeType)) { - switch ($contentType) { + $tagsMenu = array_merge($tagsMenu, $videoTags); + } + + $keepVideo = true; + $keepVideo = ($keepVideo and canReadVideoFormat($mimeType)); + $keepVideo = ($keepVideo and (in_array($ipfsHash, $pinnedVideos) or ($show != 'pinned'))); + $keepVideo = ($keepVideo and (!in_array($ipfsHash, $pinnedVideos) or ($show != 'notpinned'))); + $keepVideo = ($keepVideo and (empty($tagFilter) or (array_intersect($tagFilter, $videoTags) == $tagFilter))); + + if ($keepVideo) { + + $narrowingTags = array_merge($narrowingTags, $videoTags); + + /* + ++$i; + if ($i % $div != $r) { + continue; + } + + ++$j; + if ($j > 9) { + break; + } + */ + + $duration = NULL; + $thumbURL = ''; + $videoTitle = NULL; + + if (($contentType == 'youtube') and ($videoSource == 'www.youtube.com')) { + + $thumbURL = sprintf(YOUTUBE_THUMB, $videoID); - case 'youtube': - $thumbURL = sprintf(YOUTUBE_THUMB, $videoID); - - $json = getVideoJson($ipnsHash); + // $json = getVideoJson($ipnsHash); + + if (!empty($json)) { // echo '
    '; var_dump($json); echo '
    '; - $videoName = $json->title; + $videoTitle = $json->title; $duration = $json->duration; - - break; + } + + } elseif (($contentType == 'youtube') and ($videoSource == '9gag.com')) { - case 'film': - $thumbURL = 'styles/astroport/logo.png'; - break; + $thumbURL = 'styles/'. THEME .'/9gag_logo.png'; + + } else { + + $thumbURL = 'styles/'. THEME .'/font-awesome/film.white.90x90.png'; } $videosList[] = [ @@ -56,45 +110,229 @@ foreach ($videos as $v) { 'thumbURL' => $thumbURL, 'category' => $contentType, 'mime' => $mimeType, - 'eco' => '/ipns/' . $ipnsHash, + 'tags' => $videoTags, + 'ipnsHash' => $ipnsHash, 'uri' => $videoURI, - 'name' => $videoName, - 'youtubeID' => $videoID + 'title' => $videoTitle, + 'filename' => $filename, + 'videoId' => $videoID, + 'videoSource' => $videoSource ]; } - } +$tagsMenu = array_unique($tagsMenu); +$narrowingTags = empty($narrowingTags) ? $tagFilter : array_unique($narrowingTags); + $home = true; include('inc/header.php'); +echo ' +'; + // echo '
    '; var_dump($videosList); echo '
    '; -echo '
      '; + +echo ' +
        '; foreach ($videosList as $video) { echo '
      • '; + + $displayTitle = isset($video['title']) ? $video['title'] : $video['filename']; - $href = 'youtube_watch.php?uri='. $video['uri'] . '&name='. urlencode($video['name']) .'&mime='. $video['mime']; - + $href = 'youtube_watch.php?uri='. $video['uri'] . '&name='. urlencode($displayTitle) .'&mime='. $video['mime']; + echo ' - - - '. $video['name'] . ' - - -

        - '. formatDuration($video['duration']) . ' +

        + + '. $displayTitle  . ' +

        + '; + + if (isset($video['duration'])) { + + echo ' +

        + '. formatDuration($video['duration']) . ' +

        '; + } + + echo '

        - ' . $video['name'] . ' + ' . $displayTitle . ' -

        '; +

        + +
          '; + + foreach ($video['tags'] as $tag) { + + $tagArray = array($tag); + + if (!in_array($tag, $tagFilter)) { + + $selectedTag = false; + $tagQueryArray = array_merge($tagFilter, $tagArray); + + } else { + + $selectedTag = true; + $tagQueryArray = array_diff($tagFilter, $tagArray); + } + + $classes = $selectedTag ? ' selected' : 'selectable'; + + if (!empty($tagQueryArray)) { + + $uriParams['tags'] = implode('|', $tagQueryArray); + } + + $uriParams['show'] = $show; + + echo ' +
        • + + ' . $tag .' + +
        • '; + } + + echo ' +
        '; echo '
      • '; } diff --git a/www/boris/youtube_add_video_aux.php b/www/boris/youtube_add_video_aux.php index 44a7024..594637e 100644 --- a/www/boris/youtube_add_video_aux.php +++ b/www/boris/youtube_add_video_aux.php @@ -1,7 +1,7 @@