Page 2 of 2

Re: WP_w3all WordPress phpBB 1.6.6 has been released!

Posted: Fri Mar 24, 2017 10:17 am
by axew3
yes will be added, together with responsive ajax code to update unread/read pm forums state if on iframe mode or two column page forum.

i see a little thing to adjust: if are 0 PM to read, than not display you have 0 pm msg on forum, info, and display it only if there are new PM. It is easy like just substituting code on

views/login_form_include_iframe_mode_links.php
or
views/login_form_include_noiframe_mode_links.php

Code: Select all

echo __( '<li>You have ' , 'wp-w3all-phpbb-integration' ) . '<a href="'.$w3all_url_to_cms.'/ucp.php?i=pm&amp;folder=inbox">' . $phpbb_user_session[0]->user_unread_privmsg . '</a>' . __( ' unread forum\'s pm' , 'wp-w3all-phpbb-integration' ) . '</li>';
REPLACE with:

Code: Select all

		if($phpbb_user_session[0]->user_unread_privmsg > 0){
		echo __( '<li>You have ' , 'wp-w3all-phpbb-integration' ) . '<a href="'.$w3all_url_to_cms.'/ucp.php?i=pm&amp;folder=inbox">' . $phpbb_user_session[0]->user_unread_privmsg . '</a>' . __( ' unread forum\'s pm' , 'wp-w3all-phpbb-integration' ) . '</li>';
	 }
simple as is. As well it is possible add any other info with easy, included avatar that will be added.

You can also exclude info to display, just commenting out one of info (or maybe change order)

Code: Select all

echo '<ul class="" style="list-style:none;margin:auto auto auto 0px">';
echo __( '<li>Hello ' , 'wp-w3all-phpbb-integration' ) . $phpbb_user_session[0]->username . '</li>';
echo __( '<li>You have ' , 'wp-w3all-phpbb-integration' ) . '<a href="'.$w3all_url_to_cms.'/ucp.php?i=pm&amp;folder=inbox">' . $phpbb_user_session[0]->user_unread_privmsg . '</a>' . __( ' unread forum\'s pm' , 'wp-w3all-phpbb-integration' ) . '</li>';
echo __( '<li>Forum\'s posts count: ' , 'wp-w3all-phpbb-integration' ) . $phpbb_user_session[0]->user_posts . '</li>';
echo __( '<li>Registered on: ' , 'wp-w3all-phpbb-integration' ) . date_i18n( 'd M Y', $phpbb_user_session[0]->user_regdate + ( 3600 * get_option( 'gmt_offset' )) ) . '</li>';
echo '</ul>';
like this, not display for example the first "Hello username" ...

Code: Select all

//echo __( '<li>Hello ' , 'wp-w3all-phpbb-integration' ) . $phpbb_user_session[0]->username . '</li>';

look also that to get this inline with your theme, you would may like to change:

Code: Select all

<ul class="" style="list-style:none;margin:auto auto auto 0px">
to class (or id) that your theme use for ul li elements on widget.

Re: WP_w3all WordPress phpBB 1.6.6 has been released!

Posted: Sat Mar 25, 2017 8:41 am
by Goofkop
Nice that option you dont see any info if you have no pm! :D

Re: WP_w3all WordPress phpBB 1.6.6 has been released!

Posted: Wed Mar 29, 2017 11:44 pm
by axew3
i've post wrongly this also on another topic but ok:

p.s to add avatar into login widget, it is necessary to add just this:

Code: Select all

echo '<li>' . get_avatar(get_current_user_id()) . '</li>'; 
after line

Code: Select all

echo '<ul class="" style="list-style:none;margin:auto auto auto 0px">';
on file views/login_form_include_iframe_mode_links.php
OR
views/login_form_include_noiframe_mode_links.php

by the way on next version the entire code about this will be replaced by the new corrected one.

The file:
views/config.php has been patched already instead due to this important fix for wp_w3all admin config page:
https://wordpress.org/support/topic/1-6 ... st-8972103