1
#21
AutoMOD for phpBB 3.1
Posted January 19th 2017, 5:55pm
If the includes/functions_install.php file doesn't exist in phpBB 3.2, then I suggest you take a copy of the file from phpBB 3.0 or 3.1, and put it in the /includes directory in phpBB 3.2. ;)
φ
Posts: 1600
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
AutoMOD for phpBB 3.1
Posted January 19th 2017, 6:10pm
Thanks! I had one little error, but I've remove this from the functions_install:

/**
* Get tables of a database
*
* @deprecated
*/
function get_tables(&$db)
{
$db_tools = new \phpbb\db\tools($db);

return $db_tools->sql_list_tables();
}


And finally it worked!

I'll try to install now a simple MOD: https://www.phpbb.com/customise/db/mod/ ... by_author/

EDIT: Ok, I tried but got an error. functions_upload.php was missing. I've done the same and grab it from 3.1 and put it on include folder. AND... IT WORKED!
φ
Posts: 14
Joined: November 16th 2015, 9:18am
Likes Given: 5
AutoMOD for phpBB 3.1
Posted January 19th 2017, 6:41pm
I'm happy, but honestly surprised it worked. Given the huge codebase differences between 3.0 and 3.2, I thought for sure the phpBB devs would do something to break AutoMOD.

Here's a full package containing all the edits/additions:

automod-3.2.0.zip
246.79 KiB  |  Downloaded 156 times

When I get some free time, I'll write something up and move this to its own separate topic. In the meantime, I would really appreciate your making a post about this over on phpbb.com. :)
φ
Posts: 1600
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
AutoMOD for phpBB 3.1
Posted January 19th 2017, 7:24pm
I was now going to post the new zip file xD

But I can't insert attachments xD

"In the meantime, I would really appreciate your making a post about this over on phpbb.com"

I'll because of this: https://www.phpbb.com/community/viewtop ... &t=2403791

A simple mod that its very hard (at least for me) to recreate as extension.
And before each phpBB update, I'll just need to unistall, update and install again the few MODs...
My idea, for all mods that just change 1 or 2 lines of codes as that one, is to merge all in one MOD. That way it will be always simple to install.

Cheers and thank YOU for re-creating this useful feature.
φ
Posts: 14
Joined: November 16th 2015, 9:18am
Likes Given: 5
AutoMOD for phpBB 3.1
Posted September 23rd 2017, 4:33pm
https://www.phpbb.com/customise/db/mod/pm_statistics/

I've tried to install this one since it's an ACP MOD and maybe not a lot has changed.
I was able to installed and bypass the 1st error on the installation file, but I get an "Module Not Accessible" page error when clicking on PM Statistics on ACP. Any hint on how to solve it?
φ
Posts: 14
Joined: November 16th 2015, 9:18am
Likes Given: 5
AutoMOD for phpBB 3.1
Posted September 23rd 2017, 6:39pm
phpBB 3.2 has a rewritten module manager, so the installer for that MOD has to change. I'd suggest replacing these two lines:

require($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);
$modules = new acp_modules();

with this line:

$modules = $phpbb_container->get('module.manager');

The MOD may need more cleanup for phpBB 3.2 (lots of things do ;) ), but this should point you in the right direction.
φ
Posts: 1600
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
AutoMOD for phpBB 3.1
Posted September 24th 2017, 6:03am
That I was able to figure out already. And I was able to install. The problem is after installation. All seemed to runned fine but then on acp when I click the pm statistic button it give me error. I need to fix the code, but don't know where to start. Is there any documentation that explains what have changed from 3.0 to 3.2 on the ACP? Cheers
φ
Posts: 14
Joined: November 16th 2015, 9:18am
Likes Given: 5
AutoMOD for phpBB 3.1
Posted September 24th 2017, 10:01am
The problems are in the installer. You should uninstall the MOD and get the installer code working correctly.

As for documentation about code changes, you should ask the phpBB devs. It appears that not much PHP code has changed in the ACP from 3.0 to 3.2. The biggest code changes in the ACP are in the theme, where a bunch of spaghetti-code javascript and CSS was added to make it semi-responsive. (One wonders why time was spent on a JS hack as opposed to cleaning up the templates, but I digress.)
φ
Posts: 1600
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
AutoMOD for phpBB 3.1
Posted September 25th 2017, 5:09am
After changing the line you told, I've got another error:

[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/module/module_manager.php on line 233: Missing argument 1 for phpbb/module/module_manager::remove_cache_file(), called in [ROOT]/install_pm_statistics.php on line 102 and defined



The line on install was this:
$modules->remove_cache_file();

And on the module_manager file:
public function remove_cache_file($module_class)

So I've put this:
$modules->remove_cache_file($errors);

So it become:
function create_modules($module_data)
{
global $modules;

for ($i = 0, $count = sizeof($module_data); $i < $count; $i++)
{
$errors = $modules->update_module_data($module_data[$i]);
if (!sizeof($errors))
{
$modules->remove_cache_file($errors);
}
}
}

And 0 error on the install after that. But I got the same error of "Module not accessible".

maybe its easier to convert it into extension. But I would like to figure this out first. :P

In the case of not being sucessfull on solving, I'll post again.

EDIT: YAY, I did it! It was fair easy after all.
Just fix the pagination, since it has own class now. And request_var is now $request->variable. And basically that was it. :)

Now its a matter of fixing the bugs xD
φ
Posts: 14
Joined: November 16th 2015, 9:18am
Likes Given: 5

Who is online

Users browsing this forum: No registered users and 0 guests