vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   AutoCopy Code and PHP to clipboard (https://vborg.vbsupport.ru/showthread.php?t=37117)

Allstar DC 05-15-2002 09:19 PM

go to: Custom vB Codes in your admin cp

click on "add"

next:

vB Code tag --> quote


vB Code replacement -->
<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.setDat a("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: Verdana,Arial; BACKGROUND-COLOR: {codebackground};">{param}</td></tr></table>

vB Code example -->
Quote:

This is a quote

vB Code explanation
The quote tag is used to denote a quote from another post

Use {option} ?
No



does it make sence to you?

aspire007 05-15-2002 09:52 PM

thanx man that made perfect sence to me :) thanx very much :)

Allstar DC 05-15-2002 09:52 PM

no prob, is it all working now?

aspire007 05-15-2002 10:02 PM

yep all working so far -- but im good at screwing things up :(

*which im not proud about*

thanx again man :)

aspire007 05-15-2002 10:28 PM

[QUOTE]Originally posted by Allstar DC
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>


when i put this in all i see is this for the quote --> <
there is no text displayed?

Boofo 05-16-2002 12:02 AM

Quote:

Originally posted by Allstar DC
boofo, your code doesn't have the "copy to clipboard"function, mine does
I tried it that way (with your code) and it didn't work. I had to put the td colspan "2" with the javascript added in the replacement variable to make it work. The code I gave will work with the replacement variable. I couldn't get yours to work with the onclick in it. :)

aspire007 05-16-2002 03:16 AM

i cant get either one to work.. dont know what i did wrong but can someone tell me step by step everything to this hack - starting from the admin/funtions.php?

i know im asking alot but maybe 1 day i will be able to return the favor :) thanx guys

Allstar DC 05-16-2002 03:27 AM

boofo: you need to have it in your replacement variable anyway, to make the [php:] and [code:] functions work

the line i posted is working for me

Allstar DC 05-16-2002 03:49 AM

aspire007:
in functions.php

find:
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>";

replace it 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: #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><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: #EEEEFF; FONT-FAMILY: Courier, Courier New, sans-serif; BACKGROUND-COLOR: #1D6AA0;\"><pre>" . $foundcode . "</pre></td></tr></table><normalfont>";


Now run this SQL query through phpMyAdmin or Telnet/SSH

Code:

ALTER TABLE bbcode CHANGE bbcodereplacement bbcodereplacement TEXT;
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='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: #EEEEFF; FONT-FAMILY: Verdana,Arial; BACKGROUND-COLOR: #1D6AA0;">{param}</td></tr></table>
Go to your admin control panel:

Replacements > Add
and enter the following information:
Code:

Code to find:  {codebackground    }  ///without the spaces

Code to insert:          #D7D7D7

And another one
Code:

Code to find:  {codefontcolor          }    ///without the spaces
Code to insert:          #000000

last one to add:
Code:

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.");'


thats it!

Boofo 05-16-2002 05:13 AM

Quote:


Code to find: #1D6AA0
Code to insert: #D7D7D7


And another one

Code to find: #EEEEFF
Code to insert: #000000

Why are you adding these two? Why not just change them in the line before you put in the code? This is 2 extra steps you really don't need, do you? :)

Allstar DC 05-16-2002 06:17 AM

lol, the board was messing up my code

when i typed this {codefontcolor } without the spaces in my code it just changed it here to #EEEEFF

i edited it now and it should be ok now

btw those codes are not mine!!
i just quoted those from FireFly's instructions,

Allstar DC 05-16-2002 06:20 AM

btw boofo, yes you can do that too, but than you have to change evrything seperatly , with those 2 lines its easier.

it will automaticly replace all the colors where the {codefontcolor } code is used

Boofo 05-16-2002 04:14 PM

NOW it makes more sense with the codefontcolor there. :) That is basically the same thing I am using, just the quote box I did a little different.

Allstar DC 05-16-2002 08:57 PM

haha, i forgot that vbb turned that code into color code when posting it

kalle 01-07-2003 08:50 PM

great hack !

THX for work

regards

Slynderdale 01-20-2003 01:56 AM

Hmm, wierd, i installed this exsactly how it said, and i used firfly's fix for it but when i double click on it i get a javascript error "Invalid FORMATECT structure" yet when my freind tried it, it worked, i have the newest version od internet explorer, when i installed this on my old board, it worked just fine.

Exo 04-06-2003 02:43 AM

i have a problem :(


between the <pres are always linebreaks


it looks like



line

space

Code Text

space

line


how can i remove the spaces between the <pre?

Exo 04-07-2003 06:29 PM

:alien:

Boofo 04-07-2003 06:34 PM

PHP Code:

<pre>".str_replace("<br>","",str_replace("<br />","",$foundcode)).
"
</pre



All times are GMT. The time now is 01:10 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
  • Page Generation 0.01622 seconds
  • Memory Usage 1,776KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete