Skip to content

Commit

Permalink
Tidied up, and fixed a few minor errors in, the code. (#179)
Browse files Browse the repository at this point in the history
Some of the changes:

* Removed $to_version from upgrade functionality - we only upgrade to the latest version possible anyway.

* Removed the nonfunctional tyl_limits_usergroup_permission_tabs() function and its registration as a hook.

* Fixed a mistakenly escaped single quote in the 'tyl_dtformat_desc' message.

* Fixed indentation in the thankyoulike_uninstall() and thankyoulike_info() functions.

* Converted $db->escape_string()s to htmlspecialchar_uni()s (or removed them altogether) where appropriate.

* Fixed the Javascript "settings peeker" so that all settings are properly hidden when the plugin's Enabled setting is Off.

* Changed the prefix of all functions I've added from "thankyoulike_" to "tyl_" for compactness.

* Inserted underscores into the names of all functions I've added where it improves their readability.

* Removed from the "global" declaration at the top of each function any variables that aren't used in the function.

* Added a check that the usergroup-based thanks/likes limits are enabled before checking for exceeding of the flood limit.
  • Loading branch information
lairdshaw authored and Eldenroot committed Jul 17, 2018
1 parent feccf09 commit 9be52b6
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 138 deletions.
4 changes: 2 additions & 2 deletions inc/languages/english/admin/config_thankyoulike.lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
$l['tyl_showdt_op_3'] = "Display on mouse hover over username";

$l['tyl_dtformat_title'] = "Date/time format";
$l['tyl_dtformat_desc'] = "Set the format you want to use to show the date/time in the thanks/likes list.<br />The format is as for PHP\'s <a href=\"php.net/manual/en/function.date.php\">date</a>() function.<br />Example format: <em>m-d-Y h:i A</em> &lt;&lt;will show&gt;&gt; <em>12-31-2009 12:01 PM</em>";
$l['tyl_dtformat_desc'] = "Set the format you want to use to show the date/time in the thanks/likes list.<br />The format is as for PHP's <a href=\"php.net/manual/en/function.date.php\">date</a>() function.<br />Example format: <em>m-d-Y h:i A</em> &lt;&lt;will show&gt;&gt; <em>12-31-2009 12:01 PM</em>";

$l['tyl_sortorder_title'] = "Sort order";
$l['tyl_sortorder_desc'] = "Select the sort order for the thanks/likes lists.";
Expand Down Expand Up @@ -115,7 +115,7 @@

$l['tyl_highlight_popular_posts_title'] = "Highlight posts with a given number of thanks/likes?";
$l['tyl_highlight_popular_posts_desc'] = "Choose \"Yes\" to enable this feature. You can then customize the highlighted posts' style via the CSS class selector <strong>.popular_post</strong> in thankyoulike.css in your <a href\"index.php?module=style-themes\">theme</a>.";
$l['tyl_highlight_popular_posts_count_title'] = "Thanks/likes count for highlight posts";
$l['tyl_highlight_popular_posts_count_title'] = "Minimum count for highlight posts";
$l['tyl_highlight_popular_posts_count_desc'] = "Posts with at least this many thanks/likes will be highlighted.";


Expand Down
Loading

0 comments on commit 9be52b6

Please sign in to comment.