The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Problem with javascript on index_body template

3 posters

Go down

Solved Problem with javascript on index_body template

Post by Van-Helsing June 9th 2015, 1:45 am

Hello,
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(' &nbsp;<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:

Problem with javascript on index_body template I9hKgiR

and the legend is not appearing correctly, can someone help me to fix this code?

Result:
Problem with javascript on index_body template Y7xB0OZ
Van-Helsing
Van-Helsing
Hyperactive

Male Posts : 2431
Reputation : 116
Language : English, Greek

http://itexperts.forumgreek.com/

Back to top Go down

Solved Re: Problem with javascript on index_body template

Post by JScript June 9th 2015, 2:09 am

@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
JScript
JScript
Forumember

Male Posts : 741
Reputation : 175
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: Problem with javascript on index_body template

Post by Van-Helsing June 9th 2015, 2:33 am

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
Van-Helsing
Van-Helsing
Hyperactive

Male Posts : 2431
Reputation : 116
Language : English, Greek

http://itexperts.forumgreek.com/

Back to top Go down

Solved Re: Problem with javascript on index_body template

Post by Van-Helsing June 10th 2015, 12:12 pm

Bump
Van-Helsing
Van-Helsing
Hyperactive

Male Posts : 2431
Reputation : 116
Language : English, Greek

http://itexperts.forumgreek.com/

Back to top Go down

Solved Re: Problem with javascript on index_body template

Post by Van-Helsing June 11th 2015, 12:23 pm

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
Van-Helsing
Van-Helsing
Hyperactive

Male Posts : 2431
Reputation : 116
Language : English, Greek

http://itexperts.forumgreek.com/

Back to top Go down

Solved Re: Problem with javascript on index_body template

Post by SLGray June 11th 2015, 8:59 pm

Topic solved and archived


Problem with javascript on index_body template Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51408
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum