Current date/time is May 7th 2024, 7:15 am

Search found 1 match for field_id-14

Reputation bar/Thanks button doesn't show up.

Hello,

I can't seem t get the reputation bar, or the thanks, like or don't like buttons to show up?
Is there something I am missing?

Thanks.

http://racearena.forumotion.com/t88-not-danbury-but-danbury-related-kewel-bobby-vee-chassis-dynamics#107


Here's the Javascript I use;

Me wrote:/*
* Application: Reputation Levels
* Date: 14/06/2018
* Version: 2.014062018
* Copyright (c) 2018 Daemon <help.forumotion.com>
* This work is free. You can redistribute it and/or modify it
*/
function bs_reputation_ipb() {

/*
* Configure below the levels for the reputation profile,
* with the respective number needed to win it.
* You can also add a class to customize the element.
*/

var reputation = [
{
reputation: 0,
level: "Neutral",
class: "zero"
},
{
reputation: 1,
level: "Beginner"
},
{
reputation: 10,
level: "Regular"
},
{
reputation: 20,
level: "Good"
},
{
reputation: 35,
level: "Great"
},
{
reputation: 50,
level: "Excellent",
class: "awesome"
}
];

/*
* No need to change anything from here down
*/

var post = $(".post"),
level = "",
repClass = "",
BreakException = {};

$.ajax({
url: post.first().find("a[href^='/u']").attr("href"),
type: "GET",
success: function(data) {
var fieldName = $("#field_id-14", data).find("dt").text().split(" ")[0],
regExp = RegExp("<span[^>]*>(?:<span[^>]*>)?(" + fieldName + ")(?:<\\/span>)?\\s:\\s<\\/span>\\s*(\\d+)", "g");
$.each($(".post"), function(idx) {
$(this).html(
$(this).html()
.replace(regExp, "<div class='reputation-bs'>$1 : $2<br><span class='title' style='font-weight:normal'></span></div>")
);
var repDiv = $(".reputation-bs", this),
fieldValue = repDiv.text().match(/\d+/);
try {
$.each(reputation, function(i, item) {
if (item.reputation <= fieldValue) {
level = (item.level) ? item.level : "",
repClass = (item.class) ? item.class : "";
} else {
throw BreakException;
}
});
} catch (e) {
if (e !== BreakException) throw e;
}
repDiv.addClass(repClass).find(".title").text(level);
});
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(textStatus, errorThrown);
}
});

};
$(function() {
bs_reputation_ipb();
});


Here's the CSS:
/*
* Application: Reputation Levels
* Date: 14/06/2018
* Version: 2.014062018
* Copyright (c) 2018 Daemon <help.forumotion.com>
* This work is free. You can redistribute it and/or modify it
*/
function bs_reputation_ipb() {

/*
* Configure below the levels for the reputation profile,
* with the respective number needed to win it.
* You can also add a class to customize the element.
*/

var reputation = [
{
reputation: 0,
level: "Neutral",
class: "zero"
},
{
reputation: 1,
level: "Beginner"
},
{
reputation: 10,
level: "Regular"
},
{
reputation: 20,
level: "Good"
},
{
reputation: 35,
level: "Great"
},
{
reputation: 50,
level: "Excellent",
class: "awesome"
}
];

/*
* No need to change anything from here down
*/

var post = $(".post"),
level = "",
repClass = "",
BreakException = {};

$.ajax({
url: post.first().find("a[href^='/u']").attr("href"),
type: "GET",
success: function(data) {
var fieldName = $("#field_id-14", data).find("dt").text().split(" ")[0],
regExp = RegExp("<span[^>]*>(?:<span[^>]*>)?(" + fieldName + ")(?:<\\/span>)?\\s:\\s<\\/span>\\s*(\\d+)", "g");
$.each($(".post"), function(idx) {
$(this).html(
$(this).html()
.replace(regExp, "<div class='reputation-bs'>$1 : $2<br><span class='title' style='font-weight:normal'></span></div>")
);
var repDiv = $(".reputation-bs", this),
fieldValue = repDiv.text().match(/\d+/);
try {
$.each(reputation, function(i, item) {
if (item.reputation <= fieldValue) {
level = (item.level) ? item.level : "",
repClass = (item.class) ? item.class : "";
} else {
throw BreakException;
}
});
} catch (e) {
if (e !== BreakException) throw e;
}
repDiv.addClass(repClass).find(".title").text(level);
});
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(textStatus, errorThrown);
}
});

};
$(function() {
bs_reputation_ipb();
});


Thanks again!
by kaptainsteve
on February 16th 2019, 3:30 am
 
Search in: Garbage
Topic: Reputation bar/Thanks button doesn't show up.
Replies: 5
Views: 570

Back to top

Jump to: