Various modifications for phpBB3Nice edit mchat function

Snippets for phpBB3
User avatar

Topic Author
dmzx
Founder
Founder
Magic user status: Online
Posts: 5975
Joined: Jan 13th, '14, 20:45
    unknown unknown

Nice edit mchat function

Post by dmzx »

Nice edit mchat function.

This is for prosilver only.

Take the attached, unzip it and upload the file into your styles theme directory
apprise.zip
OPEN styles/xxx/theme/stylesheet.css
Find This may be a partial find and not the whole line

Code: Select all

@import url("mchat.css");
Add after Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

@import url("apprise.css");
OPEN mchat_ajax_mini.js
Find This may be a partial find and not the whole line

Code: Select all

var data=prompt(mChatEditInfo,message);if(data){
Replace with Replace the preceding lines with the following

Code: Select all

apprise(mChatEditInfo + ' (Shift and Enter for new line)',{'textarea':message,'animate':true,'position':200,'confirm':true}, function(r){if(r){
Find This may be a partial find and not the whole line

Code: Select all

data:{mode:'edit',message_id:id,message:data}
Replace with Replace the preceding lines with the following

Code: Select all

data:{mode:'edit',message_id:id,message:r}
Find This may be a partial find and not the whole line

Code: Select all

}},del
Replace with Replace the preceding lines with the following

Code: Select all

}})},del
Find This may be a partial find and not the whole line

Code: Select all

if(confirm(mChatDelConfirm)){
Replace with Replace the preceding lines with the following

Code: Select all

apprise(mChatDelConfirm,{'position':200,'animate':true,'confirm':true},function(del){if(del){
Find This may be a partial find and not the whole line

Code: Select all

}},refresh:
Replace with Replace the preceding lines with the following

Code: Select all

}else{return false;}});},refresh:
go to the end of mchat js file and paste this on a new blank line

Code: Select all

    // Apprise 1.5 by Daniel Raftery
    // http://thrivingkings.com/apprise
    //
    // Button text added by Adam Bezulski
    //
    // Cached jQuery variables, position center added by Josiah Ruddell

    function apprise(a,b,c){a='<span style="font-weight:bold; font-size:1.2em;">'+a+"</span>";var d={confirm:false,verify:false,input:false,textarea:false,animate:false,textOk:"Ok",textCancel:"Cancel",textYes:"Yes",textNo:"No",position:"center"};if(b){for(var e in d){if(typeof b[e]=="undefined")b[e]=d[e]}}var f=$(document).height(),g=$(document).width(),h=$('<div class="appriseOuter"></div>'),i=$('<div class="appriseOverlay" id="aOverlay"></div>'),j=$('<div class="appriseInner"></div>'),k=$('<div class="aButtons"></div>'),l=300;i.css({height:f,width:g}).appendTo("body").fadeIn(100,function(){$(this).css("filter","alpha(opacity=70)")});h.prependTo("body");j.append(a).appendTo(h);if(b){if(b["input"]){if(typeof b["input"]=="string"){j.append('<div class="aInput"><input type="text" class="aTextbox" t="aTextbox" value="'+b["input"]+'" /></div>')}else{j.append('<div class="aInput"><input type="text" class="aTextbox" t="aTextbox" /></div>')}$(".aTextbox").focus()}if(typeof b["textarea"]=="string"){j.append('<div class="aInput"><textarea name="message" class="aEdit" style="height: 9em;" rows="5" cols="180">'+b["textarea"]+"</textarea></div>");$(".aEdit").focus()}}j.append(k);if(b){if(b["confirm"]||b["input"]){k.append('<button value="ok">'+b["textOk"]+"</button>");k.append('<button value="cancel">'+b["textCancel"]+"</button>")}else if(b["verify"]){k.append('<button value="ok">'+b["textYes"]+"</button>");k.append('<button value="cancel">'+b["textNo"]+"</button>")}else{k.append('<button value="ok">'+b["textOk"]+"</button>")}}else{k.append('<button value="ok">Ok</button>')}h.css("left",($(window).width()-$(".appriseOuter").width())/2+$(window).scrollLeft()+"px");if(b){if(b["position"]&&b["position"]==="center"){l=(f-h.height())/2}if(b["animate"]){var m=b["animate"];if(isNaN(m)){m=400}h.css("top","-200px").show().animate({top:l},m)}else{h.css("top",l).fadeIn(200)}}else{h.css("top",l).fadeIn(200)}$(document).keydown(function(a){if(i.is(":visible")){if(a.shiftKey&&a.keyCode==13){$(".aEdit").append("<br />")}else if(a.keyCode==13){$('.aButtons > button[value="ok"]').click()}else if(a.keyCode==27){$('.aButtons > button[value="cancel"]').click()}}});var n=$(".aTextbox").val();if(!n){n=false}$(".aTextbox").bind('keydown blur',function(){n=$(this).val()});var o=$(".aEdit").val();if(!o){o=false}$(".aEdit").bind('keydown blur',function(){o=$(this).val()});$(".aButtons > button").click(function(){i.remove();h.remove();if(c){$(this).text("");var a=$(this).attr("value");if(a=="ok"){if(b){if(b["input"]){c(n)}else if(b["textarea"]){c(o)}else{c(true)}}else{c(true)};$('#mChatMessage').focus();}else if(a=="cancel"){c(false);$('#mChatMessage').focus();}}})}
save the mchat js file, upload into the mchat directory on your forum, refresh the theme and your browsers cache.
You do not have the required permissions to view the files attached to this post.
binance.com ;) try it!
User avatar

clight77
Donator
Donator
Magic user status: Offline
Posts: 436
Joined: Sep 24th, '15, 14:23
    Windows 10 Firefox

Re: Nice edit mchat function

Post by clight77 »

Hi
Was snooping around about mchat and this caught my eye.

But exactly what is it supposed to do and look like ?

Thanks
User avatar

Topic Author
dmzx
Founder
Founder
Magic user status: Online
Posts: 5975
Joined: Jan 13th, '14, 20:45
    Windows 8 Firefox

Re: Nice edit mchat function

Post by dmzx »

clight77 wrote:Hi
Was snooping around about mchat and this caught my eye.

But exactly what is it supposed to do and look like ?

Thanks

Its already in 3.1.x version when you edit a message.
User avatar

clight77
Donator
Donator
Magic user status: Offline
Posts: 436
Joined: Sep 24th, '15, 14:23
    Windows 10 Firefox

Re: Nice edit mchat function

Post by clight77 »

I am using v3.0.1.2

Is there a way to move the edit input box to the middle of the chat and not at the top above the overall_ header ?

Please and Thanks :)

EDIT:

Was an issue with SE_Gamer_Dark, got it fixed :)
Love it by the way.. Got the ccs done to suit my style.
Last edited by clight77 on Oct 1st, '15, 05:55, edited 2 times in total.
User avatar

clight77
Donator
Donator
Magic user status: Offline
Posts: 436
Joined: Sep 24th, '15, 14:23
    Windows 10 Firefox

Re: Nice edit mchat function

Post by clight77 »

Hi back again :)

One thing I am unable to figure out is how to change the background color of the edit input text area from #FFFFFF to another color and also change the font color #000000 to another color.

Cheers and thanks :)

Added an image:
Image
Last edited by clight77 on Oct 2nd, '15, 17:32, edited 2 times in total.
User avatar

clight77
Donator
Donator
Magic user status: Offline
Posts: 436
Joined: Sep 24th, '15, 14:23
    Windows 10 Firefox

Re: Nice edit mchat function

Post by clight77 »

Seems it has to do with javascript, I don't know enough about that to start editing in there.
I can live with it the way it is :)
User avatar

clight77
Donator
Donator
Magic user status: Offline
Posts: 436
Joined: Sep 24th, '15, 14:23
    Windows 10 Firefox

Re: Nice edit mchat function

Post by clight77 »

OK :)
Thought I would post back on how I changed the text size and background color of the edit input box for mchat v 1.3.8, and it does not seem to interfere with my SE_Gamer_Dark (modified) style functions that I can tell. (prosilver based) phpbb 3.0.1.2

Open: styles/themes/forms.css

Find:

Code: Select all

textarea {
	width: 60%;
	padding: 2px;
	font-size: 0.8em;
	line-height: 1.4em;
	font-family: Arial, Helvetica, sans-serif;
}
Replace with:

Code: Select all

textarea {
   background-color: #262626;  /*select your template background color here*/
   color: #ffffff; /*select your text color here*/
	width: 60%;
	padding: 2px;
	font-size: 1em;  /*select your text/font size here*/
	line-height: 1.4em;
	font-family: Arial, Helvetica, sans-serif;
}

That's it :)
Last edited by clight77 on Oct 14th, '15, 21:28, edited 5 times in total.
User avatar

martin
Admin
Admin
Magic user status: Offline
Posts: 4796
Joined: Apr 6th, '14, 14:12
    Linux Chrome

Re: Nice edit mchat function

Post by martin »

Or you could just edit mchat.css file with the right edits :whistl:
Use this to install an ext on your board no more ftp or path making.
Path too install this ext is ext/boardtools/upload
Download is here Make it easy for us to solve your issues
User avatar

clight77
Donator
Donator
Magic user status: Offline
Posts: 436
Joined: Sep 24th, '15, 14:23
    Windows 10 Firefox

Re: Nice edit mchat function

Post by clight77 »

martin wrote:or you could just edit mchat.css file with the right edits :whistl:
Tried that it did not work I am afraid, at least not for me :(

But then again if you mean add lines to it, I am not tha good at coding..
Last edited by clight77 on Oct 14th, '15, 21:31, edited 1 time in total.
User avatar

clight77
Donator
Donator
Magic user status: Offline
Posts: 436
Joined: Sep 24th, '15, 14:23
    Windows 10 Firefox

Re: Nice edit mchat function

Post by clight77 »

What would you suggest in mchat.css ?
User avatar

Sniper_E
VIP
VIP
Magic user status: Offline
Posts: 1034
Joined: Oct 14th, '14, 17:01
    Windows 10 Firefox

Re: Nice edit mchat function

Post by Sniper_E »

Did you create a directory theme/SE_Gamer_Dark/ for this style?
You should be adjusting edits in there or it will effect other styles.
Do this in mchat's theme/ directory also.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!™
User avatar

martin
Admin
Admin
Magic user status: Offline
Posts: 4796
Joined: Apr 6th, '14, 14:12
    Linux Chrome

Re: Nice edit mchat function

Post by martin »

Mchat 0.1.4 has this built in now.
User avatar

clight77
Donator
Donator
Magic user status: Offline
Posts: 436
Joined: Sep 24th, '15, 14:23
    Windows 10 Firefox

Re: Nice edit mchat function

Post by clight77 »

Sniper_E wrote:Did you create a directory theme/SE_Gamer_Dark/ for this style?
You should be adjusting edits in there or it will effect other styles.
Do this in mchat's theme/ directory also.

I only use the SE_GAMER_DARK style and do all modifications to it only.
User avatar

clight77
Donator
Donator
Magic user status: Offline
Posts: 436
Joined: Sep 24th, '15, 14:23
    Windows 10 Firefox

Re: Nice edit mchat function

Post by clight77 »

martin wrote:mchat 0.1.4 has this built in now.

Thanks but I am not changing to phpbb 3.1.
I have way to many modifications over the years and I do not wish to redo them all :(
User avatar

martin
Admin
Admin
Magic user status: Offline
Posts: 4796
Joined: Apr 6th, '14, 14:12
    Linux Chrome

Re: Nice edit mchat function

Post by martin »

You dont need to i had a bucket full of mods and edits and im on 3.1.6 you just need to make the jump :tumbsyes: