Resolved but just the fixing code for all rewrite, and correct scrolls is coming ...
one have let me lost some time because was really not working in any way.
Finally i've take a not common js solution, guess some other will found a better way but in the while this work.
I mean a link rewrite like this:
Code: Select all
https://www.mysite.com/w3/forums/viewtopic.php?iframe=true&f=2&t=525&e=1&view=unread#unread
as on actual online code, the redirect is wrong. It redirect to the first page, even if the post contain more posts and the showed should be the latest one.
As on online here, the page is correct, but page not scroll to bottom.
SO after some fails, i've resolve with this coming tip:
on page forum, the function
function w3all_ajaxup_from_phpbb(res){
should become something like this (This is PSEUDO code, that work)
Code: Select all
function w3all_ajaxup_from_phpbb(res){
var w3all_phpbb_u_logged = /#w3all_phpbb_u_logged=1/ig.exec(res);
if( res.indexOf('#w3all_phpbb_u_logged=') > -1 && w3all_phpbb_u_logged == null && null !== (document.getElementById('wp-admin-bar-my-account')) ){
window.location.reload(true);
}
var w3all_phpbbpmcount = /.*(#w3all_phpbbpmcount)=([0-9]+).*/ig.exec(res);
if(w3all_phpbbpmcount !== null){
w3all_ajaxup_from_phpbb_do(w3all_phpbbpmcount[2]);
}
if(res.indexOf('#w3allScrollBottom') > -1) {
setTimeout(w3Resizehs, 200); // delay to scroll
function w3Resizehs(){
var h = jQuery('iframe').contents().height();
this.window.scrollTo(0, 3000);
}
}
} // END function w3all_ajaxup_from_phpbb(res){
and overall_footer.html change this piece of code that start immediately after
Code: Select all
if (window.frameElement) { // if in iframe mode ... to avoid js error w3all_ajaxup_from_phpbb is not a function when forum called not iframe mode (that you can also trascure maybe) if phpBB is surfed by full address and not iframe
//* // remove this line to activate
in this way, where the window location is send out to check on page-forum.php:
Code: Select all
var w3allGetLocation = window.location;
window.onload = function() {
var pmn = "{PRIVATE_MESSAGE_COUNT}";
var w3all_phpbb_u_logged = "{S_USER_LOGGED_IN}";
//
if (w3allGetLocation.indexOf('view=unread') > -1 == true){
w3allScrollBottom = '#w3allScrollBottom';
} else { w3allScrollBottom = ''; }
// to send to wp at once here, like this: #w3all_phpbbpmcount=val#w3all_phpbbnotifycount=val#etc etc etc
var w3appendevents = '#w3all_phpbbpmcount=' + pmn + '#w3all_phpbb_u_logged=' + w3all_phpbb_u_logged + w3allScrollBottom;
parent.w3all_ajaxup_from_phpbb(w3appendevents);
}
this pseudo code to be finished scroll down page forum, to latest post, and with correct redirect all is perfect.
I guess someone know, how to get the size of iframe, and pass after it to scroll page forum, in different way?
setTimeout(w3Resizehs, 200); // delay to scroll, so the page and iframe has been loaded and page correctly scroll
this work fine ... but really can't exist another way?
Resolved but just the fixing code for all rewrite, and correct scrolls is coming ...
one have let me lost some time because was really not working in any way.
Finally i've take a not common js solution, guess some other will found a better way but in the while this work.
I mean a link rewrite like this:
[code]https://www.mysite.com/w3/forums/viewtopic.php?iframe=true&f=2&t=525&e=1&view=unread#unread[/code]
as on actual online code, the redirect is wrong. It redirect to the first page, even if the post contain more posts and the showed should be the latest one.
As on online here, the page is correct, but page not scroll to bottom.
SO after some fails, i've resolve with this coming tip:
on page forum, the function [i]function w3all_ajaxup_from_phpbb(res){[/i]
should become something like this (This is PSEUDO code, that work)
[code]function w3all_ajaxup_from_phpbb(res){
var w3all_phpbb_u_logged = /#w3all_phpbb_u_logged=1/ig.exec(res);
if( res.indexOf('#w3all_phpbb_u_logged=') > -1 && w3all_phpbb_u_logged == null && null !== (document.getElementById('wp-admin-bar-my-account')) ){
window.location.reload(true);
}
var w3all_phpbbpmcount = /.*(#w3all_phpbbpmcount)=([0-9]+).*/ig.exec(res);
if(w3all_phpbbpmcount !== null){
w3all_ajaxup_from_phpbb_do(w3all_phpbbpmcount[2]);
}
if(res.indexOf('#w3allScrollBottom') > -1) {
setTimeout(w3Resizehs, 200); // delay to scroll
function w3Resizehs(){
var h = jQuery('iframe').contents().height();
this.window.scrollTo(0, 3000);
}
}
} // END function w3all_ajaxup_from_phpbb(res){[/code]
and overall_footer.html change this piece of code that start immediately after [code]if (window.frameElement) { // if in iframe mode ... to avoid js error w3all_ajaxup_from_phpbb is not a function when forum called not iframe mode (that you can also trascure maybe) if phpBB is surfed by full address and not iframe
//* // remove this line to activate[/code] in this way, where the window location is send out to check on page-forum.php:
[code]var w3allGetLocation = window.location;
window.onload = function() {
var pmn = "{PRIVATE_MESSAGE_COUNT}";
var w3all_phpbb_u_logged = "{S_USER_LOGGED_IN}";
//
if (w3allGetLocation.indexOf('view=unread') > -1 == true){
w3allScrollBottom = '#w3allScrollBottom';
} else { w3allScrollBottom = ''; }
// to send to wp at once here, like this: #w3all_phpbbpmcount=val#w3all_phpbbnotifycount=val#etc etc etc
var w3appendevents = '#w3all_phpbbpmcount=' + pmn + '#w3all_phpbb_u_logged=' + w3all_phpbb_u_logged + w3allScrollBottom;
parent.w3all_ajaxup_from_phpbb(w3appendevents);
}[/code]
this pseudo code to be finished scroll down page forum, to latest post, and with correct redirect all is perfect.
I guess someone know, how to get the size of iframe, and pass after it to scroll page forum, in different way?
[b] setTimeout(w3Resizehs, 200); // delay to scroll, so the page and iframe has been loaded and page correctly scroll[/b]
this work fine ... but really can't exist another way?