]> git.plutz.net Git - busy/commitdiff
implemented bitcoin donations and advertisement (via http://bitcoinadvertisers.com)
authorpaul <paul@plutz.net>
Wed, 30 May 2012 21:52:55 +0000 (21:52 +0000)
committerpaul <paul@plutz.net>
Wed, 30 May 2012 21:52:55 +0000 (21:52 +0000)
svn path=/trunk/; revision=44

Admin.page
Home.page
busy.css
index.cgi
project.meta
write/projectmeta.cgi

index 8bc7e4f8f9fe0aa359c7ad74fae2ada071efb63b..e26420f958fd7350b5e7e632d74bc1d0d9cb69ef 100644 (file)
@@ -36,6 +36,16 @@ else
        <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>
 
index 01d5b1b3336c3777c15fb34bea45957c80a0d8fc..33d40c58e6458124df26946053b728e4343b1036 100644 (file)
--- a/Home.page
+++ b/Home.page
@@ -80,5 +80,8 @@ 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>'
+  )
   </div>
 HomeEND
index 059791d78b24e01a5064e6e33ac83ba4614e01da..fc454a3733bb6c377bf65b200691ae21e771fddd 100644 (file)
--- a/busy.css
+++ b/busy.css
@@ -68,6 +68,22 @@ div#ACCOUNTING {
   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;
index 482a747467827e34bf9fdf667bd5abab27866bbf..6084c3e04902543ff56d5eadef0d0f3bc105f8ad 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -86,9 +86,22 @@ $( $LOGIN && $ACL_ADMIN && echo '<a href="?p=Admin">Admin</a><br>')
 $( $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>
       ')
index 157ca58c4da8c100cbc77dcd64862293502efe12..ee2dd23f936f9452464ed9571cf98c7bf78e9fc1 100644 (file)
@@ -7,6 +7,9 @@ useFlattr=yes
 flattrThingURL=http://flattr.com/thing/599434/Busy-Software-Project-Management
 usePaypal=
 paypalAddress=
-useBitcoin=
-btcAddress=
+useBitcoin=yes
+btcAddress=1PswQ3kEKQSRHsMQYaTSgfrWEvHPZbkpZN
+advertise=btcAd
+btcAdAddress=1PswQ3kEKQSRHsMQYaTSgfrWEvHPZbkpZN
+btcAdContent=3
 
index 215fe45cb1f77064183aa37c60658cdb3d1deafa..436f31e391f3c71889f3ce0517bde98043295dd6 100755 (executable)
@@ -25,7 +25,7 @@ $ACL_ADMIN || exit 0
 
 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'"':;')"
@@ -44,6 +44,9 @@ usePaypal=$usePaypal
 paypalAddress=$paypalAddress
 useBitcoin=$useBitcoin
 btcAddress=$btcAddress
+advertise=$advertise
+btcAdAddress=$btcAdAddress
+btcAdContent=$btcAdContent
 " >"$metafile"
 
 echo -n "Location: ${proto}://${HTTP_HOST}/?p=Admin\n\n"