Problem with javascript on index_body template
3 posters
Page 1 of 1
Problem with javascript on index_body template
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:
Re: Problem with javascript on index_body template
@Black-Shadow
Hello Friend!
When I made this code, I was in the second month in my first steps in web programming and this code was tailor made for my forum...
I will not give more support to this code because I consider a very bad code, but if you want to wait, I make the code compatible with all versions, just a simple JavaScript to be added in your forum!
Just one thing: I can not promise you that this will be soon because I already have several projects underway ok?
JS
Hello Friend!
When I made this code, I was in the second month in my first steps in web programming and this code was tailor made for my forum...
I will not give more support to this code because I consider a very bad code, but if you want to wait, I make the code compatible with all versions, just a simple JavaScript to be added in your forum!
Just one thing: I can not promise you that this will be soon because I already have several projects underway ok?
JS
Re: Problem with javascript on index_body template
Hello my friend @JScript,
Ok I will wait and keep open this topic, I am understand you. You a have a lot of projects opened this period.
Best Regards,
Black-Shadow
Ok I will wait and keep open this topic, I am understand you. You a have a lot of projects opened this period.
Best Regards,
Black-Shadow
Re: Problem with javascript on index_body template
Hello,
I made some modifications in template code and I fixed the problems, now it is working fine and my problem has been solved.
Best Regards,
Black-Shadow
I made some modifications in template code and I fixed the problems, now it is working fine and my problem has been solved.
Best Regards,
Black-Shadow
Re: Problem with javascript on index_body template
Topic solved and archived
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» Problem with javascript which change text in index_body template
» JavaScript problem!
» Javascript in all pages problem
» Christmas Javascript Problem
» Javascript cache problem
» JavaScript problem!
» Javascript in all pages problem
» Christmas Javascript Problem
» Javascript cache problem
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum