New Posts

xray
User ww
User ww
Posts: 34
Joined: Mon Dec 24, 2018 9:48 pm

New Posts

Post by xray »

I haven't been able to locate a thread here, so maybe it's not been mentioned yet.

- When I login to the forums and check to see 'New Post' from the drop down nav menu, it always states there are no new posts. I realize that while in iFrame and linked to WP the forums will redirect as it is logging in to WP, I wonder if when this occurs its a second login which is clearing all new posts?
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: New Posts

Post by axew3 »

Seem to be possible because just replicated!
Good shot!
yes you have reason, and the responsible seem to be this code:

Code: Select all

$w3db_conn->query("UPDATE ". $config["table_prefix"] ."users, ". $config["table_prefix"] ."sessions 
                     SET ". $config["table_prefix"] ."users.user_lastvisit = '".time()."', ". $config["table_prefix"] ."sessions.session_time = '".time()."', ". $config["table_prefix"] ."sessions.session_last_visit = '".time()."' 
                      WHERE ". $config["table_prefix"] ."users.user_id = '".$phpbb_user_session[0]->user_id."' 
                     AND ". $config["table_prefix"] ."sessions.session_user_id = '".$phpbb_user_session[0]->user_id."'
                     AND ". $config["table_prefix"] ."sessions.session_browser = '".$useragent."'");
because it repeated after login redirect on

Code: Select all

private static function verify_phpbb_credentials(){
file:
/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php
I've try a fast fix, just reverting to what was old code, so removing or commenting out all the above, and reactivate this line only:

Code: Select all

 $w3db_conn->query("UPDATE ". $config["table_prefix"] ."sessions SET session_time = '".time()."' WHERE session_id = '$phpbb_sid' OR session_browser = '".$useragent ."' AND session_user_id = '".$phpbb_user_session[0]->user_id."'");
and this fixed the issue.
The code was modified long time ago, because it was requested to set as updated online the logged in user in WP side, also in phpBB, even if user not in phpBB.

So the thing need to be review and i think yes, maybe better re-switch to old more correct behavior?
Or a trick to maintain both, would be impossible?
I will return over this asap.
xray
User ww
User ww
Posts: 34
Joined: Mon Dec 24, 2018 9:48 pm

Re: New Posts

Post by xray »

Getting this strange error...

Warning: Cannot modify header information - headers already sent by (output started at wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php:5584) in wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php on line 1956

** Update **
I fixed the header issue, some how I had white space injected into the file. Now I am trying use the other fix.
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: New Posts

Post by axew3 »

line 1956
is this

Code: Select all

$topics_number = intval($ltm['topics_number']) > 0 ? intval($ltm['topics_number']) : 0;
on
public static function wp_w3all_get_phpbb_lastopics_short( $atts ) {
on actual default file
/class.wp.w3all-phpbb.php
used for last topics shortcode.
.....
So asking my self two things:
..... ah no sorry, re-read just now you answer and yes i see you resolved.
Post Reply