Help with Prefix Script Tune up
Page 1 of 1
Help with Prefix Script Tune up
Hey there,
i'd like some help with a code for a Prefix/Tag system, it already works the way I want, but I'd like to add two more parts to it:
- Colorize the prefixes;
- Permission level, must be a moderator or an admin to use some of the prefixes.
Here is the code:
And this is the topic of the creator: http://asistencia.foroactivo.com/t110856-sistema-de-prefijos-en-el-asunto-de-los-posts
Thank you for your help.
FiskBlack
i'd like some help with a code for a Prefix/Tag system, it already works the way I want, but I'd like to add two more parts to it:
- Colorize the prefixes;
- Permission level, must be a moderator or an admin to use some of the prefixes.
Here is the code:
- Code:
var PREFIJOS_TEMAS = [];
//########## ZONA EDITABLE #####################################
PREFIJOS_TEMAS.push("[Music]");
PREFIJOS_TEMAS.push("[Question]");
PREFIJOS_TEMAS.push("[Solved]");
PREFIJOS_TEMAS.push("[Event]");
PREFIJOS_TEMAS.push("[Movie]");
PREFIJOS_TEMAS.push("[Game]");
PREFIJOS_TEMAS.push("[Tutorial]");
//Añade más prefijos si quieres, simplemente añadiendo una línea igual:
http://PREFIJOS_TEMAS.push("[Nuevo Prefijo]");
//########## FIN ZONA EDITABLE #####################################
$(function () {
if(/^\/post\?f=\d+&mode=newtopic/.test($(location).attr('pathname') + $(location).attr('search'))){
var html_options_prefijo = "<select name='prefijos'><option value=''>--Seleccionar--</option>";
for(var prefijo in PREFIJOS_TEMAS){
html_options_prefijo += "<option value='" + PREFIJOS_TEMAS[prefijo] + "'>" + PREFIJOS_TEMAS[prefijo] + "</option>";
}
html_options_prefijo += "</select>";
$('input[name="subject"]').before(html_options_prefijo);
$("form[method='post']").submit(function() {
$('input[name="subject"]').val(($('select[name="prefijos"]').val() ? $('select[name="prefijos"]').val() + " " : "") + $('input[name="subject"]').val());
});
}
});
And this is the topic of the creator: http://asistencia.foroactivo.com/t110856-sistema-de-prefijos-en-el-asunto-de-los-posts
Thank you for your help.
FiskBlack
Similar topics
» Prefix script doesn't work
» Topic Prefix
» Topic prefix
» Topic prefix Button
» Keyword as prefix in title
» Topic Prefix
» Topic prefix
» Topic prefix Button
» Keyword as prefix in title
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum