![]() |
AutoCopy Code and PHP to clipboard
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: |
Below, you see a screenshot... ;)
|
Pretty usefull, thanks.
|
i hope firefly will install this here.. ;)
|
Yeah, looks useful indeed. I'll look into this shortly. :)
|
thanks firefly. :)
it's extremly easy to install it in your hack. i have no idea how come i didnt think of this before... |
Code:
Alright, installed. :) Will make my life easier, good job. |
nice one ;)
|
Yeah, you must click inside the text and not just anywhere in the table (because the <pre> ends before the table).
Maybe with some more Javscript you can make the whole table double-clickable? :) |
i'm glad you like it firefly. it will make everyone's life easier here at vB.org... :D
|
Quote:
[high](double-click the code segment to copy to clipboard)[/high] or something like that... if you dont click on the actual code, it will not work. talking abot this, how can we remove the space? if you click on the first line (even is it's outside the text), in your example, it works. in the empty space below, it doesnt. VB adds some extra space there... only in CODE and PHP. maybe you can tell us here firefly how to remove this pesky space in both CODE and PHP.. it is not very estethic.. |
I was thinking of maybe giving every <pre> a unique ID (per page of course), and then instead of "this" in the JS use that ID.
|
[high]* FireFly beats the system. ;)
[/high] Ok, I got it to work with my hack (PHP and stuff in boxes) that you can click the table and not just the text. Instead of replacing <pre I replace this: Code:
<td colspan="2" style="BORDER: #000000 1px solid; FONT-SIZE: |
good job firefly, as usual.. ;)
so if i understand corectly.. you fall in love with me?? hehe |
Thanks for this hack nakkid.
|
Cool nakkid :D
|
I can't seem to get it to work on my 2.2.5
every time i click it copies the entire post! and gives me 3 CopyBoxes !!! HELP :) |
you have firefly's hack installed?
check his post here, related to this issue. he tells you how to edit properly the html code. |
very useful hack~~
thankz ur great work~~ |
nakkid:
Is there anyway to incorporate this in with the quotereply template so when someone clicks on the quote icon the text that is in the post is copied to the clipboard? So instead of putting the Code:
Just a thought. Parker |
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>"; 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>"; |
you have firefly's hack installed? he posted how to mod the code few posts above.
|
very nice hack mate! tnx
|
Quote:
|
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>"; 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>"; |
Quote:
|
cheers very handy hack :)
|
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?
|
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>"; Code:
return "</normalfont><table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" Code:
Create a new replacement variable. Go to your admin control panel: 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! |
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.
|
thats easy, just add
Code:
<smallfont>(double click the code to copy it)</smallfont> PHP Code:
PHP Code:
last one: In the Admin CP, goto Modify under Custom vB Codes and click [edit] next to the [quote] code Place this code in the "vB Code replacement" Box PHP Code:
|
never mind sorted it ... good job mate! :)
|
PHP Code:
|
Thanks! It works great! :)
|
Quote:
your right, thanx i pasted the wrong code in my message |
is there a way i can fix this? --
[QUOTE]Originally posted by blue devil did it work? [/QUOTE test thats how it shows up when someone quotes another person accept the last quote has this at the end ] but i couldnt put it here due to it tries to quote me :) |
In the Admin CP, goto Modify under Custom vB Codes and click [edit] next to the [quote] code Place this code in the "vB Code replacement" Box:
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='java script: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: #EEEEFF; FONT-FAMILY: Verdana,Arial; BACKGROUND-COLOR: #1D6AA0;">{param}</td></tr></table> |
Isn't it supposed to be this?
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" style="BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: Verdana,Arial; BACKGROUND-COLOR: #D7D7D7;">{param}</td></tr></table> |
boofo, your code doesn't have the "copy to clipboard"function, mine does
|
sorry guys heres what i did -- *didnt notice untill now*
when i click on modify Custom vB Codes there is no quote Definitions there.. i see the rest of the things there like [b]bold[b] but quote is gone i think i deleted the whole thing on accident so could you guys tell me what all i need to put it back in? thanx in advance to you all :) |
All times are GMT. The time now is 02:41 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|