The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Topic Prefix Help, Please?

View previous topic View next topic Go down

Topic Prefix Help, Please?

Post by Sakura Zero on May 1st 2014, 2:32 pm

Hey! I'm new here. But I've been using Forumotion for ages now. I was wondering if you can help me with something. It won't take long, I think.

So, I want topic prefixes for my forum, something that IPB has. I believe it is possible, see the image below:


Yes, I know this is one of the countless, annoying and stupid threads of its kind. But all of them are unsolved. I would like this to be a solved thread nonetheless, not one of the other threads.



var prefixes = ["prefix1","prefix2","prefix3","prefix4"];
var _pm = false;
var chk = false;
function toMenu(a) {
var htmlpre = '<select style="margin-right:5px" id="prefix" size="1"><option value="">(None)</option>';
for (i in a)
htmlpre += '<option value="' + a[i] + '">' + a[i] + '</option>';
htmlpre += '</select>';
return htmlpre;
}
function checkpre(ar, input) {
for (i in ar) {
var p = new RegExp("\\" + ar[i], "g");
var title = input.substr(0, input.indexOf(']'));
if (p.test(title)) return ar[i];
}
return "";
}
$(function () {
if (_pm) chk = /\privmsg/.test(location.href);
if (/\/post/.test(location.href) || chk) {
$(toMenu(prefixes)).insertBefore("input[name=subject][type=text]");
var mw = $("#prefix").width() + 5;
$("input[name=subject]").css("width", $("input[name=subject]").width() - mw);
var t = $("[name=subject]").val();
var cur = checkpre(prefixes, t);
if (cur != "") {
$("[value=" + cur + "]").attr("selected", "selected");
$("input[name=subject]").val(t.replace('[' + cur + ']', '').trim());
}
$("input[name=post]").click(function () {
var sub = $("input[name=subject]").val().trim();
if (sub != "" && $("#prefix").val() != "")
$("input[name=subject]").val("[" + $("#prefix").val() + "] " + sub);
});
}
});
This Code ain't working!


Already triedthis, too. Can you make it work for the English version?
I really need this to be solved and worked out. Help me out guys! Please?



Details, details:



Sakura Zero
New Member

Male Posts : 18
Reputation : 1
Language : English

http://chaotic.great-forum.com

Back to top Go down

Re: Topic Prefix Help, Please?

Post by Rhino.Freak on May 1st 2014, 5:01 pm


Rhino.Freak
Helper
Helper

Male Posts : 1246
Reputation : 105
Language : English
Location : Mumbai, India

http://freetest.forumotion.net/

Back to top Go down

Thanks a bunch

Post by Sakura Zero on May 2nd 2014, 6:38 am

Thanks a bunch but, I don't know how to use it.

Here's da code:

Code:
$(document).ready(function(){$('img[src="IMAGELINK"]').replaceWith('<span class="imageA">TitleA</span>')});


  1. you will changeImageLinkwith the image that you have set in the ACP

  2. you will changetitleAwith the text you want to show

  3. you will changeclass="imageA"if you want to have more than one (the class must be unique)




Need help with this.

Sakura Zero
New Member

Male Posts : 18
Reputation : 1
Language : English

http://chaotic.great-forum.com

Back to top Go down

Re: Topic Prefix Help, Please?

Post by Rhino.Freak on May 2nd 2014, 7:28 am

As far as I understand this,
First you have to add topic icons by
ACP > Display > Pics Management > Topic Icons
Then add new topic icon, copy that image's URL.. that is your ImageLink

TitleA would be TUTORIAL in your example image
imageA would be the class used to style the text "TUTORIAL"
Do it by adding this in CSS :
Code:
.imageA { background: blue; border: 1px solid black; }

Please report back of it works Smile

What it will do is replace the image url provided by topic icon with your text...

Rhino.Freak
Helper
Helper

Male Posts : 1246
Reputation : 105
Language : English
Location : Mumbai, India

http://freetest.forumotion.net/

Back to top Go down

Re: Topic Prefix Help, Please?

Post by SocialAcademy on May 2nd 2014, 8:30 am

check same problem here Topic Prefix

SocialAcademy
Forumember

Male Posts : 141
Reputation : 10
Language : JavaScript, CSS, Html, JQuery, C#, C++, Php, Python
Location : Forumotion

http://www.socialacademy.biz

Back to top Go down

Thanks

Post by Sakura Zero on May 3rd 2014, 6:41 am

@SocialAcademy wrote:check same problem here Topic Prefix
Thanks for that! Not working, though.

Sakura Zero
New Member

Male Posts : 18
Reputation : 1
Language : English

http://chaotic.great-forum.com

Back to top Go down

Re: Topic Prefix Help, Please?

Post by Sakura Zero on May 3rd 2014, 6:52 am

@Rhino.Freak wrote:As far as I understand this,
First you have to add topic icons by
ACP > Display > Pics Management > Topic Icons
Then add new topic icon, copy that image's URL.. that is your ImageLink

TitleA would be TUTORIAL in your example image
imageA would be the class used to style the text "TUTORIAL"
Do it by adding this in CSS :
Code:
.imageA { background: blue; border: 1px solid black; }

Please report back of it works Smile

What it will do is replace the image url provided by topic icon with your text...


No luck with this one.



Here is what a thread looks like. No luck.


Again, thanks for helping me out!

Sakura Zero
New Member

Male Posts : 18
Reputation : 1
Language : English

http://chaotic.great-forum.com

Back to top Go down

Re: Topic Prefix Help, Please?

Post by Jophy on May 3rd 2014, 7:51 am

Topic moved to the correct section.

Jophy
ForumGuru

Male Posts : 17924
Reputation : 835
Language : English
Location : Somewhere

Back to top Go down

Re: Topic Prefix Help, Please?

Post by Rhino.Freak on May 3rd 2014, 4:58 pm

umm.. :/sorry then.
Did you try SocialAcademy's link ?? its a completely different method..

Rhino.Freak
Helper
Helper

Male Posts : 1246
Reputation : 105
Language : English
Location : Mumbai, India

http://freetest.forumotion.net/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum