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.

HOT next to topic

View previous topic View next topic Go down

HOT next to topic

Post by FrOsTyXi on December 27th 2014, 12:57 am

@JScript would you know why this code is not working?

New JavaScript
Placement Subforums
Code:
    $(document).ready(function(){
    $('thead:contains("Replies")').each(function() {
      $(this).parents('.main-content').find('td.tc2').each(function() {
      var number = $(this).text();
      var hot = '<span class="hot_topic">HOT</span>';
    if(number >= 5) {
      $(this).append(hot);
    }
      });
    });
    });

CSS
Code:
    .hot_topic {
    background: #ED7710;
    display: block;
    height: 16px;
    margin: 0 auto;
    max-width: 45px;
    line-height: 16px;
    padding: 1px 5px;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    vertical-align: middle;
    }


Forum Link: TPSN

forum type: punBB
Thank you for the help in advance!

FrOsTyXi
Forumember

Male Posts : 460
Reputation : 12
Language : english

http://team-psn.forum-board.net/

Back to top Go down

Re: HOT next to topic

Post by _Twisted_Mods_ on December 27th 2014, 3:13 am

try this

Code:
    $(document).ready(function(){
    $('.tc3').each(function() {
      $(this).each(function() {
      var  numb = $(this).text().replace(/(Replies\d+ Views)/,'')
      var hot = '<span class="hot_topic">HOT</span>';
    if(numb >= 5) {
      $(this).parent().find(">:first-child").append(hot);
    }
      });
    });
    });

_Twisted_Mods_
Helper
Helper

Male Posts : 2032
Reputation : 302
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: HOT next to topic

Post by FrOsTyXi on December 27th 2014, 4:06 am

Didnt do it either thanks @_Twisted_Mods_

FrOsTyXi
Forumember

Male Posts : 460
Reputation : 12
Language : english

http://team-psn.forum-board.net/

Back to top Go down

Re: HOT next to topic

Post by _Twisted_Mods_ on December 27th 2014, 4:44 am

my fault i missed a ;


Code:
$(document).ready(function(){
$('.tc3').each(function() {
$(this).each(function() {
  var numb = $(this).text().replace(/(Replies\d+ Views)/,'');
var hot = '<span class="hot_topic">HOT</span>';
if(numb >= 5) {
$(this).parent().find(">:first-child").append(hot);
}
});
});
});

_Twisted_Mods_
Helper
Helper

Male Posts : 2032
Reputation : 302
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: HOT next to topic

Post by FrOsTyXi on December 27th 2014, 4:50 am

@_Twisted_Mods_ Thank you sir that worked great just needs abit of styling now *)

FrOsTyXi
Forumember

Male Posts : 460
Reputation : 12
Language : english

http://team-psn.forum-board.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