3 # Copyright 2014 Paul Hänsch
5 # This file is part of Busy
7 # Busy is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # Busy is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
17 # You should have received a copy of the GNU Affero General Public License
18 # along with Busy. If not, see <http://www.gnu.org/licenses/>.
22 search="$(echo "$_GET[\"s\"]" |sed 's:\t: :g;s:\r::g;s:\\:\\\\:g')"
24 if [ -n "$search" ]; then
25 echo "<h1>News search results for: $search</h1>"
26 for each in $(grep -ile "$search" Home/<0000000000-9999999999>_<000-999>.news); do
27 id=$(sed -r 's:^.*/::;s:.news$::' <<<$each)
28 echo "<div class='search'><a href='#news_$id'><h2>$(date -d @$(cut -d_ -f1 <<<"$id"))</h2></a>"
29 grep -C1 -ie "$search" "$each" |sed "s:$search:<b>&</b>:g;s:$:<br>:g"
37 btcAdAddress="$(sed -rn 's:^btcAdAddress=(.+):\1:p' project.meta)"
38 btcAdContent="$(sed -rn 's:^btcAdContent=([1-4]):\1:p' project.meta)"
39 grep -q 'advertise=btcAd' project.meta && cat <<EOF
40 <h1>Sponsored Links:</h1>
41 <iframe src="http://bitcoinadvertisers.com/a.php?p=${btcAdAddress}&a=${btcAdContent}&bg=FFFFFF&link=3366FF&text=414141"
42 scrolling="no" style="width:120px;height:300px;border:1px solid #f2f2f2;"></iframe>
43 <iframe src="http://bitcoinadvertisers.com/a.php?p=${btcAdAddress}&a=${btcAdContent}&bg=FFFFFF&link=3366FF&text=414141"
44 scrolling="no" style="width:120px;height:300px;border:1px solid #f2f2f2;"></iframe>
53 cat ${_EXEC}/templates/Home.css
56 #. ${_EXEC}/templates/text_home.sh
57 . ${_EXEC}/templates/Home.page