Skip to content

Commit

Permalink
random cleanups, fixes, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
septor committed Nov 5, 2015
1 parent dc68f6d commit 2662d66
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 60 deletions.
28 changes: 7 additions & 21 deletions _class.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php
/*
* AnteUp - A Donation Tracking Plugin for e107
*
* Copyright (C) 2012-2015 Patrick Weaver (http://trickmod.com/)
* For additional information refer to the README.mkd file.
*
*/
define("ANTEUP", e_PLUGIN."anteup/");
define("ANTEUP_ABS", SITEURLBASE.e_PLUGIN_ABS."anteup/");

Expand All @@ -15,27 +22,6 @@ function format_currency($input, $id, $commify = true)
return ($loc == "back" ? $input.$symbol : $symbol.$input);
}

function currency_info($id, $type = 'symbol')
{
$sql = e107::getDb();
if($type == "symbol")
{
return $sql->retrieve('anteup_currency', 'symbol', 'id = '.intval($id));
}
elseif($type == "code")
{
return $sql->retrieve('anteup_currency', 'code', 'id = '.intval($id));
}
elseif($type == "desc")
{
return $sql->retrieve('anteup_currency', 'description', 'id = '.intval($id));
}
else
{
return "";
}
}

function get_info($type)
{
$sql = e107::getDb();
Expand Down
2 changes: 1 addition & 1 deletion anteup_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
else
$caption = $caption;

$ns->tablerender($caption, $text, 'anteup');
e107::getRender()->tablerender($caption, $text, 'anteup');
}
?>
25 changes: 20 additions & 5 deletions anteup_shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
* For additional information refer to the README.mkd file.
*
*/

//TODO: Convert all form elements to e107::getForm()

if(!defined('e107_INIT')){ exit; }

class anteup_shortcodes extends e_shortcode
Expand Down Expand Up @@ -88,8 +85,8 @@ function sc_anteup_donator($parm)
{
if($this->var['anon'] == true)
{
$output = e107::getForm()->hidden('item_name', 'Anonymous');
$output .= "Anonymous";
$output = e107::getForm()->hidden('item_name', LAN_ANTEUP_DONATIONS_ANONYMOUS);
$output .= LAN_ANTEUP_DONATIONS_ANONYMOUS;
}
else
{
Expand All @@ -108,6 +105,18 @@ function sc_anteup_donator($parm)
return $output;
}

function sc_anteup_menutext($parm='')
{
$text = e107::pref('anteup', 'anteup_menutext');
return ($text == "LAN_ANTEUP_MENU_TEXT" ? LAN_ANTEUP_MENU_TEXT : $text);
}

function sc_anteup_donatelink($parm='')
{
$pref = e107::pref('anteup');
return "<a href='".e_PLUGIN."anteup/donate.php'><img src='".e_PLUGIN."anteup/images/icons/".$pref['anteup_button']."' title='".$pref['anteup_button']."' style='border:none' /></a>";
}

function sc_anteup_currencyselector($parm)
{
$sql = e107::getDb();
Expand Down Expand Up @@ -197,6 +206,12 @@ function sc_anteup_donation_donator($parm='')
{
return $this->var['user_id'];
}

function sc_anteup_pagetext($parm='')
{
$text = e107::pref('anteup', 'anteup_pagetext');
return ($text == "LAN_ANTEUP_PAGE_TEXT" ? LAN_ANTEUP_PAGE_TEXT : $text);
}
}

?>
4 changes: 2 additions & 2 deletions donations.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
}
else
{
$text .= "There were no donations made in that time frame.";
$text .= "<div style='text-align:center;'>There were no donations made in that time frame.</div>";
}
}
else
{
$text = "Sorry, friend, but you can't view this page based on your userclass.";
$text = "<div style='text-align:center;'>Sorry, friend, but you can't view this page based on your userclass.</div>";
}

e107::getRender()->tablerender("Donations", $text);
Expand Down
1 change: 1 addition & 0 deletions languages/English_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@
define("LAN_ANTEUP_PREFS_24", "Displays the amount of money you need to get before you met your goal.");
define("LAN_ANTEUP_PREFS_25", "Show configuration link?");
define("LAN_ANTEUP_PREFS_26", "Displays the link to this page on the menu item.");
?>
19 changes: 5 additions & 14 deletions languages/English_front.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
<?php

// general
define("LAN_ANTEUP_MENU_TITLE", "Donations");
//------------------------------------------------------------------------------------------------------------+
// anteup_menu.php
define("ANTELAN_MENU_01", "Received!");
define("ANTELAN_MENU_02", "See who has donated!");
define("ANTELAN_MENU_03", "We have met our goal! Thanks a lot!");

define("ANTELAN_MENU_04", "Current:");
define("ANTELAN_MENU_05", "Remaining:");
define("ANTELAN_MENU_06", "Target:");
define("ANTELAN_MENU_07", "Grand Total:");
define("ANTELAN_MENU_08", "Due date:");

define("ANTELAN_MENU_09", "Admin configure");
define("LAN_ANTEUP_MENU_TEXT", "Thanks for all your donations, we greatly appreciate it!");
define("LAN_ANTEUP_PAGE_TEXT", "Thanks for considering to send us a donation. We appreciate your contribution and will use it to better your experience on the site");

// donate.php
define("ANTELAN_DONATE_CAPTION00", "Donate");
Expand All @@ -25,7 +15,8 @@


// donations.php
define("ANTELAN_DONATIONS_CAPTION00", "Donations");
define("LAN_ANTEUP_DONATIONS_CAPTION", "Donations");
define("LAN_ANTEUP_DONATIONS_ANONYMOUS", "Anonymous");

define("ANTELAN_DONATIONS_01", "Start Date:");
define("ANTELAN_DONATIONS_02", "End Date:");
Expand Down
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<pref name='anteup_goal'>0</pref>
<pref name='anteup_due'>Thursday, 31 December, 2015</pref>
<pref name='anteup_lastdue'>Thursday, 1 January, 2015</pref>
<pref name='anteup_menutext'>LAN_ANTEUP_DEFAULT_DESC</pref>
<pref name='anteup_pagetext'>LAN_ANTEUP_DEFAULT_DONATE_BLURB</pref>
<pref name='anteup_menutext'>LAN_ANTEUP_MENU_TEXT</pref>
<pref name='anteup_pagetext'>LAN_ANTEUP_PAGE_TEXT</pref>
<pref name='anteup_dateformat'>short</pref>
<pref name='anteup_paypal'>[email protected]</pref>
<pref name='anteup_button'>donate.gif</pref>
Expand Down
9 changes: 8 additions & 1 deletion return.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php
/*
* AnteUp - A Donation Tracking Plugin for e107
*
* Copyright (C) 2012-2015 Patrick Weaver (http://trickmod.com/)
* For additional information refer to the README.mkd file.
*
*/
require_once("../../class2.php");
require_once(HEADERF);
e107::lan('anteup');
Expand All @@ -11,7 +18,7 @@
$caption = ANTELAN_THANKS_01;
$text = ANTELAN_THANKS_02;
}
$ns->tablerender($caption, "<div style='text-align:center;'>".$text."</div>");
e107::getRender()->tablerender($caption, "<div style='text-align:center;'>".$text."</div>");
}else{
header("location: ".e_BASE);
}
Expand Down
35 changes: 21 additions & 14 deletions templates/anteup_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,45 @@
if(!defined('e107_INIT')){ exit; }

$ANTEUP_TEMPLATE['menu'] = "
Due on: {ANTEUP_DUE}<br />
<a href='".e_PLUGIN."anteup/donations.php'>{ANTEUP_BAR}</a>
Status (in {ANTEUP_CODE}): {ANTEUP_CURRENT}/{ANTEUP_GOAL}<br />
Remaining: {ANTEUP_REMAINING: format}<br />
Lifetime Donation Total: {ANTEUP_TOTAL: format}<br />
{ANTEUP_ADMIN}
<div style='text-align:center;'>
{ANTEUP_MENUTEXT}
<br />
Due on: {ANTEUP_DUE}<br />
<a href='".e_PLUGIN."anteup/donations.php'>{ANTEUP_BAR}</a>
Status (in {ANTEUP_CODE}): {ANTEUP_CURRENT}/{ANTEUP_GOAL}<br />
Remaining: {ANTEUP_REMAINING: format}<br />
Lifetime Donation Total: {ANTEUP_TOTAL: format}<br />
<br />
{ANTEUP_DONATELINK}
<br />
{ANTEUP_ADMIN}
</div>
";

$ANTEUP_TEMPLATE['donate'] = "
{ANTEUP_PAGETEXT}
<br /><br />
<table class='table table-bordered table-hover'>
<tbody>
<tr>
<td>".ANTELAN_DONATE_01."</td>
<td>{ANTEUP_DONATOR: class=tbox}</td>
<td>{ANTEUP_DONATOR}</td>
</tr>
<tr>
<td>".ANTELAN_DONATE_02."</td>
<td>{ANTEUP_CURRENCYSELECTOR: class=tbox}</td>
<td>{ANTEUP_CURRENCYSELECTOR}</td>
</tr>
<tr>
<td>".ANTELAN_DONATE_03."</td>
<td>{ANTEUP_AMOUNTSELECTOR: class=tbox}</td>
<td>{ANTEUP_AMOUNTSELECTOR}</td>
</tr>
<tr>
<td>Donate Anonymously</td>
<td>{ANTEUP_ANONBOX}</td>
</tr>
<tr>
<td colspan='2'>{ANTEUP_SUBMITDONATION}</td>
<td class='center' colspan='2'>{ANTEUP_SUBMITDONATION}</td>
</tr>
</tbody>
</table>
<br />
If you would rather donate anonymously, <a href='?anonymously'>click here</a>.
";

$ANTEUP_TEMPLATE['donations']['filter'] = "
Expand Down

0 comments on commit 2662d66

Please sign in to comment.