Skip to content

Commit ee4815c

Browse files
committed
Update donation page with PayPal and newer layout
1 parent 18ec0e9 commit ee4815c

File tree

4 files changed

+24
-15
lines changed

4 files changed

+24
-15
lines changed

etc/config.sample.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
22
"bnetdocs": {
33
"asset_versioning": true,
4-
"btc_donate_address": "",
54
"campaigns": {
65
"battleforthenet": "",
76
"vultr": ""
87
},
98
"discord_url": "https://discord.gg/u87WVeu",
9+
"donations": {
10+
"btc_address": "",
11+
"paypal_url": ""
12+
},
1013
"maintenance": [
1114
false,
1215
"BNETDocs has to take a brief moment to do some system maintenance. We'll be back shortly."

src/controllers/Donate.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class Donate extends Controller {
1515

1616
public function &run(Router &$router, View &$view, array &$args) {
1717

18-
$model = new DonateModel();
19-
$model->btc_address = Common::$config->bnetdocs->btc_donate_address;
18+
$model = new DonateModel();
19+
$model->donations = Common::$config->bnetdocs->donations;
2020

2121
$view->render($model);
2222

src/models/Donate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
class Donate extends Model {
88

9-
public $btc_address;
9+
public $donations;
1010

1111
}

src/templates/Donate.phtml

+17-11
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,25 @@ namespace BNETDocs\Templates;
55
use \CarlBennett\MVC\Libraries\Common;
66
use \CarlBennett\MVC\Libraries\Pair;
77

8-
$title = "Donate";
9-
$description = "Donate to BNETDocs to show your support for this project!";
8+
$title = 'Donate';
9+
$description = 'Donate to BNETDocs to show your support for this project!';
1010

11-
$this->opengraph->attach(new Pair("url", "/donate"));
12-
$this->opengraph->attach(new Pair("type", "article"));
11+
$this->opengraph->attach(new Pair('url', '/donate'));
12+
$this->opengraph->attach(new Pair('type', 'article'));
1313

14-
require("./header.inc.phtml");
14+
$btc_address = $this->getContext()->donations->btc_address;
15+
$paypal_url = $this->getContext()->donations->paypal_url;
16+
17+
require('./header.inc.phtml');
1518
?>
1619
<article>
20+
<header>Support Us</header>
21+
<section>
22+
<p><ul>
23+
<li>PayPal: <a href="<?php echo filter_var($paypal_url, FILTER_SANITIZE_FULL_SPECIAL_CHARS); ?>"><?php echo filter_var($paypal_url, FILTER_SANITIZE_FULL_SPECIAL_CHARS); ?></a></li>
24+
<li>BTC: <code><?php echo $btc_address; ?></code></li>
25+
</ul></p>
26+
</section>
1727
<header>Disclaimer</header>
1828
<section>
1929
<p>By donating to BNETDocs, you understand the following:</p>
@@ -23,11 +33,7 @@ require("./header.inc.phtml");
2333
<li>A donation is not acceptable as payment for goods, products, or merchant items.</li>
2434
<li>In absolutely no scenario will a donation be used to willfully violate Blizzard Entertainment's Terms of Service or Battle.net&trade;'s Terms of Service.</li>
2535
</ol></p>
26-
<p>Please see our <a href="<?php echo Common::relativeUrlToAbsolute("/legal"); ?>">Legal Policies</a> for more info.</p>
27-
</section>
28-
<header>Bitcoin (BTC)</header>
29-
<section>
30-
<p>Please send your donation to: <code><?php echo $this->getContext()->btc_address; ?></code></p>
36+
<p>Please see our <a href="<?php echo Common::relativeUrlToAbsolute('/legal'); ?>">Legal Policies</a> for more info.</p>
3137
</section>
3238
</article>
33-
<?php require("./footer.inc.phtml"); ?>
39+
<?php require('./footer.inc.phtml'); ?>

0 commit comments

Comments
 (0)