2011-11-27, 06:04 PM
Since some people seem to be having some difficulty with the changes affecting plugins in MyBB 1.6.5, below is a short tutorial of how to correct your plugins manually.
Step 1
Download pavemen's script which will identify plugins that need looking at from this thread or here.
[attachment=24805]
Upload this file to your plugins folder via FTP, which should be found in:
/inc/plugins/
Step 2
Once uploaded, now browse to the file you have just uploaded:
http://www.yourdomain.com/inc/plugins/pl...update.php
Where you should see a list which looks something like the image below.
[attachment=24806]
Please Note: Pavemen's script will only identify where affected hooks are being used, whether or not alterations have been made. Some plugins like Pirata's MyDownloads will be flagged on the list, but the code has already been rectified.
Step 3
The script does nearly all the hard work for you. 3 different actions may be needed from the results.
Result 1: No action needs to be taken if a plugin has no hooks listed as below.
[attachment=24807]
Result 2: Issue Type 'Return Code'.
[attachment=24808]
In this situation we need to add a return value at the end of the function. Go into your /inc/plugins and find the file that has been identified; in this case it is shops.php.
Open up the file and search for what is listed under Function Called, which in this case is: shops_user_groups_edit_graph_tab. Below is the snippet of code:
We should change this to:
Do this for all plugins that have been identified.
Result 3: Issue Type 'Reference Check'.
This is the same fix as for Return Code, we need to add an & in front of any variables affected.
[attachment=24809]
Once again, go into your /inc/plugins and find the file that has been identified; in this case it is gomobile.php.
Open up the file and search for what is listed under Function Called, which in this case is: gomobile_posts. Below is the snippet of code:
We should change this to:
Do this for all plugins that have been identified. (In the above example, the same would be done for gomobile_threads).
Note
(1) Plugin authors should keep be keeping their plugins up to date so please check for plugin updates. This manual process will most likely only apply for plugins that are older/authors are not active anymore.
Hope this helps.
Step 1
Download pavemen's script which will identify plugins that need looking at from this thread or here.
[attachment=24805]
Upload this file to your plugins folder via FTP, which should be found in:
/inc/plugins/
Step 2
Once uploaded, now browse to the file you have just uploaded:
http://www.yourdomain.com/inc/plugins/pl...update.php
Where you should see a list which looks something like the image below.
[attachment=24806]
Please Note: Pavemen's script will only identify where affected hooks are being used, whether or not alterations have been made. Some plugins like Pirata's MyDownloads will be flagged on the list, but the code has already been rectified.
Step 3
The script does nearly all the hard work for you. 3 different actions may be needed from the results.
Result 1: No action needs to be taken if a plugin has no hooks listed as below.
[attachment=24807]
Result 2: Issue Type 'Return Code'.
[attachment=24808]
In this situation we need to add a return value at the end of the function. Go into your /inc/plugins and find the file that has been identified; in this case it is shops.php.
Open up the file and search for what is listed under Function Called, which in this case is: shops_user_groups_edit_graph_tab. Below is the snippet of code:
$plugins->add_hook("admin_user_groups_edit_graph_tabs", "shops_user_groups_edit_graph_tabs");
function shops_user_groups_edit_graph_tabs($tabs){
global $lang;
$tabs['shops'] = $lang->shops;
}
We should change this to:
$plugins->add_hook("admin_user_groups_edit_graph_tabs", "shops_user_groups_edit_graph_tabs");
function shops_user_groups_edit_graph_tabs(&$tabs){
global $lang;
$tabs['shops'] = $lang->shops;
}
Do this for all plugins that have been identified.
Result 3: Issue Type 'Reference Check'.
This is the same fix as for Return Code, we need to add an & in front of any variables affected.
[attachment=24809]
Once again, go into your /inc/plugins and find the file that has been identified; in this case it is gomobile.php.
Open up the file and search for what is listed under Function Called, which in this case is: gomobile_posts. Below is the snippet of code:
function gomobile_posts($p)
{
global $mybb;
....
We should change this to:
function gomobile_posts(&$p)
{
global $mybb;
....
Do this for all plugins that have been identified. (In the above example, the same would be done for gomobile_threads).
Note
(1) Plugin authors should keep be keeping their plugins up to date so please check for plugin updates. This manual process will most likely only apply for plugins that are older/authors are not active anymore.
Hope this helps.
Thanks to pavemen.