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
Details »»

Version: , by Mutt Mutt is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 06-27-2001 Last Update: Never Installs: 1
 
No support by the author.

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

Show Your Support

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

Comments
  #52  
Old 08-27-2001, 06:06 AM
ToraTora! ToraTora! is offline
 
Join Date: Nov 2001
Posts: 255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FWC


Yes. The code you displayed before wasn't formatted correctly. Mine starts like this:

PHP Code:
$ButtonExtra="
<SCRIPT LANGUAGE=\"JavaScript\">
function displayHTML() {
var inf = document.name.template.value;
wintwo = window.open(\", \", 'popup', 'toolbar = no, status = no, scrollbars=yes');
wintwo.document.write(\"\" + inf + \"\");


well, that explains a little bit...my question now, would be...is that all that is needed under the error7 area?

It should be that code above, (your code) the code in the start search, and start edit..and thats it?

I mean...i feel like i have completely different documentations here than what you guys have..lol.
Reply With Quote
  #53  
Old 08-27-2001, 06:07 AM
ToraTora! ToraTora! is offline
 
Join Date: Nov 2001
Posts: 255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

also, doesnt there have to be a closing </SCRIPT>
in there as well?
Reply With Quote
  #54  
Old 08-27-2001, 06:12 AM
FWC's Avatar
FWC FWC is offline
 
Join Date: Oct 2001
Location: Ontario, CA
Posts: 821
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's exactly what I have added:

PHP Code:
$ButtonExtra="
<SCRIPT LANGUAGE=\"JavaScript\">
function displayHTML() {
var inf = document.name.template.value;
wintwo = 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;
}
</script>
<input name='string' type='text' size=20 onChange='n=0;'>
<input type='button' value='Find' onClick='javascript:findInPage(document.name.string.value)'>&nbsp;&nbsp;&nbsp;
<input type='button' value='Preview' onclick='javascript:displayHTML()'>
<input type='button' value='Copy' onclick='javascript:HighlightAll()'>"

Then the normal admin/template.php begins again.
Reply With Quote
  #55  
Old 08-27-2001, 06:18 AM
ToraTora! ToraTora! is offline
 
Join Date: Nov 2001
Posts: 255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FWC
Here's exactly what I have added:

PHP Code:
$ButtonExtra="
<SCRIPT LANGUAGE=\"JavaScript\">
function displayHTML() {
var inf = document.name.template.value;
wintwo = 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;
}
</script>
<input name='string' type='text' size=20 onChange='n=0;'>
<input type='button' value='Find' onClick='javascript:findInPage(document.name.string.value)'>&nbsp;&nbsp;&nbsp;
<input type='button' value='Preview' onclick='javascript:displayHTML()'>
<input type='button' value='Copy' onclick='javascript:HighlightAll()'>"

Then the normal admin/template.php begins again.



Ok, there is the first opening lines of the script...than a person does the other two little mods, and that should be it...
Thanks for your help..it is greatly appreciated. If anything, we helped document this mess for him.

i will go try it out, and if this doesnt work, i am not going to bother with it. lol...had enough of it, as i am sure you have had enough of me asking for help.

again, thanks FWC, and LuBi for your time and concern to my moronic ignorance that has plagued me with this hack.

Catch ya in a bit.
Reply With Quote
  #56  
Old 08-27-2001, 06:21 AM
FWC's Avatar
FWC FWC is offline
 
Join Date: Oct 2001
Location: Ontario, CA
Posts: 821
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
again, thanks FWC, and LuBi for your time and concern
No problem. I'm no programmer. I'm sure you'll help me much more in the future.
Reply With Quote
  #57  
Old 08-27-2001, 06:23 AM
ToraTora! ToraTora! is offline
 
Join Date: Nov 2001
Posts: 255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

did you get any java errors with this? I got three rite as i opened up the template area....UGGGG!!!

So, we have the lines you have above, rite under error, and than the other two...now what?>
Reply With Quote
  #58  
Old 08-27-2001, 06:27 AM
ToraTora! ToraTora! is offline
 
Join Date: Nov 2001
Posts: 255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it is conflicting with the start generate files of line 93,94,95,
which is the db query for the templates....
Reply With Quote
  #59  
Old 08-27-2001, 06:32 AM
FWC's Avatar
FWC FWC is offline
 
Join Date: Oct 2001
Location: Ontario, CA
Posts: 821
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We're out of my league now. I compared my modified file with my original file. That code was all I added. The first couple lines of the original template.php after the hack are:

PHP Code:
($action=="customize"$action="add";

if (isset(
$action) and $action=="generate") {
  
$noheader=1;
}

require(
"./global.php");

adminlog(iif($templateid!=0,"template id = $templateid",iif($templatesetid!=0,"templateset id = $templatesetid",""))); 
Reply With Quote
  #60  
Old 08-27-2001, 06:33 AM
ToraTora! ToraTora! is offline
 
Join Date: Nov 2001
Posts: 255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here we go again....

Under report error 7 ADD
PHP Code:

$ButtonExtra
="
<SCRIPT LANGUAGE=\"JavaScript\">
function displayHTML() {
var inf = document.name.template.value;
wintwo = 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;
}
</script>
<input name='string' type='text' size=20 onChange='n=0;'>
<input type='button' value='Find' onClick='java script:findInPage(document.name.string.value)'>&nbsp;&nbsp;&nbsp;
<input type='button' value='Preview' onclick='java script:displayHTML()'>
<input type='button' value='Copy' onclick='java script:HighlightAll()'>"


Find //////// start search///////////
and the line within that that reads:
PHP Code:
[color=green]makehiddencode("group""$group");[/color
and replace it with:
PHP Code:
makelabelcode("","$ButtonExtra"); 
Find ////////start edit//////////
and the line within that reads:

PHP Code:
[color=green]makehiddencode("group""$group");[/color
and replace it with:
PHP Code:
makelabelcode("","$ButtonExtra"); 


Now..that should be all there is to it correct?
Reply With Quote
  #61  
Old 08-27-2001, 06:37 AM
ToraTora! ToraTora! is offline
 
Join Date: Nov 2001
Posts: 255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FWC
We're out of my league now. I compared my modified file with my original file. That code was all I added. The first couple lines of the original template.php after the hack are:

PHP Code:
($action=="customize"$action="add";

if (isset(
$action) and $action=="generate") {
  
$noheader=1;
}

require(
"./global.php");

adminlog(iif($templateid!=0,"template id = $templateid",iif($templatesetid!=0,"templateset id = $templatesetid",""))); 

ok, that explains a huge void here. You only added that chunk of code. I have two extra things that were supposed to be entered......this is my biggest bitch and complaint on some of these hacks...piss poor documentation.

I will give that a whirl FW, and if that doesnt do it, fuc* it..it gets ripped out.
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 10:38 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.04744 seconds
  • Memory Usage 2,350KB
  • 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
  • (10)bbcode_php
  • (4)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
  • (3)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
  • (11)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