Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Button to place [spoiler] tags in Post
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ChasLaser
Starting Member

9 Posts

Posted - 01 August 2008 :  22:58:14  Show Profile  Reply with Quote
I'd like to add a button that when clicked adds the [ spoiler][ /spoiler] Tags to the message area. I want to use this as a way of Tagging a post with keywords by placing keywords inside the spoiler tags.

I have the icon set up....

Const strIconEditorTags = "icon_editor_tag.gif|23|22"

...but the rest eludes me.




<

leatherlips
Senior Member

USA
1838 Posts

Posted - 02 August 2008 :  08:02:17  Show Profile  Visit leatherlips's Homepage  Reply with Quote
In inc_post_buttons.asp look for and add the part in red:

"<a href=""Javascript:list();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorList,"Insert List","align=""top""") & "</a>" & vbNewLine & _

Then below that add:

"<a href=""Javascript:spoiler();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorTags,"Insert Spoiler","align=""top""") & "</a>" & vbNewLine

Then in inc_func_common.asp look for:

function strike() {
   var text = getText();
   if (helpstat) {
      alert("Strike-Through Tag Makes the enclosed text have a line through it.\n\nUSE: This is some stricken text");
   } else if (basic) {
      AddTxt="[s]" + text + "[ /s]";
      AddText(AddTxt);
   } else {
      if (text) {
         txt=prompt("Text to be stricken.",text);
      } else {
         txt=prompt("Text to be stricken.","Text");
      }
      if (txt!=null) {
         AddTxt="[s]"+txt+"[ /s]";
         AddText(AddTxt);
      }
   }
}


Below that add (Notice the three green spots. Remove the space in them for your code - I had to but them there for them to show up here.):
function spoiler() {
   var text = getText();
   if (helpstat) {
      alert("The Spoiler Tag makes the enclosed text HIDDEN.\n\nUSE: [spoiler]This is some hidden text[ /spoiler]");
   } else if (basic) {
      AddTxt="[spoiler]" + text + "[ /spoiler]";
      AddText(AddTxt);
   } else {
      if (text) {
         txt=prompt("Text to be made hidden.",text);
      } else {
         txt=prompt("Text to be made hidden.","Text");
      }
      if (txt!=null) {
         AddTxt="[spoiler]"+txt+"[/ spoiler]";
         AddText(AddTxt);
      }
   }
}
<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 02 August 2008 08:05:04
Go to Top of Page

Carefree
Advanced Member

Philippines
4212 Posts

Posted - 03 August 2008 :  00:41:55  Show Profile  Reply with Quote
[quote]Originally posted by leatherlips

In inc_post_buttons.asp look for and add the part in red:

Then in inc_func_common.asp look for:

function strike() {
   var text = getText();
   if (helpstat) {
      alert("Strike-Through Tag Makes the enclosed text have a line through it.\n\nUSE: This is some stricken text");
   } else if (basic) {
      AddTxt="[s]" + text + "[ /s]";
      AddText(AddTxt);
   } else {
      if (text) {
         txt=prompt("Text to be stricken.",text);
      } else {
         txt=prompt("Text to be stricken.","Text");
      }
      if (txt!=null) {
         AddTxt="[s]"+txt+"[ /s]";
         AddText(AddTxt);
      }
   }
}


If you do not find this bit of code in "inc_func_common.asp", look in the javascript folder (js\) for a file titled "inc_code.js". Then just copy/paste where it belongs in that file instead.<
Go to Top of Page

ChasLaser
Starting Member

9 Posts

Posted - 03 August 2008 :  10:08:56  Show Profile  Reply with Quote
Thanks Guys for your time! And thanks for incuding the .js bit!!


Besides the obivious changes to these files, are you aware of where I might change 'sploiler' to 'tag' and have the same hidden text effect?<
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 03 August 2008 :  10:19:40  Show Profile  Visit leatherlips's Homepage  Reply with Quote
Change the code I told you to add from this:

function spoiler() {
   var text = getText();
   if (helpstat) {
      alert("The Spoiler Tag makes the enclosed text HIDDEN.\n\nUSE: [spoiler]This is some hidden text[ /spoiler]");
   } else if (basic) {
      AddTxt="[spoiler]" + text + "[ /spoiler]";
      AddText(AddTxt);
   } else {
      if (text) {
         txt=prompt("Text to be made hidden.",text);
      } else {
         txt=prompt("Text to be made hidden.","Text");
      }
      if (txt!=null) {
         AddTxt="[spoiler]"+txt+"[/ spoiler]";
         AddText(AddTxt);
      }
   }
}


To this:

function tag() {
   var text = getText();
   if (helpstat) {
      alert("The tag function makes the enclosed text HIDDEN.\n\nUSE: [tag]This is some hidden text[/tag]");
   } else if (basic) {
      AddTxt="[tag]" + text + "[/tag]";
      AddText(AddTxt);
   } else {
      if (text) {
         txt=prompt("Text to be made hidden.",text);
      } else {
         txt=prompt("Text to be made hidden.","Text");
      }
      if (txt!=null) {
         AddTxt="[tag]"+txt+"[/tag]";
         AddText(AddTxt);
      }
   }
}
<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 03 August 2008 10:21:12
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 03 August 2008 :  12:42:54  Show Profile  Visit leatherlips's Homepage  Reply with Quote
You'll also need to add this to inc_func_common.asp: (I had to add the space in the green text below so it would show. Yours won't have the space.)

Look for:

fString = doCode(fString, "[spoiler]", "[/ spoiler]", "<font color=""" & CColor & """>", "</font id=""" & CColor & """>")

Below that add:

fString = doCode(fString, "[tag]", "[/tag]", "<font color=""" & CColor & """>", "</font id=""" & CColor & """>")
<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 03 August 2008 12:44:13
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 03 August 2008 :  13:14:16  Show Profile  Visit leatherlips's Homepage  Reply with Quote
I forgot one more thing...

In inc_post_buttons.asp where you added:

"<a href=""Javascript:spoiler();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorTags,"Insert Spoiler","align=""top""") & "</a>" & vbNewLine


Change it to:

"<a href=""Javascript:tag();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorTags,"Insert Tags","align=""top""") & "</a>" & vbNewLine
<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 03 August 2008 13:15:11
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07