We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Add Flash Tag to your list of BBCode Tags; By Dan T
Topic Started: Feb 3 2010, 11:47 PM (1,889 Views)
Reid
Member Avatar
È una trappola!

This topic has been moved from our official support board.

Originally posted by: Will
Add Flash Tag to your list of BBCode Tags
 
This code has been moved here from our old support forum (as it will soon no longer exist at it's current location).
Please use the report button on this post to notify our staff of any problem with this modification.


Originally posted by: Dan T
Add Flash Tag to your list of BBCode Tags
 
place this under the < !--Board -->

doesnt really need a preview it just added a button which allows you to easily use the flash BBCode.

Code:
 
<script type="text/javascript">
//created by Holysavior of ZBCode and Javascriptin.com

if(location.href.match(/\/post\//i) ){
$("#c_bbcode").append("<button type='button' id='flash' onclick='workflash()'>Flash</button>")
$("#flash").insertBefore("#c_bbcode select");

function workflash() {
var height = prompt("Height of the File?");
var width = prompt("Width of the File?");
var url = prompt("URL of the File?");

document.forms['posting'].post.value="[flash="+width+","+height+"]"+url+"[/flash]"
}
}
</script>
Edited by Reid, Feb 7 2010, 01:48 AM.
Offline Profile Quote Post Goto Top
 
JohnSlider
Member
[ *  * ]
Is there a way that I could change this button's placement to in between the Flash and Spoiler buttons on the BBcode bar?
Offline Profile Quote Post Goto Top
 
RyuraGS-ZNR
Member Avatar
Generation Studio
[ *  * ]
JohnSlider
Jan 22 2012, 11:46 AM
Is there a way that I could change this button's placement to in between the Flash and Spoiler buttons on the BBcode bar?
Yeah, just use this:
Code:
 

<script>
//created by Holysavior of ZBCode and Javascriptin.com

if(location.href.match(/\/post\//i) ){
$("#c_bbcode button[name='Spolier']").after("<button type='button' id='flash' onclick='workflash()'>Flash</button>")

function workflash() {
var height = prompt("Height of the File?");
var width = prompt("Width of the File?");
var url = prompt("URL of the File?");

document.forms['posting'].post.value="[flash="+width+","+height+"]"+url+"[/flash]"
}
}
</script>
Offline Profile Quote Post Goto Top
 
JohnSlider
Member
[ *  * ]
Thanks a bunch, Ryura.
Offline Profile Quote Post Goto Top
 
JohnSlider
Member
[ *  * ]
I'm using that code, but for some reason whenever I click the BBcode button and fill in the prompt, it deletes all the text already in the response box and adds the tag. Is there a way to just have it add the tag at the end of the post instead of deleting everything that was already in the text box before the button was pushed?
Offline Profile Quote Post Goto Top
 
Real112288
Member Avatar
Member
[ * ]
JohnSlider
Feb 2 2012, 01:02 PM
I'm using that code, but for some reason whenever I click the BBcode button and fill in the prompt, it deletes all the text already in the response box and adds the tag. Is there a way to just have it add the tag at the end of the post instead of deleting everything that was already in the text box before the button was pushed?
I am using this code. Place it below below the Board. I haven't had any problems with it since I started using it yesterday. Try it.
Code:
 
<script type='text/javascript'>
if (ZetaFlash) {
ZetaFlash = function () {
var tVal = ZetaPrompt("FLASH", "http://");
if (!tVal) {
return;
}
ZetaInsert("[flash=400,600]" + tVal + "[/flash]");
};
}
</script>


I edited the length and width to 410,450 to make the size more even.
Offline Profile Quote Post Goto Top
 
JohnSlider
Member
[ *  * ]
Thanks, Real112288, but that won't work for me. See, I used the original code, but edited it for a different BBCode, so it's not for Flash tags anymore.
Offline Profile Quote Post Goto Top
 
JohnSlider
Member
[ *  * ]
does anyone have a fix for my problem? When we use this code:
Code:
 
<script>
//created by Holysavior of ZBCode and Javascriptin.com

if(location.href.match(/\/post\//i) ){
$("#c_bbcode button[name='Spolier']").after("<button type='button' id='flash' onclick='workflash()'>Flash</button>")

function workflash() {
var height = prompt("Height of the File?");
var width = prompt("Width of the File?");
var url = prompt("URL of the File?");

document.forms['posting'].post.value="[flash="+width+","+height+"]"+url+"[/flash]"
}
}
</script>


it will delete what is already in the text box when it is clicked. Also, if you click it and then close the dialog box it will say "NULL". It's really annoying when you've got a long post written up and when you click on the button to add something it ends up deleting what you've already written. :P
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
This code is no longer needed.

You can show the flash button via the Admin CP:

Admin CP Posted Image Board Customization Posted Image Preferences Posted Image BBCode

Click the radio button for the flash Show Tag Button.
Online Profile Quote Post Goto Top
 
JohnSlider
Member
[ *  * ]
True, but I am no longer using it for Flash. I changed the values to make it work for anther custom BBCode.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Changing 'value=' to 'value+=' will make it add the tag instead of it re-creating the value.
Code:
 
document.forms['posting'].post.value+="[flash="+width+","+height+"]"+url+"[/flash]"
Find that and add the following before and after it to actually cancel the prompt when the value for 'url' is null or 0.

Before:
Code:
 
if (url) {
After:
Code:
 
}
Online Profile Quote Post Goto Top
 
JohnSlider
Member
[ *  * ]
It works perfectly now, thank you.
Offline Profile Quote Post Goto Top
 
tobeme
Member Avatar
Member
[ *  * ]
nice!
Edited by tobeme, Jul 17 2012, 11:46 AM.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply