From 2662d661425df2e4b8106dc0581f62e3ec76993e Mon Sep 17 00:00:00 2001 From: septor Date: Thu, 5 Nov 2015 07:02:40 -0500 Subject: [PATCH] random cleanups, fixes, etc --- _class.php | 28 +++++++--------------------- anteup_menu.php | 2 +- anteup_shortcodes.php | 25 ++++++++++++++++++++----- donations.php | 4 ++-- languages/English_admin.php | 1 + languages/English_front.php | 19 +++++-------------- plugin.xml | 4 ++-- return.php | 9 ++++++++- templates/anteup_template.php | 35 +++++++++++++++++++++-------------- 9 files changed, 67 insertions(+), 60 deletions(-) diff --git a/_class.php b/_class.php index 618e6da..78ad305 100644 --- a/_class.php +++ b/_class.php @@ -1,4 +1,11 @@ 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(); diff --git a/anteup_menu.php b/anteup_menu.php index da1125e..a2629c6 100644 --- a/anteup_menu.php +++ b/anteup_menu.php @@ -23,6 +23,6 @@ else $caption = $caption; - $ns->tablerender($caption, $text, 'anteup'); + e107::getRender()->tablerender($caption, $text, 'anteup'); } ?> diff --git a/anteup_shortcodes.php b/anteup_shortcodes.php index 27f2e6a..e399ff6 100644 --- a/anteup_shortcodes.php +++ b/anteup_shortcodes.php @@ -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 @@ -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 { @@ -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 ""; + } + function sc_anteup_currencyselector($parm) { $sql = e107::getDb(); @@ -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); + } } ?> diff --git a/donations.php b/donations.php index 9087331..b4be90f 100644 --- a/donations.php +++ b/donations.php @@ -49,12 +49,12 @@ } else { - $text .= "There were no donations made in that time frame."; + $text .= "
There were no donations made in that time frame.
"; } } else { - $text = "Sorry, friend, but you can't view this page based on your userclass."; + $text = "
Sorry, friend, but you can't view this page based on your userclass.
"; } e107::getRender()->tablerender("Donations", $text); diff --git a/languages/English_admin.php b/languages/English_admin.php index f266e70..128e27e 100644 --- a/languages/English_admin.php +++ b/languages/English_admin.php @@ -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."); +?> diff --git a/languages/English_front.php b/languages/English_front.php index ad89db6..6f352c8 100644 --- a/languages/English_front.php +++ b/languages/English_front.php @@ -1,19 +1,9 @@ 0 Thursday, 31 December, 2015 Thursday, 1 January, 2015 - LAN_ANTEUP_DEFAULT_DESC - LAN_ANTEUP_DEFAULT_DONATE_BLURB + LAN_ANTEUP_MENU_TEXT + LAN_ANTEUP_PAGE_TEXT short yourpaypal@email.com donate.gif diff --git a/return.php b/return.php index 1ffc33f..8e18c77 100644 --- a/return.php +++ b/return.php @@ -1,4 +1,11 @@ tablerender($caption, "
".$text."
"); + e107::getRender()->tablerender($caption, "
".$text."
"); }else{ header("location: ".e_BASE); } diff --git a/templates/anteup_template.php b/templates/anteup_template.php index fc7e270..f6f7a8c 100644 --- a/templates/anteup_template.php +++ b/templates/anteup_template.php @@ -9,38 +9,45 @@ if(!defined('e107_INIT')){ exit; } $ANTEUP_TEMPLATE['menu'] = " -Due on: {ANTEUP_DUE}
-{ANTEUP_BAR} -Status (in {ANTEUP_CODE}): {ANTEUP_CURRENT}/{ANTEUP_GOAL}
-Remaining: {ANTEUP_REMAINING: format}
-Lifetime Donation Total: {ANTEUP_TOTAL: format}
-{ANTEUP_ADMIN} +
+ {ANTEUP_MENUTEXT} +
+ Due on: {ANTEUP_DUE}
+ {ANTEUP_BAR} + Status (in {ANTEUP_CODE}): {ANTEUP_CURRENT}/{ANTEUP_GOAL}
+ Remaining: {ANTEUP_REMAINING: format}
+ Lifetime Donation Total: {ANTEUP_TOTAL: format}
+
+ {ANTEUP_DONATELINK} +
+ {ANTEUP_ADMIN} +
"; $ANTEUP_TEMPLATE['donate'] = " + {ANTEUP_PAGETEXT} +

- + - + - + - - - - - +
".ANTELAN_DONATE_01."{ANTEUP_DONATOR: class=tbox}{ANTEUP_DONATOR}
".ANTELAN_DONATE_02."{ANTEUP_CURRENCYSELECTOR: class=tbox}{ANTEUP_CURRENCYSELECTOR}
".ANTELAN_DONATE_03."{ANTEUP_AMOUNTSELECTOR: class=tbox}{ANTEUP_AMOUNTSELECTOR}
Donate Anonymously{ANTEUP_ANONBOX}
{ANTEUP_SUBMITDONATION}{ANTEUP_SUBMITDONATION}
+
+ If you would rather donate anonymously, click here. "; $ANTEUP_TEMPLATE['donations']['filter'] = "