<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>
+ <a target='_blank' href='http://bitcoinadvertisers.com'>BitCoinAdvertisers.com</a><br>Bitcoin Address:</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 $(grep -q 'btcAdContent=1' project.meta && echo selected)>All</option>
- <option value=2 $(grep -q 'btcAdContent=2' project.meta && echo selected)>No Gambling</option>
- <option value=3 $(grep -q 'btcAdContent=3' project.meta && echo selected)>No Erotic</option>
- <option value=4 $(grep -q 'btcAdContent=4' project.meta && echo selected)>Neither</option>
- </select>
+ <input type='text' name='btcAdAddress' value='$(sed -rn 's:^btcAddress=(.*)$:\1:p' "$metafile")'>
+ <input type='checkbox' name='btcAdGamble' value='yes' $(egrep -q 'btcAdContent=[13]' project.meta && echo checked)>Allow gambling ads
+ <input type='checkbox' name='btcAdErotic' value='yes' $(egrep -q 'btcAdContent=[12]' project.meta && echo checked)>Allow erotic ads
</div><br>
</fieldset>
<input type='submit'>
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|btcAdAddress)=.*|repoType=(svn|git)|(useFlattr|usePaypal|useBitcoin)=yes|advertise=(btcAd|no)|btcAdContent=[1-4])$/{
+ |sed -rn '/^((appName|appSlogan|svnRepo|gitRepo|flattrThingURL|paypalAddress|btcAddress|btcAdAddress)=.*|repoType=(svn|git)|(useFlattr|usePaypal|useBitcoin|btcAdGamble|btcAdErotic)=yes|advertise=(btcAd|no))$/{
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'"':;')"
done
fi
+[ "$btcAdGamble" = yes -a "$btcAdErotic" = yes ] && btcAdContent=1
+[ "$btcAdGamble" != yes -a "$btcAdErotic" = yes ] && btcAdContent=2
+[ "$btcAdGamble" = yes -a "$btcAdErotic" != yes ] && btcAdContent=3
+[ "$btcAdGamble" != yes -a "$btcAdErotic" != yes ] && btcAdContent=4
+
echo "\
name=$appName
slogan=$appSlogan