The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Problem with javascript on index_body template

View previous topic View next topic Go down

Solved Problem with javascript on index_body template

Post by Van-Helsing on 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:



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

Result:

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem with javascript on index_body template

Post by JScript on 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
Forumember

Male Posts : 741
Reputation : 167
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 on 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
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem with javascript on index_body template

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

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem with javascript on index_body template

Post by Van-Helsing on 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
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem with javascript on index_body template

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

Topic solved and archived


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


SLGray
Administrator
Administrator

Male Posts : 35660
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


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