X-Git-Url: http://git.plutz.net/?p=busy;a=blobdiff_plain;f=pages%2FHome.sh;fp=pages%2FHome.sh;h=eea431657acb47c333c8c39b19082918a62132d2;hp=0000000000000000000000000000000000000000;hb=f485895094cd72318b46f39689c3ba954eb37411;hpb=904730d1782749bfac15b0344fe5782433f3099b diff --git a/pages/Home.sh b/pages/Home.sh new file mode 100755 index 0000000..eea4316 --- /dev/null +++ b/pages/Home.sh @@ -0,0 +1,60 @@ +#!/bin/zsh + +# Copyright 2014 Paul Hänsch +# +# This file is part of Busy +# +# Busy is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Busy is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Busy. If not, see . + + +searchresults() { + search="$(echo "$_GET[\"s\"]" |sed 's:\t: :g;s:\r::g;s:\\:\\\\:g')" + + if [ -n "$search" ]; then + echo "

News search results for: $search

" + for each in $(grep -ile "$search" Home/<0000000000-9999999999>_<000-999>.news); do + id=$(sed -r 's:^.*/::;s:.news$::' <<<$each) + echo "' + done + echo '
' + fi +} + +sponsored() { + btcAdAddress="$(sed -rn 's:^btcAdAddress=(.+):\1:p' project.meta)" + btcAdContent="$(sed -rn 's:^btcAdContent=([1-4]):\1:p' project.meta)" + grep -q 'advertise=btcAd' project.meta && cat <Sponsored Links: + + +EOF +} + +case "$1" in + title) + echo "Home" + ;; + css) + cat ${_EXEC}/templates/Home.css + ;; + body) + #. ${_EXEC}/templates/text_home.sh + . ${_EXEC}/templates/Home.page + ;; +esac +