Skip to content

Commit

Permalink
WeChall: Donation stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ricerbot committed Oct 3, 2017
1 parent 89817f2 commit 92cf14d
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 2 deletions.
37 changes: 37 additions & 0 deletions core/module/WeChall/method/Donations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

final class WeChall_Donations extends GWF_Method
{
public function getHTAccess()
{
return
'RewriteRule ^donations/?$ index.php?mo=WeChall&me=Donations'.PHP_EOL;
}

public function execute()
{
GWF_Website::setPageTitle('Donations');

return $this->templateDonations();
}

public function templateDonations()
{
$tVars = array(
'paybutton' => $this->getPayButton(),
);
return $this->module->templatePHP('donations.php', $tVars);
}

private function getPayButton()
{
return <<<EOB
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="R9RXRQ3EAYU2G">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="donations">
<img alt="" border="0" src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" width="1" height="1">
</form>
EOB;
}
}
5 changes: 3 additions & 2 deletions core/module/WeChall/method/Sidebar2.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ private function displayStats()
'<div><a href="'.GWF_WEB_ROOT.'active_sites">'.$this->module->lang('rp_sitecount', array(count(WC_Site::getActiveSites()))).'</a></div>'.PHP_EOL.
'<div><a href="'.GWF_WEB_ROOT.'challs">'.$this->module->lang('rp_challcount', array(GDO::table('WC_Challenge')->countRows())).'</a></div>'.PHP_EOL.
'<div><a href="'.GWF_WEB_ROOT.'forum">'.$this->module->lang('rp_postcount', array($postcount)).'</a></div>'.PHP_EOL.
'<div><a href="'.GWF_WEB_ROOT.'users">'.$this->module->lang('rp_usercount', array(GDO::table('GWF_User')->countRows())).'</a></div>'.PHP_EOL;
return
'<div><a href="'.GWF_WEB_ROOT.'users">'.$this->module->lang('rp_usercount', array(GDO::table('GWF_User')->countRows())).'</a></div>'.PHP_EOL.
'<div><a href="'.GWF_WEB_ROOT.'donations">0 donations</a></div>'.PHP_EOL;
return
$this->sidebox($this->module->lang('rp_stats').$btn, $box);
}

Expand Down
57 changes: 57 additions & 0 deletions www/tpl/default/module/WeChall/donations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
$css = <<<CSS
div.donation-page pre, div.donation-page ul, div.donation-page div.box {
padding: 8px;
}
div.donation-page form {
display: inline-block;
}
CSS;
GWF_Website::addInlineCSS($css);
?>
<div class="donation-page">
<h1>Donations</h1>

<?php if (isset($_GET['thx'])) : ?>
<div class="box">
Thank you very much!<br/>
We will probably contact you any soon, for saying thanks and if you would like to be mentioned here.
</div>
<?php endif; ?>

<div class="box">
You are reading right; We are accepting <?= $tVars['paybutton']; ?>'s now.<br/>
It would be awesome, if some people would donate something, as the rent for <a href="http://warchall.net">box0</a> and <a href="https://www.wechall.net">box2</a> is due in nov/december.<br/>
We will give an overview here of the donations, manually updated.<br/>
</div>
<div class="box">
<pre>Donors: 0
Sum: € 0,00
Goal: €250,00
</pre>
</div>

<div class="box">
We currently have the following ca. expenses for WeChall:<br/>
<ul>
<li>- Box0 (warchall.net) €110/y</li>
<li>- Box2 (wechall.net) €100/y</li>
<li>- Domain costs €30/y</li>
<li>-&nbsp;</li>
<li>- Wishlist; A better server?</li>
</ul>
</div>

<hr>

<h2>Hall of purchased Fame :)</h2>

<hr>

<div class="box">
If you donate you <em>can</em> get an entry here. (tell us what you would like to write on this wall).<br/>
<br/>
THANKS!
<br/>
</div>
</div>

0 comments on commit 92cf14d

Please sign in to comment.