Skip to content

Commit

Permalink
Fixes #168 by adding support for automatic upgrade on activate. (#176)
Browse files Browse the repository at this point in the history
* Fixes #168 by adding support for automatic upgrade on activate.

* Documents this feature in README.md under the heading "Upgrading".
* Also adds to README.md instructions for installing.
* Bumps the version to 2.4.0.

* Clarified some of the new wording of README.md.

* Added success messages on upgrade and a link to the changelog, and fixed an issue where upgrades were not performed after first downgrading without dropping tables.
  • Loading branch information
lairdshaw authored and Eldenroot committed Jul 16, 2018
1 parent 1a5bb21 commit 4e6165e
Show file tree
Hide file tree
Showing 4 changed files with 586 additions and 279 deletions.
57 changes: 39 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,43 @@ For more information, see the plugin's:
- [Extend MyBB page](http://community.mybb.com/mods.php?action=view&pid=360).
- [MyBB Community Forums topic](http://community.mybb.com/thread-169382.html).

Installing
----------

1. Download an archive of the plugin's files from its Extend MyBB page linked to above.
2. Extract the files in that archive to a temporary location, and then copy them into the root of your MyBB installation. That is to say that "tylsearch.php" should be copied to your MyBB root, "jscripts/thankyoulike.js" should be copied to your MyBB root's "jscripts/" directory, etc.
3. In a web browser, open the "Plugins" module in the Admin Control Panel (ACP) of your MyBB installation. You should see "Thank You/Like System" under "Inactive Plugins".
4. Click "Install & Activate" next to it. You should then see the plugin listed under "Active Plugins" on the reloaded page.
5. Click "Configure Settings" below the plugin and set up the plugin to your preferences.
6. If you want to, you can also edit the plugin's stylesheet ("thankyoulike.css", accessible via the ACP under Templates & Style -> Themes) and its templates (under "Thank You/Like Templates", accessible via the ACP under Templates & Style -> Templates).

Upgrading
---------

If you are upgrading to version 2.4.0 or above, then follow these steps:

1. Click the "Deactivate" button beside the Thank You/Like System plugin in the ACP "Plugins" module.
2. Copy the new version's files, overwriting the old ones (per steps #1 and #2 of Installing above).
3. Activate the plugin again via the ACP. This will upgrade the plugin, retaining all data, including received and given thanks/likes, per-user counts of thanks/likes, overall thanks/likes statistics, the plugin's settings including per-usergroup settings, any changes made to the plugin's stylesheet, and any changes made to the plugin's templates.
4. If you had modified any of the plugin's templates, then, as when upgrading MyBB core, go to "Find Updated Templates" in the ACP to see whether you need to perform any updates.
5. If you had modified the plugin's stylesheet (thankyoulike.css) for any themes, then you might need to apply any changes to this file that came with the new version of the plugin. You can check whether there are any changes in the new Master version of thankyoulike.css that need to be applied by clicking "View the Master theme's thankyoulike.css" under the plugin's entry in the ACP "Plugins" module and comparing it with your existing thankyoulike.css theme files (via the ACP under Templates & Style -> Themes).

If you are upgrading to version 2.3.0 or below, then:

If the updated version of the plugin does not contain new settings or changes to its templates or stylesheet, then:

1. Click the "Deactivate" button beside the Thank You/Like System plugin in the ACP "Plugins" module.
2. Copy the new version's files, overwriting the old ones (per steps #1 and #2 of Installing above).
3. Activate the plugin again via the ACP. All data will be retained, including received and given thanks/likes, per-user counts of thanks/likes, overall thanks/likes statistics, the plugin's settings including per-usergroup settings, any changes made to the plugin's stylesheet, and any changes made to the plugin's templates.

If the updated version of the plugin <strong>does</strong> contain new settings or changes to its templates or stylesheet, then:

1. Make a note of your ACP settings for this plugin including per-usergroup settings (applicable when the plugin's "Usergroup-based thanks/likes limits" setting is enabled), any changes you have made to the plugin's stylesheet file ("thankyoulike.css", accessible via the ACP under Templates & Style -> Themes) and any changes you have to to the plugin's templates (under "Thank You/Like Templates", accessible via the ACP under Templates & Style -> Templates).
2. Click the "Uninstall" button beside the Thank You/Like System plugin in the ACP "Plugins" module and choose "NO" when asked whether to drop plugin data from the database.
3. Copy the new version's files, overwriting the old ones (per steps #1 and #2 of Installing above).
4. Install and activate the plugin again via the ACP.
5. Re-enter your settings for the plugin including any per-usergroup settings and any changes you had made to the plugin's stylesheet and templates (this is why it is important to have made a note of them before uninstalling the plugin).

Credits
-------

Expand All @@ -25,24 +62,8 @@ FAQ

<strong>How do I completely uninstall the Thank You/Like System plugin and remove all of its data from the database?</strong>

Click the "Uninstall" button beside the Thank You/Like System plugin in the "Plugins" module of the ACP and choose "YES" to drop all plugin data from database. This cannot be reverted. <strong>All</strong> data will be lost, including received and given thanks/likes, per-user counts of thanks/likes, overall thanks/likes statistics, plugin settings including per-usergroup settings, and any changes made to the plugin's CSS file.

<strong>How do I update the plugin to a newer version without losing data?</strong>

If the updated version of the plugin does not contain new settings, then:

1. Click the "Deactivate" button beside the Thank You/Like System plugin in the ACP "Plugins" module.
2. Copy the new version's files, overwriting the old ones.
3. Activate the plugin again via the ACP. All data will be retained: this includes received and given thanks/likes, per-user counts of thanks/likes, overall thanks/likes statistics, the plugin's settings including per-usergroup settings, and any changes made to the plugin's CSS file.

If the updated version of the plugin <strong>does</strong> contain new settings, then:

1. Make a note of your ACP settings for this plugin including per-usergroup settings (applicable when the plugin's "Usergroup-based thanks/likes limits" setting is enabled) and any changes you have made to the plugin's CSS file ("thankyoulike.css", accessible via the ACP under Templates & Style -> Themes).
2. Click the "Uninstall" button beside the Thank You/Like System plugin in the ACP "Plugins" module and choose "NO" when asked whether to drop plugin data from the database.
3. Copy the new version's files, overwriting the old ones.
4. Install and activate the plugin again via the ACP.
5. Reenter your settings for the plugin including any per-usergroup settings and any changes you had made to the plugin's CSS file (this is why it is important to have made a note of them before uninstalling the plugin).
Click the "Uninstall" button beside the Thank You/Like System plugin in the "Plugins" module of the ACP and choose "YES" to drop all plugin data from database. This cannot be reverted. <strong>All</strong> data will be lost, including received and given thanks/likes, per-user counts of thanks/likes, overall thanks/likes statistics, plugin settings including per-usergroup settings, and any changes made to the plugin's stylesheet and templates.

<strong>How do I change the icons of the buttons to add and remove thanks/likes?</strong>

Replace the files thx_add.png and thx_del.png in the images/thankyoulike directory.
Replace the files tyl_add.png and tyl_del.png in the images/thankyoulike directory.
5 changes: 5 additions & 0 deletions inc/languages/english/admin/config_thankyoulike.lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
$l['tyl_info_desc_url'] ="<br />*Edited and maintained for MyBB 1.8.x by: {1}, {2}, {3}, {4} and {5}<br />*Sources: {6}";
$l['tyl_info_desc_recount'] = "Recount thanks/likes";
$l['tyl_info_desc_configsettings'] = "Configure Settings";
$l['tyl_view_master_thankyoulike_css'] = "View the Master theme's thankyoulike.css";
$l['tyl_use_this_css_for'] = "(use this after plugin upgrade to update this stylesheet in <a href=\"index.php?module=style-themes\">any themes</a> for which you have modified it).";
$l['tyl_info_desc_alerts_error'] = "<b>The Thank You/Like System is uninstalled or deactivated</b>";
$l['tyl_successful_upgrade_msg'] = "The {1} has been activated successfully and upgraded to version {2}.";
$l['tyl_successful_upgrade_msg_for_info'] = "Successfully upgraded to version {1}.";
$l['tyl_view_changelog'] = "View changelog.";
$l['tyl_info_desc_alerts_integrate'] = "<b>Click <u>HERE</u> to integrate the Thank You/Like System with MyAlerts</b>";
$l['tyl_info_desc_alerts_integrated'] = "<b>The Thank You/Like System and MyAlerts were integrated successfully!</b>";
$l['tyl_info_desc_alerts_registeralerttype'] = "Register a new alert type into MyAlerts";
Expand Down
Loading

0 comments on commit 4e6165e

Please sign in to comment.