Development release 1.6.9

User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Development release 1.6.9

Post by axew3 »

The 1.6.9 release will be mainly focused about iframe fixes and additions.
Resumed on this:
ready javascript code to pass via ajax into the wordpress page forum where phpBB iframe is loaded (as well into any other WP page with very little more).
This has been added to get updated template phpBB listeners into WP, so for example, when an user receive a new pm message, and is navigating the iframe forum page, the wp top admin bar will update his value.
This as mentioned can be used into any other WP contest, for any phpBB template event. With data retrieved by plugin via sql also, there is no limit on how to use all these info into WP. In just few easy steps.

will be also added the .htaccess tutorial, and page-forum.php improvement to fit new features about:
right click/copy link
right click open new window
notification email

events for iframe, to point to WP iframe page, instead of full phpBB.

This is just the first addition about ajax updates for PM on top WP bar, when in iframe forum page.

To download/test development 1.6.9 files:
https://plugins.trac.wordpress.org/brow ... ches/1.6.9

To try/test this new feature, it is necessary to change/update the file:
wp_w3all.php
rebuild page-forum.php with the new one in /addons folder
change the phpBB overall_footer.html code with this new one (rebuild stale template on ACP after changed and reload WP page):

Code: Select all

<script type="text/javascript">
//document.domain = 'mydomain.com'; // if js error "Blocked a frame with origin "http://www.w3host.com" from accessing a cross-origin frame ..." on including the iframe, comment out this line and the same line you'll find into page-forum.php
// Also note: check for line // checkOrigin : false, into page-forum and comment out for the same reason if on subdomain installation the resizer return an 'iframe orgin' error

// w3all Ajax updates for phpBB events
// ... before iframe resizer events

//if (window.frameElement) { // if in iframe mode ... to avoid a js notify (that you can also trascure maybe) if phpBB is surfed by full address and not iframe
window.onload = function() {
var pmn = "{PRIVATE_MESSAGE_COUNT}";
// Add different messages to wp at once here just like this: #w3all_phpbbpmcount=val#w3all_phpbbnotifycount=val#etc etc etc
var w3appendevents = '#w3all_phpbbpmcount=' + pmn;
parent.w3all_ajaxup_from_phpbb(w3appendevents);
}
//}

// the htaccess coming trick ... w3all append var to a href if on right click ... htaccess about redirect iframe mode
/*
$( "a" ).contextmenu(function() {
  var href = $(this).attr("href");
	var ck  = (href.indexOf('iframe=true') > -1);
	 if ( ck == false ){ // not re-append in case of more right click events
 //   $(this).attr("href", $(this).attr("href") + "&iframe=true");
   }
});
*/

// TO ACTIVATE phpBB lightbox events remove /* and */ here below
/* 
$(document).on('mouseup', '.postimage', function(){
 //var w3allappend = "getw3all_lightbox";
 if ('parentIFrame' in window) window.parentIFrame.scrollToOffset(0,0);
 //if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend);
});
*/

  $(document).on("click", "a", function() {
   var href = $(this).attr("href");
   var w3allappend = href;
   var w3all_parent_element_id = $(this).parent().get( 0 ).id; // detect click x ... (ex: return ID smiley-box, onclick post smiles) ... // detect and avoid/allow certain behaviors
   var w3all_onclick_smile  = (w3all_parent_element_id.indexOf('smiley-box') > -1);
   var w3all_onview_topic  = (href.indexOf('viewtopic.php') > -1);
   var w3all_onview_attach  = (href.indexOf('file.php') > -1);
   var w3all_onview_post = /#p[0-9]+/ig.exec(href);
   var w3all_ck_quickmod  = (href.indexOf('quickmod') > -1);
   var w3all_ck_onindex  = (href.indexOf('index.php') > -1);

if (w3all_ck_quickmod == true || w3all_ck_onindex == true || w3all_onview_topic == false && w3all_onview_attach == false && w3all_onview_post == null && w3all_onclick_smile != true )
{
 if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend+"#scroll");
} else {
	 if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend);
}
  
});

$(document).on('click', '.quick-login', function(){ 
var w3allappend = "phpbb_quick_login";
if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend+'#scroll');
});
 
 $('form').on('submit', function() {
 var href = $(this).attr("action");
 var ckr = (href.indexOf('#preview') > -1);
 if(ckr == true){
  if ('parentIFrame' in window) window.parentIFrame.sendMessage(href+'#scroll');
 }
});
</script>
<script type="text/javascript" src="iframeResizer.contentWindow.min.js" defer></script>
hope to have not forget nothing on the way it is working like a charm here ... i can't stop to send PM between test users ... looking ajax doing his work increasing/decreasing and removing :)