MaxiTR
MaxiTR

Bağlı değilsiniz. Bağlanın ya da kayıt olun

Pupüler konu iconu

Admin

Admin

Admin
 Admin
Pupüler konu iconu EmptyMesaj Sayısı Mesaj Sayısı : 21
Pupüler konu iconu EdQFHGs


AKP -> Mödüller -> HTML & JAVASCRIPT -> Javascript ekle
İsim: Popular konu

Kod:

/***
* Version: 1.2
* Code: Popular post
* Date: 14/07/2015
* Author: Daemon
***/
$(function() {
    $('head').append(
    '<style type="text/css">' +
    '.popular_post {' +
    ' background: #D5DEE5;' +
    ' border-radius: 5px 5px 5px 5px;' +
    ' color: #1D3652;' +
    ' float: right;' +
    ' font-size: 0.8em;' +
    ' font-weight: bold;' +
    ' margin: 5px 10px 10px;' +
    ' padding: 5px;' +
    ' text-align: center;' +
    '}' +
    '.popular_post img {' +
    ' max-width: 20px;' +
    '}' +
    '</style>'
    );
    var x = $('.vote');
    var qtd = 5; // Number of votes for the post to become popular
    for(var i = 0, l = x.length; i < l; i++) {
        var v = x[i],
            value = 0;
        var votebar = $('.vote-bar', v)[0];
        if(votebar) {
          var numbar = votebar.title.match(/\d+/g);
          value = Math.round(parseInt(numbar[1]) * parseInt(numbar[0])) / 100;
        }
        if(value >= qtd) {
          var pop = '<p class="popular_post"><img src="http://imgur.com/hds8Nup.png"><br>POPULAR</p>';
          v.insertAdjacentHTML('afterbegin', pop);
        }
  }
});

#1 - Posted C.tesi Ocak 06 2018, 23:08
https://maxitr.hareketforum.net

Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz