First intergration with wp_w3all

Post a reply

This question is a means of preventing automated form submissions by spambots.
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review

If you wish to attach one or more files enter the details below.

Expand view Topic review: First intergration with wp_w3all

Re: First intergration with wp_w3all

by axew3 » Tue Apr 18, 2023 10:32 pm

Hi! Sorry delay on answer in these days.

About login and refresh: yes if you mean that when on the iframed phpBB into WP, you go to login into phpBB, then you get a WP refresh: it is because at this time the phpBB overall_footer js code you added execute the function into the Parent Wp page and since the user result to be with UID > 0 in phpBB, wordpress js (on page-forum or the code of the iframe integration via shortcode) fire a refresh to set the WP user logged in into WP also.
It could be done in different way, but how to set/refresh (for example) the WP admin bar to display Howdy, axew3 after a login into the iframed phpBB?
Possible yes, but this make the long story very short, with a refresh (or in some theme you'll result logged in phpBB.but not in WP until you do not refresh WP in someway, changing page or refreshing the same you are on.
If you do not want a refresh because the WP page that display the phpBB, do not show any user info in wp so it is not useful that the user see he is already logged also in WP, it is very easy to do looking into related files (page-forum(or whatevernamed).php or the shortcode related code.
If in trouble to know how, just let know.

The whole iframe integration will be reviewed possibly yet on next release.

About online users widget, yes i know the code is not perfect, i did not followed on doing it more precise, but it will be maybe improved asap. If any suggestion about in the while, also let know!

Re: First intergration with wp_w3all

by coute » Mon Apr 17, 2023 11:33 am

I have an other question. Is it normal that the forum iframe is loaded twice when i log in ?

Re: First intergration with wp_w3all

by coute » Mon Apr 17, 2023 8:10 am

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".

Re: First intergration with wp_w3all

by axew3 » Fri Apr 14, 2023 11:28 pm

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:
(17.17 KiB) Downloaded 13 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

Re: First intergration with wp3_all

by coute » Thu Apr 13, 2023 4:59 pm

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.

Re: First intergration with wp3_all

by axew3 » Wed Apr 12, 2023 10:22 pm

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!

Re: First intergration with wp3_all

by coute » Wed Apr 12, 2023 5:29 pm

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.

First intergration with wp_w3all

by coute » Wed Apr 12, 2023 1:19 pm

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

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

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.