solved Stats for site visits

johnchansa
@johnchansa
10 years ago
195 posts
In JR4 I could track the total number of visits to the site.How can I incorporate that in JR5 Nova skin?
How can you customize/modify the stats section?
updated by @johnchansa: 06/20/14 11:58:34PM
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
Your skin (whichever it is) is taking care of displaying your stats to the site visitor. So look through your skin for the relevant smarty, css, html and php relating to stats.

In Nova skin config you have Show Stats which switches showing of stats on and off.

All stats registered by modules are available in the skin template in the $_stats variable, Nova reaches that using {foreach $_stats as $title => $_stat} so each stat is listed in a span with $title and $count.

In jrNova stats are output using a capture assign (from index.tpl):
{* SITE STATS *}
    {if isset($_conf.jrNova_show_stats) && $_conf.jrNova_show_stats == 'on'}
        <div class="row">
            <div class="col12 last">
                <div class="inner">
                    <div class="inner leader">
                        <span class="capital">{jrCore_lang  skin=$_conf.jrCore_active_skin id="42" default="stats"}</span> -
                        {capture name="template" assign="stats_tpl"}
                            {literal}
                                {foreach $_stats as $title => $_stat}
                                <span class="media_title">• {$title}: {$_stat.count}</span>
                                {/foreach}
                            {/literal}
                        {/capture}
                        {jrCore_stats template=$stats_tpl}
                    </div>
                </div>
            </div>
        </div>
    {/if}
It is also used in profile_header.tpl to display the profile stats (the code smarty html and css are a little different)

Modules each register their stats with the core so the stat appears in the template..
For example, from jrPlaylist_init in include.php:
    // Profile Stats
    jrCore_register_module_feature('jrProfile', 'profile_stats', 'jrPlaylist', 'profile_jrPlaylist_item_count', 21);
That gets the stat into the skin so it can be displayed.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 05/10/14 12:04:22PM
johnchansa
@johnchansa
10 years ago
195 posts
Is there a specific code i can use to show total site visits using the code below:
{foreach $_stats as $title => $_stat}
<span class="media_title">• {$title}: {$_stat.count}</span>
{/foreach}
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
Try using {debug} to see what is available in your template.

If you dont see what you need, jrCore_get_count and jrCore_counter are the two functions to look at in the docs.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
brian
@brian
10 years ago
10,148 posts
Jamroom doesn't really track total site visits - it does have profile stats (i.e. number of items, etc.) but if you're trying to get visitor stats I'd recommend an analytic package like Google Analytics:

https://www.jamroom.net/the-jamroom-network/networkmarket/80/google-analytics

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags