Hello,
I am testing the following code:
in my index_body template to display IPB look like forum statistics. The problem is that previous javascript appearing the following error:
and the legend is not appearing correctly, can someone help me to fix this code?
Result:
I am testing the following code:
- Code:
<script type="text/javascript">
//<![CDATA[
/** START Personal forum values
* Sample: Há 5 usuários online :: 1 usuário cadastrado, Nenhum InvisĂvel e 4 Visitantes :: 1 Motor de busca
****/
var reg_users = 'Εγγργραμένα μέλη:';
var search_bots = 'Robots (Μηχανές Αναζήτησης) :';
var nobody_text = 'Κανένας';
var and_text = ' και ';
var guests_text = ' επισκέπτες';
var anonimous_txt = ' μη ορατοί';
var full_list_txt = '(Πλήρης Λίστα)';
var active_text = ' Ενεργά μέλη (τα τελευταία 45 λεπτά)';
/* END Personal forum values */
var target = $('#total_users_online');
var aSplit = target.text();
/* Usuários online/ativos */
var users_active = target.find('strong:first').text() + active_text;
$('#board_statistics').find('h4.statistics_head').text(users_active);
var membros = aSplit.split(' :: ')[1].split(' ')[0];
if(isNaN(parseInt(membros))) {membros = 0;}
membros += ' membros, ';
var visitantes = aSplit.split(and_text)[1].split(' ')[0];
if(isNaN(parseInt(visitantes))) {visitantes = 0;}
var invisivel = aSplit.split(', ')[1].split(' ')[0];
if(isNaN(parseInt(invisivel))) {invisivel = 0;}
$('#board_statistics').find('h4.statistics_head').text(users_active);
$('#board_statistics').find('p.statistics_brief.desc')
.text(membros + visitantes + guests_text + ', ' + invisivel + anonimous_txt)
.append(' <a href="/viewonline">' + full_list_txt + '</a>');
users_active = $('#logged_in_user_list').html();
users_active = users_active.replace(reg_users, '');
users_active = users_active.replace('<br>', '');
if (users_active.indexOf(nobody_text) !== -1) {
users_active = users_active.replace(search_bots, '');
} else {
users_active = users_active.replace(search_bots, ', ');
}
users_active = users_active.replace(nobody_text,"");
$('#board_statistics').find('p.users_online').html(users_active);
var listHtml = '';
var target = $('#group_legend').find('b');
target.each(function(index, value){
if (listHtml != '') {listHtml += ' <strong>·</strong> ';}
listHtml += $(this).html();
});
$('#new_group_legend').html('<img src="http://punbb.informer.com/favicon.ico" alt="PunBB.Forumeiros.com"> ' + listHtml);
var total_chatters = $('#onlinechat').find('p.page-bottom > strong').text();
$('#shoutbox-active-total').text(total_chatters);
$('#shoutbox-active-member').text(total_chatters);
//]]>
</script>
in my index_body template to display IPB look like forum statistics. The problem is that previous javascript appearing the following error:
and the legend is not appearing correctly, can someone help me to fix this code?
Result: