<div class='key'><input type='checkbox' name='usePaypal' value='yes' $(grep -q usePaypal=yes $metafile && echo checked)>Paypal Address</div>
<div class='value'><input type='text' name='paypalAddress' value='$(sed -rn 's:^paypalAddress=(.*)$:\1:p' "$metafile")'></div><br>
</fieldset>
+
+ <fieldset><legend>Advertisement</legend>
+ <div class='key'><input type='radio' name='advertise' value='no' $(grep -q advertise=no $metafile && echo checked)>No Advertisement</div><br>
+ <div class='key'><input type='radio' name='advertise' value='btcAd' $(grep -q advertise=btcAd $metafile && echo checked)>
+ <a href="http://bitcoinadvertisers.com">BitCoinAdvertisers.com</a></div>
+ <div class='value'>
+ Bitcoin Address: <input type='text' name='btcAdAddress' value='$(sed -rn 's:^btcAddress=(.*)$:\1:p' "$metafile")'><br>
+ Content: <select name=btcAdContent size=1><option value=1>All</option><option value=2>No Gambling</option><option value=3>No Erotic</option><option value=4>Neither</option></select>
+ </div><br>
+ </fieldset>
<input type='submit'>
</form></div>
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>'
+ )
</div>
HomeEND
border-color: #AAF;
padding: .5em 1em .5em 1em;
}
+div#ACCOUNTING #btcqr {
+ position: fixed;
+ border: 1px solid #000;
+ background-color: #FFF;
+ padding: 1em;
+
+ /*left: 40%; right: 40%; top: 10em;*/
+ text-align: center;
+ vertical-align: middle;
+ z-index: 100;
+
+ overflow: none;
+}
+div#ACCOUNTING #btcqr img {
+ width: 80%
+}
div#MENU {
position: absolute;
$( $LOGIN && echo '<a href="?p=Settings">My Settings</a><br>')
</div>
<div id="ACCOUNTING">
- $(grep -q 'useFlattr=yes' project.meta && echo '
+ $(btcAddress="$(sed -rn 's:^btcAddress=(.*)$:\1:p' project.meta)"
+ flattrThingURL=$(sed -rn 's:^flattrThingURL=(.*)$:\1:p' project.meta)
+
+ grep -q 'useBitcoin=yes' project.meta && [ \! -f "QRcodes/bitcoin:${btcAddress}.png" ] &&\
+ qrencode -o "QRcodes/bitcoin:${btcAddress}.png" "bitcoin:$btcAddress"
+ grep -q 'useBitcoin=yes' project.meta && echo '
+ <a href="#" onclick="javascript:show_screen('\'btcqr\'')"><img src="http://bitcoin.it/img/bc_logo_135.png" height="60"></a>
+ <div id='btcqr' style="display:none;">
+ <a href="#" onclick="javascript:hide_screen('\'btcqr\'')">close</a><br>
+ <img src="QRcodes/bitcoin:'$btcAddress'.png"><br>
+ Address:<br><a href="bitcoin:'$btcAddress'">'$btcAddress'</a>
+ </div>
+ '
+ grep -q 'useFlattr=yes' project.meta && echo '
<a class="FlattrButton" style="display:none;" href="http://'${HTTP_HOST}'"></a>
- <noscript> <a href="'$(sed -rn 's:^flattrThingURL=(.*)$:\1:p' project.meta)'" target="_blank">
+ <noscript> <a href="'$flattrThingURL'" target="_blank">
<img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" />
</a></noscript>
')
flattrThingURL=http://flattr.com/thing/599434/Busy-Software-Project-Management
usePaypal=
paypalAddress=
-useBitcoin=
-btcAddress=
+useBitcoin=yes
+btcAddress=1PswQ3kEKQSRHsMQYaTSgfrWEvHPZbkpZN
+advertise=btcAd
+btcAdAddress=1PswQ3kEKQSRHsMQYaTSgfrWEvHPZbkpZN
+btcAdContent=3
if [ -n "${CONTENT_LENGTH}" -a "${CONTENT_LENGTH}" -gt 0 ]; then
(head -c "${CONTENT_LENGTH}"; echo)|sed 's/&/\n/g' \
- |sed -rn '/^((appName|appSlogan|svnRepo|gitRepo|flattrThingURL|paypalAddress|btcAddress)=.*|repoType=(svn|git)|(useFlattr|usePaypal|useBitcoin)=yes)$/{
+ |sed -rn '/^((appName|appSlogan|svnRepo|gitRepo|flattrThingURL|paypalAddress|btcAddress|btcAdAddress)=.*|repoType=(svn|git)|(useFlattr|usePaypal|useBitcoin)=yes|advertise=(btcAd|no)|btcAdContent=[1-4])$/{
s:\+: :g;s:%:\\x:g;p}' \
|while line="$(line)"; do
eval "$(echo -e "$line" |sed -r 's:[\n\r'\'']::g;s:^([a-zA-Z0-9_+-]+)=(.*)$:\1='"'\2'"':;')"
paypalAddress=$paypalAddress
useBitcoin=$useBitcoin
btcAddress=$btcAddress
+advertise=$advertise
+btcAdAddress=$btcAdAddress
+btcAdContent=$btcAdContent
" >"$metafile"
echo -n "Location: ${proto}://${HTTP_HOST}/?p=Admin\n\n"