
I found that in latest version of plugin you support information about number of unread messages in WP admin panel. It's possible to get this information outside admin panel? I want to integrate into theme header file.
Thank you
Code: Select all
function w3all_ajaxup_from_phpbb_do(res){
jQuery(document).ready(function($) {
if ( parseInt(res,10) > 0 && null == (document.getElementById('wp-admin-bar-w3all_phpbb_pm')) ){
var resp = '".__( 'You have ', 'wp-w3all-phpbb-integration' )."' + parseInt(res,10) + '".__( ' unread forum PM', 'wp-w3all-phpbb-integration' )."';
jQuery('#wp-admin-bar-root-default').append('<li id=\"wp-admin-bar-w3all_phpbb_pm\"><a class=\"ab-item\" href=\"".$w3all_url_to_phpbb_ib."\">' + resp + '</li>');
// window.location.reload(true);// this could be a work around for different themes, but lead to loop in this way
} else if (parseInt(res,10) > 0){
var r = '".__( 'You have ', 'wp-w3all-phpbb-integration' )."' + parseInt(res,10) + '".__( ' unread forum PM', 'wp-w3all-phpbb-integration' )."';
jQuery( 'li.w3all_phpbb_pmn' ).children().text( r );
} else {
if( parseInt(res,10) == 0 && null !== (document.getElementById('wp-admin-bar-w3all_phpbb_pm'))){
jQuery('li[id=wp-admin-bar-w3all_phpbb_pm]').remove();
}
}
});
}
Code: Select all
#wp-admin-bar-root-default
Code: Select all
... jQuery('#wp-admin-bar-root-default') ...
Code: Select all
function w3all_ajaxup_from_phpbb_do(res){
jQuery(document).ready(function($) {
// code to display res (res = return pm count) where you want
});
}