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)
-   -   Preview and copy buttons for Edit Template (https://vborg.vbsupport.ru/showthread.php?t=21518)

Mutt 06-27-2001 10:00 PM

Ok don't give me a bunch of crap if I'm posting this wrong, this is my first little contribution to VB.

In the short time I've been playing around with VB, I've already become annoyed at editing templates. I added two little javascript buttons to the page to make things easier.

Copy - click the button to highlight all the text in the textarea and copy it to the clipboard in one step

Preview - opens a new window displaying the html from the message area. It doesn't replace the variables with any value, but does gives you an idea of layout and color changes

for VB v2.0.1

updated attachment below

Philipp 06-28-2001 10:49 PM

Nice hack. I try it tomorrow :)

and welcome aboard Mutt ;)

Raptor 06-30-2001 12:17 AM

doesnt work

and yes i did change the php3 to php ;)

Mutt 07-02-2001 01:38 AM

what didn't work?

maybe I left something out

Mutt 07-02-2001 01:45 AM

I edited the directions so try it again

the forum seems to be spliting the word javascript up into 2 words java and script with a space between them. make sure you remove that space

Mutt 07-04-2001 12:18 AM

Hey there, I was doing alot of template editing today and needed an easy way to search an individual template. It got so bad that I finally added one.

new feature
Find - adds a small input field and a form button so you can search the textarea. very handy

While editing the directions I realized that I left out a step before. This attachment has complete instructions and all 3 features. I also moved the buttons for esthetic reasons.

Mutt 07-04-2001 12:19 AM

heres a screen shot

MrLister 07-04-2001 02:52 AM

great job! looks usefull. i'll try it right now

webhost 07-04-2001 12:45 PM

Thanks Mutt , this will help out alot. I would recommend this to anyone. The only problem I see sometimes is the way the preview turns out, not enough to matter though.
Great Job.

Jpp 07-04-2001 01:30 PM

Quote:

Originally posted by Mutt
Ok don't give me a bunch of crap if I'm posting this wrong, this is my first little contribution to VB.

In the short time I've been playing around with VB, I've already become annoyed at editing templates. I added two little javascript buttons to the page to make things easier.

Copy - click the button to highlight all the text in the textarea and copy it to the clipboard in one step

Preview - opens a new window displaying the html from the message area. It doesn't replace the variables with any value, but does gives you an idea of layout and color changes

for VB v2.0.1

updated attachment below

Getting dizzy here!! Where is it?????

webhost 07-04-2001 01:37 PM

In your admin control panel under templates. This adds copy,preview, and find buttons to the box you view when looking at your templates.
You select copy it copies all in the template you are looking at for clipboard pasting, Select find and you can search the template you are viewing fot strings. Select preview and you can preview the template.

Jpp 07-04-2001 09:24 PM

Damn!!! This is useful ;) ;)

bira 07-06-2001 07:17 AM

fantastic hack! That bloody 'find' is brilliant

pestilence 07-06-2001 08:32 AM

wheres the attachment for this hack went to ?

BluSmurf 07-06-2001 09:06 PM

woooowwwwwwwwwww!!! GREAT HACK! :D

bira 07-06-2001 09:32 PM

Quote:

Originally posted by pestilence
wheres the attachment for this hack went to ?
6th post from the top :)

dxb 07-07-2001 12:01 AM

what can I say Mutt

you were great with UBB and I think you will be one of the greatest with VB

very very well done :)

zarkov 07-07-2001 11:48 PM

Class hack m8, less than 30 secs to install.

I could have done with this 2 days ago lol.
:)

Johnny 07-08-2001 02:42 PM

can you maybe put it so in a post that you very good can see what you exactly must change??
in the attachment everything is uhh... how can i say this in english... in dutch it is: alles staat naast elkaar van wat je moet doen!

can you maybe do it so:

templates to edit:

and then bv: find in the template ..... and place after it ....

tnx!
Killer

Johnny 07-09-2001 12:09 PM

can maybe someone tell it me how to install!
the file is not so clear!

