The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
AutoCopy Code and PHP to clipboard Details »» | |||||||||||||||||||||||||
This hack will allow you to copy the text quoted in Code and PHP, to your clipboard, with a simple double-click.
This is extremly useful if your users utilise frequently the code environment. Once installed the hack, if an user double-click in the quoted area, an alert will popup let him(her) know that the code was copied to the clipboard. ESTIMATED INSTALL TIME: 1 minute TESTED IN VERSION: 2.2.5 [HIGH]NOTE:[/HIGH] As a thank you for using my hack, please click on the INSTALL button. You will receive updates in your email, whenever I add new features to it and it will let me evaluate better the quality of my hacks. [HIGH]Also post a reply with your comments. Your oppinion is important to me.[/HIGH] To use this hack with FireFly's Quote, Code and PHP hack, read the instructions mentioned here. To download the latest version of this hack, click below: Show Your Support
|
Comments |
#22
|
|||
|
|||
in the instructions in the txt file says:
| File: admin/functions.php (1 change) | +-----------------------------------------------+ | 1. Find this code: +--------------------------------------------------------------------------+ Code:
return "</normalfont><blockquote><pre><smallfont>PHP:</smallfont><hr>$buffer<hr></pre></blockquote><normalfont>"; } // ###################### Start stripbrsfromcode ####################### function stripbrsfromcode($foundcode) { $foundcode = str_replace("\\\"","\"",$foundcode); return "</normalfont><blockquote><pre><smallfont>code:</smallfont><hr>" . str_replace("<br>", "", str_replace("<br />", "", $foundcode) ) . "<hr></pre></blockquote><normalfont>"; } Code:
return "</normalfont><table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" cellspacing=\"1\"><tr><td><smallfont><b>PHP:</b></smallfont></td></tr><tr><td style=\"BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: {codefontcolor}; FONT-FAMILY: Courier, Courier New, sans-serif; BACKGROUND-COLOR: {codebackground};\"><pre>" . $buffer . "</pre></td></tr></table><normalfont>"; } // ###################### Start stripbrsfromcode ####################### function stripbrsfromcode($foundcode) { $foundcode = str_replace("\\\"","\"",$foundcode); return "</normalfont><table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" cellspacing=\"1\"><tr><td><smallfont><b>code:</b></smallfont></td></tr><tr><td style=\"BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: {codefontcolor}; FONT-FAMILY: Courier, Courier New, sans-serif; BACKGROUND-COLOR: {codebackground};\"><pre>" . $foundcode . "</pre></td></tr></table><normalfont>"; } |
#23
|
||||
|
||||
you have firefly's hack installed? he posted how to mod the code few posts above.
|
#24
|
|||
|
|||
very nice hack mate! tnx
|
#25
|
|||
|
|||
Quote:
|
#26
|
|||
|
|||
Just replace
Code:
return "</normalfont><table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" cellspacing=\"1\"><tr><td><smallfont><b>PHP:</b></smallfont></td></tr><tr><td style=\"BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: #EEEEFF; FONT-FAMILY: Courier, Courier New, sans-serif; BACKGROUND-COLOR: #1D6AA0;\"><pre>" . $buffer . "</pre></td></tr></table><normalfont>"; } // ###################### Start stripbrsfromcode ####################### function stripbrsfromcode($foundcode) { $foundcode = str_replace("\\\"","\"",$foundcode); return "</normalfont><table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" cellspacing=\"1\"><tr><td><smallfont><b>code:</b></smallfont></td></tr><tr><td style=\"BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: #EEEEFF; FONT-FAMILY: Courier, Courier New, sans-serif; BACKGROUND-COLOR: #1D6AA0;\"><pre>" . $foundcode . "</pre></td></tr></table><normalfont>"; } Code:
return "</normalfont><table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" cellspacing=\"1\"><tr><td><smallfont><b>PHP:</b></smallfont></td><td align=\"right\"><smallfont>(double-click to copy to clipboard)</smallfont></td></tr><tr><td colspan=\"2\" ondblclick='javascript:window.clipboardData.setData(\"Text\", this.innerText); alert(\"Code copied to the clipboard. You can paste it now.\");' style=\"BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: {codefontcolor}; FONT-FAMILY: Courier, Courier New, sans-serif; BACKGROUND-COLOR: {codebackground};\"><pre>" . $buffer . "</pre></td></tr></table><normalfont>"; } // ###################### Start stripbrsfromcode ####################### function stripbrsfromcode($foundcode) { $foundcode = str_replace("\\\"","\"",$foundcode); return "</normalfont><table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" cellspacing=\"1\"><tr><td><smallfont><b>code:</b></smallfont></td><td align=\"right\"><smallfont>(double-click to copy to clipboard)</smallfont></td></tr><tr><td colspan=\"2\" ondblclick='javascript:window.clipboardData.setData(\"Text\", this.innerText); alert(\"Code copied to the clipboard. You can paste it now.\");' style=\"BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: {codefontcolor}; FONT-FAMILY: Courier, Courier New, sans-serif; BACKGROUND-COLOR: {codebackground};\"><pre>" . $foundcode . "</pre></td></tr></table><normalfont>"; } |
#27
|
||||
|
||||
Quote:
|
#28
|
|||
|
|||
cheers very handy hack
|
#29
|
||||
|
||||
I already installed Firefly's code and php hack and I also installed this great hack (the part I needed with Firefly's hack), but how do I add the "double-click to copy to clipboard" text at the top of the box if I only need to use the final step 1 in this file? Also, I'm not 100 % clear on the instructions Firefly said about the <pre replacement. Can anyone help explain what it is exactly that I am supposed to do here?
|
#30
|
|||
|
|||
ok,i figured it out. do the following after you installed firefly's hack:
replace: Code:
return "</normalfont><table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" cellspacing=\"1\"><tr><td><smallfont><b>PHP:</b></smallfont></td></tr><tr><td style=\"BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: Courier, Courier New, sans-serif; BACKGROUND-COLOR: #D7D7D7;\"><pre>" . $buffer . "</pre></td></tr></table><normalfont>"; } // ###################### Start stripbrsfromcode ####################### function stripbrsfromcode($foundcode) { $foundcode = str_replace("\\\"","\"",$foundcode); return "</normalfont><table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" cellspacing=\"1\"><tr><td><smallfont><b>code:</b></smallfont></td></tr><tr><td style=\"BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: Courier, Courier New, sans-serif; BACKGROUND-COLOR: #D7D7D7;\"><pre>" . $foundcode . "</pre></td></tr></table><normalfont>"; Code:
return "</normalfont><table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" cellspacing=\"1\"><tr><td><smallfont><b>PHP:</b></smallfont></td><td align=\"right\"><smallfont>(double click the code to copy it)</smallfont></td></tr><tr><td colspan=\"2\" style=\"BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: Courier, Courier New, sans-serif; BACKGROUND-COLOR: #D7D7D7;\"><pre>" . $buffer . "</pre></td></tr></table><normalfont>"; } // ###################### Start stripbrsfromcode ####################### function stripbrsfromcode($foundcode) { $foundcode = str_replace("\\\"","\"",$foundcode); return "</normalfont><table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" cellspacing=\"1\"><tr><td><smallfont><b>code:</b></smallfont></td><td align=\"right\"><smallfont>(double click the code to copy it)</smallfont></td></tr><tr><td colspan=\"2\" style=\"BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: Courier, Courier New, sans-serif; BACKGROUND-COLOR: #D7D7D7;\"><pre>" . $foundcode . "</pre></td></tr></table><normalfont>"; Code:
Create a new replacement variable. Go to your admin control panel: | | Replacements > Add | | and enter the following information: | | Code to find: <td colspan="2" | Code to insert: <td colspan="2" ondblclick='javascript:window.clipboardData.setData("Text", this.innerText); alert("Code copied to the clipboard. You can paste it now.");' to make the box clickable with quote do the following: +-------------------------------------------------------------------------------------------------+ | In the Admin CP, goto Modify under Custom vB Codes and click [edit] next to the [quote] code | | | +-------------------------------------------------------------------------------------------------+ replace this: Code:
<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1"><tr><td><smallfont><b>quote:</b></smallfont></td></tr><tr><td style="BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: Verdana,Arial; BACKGROUND-COLOR: #D7D7D7;">{param}</td></tr></table> Code:
<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1"><tr><td><smallfont><b>quote:</b></smallfont></td><td align="right"><smallfont>(double click the code to copy it)</td></tr><tr><td colspan="2" ondblclick='javascript:window.clipboardData.setData("Text", this.innerText); alert("Code copied to the clipboard. You can paste it now.");' style="BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: Verdana,Arial; BACKGROUND-COLOR: #D7D7D7;">{param}</td></tr></table> that will fix it for you! |
#31
|
||||
|
||||
It works here now, I just don't have the "double-click to copy to clipboard" showing up like it does here. That's the only part I need to make it look right.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|