1

Topic: want to pimp my stats....

hi,

i found this:

Member online: {stats:count="members",online="1",cache_time=1,cache_name="online"}<br>
Member total: {stats:count="members",="1",cache_time=5,cache_name="empty"}<br>
Pictures: {stats:count="pictures",="1",cache_time=5,cache_name="empty"}<br>
Blogs: {stats:count="blogs",="1",cache_time=5,cache_name="empty"}<br>
Videos: {stats:count="videos",="1",cache_time=5,cache_name="empty"}<br>
Musik: {stats:count="audios",="1",cache_time=5,cache_name="empty"}<br>

at the script, and works great!!

i would like:

-total of all sent pm´s
-total of all sent winks
-total of all comments
-total of all guestbook entries
-total of all friendships
-total of all credits

I hope someone can help me :-)

Best regards

Last edited by woody (2011-05-05 11:23:00)

2

Re: want to pimp my stats....

got it ;-)

i modified /includes/ex/ext.stats.php (for professionals, of course, not very hard, but for me it was)

{stats:count="visitors",="1",cache_time=5,cache_name="empty"}
{stats:count="members",online="1",cache_time=1,cache_name="online"}{stats:count="pictures",="1",cache_time=5,cache_name="empty"}
{stats:count="pictures_comments",="1",cache_time=5,cache_name="empty"}
{stats:count="blogs",="1",cache_time=5,cache_name="empty"}
{stats:count="videos",="1",cache_time=5,cache_name="empty"}
{stats:count="videos_comments",="1",cache_time=5,cache_name="empty"}
{stats:count="audios",="1",cache_time=5,cache_name="empty"}{stats:count="news",="1",cache_time=5,cache_name="empty"}
{stats:count="events",="1",cache_time=5,cache_name="empty"}
{stats:count="messages",="1",cache_time=5,cache_name="empty"}
{stats:count="friends",="1",cache_time=5,cache_name="empty"}
{stats:count="guestbooks",="1",cache_time=5,cache_name="empty"}
{stats:count="messages_gifts",="1",cache_time=5,cache_name="empty"}
{stats:count="statuses",="1",cache_time=5,cache_name="empty"}{stats:count="orders",="1",cache_time=5,cache_name="empty"}
{stats:count="notifications",="1",cache_time=5,cache_name="empty"}
{stats:count="votes",="1",cache_time=5,cache_name="empty"}
{stats:count="members",="1",cache_time=5,cache_name="empty"}

if someone has an idea for "total credits" of all users, I would be happy ;-)

why i use stats? i love them, an our users also....

3

Re: want to pimp my stats....

woody wrote:

got it ;-)
i modified /includes/ex/ext.stats.php (for professionals, of course, not very hard, but for me it was)

and to make it even easier for the rest of us, you modified it how ....?

4

Re: want to pimp my stats....

of course ;-)...... here the ext.stats.php , it is intended easier, but for us it is ok



$data = array(
    'name' => 'System stats',
    'about' => 'Displays different types of system statistics.',
    'author' => 'VLD Interactive',
    'email' => 'support@vldpersonals.com',
    'help' => 'http://www.vldpersonals.com/downloads/extensions/',
    'website' => 'http://www.vldpersonals.com',
);

function vldext_stats ($params = array())
{
    global $DB, $CACHE, $PREFS, $SESSION;

    $count = isset($params['count']) ? $params['count'] : "";
    $online = isset($params['online']) ? $params['online'] : 0;
    $timeframe = isset($params['timeframe']) ? $params['timeframe'] : "";
    $group_id = isset($params['group_id']) && $params['group_id'] ? intval($params['group_id']) : 0;
    $cache_time = isset($params['cache_time']) && $params['cache_time'] ? intval($params['cache_time']) : 10;
    $cache_name = (isset($params['cache_name']) && $params['cache_name'] ? "_".$params['cache_name'] : "")."_".$count;
    $cache_enable = isset($params['cache_enable']) ? intval($params['cache_enable']) : 1;

    // any profile fields?
    $profile_fields = array();
    foreach ( $params as $key => $value ) {
        if ( strpos($key, 'profile_') !== false && $value ) {
            $profile_fields[] = "data_".substr($key, 8)."='".mysql_real_escape_string($value)."'";
        }
    }
    $type_label = $PREFS->conf['profile_types'][$PREFS->conf['default_profile_type']]['type_label'];

    if ( !$cache_enable || ($total = $CACHE->get("ext", "stats".$cache_name)) === false ) {

        $sql = '';
        $where = array();
        switch ( $count ) {
            case 'members':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "joindate>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "joindate>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "joindate>=".(time()-60*60*24*30);
                        break;
                }
                if ( $group_id ) {
                    $where[] = "group_id=$group_id";
                }
                if ( $online ) {
                    $where[] = "lastvisit>=".(time()-$PREFS->conf['user_timeout']*60);
                }
                if ( $profile_fields ) {
                    $where[] = implode(" AND ", $profile_fields);
                }
                break;
            case 'friends':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "request_date>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "request_date>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "request_date>=".(time()-60*60*24*30);
                        break;
                }
                $where[] = "pending=0";
                break;
            case 'albums':
            case 'audios':
            case 'pictures':
            case 'videos':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "dateadded>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "dateadded>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "dateadded>=".(time()-60*60*24*30);
                        break;
                }
                break;
            case 'blogs':
            case 'guestbooks':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "postdate>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "postdate>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "postdate>=".(time()-60*60*24*30);
                        break;
                }
                break;
            case 'messages':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "senddate>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "senddate>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "senddate>=".(time()-60*60*24*30);
                        break;
                }
                break;

            case 'messages_gifts':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "senddate>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "senddate>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "senddate>=".(time()-60*60*24*30);
                        break;
                }
                break;



            case 'statuses':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "statusdate>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "statusdate>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "statusdate>=".(time()-60*60*24*30);
                        break;
                }
                break;


            case 'visitors':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "visitdate>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "visitdate>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "visitdate>=".(time()-60*60*24*30);
                        break;
                }
                break;

            case 'orders':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "paymentdate>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "paymentdate>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "paymentdate>=".(time()-60*60*24*30);
                        break;
                }
                break;

            case 'notifications':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "postdate>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "postdate>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "postdate>=".(time()-60*60*24*30);
                        break;
                }
                break;


            case 'votes':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "postdate>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "postdate>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "postdate>=".(time()-60*60*24*30);
                        break;
                }
                break;

            case 'news':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "postdate>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "postdate>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "postdate>=".(time()-60*60*24*30);
                        break;
                }
                break;


            case 'events':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "dateadded >=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "dateadded >=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "dateadded >=".(time()-60*60*24*30);
                        break;
                }
                break;


            case 'blogs_comments':
            case 'pictures_comments':
            case 'videos_comments':
                switch ( $timeframe ) {
                    case 'day':
                        $where[] = "postdate>=".(time()-60*60*24*1);
                        break;
                    case 'week':
                        $where[] = "postdate>=".(time()-60*60*24*7);
                        break;
                    case 'month':
                        $where[] = "postdate>=".(time()-60*60*24*30);
                        break;
                }
                break;
            default:
                $sql = 'skip';
        }

        if ( $sql != 'skip' ) {
            $sql = "SELECT COUNT(*) as totalrows FROM " . DB_PREFIX . $count;
            $where = implode(" AND ", $where);
            if ( $profile_fields ) {
                $sql = $sql.($where ? " as m, " . DB_PREFIX . "members_data_". $type_label ." as d WHERE m.member_id=d.data_id ".($where ? " AND $where" : "") : "");
            }
            else {
                $sql = $sql.($where ? " WHERE $where" : "");
            }

            $result = $DB->query($sql);
            $obj = $DB->fetch_array($result, MYSQL_ASSOC);
            $total = $obj['totalrows'];
        }

        if ( $cache_enable ) {
            $CACHE->put("ext", "stats".$cache_name, $cache_time, $total);
        }
    }

    echo $total;
}

?>



best regards

Last edited by woody (2011-05-06 13:52:01)

5

Re: want to pimp my stats....

Hi,

Do you care to share how to implement that on the main page for example

Thanks

6

Re: want to pimp my stats....

hi,

we put it in the sidebar:

<div class="sidebox_wrap">
    <h5><span>KK-Stats:</span></h5>
    <div class="sidebox">

                    Profilbesuche: {stats:count="visitors",="1",cache_time=5,cache_name="empty"}<br>
                    Member online: 1{stats:count="members",online="1",cache_time=1,cache_name="online"}<br>
                    Member total: {stats:count="members",="1",cache_time=5,cache_name="empty"}<br>
                    Bilder: {stats:count="pictures",="1",cache_time=5,cache_name="empty"}<br>
                    Bilder Kommentare: {stats:count="pictures_comments",="1",cache_time=5,cache_name="empty"}<br>
                    Blogs: {stats:count="blogs",="1",cache_time=5,cache_name="empty"}<br>
                    Videos: {stats:count="videos",="1",cache_time=5,cache_name="empty"}<br>
                    Video Kommentare: {stats:count="videos_comments",="1",cache_time=5,cache_name="empty"}<br>
                    Musik: {stats:count="audios",="1",cache_time=5,cache_name="empty"}<br>
                    Nachrichten: {stats:count="messages",="1",cache_time=5,cache_name="empty"}<br>
                    Freundschaften: {stats:count="friends",="1",cache_time=5,cache_name="empty"}<br>
                    G&auml;stebucheintr&auml;ge: {stats:count="guestbooks",="1",cache_time=5,cache_name="empty"}<br>
                    Geschenke verschickt: {stats:count="messages_gifts",="1",cache_time=5,cache_name="empty"}<br>
                    Statusmeldungen: {stats:count="statuses",="1",cache_time=5,cache_name="empty"}<br>
                    Transaktionen: {stats:count="orders",="1",cache_time=5,cache_name="empty"}<br>




<br>


    </div>
</div>

best regards

7

Re: want to pimp my stats....

Beautifull.

Thank you

Last edited by tabouda (2011-05-06 15:04:44)

8

Re: want to pimp my stats....

Thanks

9

Re: want to pimp my stats....

Hi,

Any idea how to add the stats for Blog Comments?

Thanks

10

Re: want to pimp my stats....

i want to count and show all credits,favorites and other things,  can someone help me?

thx

11

Re: want to pimp my stats....

how can we get stats for reports ?

Last edited by gugu (2012-05-12 16:21:11)

Design & Customizations Service for VldPersonals  Add CometChat to your vldPersonals site
Give the world the best you have, and the best will come to you.

12

Re: want to pimp my stats....

@gugu: 1+

Endlich ist ein deutsches Forum für VLDpersonals erschienen: www.vldforum.de

13

Re: want to pimp my stats....

Das Deutsche Support-Forum für vldPersonals hat wiedereröffnet:

www.vldpersonals.de

Ihr seid alle herzlich eingeladen!

Grüße - Jürgen

Last edited by Olaf (2012-12-14 16:36:11)

Offizielles DEUTSCHES FORUM für vldPersonals
mit Genehmigung von VLD Interactive

www.vldpersonals.de

14

Re: want to pimp my stats....

Nice!

I have one question, what's the notification for?

{stats:count="notifications",="1",cache_time=5,cache_name="empty"}

Is it notifications sent? Or what does it show?