Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
AutoCopy Code and PHP to clipboard Details »»
AutoCopy Code and PHP to clipboard
Version: 1.00, by TECK TECK is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 04-06-2002 Last Update: Never Installs: 26
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 04-22-2002, 12:54 AM
212rikanmofo 212rikanmofo is offline
 
Join Date: Nov 2001
Location: paris
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>";
}
but in my admin/functions.php it says:

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>";
}
im running vb 2.2.5... btw... so how am i spose to modify this?
Reply With Quote
  #23  
Old 04-22-2002, 01:31 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you have firefly's hack installed? he posted how to mod the code few posts above.
Reply With Quote
  #24  
Old 04-22-2002, 09:27 AM
Entourage Entourage is offline
 
Join Date: Apr 2002
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very nice hack mate! tnx
Reply With Quote
  #25  
Old 04-22-2002, 09:41 AM
212rikanmofo 212rikanmofo is offline
 
Join Date: Nov 2001
Location: paris
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FireFly
[high]* 212rikanmofo 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:
With the same code only with added JavaScript.
k, firefly im really confused here, i have installed your code,php quote box hack, and i want to install this hack to work with your hack, can you please be more specific on what to do. when i install this hack, the php and code boxes return to vbulletin's default, which is them lines....
Reply With Quote
  #26  
Old 05-04-2002, 08:16 PM
Felix
Guest
 
Posts: n/a
Default

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>";
}
with this:

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>";
}
Worked for me
Reply With Quote
  #27  
Old 05-07-2002, 03:56 PM
Bald Bouncer's Avatar
Bald Bouncer Bald Bouncer is offline
 
Join Date: Oct 2001
Location: UK
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FireFly
* FireFly beats the system.

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:
With the same code only with added JavaScript.
what added javascript ... I just cant get this too work with your boxes
Reply With Quote
  #28  
Old 05-13-2002, 08:42 AM
mersey mersey is offline
 
Join Date: Jan 2002
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cheers very handy hack
Reply With Quote
  #29  
Old 05-13-2002, 09:26 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #30  
Old 05-14-2002, 02:17 PM
Allstar DC Allstar DC is offline
 
Join Date: Apr 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>";
with:
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>";
forget about the lines in nakkids hack, just do this:
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.");'
that will fix the "php:" and "code:" part.

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>
with 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" 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!
Reply With Quote
  #31  
Old 05-14-2002, 05:35 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:47 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04873 seconds
  • Memory Usage 2,332KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (11)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete