Problem with member of the month javascript code
2 posters
Page 1 of 1
Problem with member of the month javascript code
Hello,
I am trying to install the below code for Member Of The Month in board index but it is not displaying anything and I can't locate what is going wrong. Can you help me please to fix it?
I am trying to install the below code for Member Of The Month in board index but it is not displaying anything and I can't locate what is going wrong. Can you help me please to fix it?
- Code:
$(document).ready(function(){
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}
var months = new makeArray('Ιανουαρίου','Φεβρουαρίου','Μαρτίου','Απριλίου','Μαΐου','Ιουνίου','Ιουλίου','Αυγούστου','Σεπτεμβρίου','Οκτωβρίου','Νοεμβρίου','Δεκεμβρίου');
var date = new Date();
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
var link = $('.module table[summary="Most active topic starters"] td:eq(0) a').attr('href');
$.get(link, function(d) {
var nome = jQuery('#profile-advanced-right .module .main-head .h3:eq(0) strong', d).text();
var avatar = jQuery('#profile-advanced-right .main-content.clearfix.center:eq(0) img', d).attr('src');
var register = jQuery('#field_id-4 dd', d).text();
var posts = jQuery('#field_id-6 dd', d).text();
var pontos = jQuery('#field_id-14 dd', d).text();
var rep_m = jQuery('#field_id-13 dd', d).text();
var id = link.match(/\d+/g);
var verify = jQuery('#profile-advanced-right .module .main-head .h3:eq(0) em', d).text();
if(verify == '(Συνδεδεμένος)') {
var status = 'online';
}else {
var status = 'offline';
}
var p = $('.pun-crumbs')[0];
$(p).after('
<div class="main destaque" style="display: none;">
<div class="main-head">
<div class="page-title" style="padding: 3px 6px 3px;">
<h2><img src="http://i.imgur.com/fHukYSL.png" /> Μέλος του Μήνα</h2>
</div>
</div>
<div class="main-content">
<table>
<tbody class="statused">
<tr>
<td width="105px" align="center" style="background-color: aliceBlue;padding: 3px;">
<img src="'+avatar+'" class="avatar_d" alt="'+avatar+'" /><br><br>
<span class="bs_badge" style="background:green;margin-bottom:3px;margin-top:3px;"><a href="/privmsg?mode=post&u='+id+'">Αποστολή Π.Μ</a></span><br>
<span class="bs_badge" style="background:green;"><a href="/spa/'+nome+'">Θέματα</a></span>
</td>
<td>
<div style="position:relative;left:-5px;padding:5px 0px 5px 15px;">
<div style="border-bottom:1px solid lightgrey;padding-bottom:3px;">
<h4><span style="font-size:1.3em;">'+nome+'</span>
<span style="float:right;color:grey;font-size:10px;position:relative;" class="m_o_m"></span></h4>
</div>
<span>
<p class="message_motm" style="padding-top:3px"></p>
<div style="padding:5px;float:right">
<span class="bs_badge reset_cursor" id="m_post"></span>
<span class="bs_badge reset_cursor" id="m_rep"></span>
<span class="bs_badge bs_badge_lightgrey reset_cursor perf"><a href="'+link+'">Δείτε το προφίλ</a></span>
</div>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
');
if(link) {$('.destaque').show();}
$('p.message_motm').html('Συγχαρητήρια στον/την '+nome+' το νεότερο μέλος του μήνα - <strong>'+months[month]+' - '+year+'</strong>. Έχει εγγραφεί στο φόρουμ στις '+register+'. Έχει δημοσιεύσει συνολικά '+posts+' θέματα. Έχει λάβει συνολικά '+pontos+' βαθμούς. Έχει λάβει '+rep_m+' "Ευχαριστώ. Τώρα είναι '+status+'.');
$('.m_o_m').html('Μέλος του Μήνα: <span class="bs_badge" style="background:green;">'+months[month]+' - '+year+'</span>');
$('#m_post').html(''+posts+' θέματα');
$('#m_rep').html(''+rep_m+' "Ευχαριστώ"');
});
});
Last edited by Black-Shadow on March 5th 2015, 12:18 am; edited 1 time in total
Re: Problem with member of the month javascript code
try this
- Code:
$(document).ready(function(){
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}
var months = new makeArray('Ιανουαρίου','Φεβρουαρίου','Μαρτίου','Απριλίου','Μαΐου','Ιουνίου','Ιουλίου','Αυγούστου','Σεπτεμβρίου','Οκτωβρίου','Νοεμβρίου','Δεκεμβρίου');
var date = new Date();
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
var link = $('.module table[summary="Most active topic starters"] td:eq(0) a').attr('href');
$.get(link, function(d) {
var nome = jQuery('#profile-advanced-right .module .main-head .h3:eq(0) strong', d).text();
var avatar = jQuery('#profile-advanced-right .main-content.clearfix.center:eq(0) img', d).attr('src');
var register = jQuery('#field_id-4 dd', d).text();
var posts = jQuery('#field_id-6 dd', d).text();
var pontos = jQuery('#field_id-14 dd', d).text();
var rep_m = jQuery('#field_id-13 dd', d).text();
var id = link.match(/\d+/g);
var verify = jQuery('#profile-advanced-right .module .main-head .h3:eq(0) em', d).text();
if(verify == '(Συνδεδεμένος)') {
var status = 'online';
}else {
var status = 'offline';
}
var p = $('.pun-crumbs')[0];
$(p).after('<div class="main destaque" style="display: none;"><div class="main-head"><div class="page-title" style="padding: 3px 6px 3px;"><h2><img src="http://i.imgur.com/fHukYSL.png" /> Μέλος του Μήνα</h2></div></div><div class="main-content"><table><tbody class="statused"><tr><td width="105px" align="center" style="background-color: aliceBlue;padding: 3px;"><img src="'+avatar+'" class="avatar_d" alt="'+avatar+'" /><br><br><span class="bs_badge" style="background:green;margin-bottom:3px;margin-top:3px;"><a href="/privmsg?mode=post&u='+id+'">Αποστολή Π.Μ</a></span><br><span class="bs_badge" style="background:green;"><a href="/spa/'+nome+'">Θέματα</a></span></td><td><div style="position:relative;left:-5px;padding:5px 0px 5px 15px;"><div style="border-bottom:1px solid lightgrey;padding-bottom:3px;"><h4><span style="font-size:1.3em;">'+nome+'</span><span style="float:right;color:grey;font-size:10px;position:relative;" class="m_o_m"></span></h4></div><span><p class="message_motm" style="padding-top:3px"></p><div style="padding:5px;float:right"><span class="bs_badge reset_cursor" id="m_post"></span><span class="bs_badge reset_cursor" id="m_rep"></span><span class="bs_badge bs_badge_lightgrey reset_cursor perf"><a href="'+link+'">Δείτε το προφίλ</a></span></div></span></div></td></tr></tbody></table></div></div>');
if(link) {$('.destaque').show();}
$('p.message_motm').html('Συγχαρητήρια στον/την '+nome+' το νεότερο μέλος του μήνα - <strong>'+months[month]+' - '+year+'</strong>. Έχει εγγραφεί στο φόρουμ στις '+register+'. Έχει δημοσιεύσει συνολικά '+posts+' θέματα. Έχει λάβει συνολικά '+pontos+' βαθμούς. Έχει λάβει '+rep_m+' "Ευχαριστώ. Τώρα είναι '+status+'.');
$('.m_o_m').html('Μέλος του Μήνα: <span class="bs_badge" style="background:green;">'+months[month]+' - '+year+'</span>');
$('#m_post').html(''+posts+' θέματα');
$('#m_rep').html(''+rep_m+' "Ευχαριστώ"');
});
});
Re: Problem with member of the month javascript code
Hello @_Twisted_Mods_,_Twisted_Mods_ wrote:try this
- Code:
$(document).ready(function(){
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}
var months = new makeArray('Ιανουαρίου','Φεβρουαρίου','Μαρτίου','Απριλίου','Μαΐου','Ιουνίου','Ιουλίου','Αυγούστου','Σεπτεμβρίου','Οκτωβρίου','Νοεμβρίου','Δεκεμβρίου');
var date = new Date();
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
var link = $('.module table[summary="Most active topic starters"] td:eq(0) a').attr('href');
$.get(link, function(d) {
var nome = jQuery('#profile-advanced-right .module .main-head .h3:eq(0) strong', d).text();
var avatar = jQuery('#profile-advanced-right .main-content.clearfix.center:eq(0) img', d).attr('src');
var register = jQuery('#field_id-4 dd', d).text();
var posts = jQuery('#field_id-6 dd', d).text();
var pontos = jQuery('#field_id-14 dd', d).text();
var rep_m = jQuery('#field_id-13 dd', d).text();
var id = link.match(/\d+/g);
var verify = jQuery('#profile-advanced-right .module .main-head .h3:eq(0) em', d).text();
if(verify == '(Συνδεδεμένος)') {
var status = 'online';
}else {
var status = 'offline';
}
var p = $('.pun-crumbs')[0];
$(p).after('<div class="main destaque" style="display: none;"><div class="main-head"><div class="page-title" style="padding: 3px 6px 3px;"><h2><img src="http://i.imgur.com/fHukYSL.png" /> Μέλος του Μήνα</h2></div></div><div class="main-content"><table><tbody class="statused"><tr><td width="105px" align="center" style="background-color: aliceBlue;padding: 3px;"><img src="'+avatar+'" class="avatar_d" alt="'+avatar+'" /><br><br><span class="bs_badge" style="background:green;margin-bottom:3px;margin-top:3px;"><a href="/privmsg?mode=post&u='+id+'">Αποστολή Π.Μ</a></span><br><span class="bs_badge" style="background:green;"><a href="/spa/'+nome+'">Θέματα</a></span></td><td><div style="position:relative;left:-5px;padding:5px 0px 5px 15px;"><div style="border-bottom:1px solid lightgrey;padding-bottom:3px;"><h4><span style="font-size:1.3em;">'+nome+'</span><span style="float:right;color:grey;font-size:10px;position:relative;" class="m_o_m"></span></h4></div><span><p class="message_motm" style="padding-top:3px"></p><div style="padding:5px;float:right"><span class="bs_badge reset_cursor" id="m_post"></span><span class="bs_badge reset_cursor" id="m_rep"></span><span class="bs_badge bs_badge_lightgrey reset_cursor perf"><a href="'+link+'">Δείτε το προφίλ</a></span></div></span></div></td></tr></tbody></table></div></div>');
if(link) {$('.destaque').show();}
$('p.message_motm').html('Συγχαρητήρια στον/την '+nome+' το νεότερο μέλος του μήνα - <strong>'+months[month]+' - '+year+'</strong>. Έχει εγγραφεί στο φόρουμ στις '+register+'. Έχει δημοσιεύσει συνολικά '+posts+' θέματα. Έχει λάβει συνολικά '+pontos+' βαθμούς. Έχει λάβει '+rep_m+' "Ευχαριστώ. Τώρα είναι '+status+'.');
$('.m_o_m').html('Μέλος του Μήνα: <span class="bs_badge" style="background:green;">'+months[month]+' - '+year+'</span>');
$('#m_post').html(''+posts+' θέματα');
$('#m_rep').html(''+rep_m+' "Ευχαριστώ"');
});
});
Its still not working
Re: Problem with member of the month javascript code
do you have the Most active topic starters widget on your forum active?
Re: Problem with member of the month javascript code
_Twisted_Mods_ wrote:do you have the Most active topic starters widget on your forum active?
Hello @_Twisted_Mods_,
Yes but I have modified it due the recent topics system v5, on my testing forum i haven't the recent topics systems and i havent most active starters widget active in both cases it is not working.
Is there a way to retrieve the data from recent topics system v5?
Re: Problem with member of the month javascript code
@_Twisted_Mods_,
Here is the Recent Topics System :
and it must retrieve the member of the month as the red arrows showing.
@_Twisted_Mods_ is there a way to get the data from the member of the month widget?
I want to make this:
@_Twisted_Mods_ can we adapt the widget Member of the month code for the main page message code?
Here is the Recent Topics System :
and it must retrieve the member of the month as the red arrows showing.
@_Twisted_Mods_ is there a way to get the data from the member of the month widget?
I want to make this:
@_Twisted_Mods_ can we adapt the widget Member of the month code for the main page message code?
Last edited by Black-Shadow on March 4th 2015, 10:32 am; edited 1 time in total
Re: Problem with member of the month javascript code
- Code:
$(document).ready(function(){
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}
var months = new makeArray('Ιανουαρίου','Φεβρουαρίου','Μαρτίου','Απριλίου','Μαΐου','Ιουνίου','Ιουλίου','Αυγούστου','Σεπτεμβρίου','Οκτωβρίου','Νοεμβρίου','Δεκεμβρίου');
var date = new Date();
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
var link = $('#top_posters li:eq(1) a').attr('href');
$.get(link, function(d) {
var nome = jQuery('#profile-advanced-right .module .main-head .h3:eq(0) strong', d).text();
var avatar = jQuery('#profile-advanced-right .main-content.clearfix.center:eq(0) img', d).attr('src');
var register = jQuery('#field_id-4 dd', d).text();
var posts = jQuery('#field_id-6 dd', d).text();
var pontos = jQuery('#field_id-14 dd', d).text();
var rep_m = jQuery('#field_id-13 dd', d).text();
var id = link.match(/\d+/g);
var verify = jQuery('#profile-advanced-right .module .main-head .h3:eq(0) em', d).text();
if(verify == '(Συνδεδεμένος)') {
var status = 'online';
}else {
var status = 'offline';
}
var p = $('.pun-crumbs')[0];
$(p).after('<div class="main destaque" style="display: none;"><div class="main-head"><div class="page-title" style="padding: 3px 6px 3px;"><h2><img src="http://i.imgur.com/fHukYSL.png" /> Μέλος του Μήνα</h2></div></div><div class="main-content"><table><tbody class="statused"><tr><td width="105px" align="center" style="background-color: aliceBlue;padding: 3px;"><img src="'+avatar+'" class="avatar_d" alt="'+avatar+'" /><br><br><span class="bs_badge" style="background:green;margin-bottom:3px;margin-top:3px;"><a href="/privmsg?mode=post&u='+id+'">Αποστολή Π.Μ</a></span><br><span class="bs_badge" style="background:green;"><a href="/spa/'+nome+'">Θέματα</a></span></td><td><div style="position:relative;left:-5px;padding:5px 0px 5px 15px;"><div style="border-bottom:1px solid lightgrey;padding-bottom:3px;"><h4><span style="font-size:1.3em;">'+nome+'</span><span style="float:right;color:grey;font-size:10px;position:relative;" class="m_o_m"></span></h4></div><span><p class="message_motm" style="padding-top:3px"></p><div style="padding:5px;float:right"><span class="bs_badge reset_cursor" id="m_post"></span><span class="bs_badge reset_cursor" id="m_rep"></span><span class="bs_badge bs_badge_lightgrey reset_cursor perf"><a href="'+link+'">Δείτε το προφίλ</a></span></div></span></div></td></tr></tbody></table></div></div>');
if(link) {$('.destaque').show();}
$('p.message_motm').html('Συγχαρητήρια στον/την '+nome+' το νεότερο μέλος του μήνα - <strong>'+months[month]+' - '+year+'</strong>. Έχει εγγραφεί στο φόρουμ στις '+register+'. Έχει δημοσιεύσει συνολικά '+posts+' θέματα. Έχει λάβει συνολικά '+pontos+' βαθμούς. Έχει λάβει '+rep_m+' "Ευχαριστώ. Τώρα είναι '+status+'.');
$('.m_o_m').html('Μέλος του Μήνα: <span class="bs_badge" style="background:green;">'+months[month]+' - '+year+'</span>');
$('#m_post').html(''+posts+' θέματα');
$('#m_rep').html(''+rep_m+' "Ευχαριστώ"');
});
});
Re: Problem with member of the month javascript code
Hello @_Twisted_Mods_,
Ok I solved it, Thank you very much.
i change this code
with this code
Ok I solved it, Thank you very much.
i change this code
- Code:
$('#top_posters li:eq(1) a').attr('href');
with this code
- Code:
$('#top_posters li:eq(0) a').attr('href');
Similar topics
» problem with code Remove messages of a member
» (former) (new problem) Avatar missing in member list (code issue)
» How can I make a customized Member Of The Month widget?
» How to make a member of the month?
» How do I put a picture of a member of the JavaScript technology
» (former) (new problem) Avatar missing in member list (code issue)
» How can I make a customized Member Of The Month widget?
» How to make a member of the month?
» How do I put a picture of a member of the JavaScript technology
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum