First intergration with wp_w3all

User avatar
coute
User w
User w
Posts: 5
Joined: Mon Apr 10, 2023 5:39 pm
Location: France

First intergration with wp_w3all

Post by coute »

Hello axew3,
First, thanks for this great work.
I have installed wp3_all extension to integrate my phpbb forum into a WP page.
I followed your instructions and created 2 pages :

1. I tried to use the page template to integrate my forum. I added a WP page named "forum" and I used your tool in WP extension to "Create or rebuild WordPress forum page template". It works well. But I want to custom this template (remove search bloc for example). It is a little bit hard to edit the template file in wp-content/themes/mytheme/page-forum.php. So i tried to use shortcode instead.

2. I created a new page named "phpbb". I changed overall_footer and overall_header to fit the new URL. I added this shortcode in the page :
[w3allphpbbiframe wp_page_name="phpbb" wp_page_iframe_top_gap="300"]. It works well to.

The last things i tried to add is your "Last Topics" widgets.
I added in my WP main page the short code [w3allastopics topics_number="5"]. The setup in WP extension "Retrieve posts on Last Topics Widget based on phpBB user's group" is set to no.
The last topics are displayed, BUT I encountered 2 main issues :

1. When I use the WP page "phpbb" with the shortcode, when i click on a topic in the "Last topic widget". The url looks like :

Code: Select all

"https://phpbb.mydomain.com/viewtopic.php?f=12&t=13121&p=144581#p144581"
The main page of the forum is displayed in my WP page, not the forum post.

2. So i tried with the WP page "forum" that used the built template. The widget is automatically added on the right side of the page. Nice. When i click on a topic in the "Last topic widget", the post is displayed in my WP page.
But if I click again on an other recent topic, the URL is malformed and the same post is displayed. The url looks like :

Code: Select all

"https://phpbb.mydomain.com/viewtopic.php?f=12&t=13121&p=144581#p144581/viewtopic.php?f=14&t=1876&p=184471#p184471"
The URL is append to the previous one.

So, i only have some issues with the last topics widget. It's a feature i really want to display for my users. Could you please help me.

Thanks.
"The highest you fly my Lord, the farther you have to fall" - Bayushi Kachiko
User avatar
coute
User w
User w
Posts: 5
Joined: Mon Apr 10, 2023 5:39 pm
Location: France

Re: First intergration with wp3_all

Post by coute »

Hello axew3,
I have resolved the issue with the widget. I removed the main widget in WP and the forum was displayed has expected.

But I have now an other issue with the registration of new account.
In phpbb, in "User registration settings" when i set "Account activation"' to "by user (email verification)"
I have the following error :

Code: Select all

[phpBB Debug] PHP Warning: in file /bitnami/phpbb/ext/w3all/phpbbwordpress/event/main_listener.php on line 231: Undefined array key "user_new"
The user is not added in WP even after I activate the user.
"The highest you fly my Lord, the farther you have to fall" - Bayushi Kachiko
User avatar
axew3
w3all User
w3all User
Posts: 2689
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: First intergration with wp3_all

Post by axew3 »

Ok thank You for the report coute, going to check and fix it!
Going to take a look tomorrow evening, or at max within Friday evening my time, i am sorry i cannot right immediately!
And sorry for the delay on answer and approving your first post, due to some personal problems i have around.

Please if any more come out, just reply in the while.
I will reply here too, as checked and fixed the phpBB ext for the above reported issue.
See you soon! Cheers!
User avatar
coute
User w
User w
Posts: 5
Joined: Mon Apr 10, 2023 5:39 pm
Location: France

Re: First intergration with wp3_all

Post by coute »

Don't worry, I have found many solutions to avoid those issues. But it will be better to fix them for other users.
Thanks for your answer.
I found an other issue with the widget "Online users".
Don't hesitate to send me a private message if you want the URL of the site i'm working on.
"The highest you fly my Lord, the farther you have to fall" - Bayushi Kachiko
User avatar
axew3
w3all User
w3all User
Posts: 2689
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: First intergration with wp_w3all

Post by axew3 »

So i tested the thing, and all is working fine about the phpBB extension, except the warning coming out to you due to some setting about user's registration in phpBB. The warning above reported can maybe be just resolved adding an if isset.
But also i note the fact that if the URL setting that point to WP do NOT contain the final slash, WON'T work, so:
https://localhost/wp/ or https://localhost/wp/a-test-page/ --> OK
https://localhost/wp --> NOT Ok, will not work
this is easily solvable also, adjusting the right required URL, adding a slash when lacking.
It will be so improved asap on next coming ext version.


But the main problem about the user that is NOT added in WP, come after when the wordpress with the integration plugin installed, and based on the cURL/request received, go to execute the function

Code: Select all

function w3all_add_phpbb_user() {
into the /wp-content/plugins/wp-w3all-phpbb-integration/wp_w3all.php file.

Inside this function, the very strange thing, that's to me coming from a bug in wordpress, is that passing the email:

Code: Select all

             $userdata = array(
               'user_login'       =>  $phpbb_user[0]->username,
               'user_pass'        =>  md5($phpbb_user[0]->user_password),
               'user_email'       =>  $phpbb_user[0]->user_email,
               'user_registered'  =>  date_i18n( 'Y-m-d H:i:s', $phpbb_user[0]->user_regdate ),
               'role'             =>  $role
               );
DO NOT WORK, while the follow will WORK, that DO NOT PASS the email:

Code: Select all

             $userdata = array(
               'user_login'       =>  $phpbb_user[0]->username,
               'user_pass'        =>  md5($phpbb_user[0]->user_password),
               //'user_email'       =>  $phpbb_user[0]->user_email,
               'user_registered'  =>  date_i18n( 'Y-m-d H:i:s', $phpbb_user[0]->user_regdate ),
               'role'             =>  $role
               );
It can be also easily resolved, updating into the subsequent query the email for the just created user.
Very strange behavior, it has been quite hard to understand the issue.
The bug in WordPress is about the wp_insert_user function that in my tests fail with error not enough data provided when email value provided.

This is the wp_w3all.php file with the function w3all_add_phpbb_user() {
patched to work fine:
wp_w3all.zip
(17.17 KiB) Downloaded 87 times

I will return over this to check if can be resolved in a different way (but it appear to me to be a WP bug, we'll see) , or the next 2.7.1 will come with this same fix applied.
If you want i will surely take a look to your going on, so may link it to me into a pm
User avatar
coute
User w
User w
Posts: 5
Joined: Mon Apr 10, 2023 5:39 pm
Location: France

Re: First intergration with wp_w3all

Post by coute »

The number of online online users is wrong. Maybe I missed a set up in PHPBB. But when i'm logged on the forum, the widget display "0 online user".
"The highest you fly my Lord, the farther you have to fall" - Bayushi Kachiko
Post Reply