WordPress phpBB mChat integration procedure

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: WordPress phpBB mChat integration procedure

Re: WordPress phpBB mChat integration procedure

by axew3 » Fri Feb 08, 2019 11:17 pm

but takes you to the link within the forum AND it keeps you logged in.
I've not well understand this, i will take a look asap because would like to release new plugin vers very soon.
The css code to style mChat html elements wrappers has been separated into a file, that can be so also moved/edited into custom folder to avoid the overwrite of custom css style when plugin update.
About the needed js on overall_footer.html, it is just a little short piece of code to make the joke happen. As said last time, it lack to me of the trick to make all work perfect in a more easy way about links/buttons, without adding more code to complicate things, so some idea will come out in short in mind as over the thing or may because suggested!

P.s last time i've test the second test code, that i nor applied on the online raw example, it was working ok in any mess i've try, but maybe i've not check all

Re: WordPress phpBB mChat integration procedure

by xray » Fri Feb 01, 2019 10:41 pm

Added fix to style/prosilver/overall_footer.html

I clicked on the link within the chat window and expected behavior to open within the WP iFrame is correct. Instead of it opening the current window it opens a new window, but takes you to the link within the forum AND it keeps you logged in.

Re: WordPress phpBB mChat integration procedure

by axew3 » Mon Jan 28, 2019 2:29 pm

ok look may i have over complicate things, it seem to me lack of the right tricky and easy logic that exist behind, even if i've not still discover. I will return over as soon i stop to fight with an mmpeg install on a centoOS cloud server :( unable to compile it correctly like a newbie from hours now- damned

But in the while the patched code may can be something like this (that maybe resolve the problem):

Code: Select all

<script>
// a simple mChat style/display example setup for WP 
if( /#w3allmchatif/ig.exec(document.URL) != null || /#w3allmchatif/ig.exec(document.location.href) != null ){
	var boardU = "{BOARD_URL}";
	var hnofollow = 0;
$( document ).ready(function() {

$( "body" ).on("click", "a", function(e) {
	var href = $(this).attr("href");

 if( typeof href != 'undefined' && this.href[this.href.length -1] != '#' && /\?jumpto=/ig.exec(this.href) == null )
	{
	 if( href.indexOf(boardU) < 0 || href.indexOf('i=permissions&mode=setting_user_global') > -1 || href.indexOf('/mchat') > -1 ){
	 //if(href.indexOf('/mchat') > -1){
	 if( /[.+[\/mchat]$/ig.exec(href) !== null ){
		return;
	 }
	 
		hnofollow = 1;
		e.preventDefault();
		e.stopPropagation();
		window.open(href,'_blank');
		return;
	} else {
		e.preventDefault();
		e.stopPropagation();
		window.open(href,'_blank');
		return;
	}
	}
});	
	
$( "#page-header,#page-footer" ).css( { "height" : "0px", "max-height" : "0px", "overflow": "hidden" } ); // can't be none, or events will not affect
$( "body" ).css( "padding", "0px" );
$( ".page-body h2" ).css( "display", "none" );
$( "div.mchat-text blockquote div cite a" ).click(function(e) {
	if( /\?jumpto=/ig.exec(this.href) == null ){
		e.preventDefault();
		if(hnofollow < 1){
		 window.open(this.href,'_blank');
	  }
		return;
	}
});

$( "div.list-inner span.mchat-title a" ).click(function(e) {
		e.preventDefault();
		window.open(this.href,'_blank');
		return;
});

$( "body" ).on("click", ".username,.username-coloured,#mchat-legend a,cite a", function(e) {
	var href = $(this).attr("href");
	if( typeof href != 'undefined' && /\?jumpto=/ig.exec(this.href) == null ){
		e.preventDefault();
		if(hnofollow < 1){
		window.open(href,'_blank');
	}
		return;
	}
});

}); // ready
}
</script>

Re: WordPress phpBB mChat integration procedure

by axew3 » Mon Jan 28, 2019 10:14 am

yes gotcha the problem looking asap

Re: WordPress phpBB mChat integration procedure

by xray » Mon Jan 28, 2019 10:11 am

I applied the new code, but that did not work.

The link for a post in the chat box is what I am referring to. If there is a topic post and clicked its staying within the chat. If I am using the mChat from the iFrame the link will work. Expected behavior would be when clicking on a link within the wp_chat box it will open the iFrame forum, or if its an external link to another site than it goes there. Otherwise it will open the forum.

Re: WordPress phpBB mChat integration procedure

by axew3 » Mon Jan 28, 2019 9:17 am

the above has been edited

Re: WordPress phpBB mChat integration procedure

by axew3 » Mon Jan 28, 2019 9:11 am

ok, i've just test and if i'm not wrong you mean links within board, like this:
https://localhost/root_integrations/php ... um.php?f=2
assuming we are on localhost. Think you mean this.
Any other link (also just inserted on chat, the latest pushed), i have the right result with above code, but may i've still not understand your point instead, or not try out the issue.

The kind of url like the above will open within the chat, the forum or the linked topic/post, yes.
I had not give a try to this, patching asap.

[EDITED]

Re: WordPress phpBB mChat integration procedure

by axew3 » Mon Jan 28, 2019 9:03 am

AH! i was quite sure that all resolved since this last code:

Code: Select all

<script>
// a simple mChat style/display example setup for WP 
if( /#w3allmchatif/ig.exec(document.URL) != null || /#w3allmchatif/ig.exec(document.location.href) != null ){
$( document ).ready(function() {
$( "#page-header,#page-footer" ).css( { "height" : "0px", "max-height" : "0px", "overflow": "hidden" } ); // can't be none, or events will not affect
$( "body" ).css( "padding", "0px" );
$( ".page-body h2" ).css( "display", "none" );
$( "div.mchat-text blockquote div cite a" ).click(function(e) {
		if( /\?jumpto=/ig.exec(this.href) == null ){
		e.preventDefault();
		window.open(this.href,'_blank');
		return;
	}
});

$( "div.list-inner span.mchat-title a" ).click(function(e) {
		e.preventDefault();
		window.open(this.href,'_blank');
		return;
});
$( "a[href='#']" ).click(function(e) {
		e.preventDefault();
		return;
});


$( "body" ).on("click", ".username,.username-coloured,#mchat-legend a,cite a", function(e) {
	var href = $(this).attr("href");
	if( typeof href != 'undefined' && /\?jumpto=/ig.exec(this.href) == null ){
		e.preventDefault();
		window.open(href,'_blank');
		return;
	}
});
});
}
</script>
any link, you mean an external link like

Code: Select all

[url]http://externalsite.com[/url]
or that point to a post within the board?
ok! let think and add the joke, patching asap!

Re: WordPress phpBB mChat integration procedure

by xray » Mon Jan 28, 2019 8:18 am

I have noticed an issue in mChat regarding any link in the chat. example if you have the latest topic or post showing in the mCaht window and then use the chat window created it will try an open the link within the chat window instead of taking you to the forum. you can see the example on my site if you don't understand.

Re: WordPress phpBB mChat integration procedure

by axew3 » Fri Jan 25, 2019 5:52 pm

little piece of js code to add into overall_footer.html just updated at date of this post.

Top