SocialAcademy • Forum

Social Academy Community Support Forum & Free Tutorial's & Skins



[Solved] Topic Icon Help


    Go to page : 1, 2  Next

  • Please log in to Reply

View previous topic View next topic Go down  Message [Page 1 of 2]

#1

OfflineUdarsha45

Udarsha45
 
Advance Member
Advance Member

Posted Mon Jun 09, 2014 12:13 pm

 

*
POPULAR

Details: Hey,

I would like to know how to have topic icons with the text of "private", "open" and "closed". Also I would like to know how to make that icon appear beside the topic in the Latest Topic System.
Forum Address: http://www.bleachstory.net/
Forum Version: PunBB

#2

OfflineGrafix

Grafix
 
Management Team
 Management Team

Posted Tue Jun 10, 2014 1:20 am

 

Hello , at first that's not topic icon its Topic Prefix . do you mean this ? https://socialacademy.forumotion.com/t107-solved-tags-prefixes-for-topics

https://socialacademy.forumotion.com
#3

OfflineUdarsha45

Udarsha45
 
Advance Member
Advance Member

Posted Tue Jun 10, 2014 11:18 am

 
Yes, I mean that.

Do you need to create more than 1 JavaScript for the topic prefixes that i'm gonna add?

#4

OfflineGrafix

Grafix
 
Management Team
 Management Team

Posted Tue Jun 10, 2014 11:36 am

 
try this add to your Javascript
Code:
        var prefixes = ["prefix1","prefix2","prefix3","prefix4"];
          var _pm = false;
            var chk = false;
            function toMenu(a) {
              var htmlpre = '<select style="margin-right:5px" id="<b style="color:#aa0000" class="coloradmin">prefix</b>" 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 = $("#<b style="color:#aa0000" class="coloradmin">prefix</b>").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 != "" && $("#<b style="color:#aa0000" class="coloradmin">prefix</b>").val() != "")
                        $("input[name=subject]").val("[" + $("#<b style="color:#aa0000" class="coloradmin">prefix</b>").val() + "] " + sub);
                  });
              }
            });


then save . and create another Javascript and paste this
Code:
$(function () {
  $("a[href^='/t'],a[href^='http://"+ location.host +"/t']").html(function () {
      var u = $(this).text();
      if(/^\[([^\[\]]+)\]/.test(u)) return u.replace(/^\[[^\[\]]+\]/, function (a) {
        a = a.slice(1, -1);
        return '<span class="prefix ' + a + '">' + a + "</span>"
      })
  });
});
then go to your CSS and add this
Code:
.prefix{background:#008287;color:#FFF;border-radius:2px;display:inline-block;height:18px;line-height:18px;padding:0 4px}
.prefix.prefix1{background:green}
.prefix.prefix2{background:#16499a}
.prefix.prefix3{background:#fa6800}
.prefix.prefix4{background:#60a917}
all Javascript tick it in all pages

https://socialacademy.forumotion.com
#5

OfflineUdarsha45

Udarsha45
 
Advance Member
Advance Member

Posted Tue Jun 10, 2014 11:48 am

 
Okay, I've added it.

Now when I'm creating a topic- how should I add the topic prefix, I prefer?

#6

OfflineGrafix

Grafix
 
Management Team
 Management Team

Posted Tue Jun 10, 2014 12:24 pm

 
Just select the prefix you want in the side of message subject ..

https://socialacademy.forumotion.com
#7

OfflineGrafix

Grafix
 
Management Team
 Management Team

Posted Wed Jun 11, 2014 12:00 am

 
is this solved ?

https://socialacademy.forumotion.com
#8

OfflineUdarsha45

Udarsha45
 
Advance Member
Advance Member

Posted Wed Jun 11, 2014 11:14 am

 
There is actually nothing appearing to select...

#9

OfflineGrafix

Grafix
 
Management Team
 Management Team

Posted Wed Jun 11, 2014 11:17 am

 
if there is not .. you can put the prefix in message subject like this -- > Prefix1 Title of Message i think there is an error in jscript that i give you .. just this -- > Prefix1 Title of Message instead

https://socialacademy.forumotion.com
#10

OfflineUdarsha45

Udarsha45
 
Advance Member
Advance Member

Posted Wed Jun 11, 2014 11:23 am

 
Nope. Nothing.

Here; http://www.bleachstory.net/t5791-prefix1-title-of-message-instead

Also I would like to state that when I added those 2 jvs the pop up chat box and the back to top button began to stop showing....

#11

OfflineSponsored content


 

Posted

 

Message (Page 1 of 2)


    Go to page : 1, 2  Next


Share Topics Url

Url
BBcode
HTML

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

 
  • Forum free | ©phpBB | Free forum support | Report an abuse | Forumotion.com


Social Academy Forum
© Social Academy 2013-2022