can it maybe like this thread: http://vbulletin.com/forum/showthrea...threadid=22148

tnx
Johnny

Johnny 07-11-2001 11:39 AM

ok here's another post from me! :(
i don't know why the people here don't tell me the answer on my questions!

In the attachtment
Quote:

Adds some helpful features to the admin edit template page - Highlight All and Copy - Quick & Dirty Preview Template - Find in template Made By Mutt VB2.0.1 edit templete.php right at the begining of the script just after function displayHTML() { var inf = document.name.template.value; win = window.open(\", \", 'popup', 'toolbar = no, status = no, scrollbars=yes'); win.document.write(\"\" + inf + \"\"); } function HighlightAll() { var tempval=eval(\"document.name.template\") tempval.focus() tempval.select() if (document.all){ therange=tempval.createTextRange() therange.execCommand(\"Copy\") window.status=\"Contents highlighted and copied to clipboard!\" setTimeout(\"window.status=''\",1800) } } var NS4 = (document.layers); // Which browser? var IE4 = (document.all); var win = window; // window to search. var n = 0; function findInPage(str) { var txt, i, found; if (str == '') return false; if (NS4) { if (!win.find(str)) while(win.find(str, false, true)) n++; else n++; if (n == 0) alert('Not found.'); } if (IE4) { txt = win.document.body.createTextRange(); for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart('character', 1); txt.moveEnd('textedit'); } if (found) { txt.moveStart('character', -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } else { if (n > 0) { n = 0; findInPage(str); } else alert('Not found.'); } } return false; } "; find ###################### Start add ####################### add makelabelcode("","$ButtonExtra"); right before makehiddencode("group", "$group"); find ###################### Start edit ####################### add makelabelcode("","$ButtonExtra"); right before makehiddencode("group", "$group");
ok what must i now change in the template "template.php"??
pleazz tell it me! this is a great hack and i want it too!!!

tnx
Johnny

Jpp 07-11-2001 11:56 PM

Ahhhh my find button dont work, damn!!!! what can be wrong??Nothing happends at all. it just clicks,

any suggestions

ShadowTech 07-12-2001 05:47 AM

The find feature doesn't work for me either.. there must be some wrong coding in the java cause everytime I push the find button I get the Error on Page message in the status bar of IE.

Ok.. after I posted this I went back to the templates to try it again and found out this:

The Find button will ONLY work until you hit the preview button. Once the preview button loads up the new page.. the Find will NO longer work.. simply refresh the template page and the find will work again.. however your code changes will be lost.

It still works after you press copy.. but for some reason it must not like the popup feature of the preview.

Mutt 08-03-2001 01:44 AM

Just wanted everyone to know that this works in 2.03 and I fixed the javascript bug that kills find after using the preview. the only changes were where $ButtonExtra is defined.

I'd like to add an undo button. Alt+U will undo changes to the text area and I need a way to make a button that simulates pressing Alt+U. Any ideas? If you know of anything where you can use javascript to make a link simulate a key press, let me know. thanx!

Admin 08-05-2001 12:19 PM

Tremendous hack!
Very useful, easy to install, simply great! :D

FWC 08-05-2001 07:01 PM

Excellent work, Mutt! Can't beat the ease of installation.

LuBi 08-26-2001 02:10 PM

Can anyone make something like this for 2.0.3?

webhost 08-26-2001 02:32 PM

I am running 2.0.3 runs fine for me.

LuBi 08-26-2001 04:54 PM

Did you follow the same instructions or did you have to modify different files?

webhost 08-26-2001 05:02 PM

i followed same instructions in the opening post of this thread

LuBi 08-26-2001 05:05 PM

thanks I look forward to installing. the reason i'm being so annoying is because I wasi nstalling hack before and kept fouling up my forum. now I use all 2.0.3 hacks and they seem to work :D go figure.

LuBi 08-26-2001 05:40 PM

Can this hack work with this one? [RELEASE] Template Control Panel for 2.0

webhost 08-26-2001 05:42 PM

don't know never installed that one

ToraTora! 08-26-2001 07:50 PM

1) the instructions, seem to say..."edit templete.php right at the begining of the script just after function displayHTML() "
now, I dont know where the function display HTML went, but its not in any template.php file i have. Could this be clarified>?


2) the only function that is shown somewhere even resembling the beginning, is Start search area, which is a quarter of the way down. I might add, there is nothing said about display HTML there either...just this...
PHP Code:

function confirmaction(theform) {
    if ((
theform.searchstring.value=="") || (theform.replacestring.value=="")) {
        
theform.searchstring.select();
        return 
confirm("WARNING:\n\nYou have chosen to perform a FIND/REPLACE operation on all your templates,\nbut at least one of the fields is empty.\n\nAre you SURE?");
    } else {
        return 
true;
    } 

is there something i am missing here?
The instuctions send mixed signals. Is it function display HTML, is it after the function, we add the code, is it after functionhtml we add code?

Is the php file, template.php, which is found in the admin folder??

Either way, im not finding this elusive display HTML code, and it is on 2.03...

any help would be greatly appreciated.

FWC 08-26-2001 08:00 PM

Quote:

Is the php file, template.php, which is found in the admin folder??
I added the code to admin/template.php right below "error_reporting(7);" at the top of the file. It works fine that way.

ToraTora! 08-27-2001 12:08 AM

Quote:

Originally posted by FWC


I added the code to admin/template.php right below "error_reporting(7);" at the top of the file. It works fine that way.

thank you. I was thinking of doing that myself, however backed out until i recieved a straight answer here.

One last question, and than im off to install this bad boy.

exactly where do you start with the hacked code to add below the error 7?

this?

PHP Code:


{ var inf document.name.template.valuewin window.open(\", \", 'popup', 'toolbar = no, status = no, scrollbars=yes'); 

Thanks again. :)

FWC 08-27-2001 01:03 AM

Quote:

exactly where do you start with the hacked code to add below the error 7?
I started with:

$ButtonExtra="

I assume that was right because it works. It's really a nice tool to have, too.

ToraTora! 08-27-2001 05:08 AM

one thing i was going to ask about, was the preview feature. will this actually show a HTML preview of the template>?

It looks to me like a very usefull hack. The documentation is a little loose on the edges, but other than that, it sounds like he did one hell of a job on it.

ToraTora! 08-27-2001 05:23 AM

Here is the problem I add that long code, under the error 7,

PHP Code:

{ var inf document.name.template.valuewintwo window.open(\", \", 'popup', 'toolbar = no, status = no, scrollbars=yes'); wintwo.document.write(\"\" + inf + \"\"); } 
function HighlightAll() { var tempval=eval(\"document.name.template\") tempval.focus() tempval.select() if (document.all){ therange=tempval.createTextRange() therange.execCommand(\"Copy\") 
window.status=\"Contents highlighted and copied to clipboard!\" setTimeout(\"window.status=''\",1800) } } var NS4 = (document.layers); 
// Which browser? var IE4 = (document.all); var win = window; 
// window to search. var n = 0; function findInPage(str) { var txt, i, found; if (str == '') return false; if (NS4) 

if (!win.find(str)) while(win.find(str, false, true)) n++; else n++; if (n == 0) alert('Not found.'); } if (IE4) { txt = win.document.body.createTextRange(); 
for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart('character', 1); txt.moveEnd('textedit'); } 
if (found) 
{ txt.moveStart('character', -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } else { if (n > 0) { n = 0; findInPage(str); } else alert('Not found.'); 
} } return false; }       "




Now i am getting a parse error, on line three, which is the code under the error 7.

Any hints?

This documentation needs work.

LuBi 08-27-2001 05:30 AM

I had the same problem the anser is in the error. I think its like template.php and you'll see the rroer infront of <?php or something. I got the same thing I installed the hack by the instructions..goodluck that fix worked for me


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
  • Page Generation 0.01434 seconds
  • Memory Usage 1,829KB
  • 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
  • (3)bbcode_php_printable
  • (6)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
  • (40)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