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:
Locked Topic
[ C ] Macro Request
Topic Started: Aug 2 2010, 05:06 PM (319 Views)
.Vulture
Member Avatar
Connect Gaming
[ *  *  * ]
Board Address: PublicNotice
Board Software: Zetaboards
Description: I would like to request a Macro code. You may know what it is, but for the sake of the request, I'll explain. It would be put with the BBcodes when you are making a post, preferably next to the "Font" or "Color" drop-down menus. It would be labeled Macro. So, these macros are customizable. Simply, you go in and edit the name of the macro and the content that it would appear when selected. For example, when you go down the "Font" drop-down menu and click "Verdana," the BBcode for the Verdana font would appear in the posting area.

Thanks.
Offline Profile Goto Top
 
RedBldSandman
Member Avatar
Asante sana Squash banana
[ *  *  *  * ]
Code:
 
<script type="text/javascript">
$(function() {
var macros = [],n=0;
macros[n++] = ["MACRO NAME","TEXT TO INSERT"];

//stop editing
if ($("#c_bbcode").length) {
var macro_after = "<select onmouseover='ZetaHelp(\"Insert Macro\")' onchange='MacroSelect(this)' name='macro'><option value='' selected='selected'>Macros</option>";
for (var i=0;i<n;i++) {
macro_after += "<option value='"+macros[i][1]+"'>"+macros[i][0]+"</option>";
}
macro_after += "</select>";
$("select[name=fcolor]").after(macro_after);
}
});
function MacroSelect(select) {
var macro_selected = select.options[select.selectedIndex].value;
var post = document.posting.post;
post.value += macro_selected;
post.focus();
select.selectedIndex = 0;
}
</script>
To add macros find this line:
Code:
 
macros[n++] = ["MACRO NAME","TEXT TO INSERT"];
and add in as many as you want (edit that one too).
Is this what you wanted? :)
Offline Profile Goto Top
 
.Vulture
Member Avatar
Connect Gaming
[ *  *  * ]
Yes, thank you. I will have to test it out before I can rest my case :D

Also, do you know if it's possible for each individual member to set up their own set of macros? Or is it all set by the staff?
Offline Profile Goto Top
 
Roby-ZNR
Member Avatar
Efficacy
[ *  *  *  *  *  * ]
They are set via the line of code that RedBld pointed out; only those with Board Template access can set up the macros.

How did this work out for you?
Offline Profile Goto Top
 
.Vulture
Member Avatar
Connect Gaming
[ *  *  * ]
I got it to work, pretty well, but when I installed it(pasted the code in) It interfered with my other code request http://resources.zetaboards.com/topic/5093728/1/#new

It went all wack and is not where its supposed to be located.
Offline Profile Goto Top
 
Roby-ZNR
Member Avatar
Efficacy
[ *  *  *  *  *  * ]
Could you provide a screenshot of what's going wrong? They both work fine on my test board.
Offline Profile Goto Top
 
.Vulture
Member Avatar
Connect Gaming
[ *  *  * ]
I got it to work out, Its with my theme its cause the we lost the AiO drop menu which threw it off. Its all good now.
Offline Profile Goto Top
 
Roby-ZNR
Member Avatar
Efficacy
[ *  *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic