+++ /dev/null
-#!/bin/zsh
-search="$(egrep -o '(^|&)(s=).+(&|$)' <<<"${QUERY_STRING}" |sed -r 's:^&?s=::;s:\+: :g;s:%:\\x:g')"
-search="$(echo -e "${search}" |sed 's:\t: :g;s:\r::g;s:\\:\\\\:g' |head -n1)"
-
-cat <<WikiEND
- <div id="LEFT">
- <form method="GET" action="/${SCRIPTNAME}" accept-charset="utf-8">
- <input type="hidden" name="p" value="Home">
- <input type="text" name="s" placeholder="Search"><br>
- <input type="submit" value="Search News">
- </form>
- <hr>
-WikiEND
-if [ -n "$search" ]; then
- echo "<h1>News search results for: $search</h1>"
- for each in $(grep -ile "$search" Home/<0000000000-9999999999>_<000-999>.news); do
- id=$(sed -r 's:^.*/::;s:.news$::' <<<$each)
- echo "<div class='search'><a href='#news_$id'><h2>$(date -d @$(cut -d_ -f1 <<<"$id"))</h2></a>"
- grep -C1 -ie "$search" "$each" |sed "s:$search:<b>&</b>:g;s:$:<br>:g"
- echo '</div>'
- done
- echo '<hr>'
-fi
-
-cat <<HomeEND
- </div>
-
- <div id="MAIN">
- <div id="INTRO">
- <div id="introtext"><div class="wikitext">
- $([ -r "Home/intro" ] && _wiki "Home/intro")
- $($ACL_EDITINTRO && echo "<hr><a class='function' href='#' onclick='javascript:hide_screen(\"introtext\");show_screen(\"introedit\");'>Edit</a>" )
- </div></div>
-HomeEND
-$ACL_EDITINTRO && cat <<HomeEND
- <div id="introedit" style="display: none;">
- <form action="/write/$($LOGIN && echo user_)introedit.cgi?i=intro" method="post" accept-charset="UTF-8">
- <textarea name="text" rows="10">$([ -r "Home/intro" ] && cat Home/intro)</textarea><br>
- <input type="submit">
- <a class="function" href="#" onclick="javascript:hide_screen('introedit');show_screen('introtext');">Cancel</a>
- </form>
- </div>
-HomeEND
-echo '</div>'
-
-$ACL_ADDNEWS && cat <<HomeEND
- <div class="NEWS">
- <a id="new" class='function' href='#add' onclick='javascript:hide_screen("new");show_screen("add");'>Add News</a>
- <div id="add" style="display: none;">
- <form action="/write/$($LOGIN && echo user_)introedit.cgi?i=news" method="post" accept-charset="UTF-8">
- <textarea name="text" rows="10">$([ -r "$each" ] && cat $each)</textarea><br>
- <input type="submit">
- <a class="function" href="#new" onclick="javascript:hide_screen('add');show_screen('new');">Cancel</a>
- </form>
- </div>
- </div>
-HomeEND
-
-stat -c '' Home/<0000000000-9999999999>_<000-999>.news && for each in $(ls -c Home/<0000000000-9999999999>_<000-999>.news); do
- info="$(sed 's:Home/::;s:.news::' <<<"$each")"
- cat <<HomeEND
- <div class="NEWS">
- <div id="news_$info"><div class="wikitext">
- $([ -r "$each" ] && _wiki "$each")
- $($ACL_EDITNEWS && echo "<hr><a class='function' href='#edit_$info' onclick='javascript:hide_screen(\"news_$info\");show_screen(\"edit_$info\");'>Edit</a>" )
- </div></div>
-HomeEND
- $ACL_EDITNEWS && cat <<HomeEND
- <div id="edit_$info" style="display: none;">
- <form action="/write/$($LOGIN && echo user_)introedit.cgi?i=$info" method="post" accept-charset="UTF-8">
- <textarea name="text" rows="10">$([ -r "$each" ] && cat $each)</textarea><br>
- <input type="submit">
- <a class="function" href="#news_$info" onclick="javascript:hide_screen('edit_$info');show_screen('news_$info');">Cancel</a>
- </form>
- </div>
-HomeEND
- echo '</div>'
-done
-
-cat <<HomeEND
- </div>
- <div id="RIGHT">
- $(grep -q 'advertise=btcAd' project.meta && echo '<h1>Sponsored Links:</h1>
- <iframe src="http://bitcoinadvertisers.com/a.php?p='$(sed -rn 's:^btcAdAddress=(.+):\1:p' project.meta)'&a='$(sed -rn 's:^btcAdContent=([1-4]):\1:p' project.meta)'&bg=FFFFFF&link=3366FF&text=414141" scrolling="no" style="width:120px;height:300px;border:1px solid #f2f2f2;"></iframe>
- <iframe src="http://bitcoinadvertisers.com/a.php?p='$(sed -rn 's:^btcAdAddress=(.+):\1:p' project.meta)'&a='$(sed -rn 's:^btcAdContent=([1-4]):\1:p' project.meta)'&bg=FFFFFF&link=3366FF&text=414141" scrolling="no" style="width:120px;height:300px;border:1px solid #f2f2f2;"></iframe>'
- )
- </div>
-HomeEND