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 problem

View previous topic View next topic Go down

Topic Prefix problem

Post by erchima on May 28th 2014, 9:20 am


erchima
Forumember

Female Posts : 629
Reputation : 15
Language : INDONESIAN | Lua Script | Visual Basic | and Coding
Location : Under your bed xD

http://erchimacute.forumid.net

Back to top Go down

Re: Topic Prefix problem

Post by @Mark on May 28th 2014, 9:52 am

Is this your forum?http://erchimacute.forumid.net/
Try putting again the codes, afterwards, create a topic. Allow me to check the problem.

@Mark
Forumember

Male Posts : 187
Reputation : 37
Language : HTML | CSS | Javascript | C | Java
Location : Republic of the Philippines

http://help.forumotion.com/

Back to top Go down

Re: Topic Prefix problem

Post by erchima on May 30th 2014, 8:39 am

still not work :/

erchima
Forumember

Female Posts : 629
Reputation : 15
Language : INDONESIAN | Lua Script | Visual Basic | and Coding
Location : Under your bed xD

http://erchimacute.forumid.net

Back to top Go down

Re: Topic Prefix problem

Post by SocialAcademy on May 30th 2014, 9:33 am

Hello @Erchima did you follow this ?




click the link - > Post # 2

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

Re: Topic Prefix problem

Post by erchima on May 30th 2014, 4:17 pm

yes, but doesn't work

erchima
Forumember

Female Posts : 629
Reputation : 15
Language : INDONESIAN | Lua Script | Visual Basic | and Coding
Location : Under your bed xD

http://erchimacute.forumid.net

Back to top Go down

Re: Topic Prefix problem

Post by Van-Helsing on May 31st 2014, 12:38 am

Hello Erchima,
You must make a new javascript and add the following code:

Code:
jQuery(document).ready(function(){jQuery(".modulea,.topiclist,.page-title,.statused").each(function(){jQuery(this).html(jQuery(this).html().replace(/Problem1/g,'<spanid=\'Problem1\'>Problem</span>'))})})

Then you must add a css for this element:
Code:

#problem1 {
  background: none repeat scroll 0px 0px rgb(123, 166, 13);
  border-radius: 4px 4px 4px 4px;
  color: rgb(255, 255, 255);
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  height: 15px;
  line-height: 15px;
  padding: 0px 5px;
  text-transform: uppercase;
  vertical-align: middle;
}

For each time which you want you must add in the same javascript the below code and change the element "Problem1" into which one you want. After that you must create a new CSS with the new element which you added in the javascript. By this way you can have the number of prefixes that you want.

With Best Regards,
Dark-Avenger

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Re: Topic Prefix problem

Post by erchima on May 31st 2014, 12:57 pm

ID for topic work but style for ID doesn't work
http://erchimacute.forumid.net/f1-one-information
My Code

JS
Code:

jQuery(document).ready(function(){jQuery(".module a, .topiclist, .page-title, .statused").each(function(){jQuery(this).html(jQuery(this).html().replace(/error/g,'<span id=\'error\'>ERROR</span>'))})})
CSS
Code:

.error {
background: url('http://i57.servimg.com/u/f57/17/68/86/50/highli10.png') repeat-x scroll 0px -1px #008000;}

erchima
Forumember

Female Posts : 629
Reputation : 15
Language : INDONESIAN | Lua Script | Visual Basic | and Coding
Location : Under your bed xD

http://erchimacute.forumid.net

Back to top Go down

Re: Topic Prefix problem

Post by Van-Helsing on May 31st 2014, 2:07 pm

Try this js:
Check in the topics
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);
                  });
              }
            });

and change the prefix1, prefix2, prefix2 prefixX in which you wish.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Re: Topic Prefix problem

Post by BrennanSupport on May 31st 2014, 9:23 pm

Hello try using this code I set for important already:

JS:
Code:
jQuery(document).ready(function(){jQuery(".module a, .topiclist, .page-title, .statused").each(function(){jQuery(this).html(jQuery(this).html().replace(/✔/g,'<span id=\'resol_d\'>Important</span>'))})});

CSS:
Code:
#resol_d {
    background: none repeat scroll 0px 0px rgb(252, 218, 63);
  border-radius: 4px 4px 4px 4px;
    color: rgb(255, 255, 255);
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    height: 15px;
    line-height: 15px;
    padding: 0px 5px;
    text-transform: uppercase;
    vertical-align: middle;
}

How it would look:


Look at the javascript code and find the check mark, aswell where I put Important, you may change that to anything you wish to e.g: Solved, Pro, Admin ect.

You may also change the colors in the CSS code:
Code:
    background: none repeat scroll 0px 0px rgb(252, 218, 63);

Now finally, when making the post be sure in the title to put it as (example):✔ (or whatever you replaced the check with) Hello guys

Enjoycheers

BrennanSupport
Forumember

Male Posts : 31
Reputation : 2
Language : English

http://officialssforum.com

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