Live Statistics Block

Support for the IM Portal Project

Moderator: Integra Moderator

Live Statistics Block

PostAuthor: Pogue Moran » Tue Jun 27, 2006 5:58 am

I was wondering if anyone made this into an IM portal block. And if not how would I go about creating the blocks. I've tried but ended up with a blank page

[flash=,:1i1ykqrk]http://www.apota.co.uk/mrc/stuff/stats.jpg[/flash:1i1ykqrk]

Here is the original script
Code: Select all
#-----[ OPEN ]------------------------------------------#index.php  ##-----[ FIND ]------------------------------------------#         // Start add - Last visit MOD         'USERS_TODAY_LIST' => $users_today_list,  ##-----[ AFTER ADD ]------------------------------------------#                  'L_ONLINE_MEMBERS' => $lang['Online_Members_P'],  ##-----[ OPEN ]------------------------------------------#portal.php  ##-----[ FIND ]------------------------------------------#// End session management  ##-----[ AFTER ADD ]------------------------------------------#color_groups_setup_list_portal();  ##-----[ FIND ]------------------------------------------#// End add - Last visit MOD  ##-----[ AFTER ADD ]------------------------------------------#{$today_registered_users = 0;$yesterday_registered_users = 0;  $today_time = time();$yesterday_time = $today_time - 86400;  $day = create_date('d', $yesterday_time, $userdata['user_timezone']);$month = create_date('m', $yesterday_time, $userdata['user_timezone']);$year = create_date('Y', $yesterday_time, $userdata['user_timezone']);  $y_day_from = strtotime($year.'-'.$month.'-'.$day.' 00:00:00');  $day = create_date('d', $today_time, $userdata['user_timezone']);$month = create_date('m', $today_time, $userdata['user_timezone']);$year = create_date('Y', $today_time, $userdata['user_timezone']);  $t_day_from = strtotime($year.'-'.$month.'-'.$day.' 00:00:00');       $sql = "SELECT count(distinct user_id) as total_users FROM " . USERS_TABLE . "     WHERE user_regdate >= $y_day_from         AND user_regdate < $t_day_from         AND user_id <ANONYMOUS>sql_query($sql) ){     message_die(GENERAL_ERROR, 'Could not get yesterday registered users', '', __LINE__, __FILE__, $sql);}  while ( $row = $db->sql_fetchrow($result) ){     $yesterday_registered_users = $row['total_users'];}  $db->sql_freeresult($result);       $sql = "SELECT count(distinct user_id) as total_users FROM " . USERS_TABLE . "         WHERE user_regdate >= $t_day_from         AND user_id <ANONYMOUS>sql_query($sql) ){     message_die(GENERAL_ERROR, 'Could not get yesterday registered users', '', __LINE__, __FILE__, $sql);}  while ( $row = $db->sql_fetchrow($result) ){     $today_registered_users = $row['total_users'];}  $db->sql_freeresult($result);}  ##-----[ FIND ]------------------------------------------#// End add  - Photo Album Block  $template->assign_vars(array(  ##-----[ AFTER ADD ]------------------------------------------#          // Live Statistik on Portal             'P_NEWEST_USER' => sprintf($lang['Newest_user_plus'], '<a>', $newest_user, '</a>'),             'TODAY_USERS' => $today_registered_users,          'P_TOTAL_USERS' => $total_users,             'YESTERDAY_USERS' => $yesterday_registered_users,          'GUESTS_ONLINE' => $guests_online,             'REGGED_ONLINE' => $logged_visible_online,          'P_TOTAL_POSTS' => $total_posts,          'L_LIVE_STATS' => $lang['Live_Statistics'],          'L_MEMBERS' => $lang['Top_Member'],          'L_LATEST' => $lang['Latest_Member'],             'L_NEW_TODAY' => $lang['New_Today'],             'L_NEW_YESTERDAY' => $lang['New_Yesterday'],             'L_MEMBERS_OVERALL' => $lang['Members_Overall'],             'L_ONLINE_NOW' => $lang['Online_Now'],             'L_GUESTS' => $lang['Guests_P'],          'L_STATS' => $lang['Box_Stats'],             'L_USER_RECORD' => $lang['User_Record'],             'L_TOTAL_POSTS' => $lang['Total_Posts'],          'L_ONLINE_MEMBERS' => $lang['Online_Members_P'],          'RECORD_USERS_P' => sprintf($board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])),          'ONLINE_USERLIST_P' => $online_userlist,  ##-----[ OPEN ]------------------------------------------#page_header.php  ##-----[ FIND ]------------------------------------------#     // Start replacement - Topic in Who is online MOD     if ($plus_config['index_layout'] == 'index_body_plus.tpl')     {         $online_userlist = $online_userlist;     }     else     {     $online_userlist = $lang['Registered_users'].' ' . $online_userlist;     }     // End replacement - Topic in Who is online MOD  ##-----[ REPLACE, WITH ]------------------------------------------#     // Start replacement - Topic in Who is online MOD     /* if ($plus_config['index_layout'] == 'index_body_plus.tpl')     {         $online_userlist = $online_userlist;     }     else     {     $online_userlist = $lang['Registered_users'].' ' . $online_userlist;     } */     $online_userlist = $online_userlist;     // End replacement - Topic in Who is online MOD  ##-----[ OPEN ]------------------------------------------#includes/functions_color_groups.php  ##-----[ FIND ]------------------------------------------#function color_group_colorize_name($user_id, $no_profile = false)  ##-----[ BEFORE, ADD ]------------------------------------------#function color_groups_setup_list_portal(){     global $lang, $template, $db, $plus_config;       $sql = 'SELECT * FROM ' . COLOR_GROUPS_TABLE . '         WHERE hidden = 0         ORDER BY order_num ASC';     if (!$result = $db->sql_query($sql)) message_die(GENERAL_ERROR, $lang['Error_Group_Table'], '', __LINE__, __FILE__, $sql);     $list = '';       {         while ($row = $db->sql_fetchrow($result))         {             $list .= ' [ <span>' . $row['group_name'] . '</span> ] <br>';         }     }         $template->assign_var('COLOR_GROUPS_LIST', $list);}  ##-----[ OPEN ]------------------------------------------#index_body.tpl  ##-----[ FIND ]------------------------------------------#{LOGGED_IN_USER_LIST}</span></td>  ##-----[ REPLACE, WITH ]------------------------------------------#{L_ONLINE_MEMBERS}: {LOGGED_IN_USER_LIST}</span></td>  ##-----[ OPEN ]------------------------------------------#portal_body.tpl  ##-----[ FIND ]------------------------------------------## Add somewhere or after#<table><tr><td><img></td><td><img></td><td><img></td></tr></table><br>  ##-----[ AFTER ADD ]------------------------------------------#<table><tr><th>{L_LIVE_STATS}</th></tr><tr><td><img> <strong><span>{L_MEMBERS}:</span></strong><br><img> <span>{L_LATEST}: {P_NEWEST_USER}<br><img> {L_NEW_TODAY}: <strong>{TODAY_USERS}</strong><br><img> {L_NEW_YESTERDAY}: <strong>{YESTERDAY_USERS}</strong><br><img> {L_MEMBERS_OVERALL}: <strong>{P_TOTAL_USERS}</span></strong><br></td></tr><tr><td><img> <strong><span>{L_ONLINE_NOW}:</span></strong><br><img> <span>{L_GUESTS}: <strong>{GUESTS_ONLINE}</strong><br><img> {L_MEMBERS}: <strong>{REGGED_ONLINE}</strong></span></td></tr><tr><td><img> <strong><span> {L_STATS}:</span></strong><br><span>{L_USER_RECORD}: <strong>{RECORD_USERS_P}</strong><br>{L_TOTAL_POSTS}: <strong>{P_TOTAL_POSTS}</strong><br>{GOOGLE_VISIT_COUNTER}<br></span></td></tr><tr><td><img> <strong><span> {L_ONLINE_MEMBERS}:</span></strong><br><span>{ONLINE_USERLIST_P}</span></td></tr><tr><td><span>{COLOR_GROUPS_LIST}</span></td></tr></table><table><tr><td><img></td><td><img></td><td><img></td></tr></table><br>  ##-----[ FIND ]------------------------------------------## If "Who is Online" box still installed#{LOGGED_IN_USER_LIST}<br><br>  ##-----[ REPLACE, WITH ]------------------------------------------#<b>{L_ONLINE_MEMBERS}</b></b>: {LOGGED_IN_USER_LIST}<br><br>    ##-----[ SAVE/CLOSE ALL FILES ]------------------------------------------## EoM




Here's what I tried
Code: Select all
<php>sql_query($sql) ){     message_die(GENERAL_ERROR, 'Could not get yesterday registered users', '', __LINE__, __FILE__, $sql);}  while ( $row = $db->sql_fetchrow($result) ){     $yesterday_registered_users = $row['total_users'];}  $db->sql_freeresult($result);       $sql = "SELECT count(distinct user_id) as total_users FROM " . USERS_TABLE . "         WHERE user_regdate >= $t_day_from         AND user_id <ANONYMOUS>sql_query($sql) ){     message_die(GENERAL_ERROR, 'Could not get yesterday registered users', '', __LINE__, __FILE__, $sql);}  while ( $row = $db->sql_fetchrow($result) ){     $today_registered_users = $row['total_users'];}  $db->sql_freeresult($result);}$template->assign_vars(array('P_NEWEST_USER' => sprintf($lang['Newest_user_plus'], '<a>', $newest_user, '</a>'),'L_ONLINE_MEMBERS' => $lang['Online_Members_P'],             'TODAY_USERS' => $today_registered_users,         'P_TOTAL_USERS' => $total_users,             'YESTERDAY_USERS' => $yesterday_registered_users,         'GUESTS_ONLINE' => $guests_online,             'REGGED_ONLINE' => $logged_visible_online,         'P_TOTAL_POSTS' => $total_posts,         'L_LIVE_STATS' => $lang['Live_Statistics'],         'L_MEMBERS' => $lang['Top_Member'],         'L_LATEST' => $lang['Latest_Member'],             'L_NEW_TODAY' => $lang['New_Today'],             'L_NEW_YESTERDAY' => $lang['New_Yesterday'],             'L_MEMBERS_OVERALL' => $lang['Members_Overall'],             'L_ONLINE_NOW' => $lang['Online_Now'],             'L_GUESTS' => $lang['Guests_P'],         'L_STATS' => $lang['Box_Stats'],             'L_USER_RECORD' => $lang['User_Record'],             'L_TOTAL_POSTS' => $lang['Total_Posts'],         'L_ONLINE_MEMBERS' => $lang['Online_Members_P'],         'RECORD_USERS_P' => sprintf($board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])),         'ONLINE_USERLIST_P' => $online_userlist)         );         // Start replacement - Topic in Who is online MOD     /* if ($plus_config['index_layout'] == 'index_body_plus.tpl')     {         $online_userlist = $online_userlist;     }     else     {     $online_userlist = $lang['Registered_users'].' ' . $online_userlist;     } */     $online_userlist = $online_userlist;     // End replacement - Topic in Who is online MOD     function color_groups_setup_list_portal(){     global $lang, $template, $db, $plus_config;       $sql = 'SELECT * FROM ' . COLOR_GROUPS_TABLE . '         WHERE hidden = 0         ORDER BY order_num ASC';     if (!$result = $db->sql_query($sql)) message_die(GENERAL_ERROR, $lang['Error_Group_Table'], '', __LINE__, __FILE__, $sql);     $list = '';       {         while ($row = $db->sql_fetchrow($result))         {             $list .= ' [ <span>' . $row['group_name'] . '</span> ] <br>';         }     }         $template->assign_var('COLOR_GROUPS_LIST', $list);}     }    imp_live_stats_func();    ?>



Please help
Last edited by Pogue Moran on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Pogue Moran
Members
Members
 
Posts: 74
Likes: 0 post
Liked in: 0 post
Joined: Sat Jun 24, 2006 4:48 pm
Cash on hand: 0.00

Re: Live Statistics Block

PostAuthor: Teelk » Wed Jun 28, 2006 9:42 am

Hey Pogue Moran,

I like the looks of that block, from what portal did you get it from? I'd like to take a crack at it, but I think I'll need the images etc. as well...
Last edited by Teelk on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Teelk
Dev Team
Dev Team
 
Posts: 1309
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 14, 2006 5:25 pm
Cash on hand: 0.00
Location: Canada

Re: Live Statistics Block

PostAuthor: Dragonsys » Wed Jun 28, 2006 10:02 am

That looks like a port of the phpNuke block...

There is a problem with your code
Where you have the following:
Code: Select all
<php>

It should be
Code: Select all
<?php


that is only one of the errors, in the 1st line. That code you have will not work. Do you have a link to the original site/block code? Maybe we can take a look at it for you.
Last edited by Dragonsys on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Image
User avatar
Dragonsys
Sr Integra Member
Sr Integra Member
 
Posts: 326
Likes: 0 post
Liked in: 0 post
Joined: Mon Apr 10, 2006 6:45 am
Cash on hand: 0.00
Location: Springtown, TX

Re: Live Statistics Block

PostAuthor: Threat009 » Wed Jun 28, 2006 4:48 pm

Interesting.... I posted something very similiar to this a few months back. Ganbei, had told me he would whip something together for me when he had a chance, but has been mia for quite some time <img> I would also still love to have something like this. I think it's a phpnuke mod. Note the image below reads subscribers. I'm wondering how difficult an integration like this would be as well. screenshot taken from [url=http]http://www.forumimages.com/[/url]

[flash=,:1fc4dc5u]http://i63.photobucket.com/albums/h129/Threat009/livestats.gif[/flash:1fc4dc5u]
Last edited by Threat009 on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://i63.photobucket.com/albums/h129/Threat009/donate.gif[/img][/url]
User avatar
Threat009
Sr Integra Member
Sr Integra Member
 
Posts: 220
Likes: 0 post
Liked in: 0 post
Joined: Sun Apr 09, 2006 11:48 pm
Cash on hand: 0.00

PostAuthor: Pogue Moran » Thu Jun 29, 2006 1:52 pm

"Threat009";p="10464" wrote:Interesting.... I posted something very similiar to this a few months back. Ganbei, had told me he would whip something together for me when he had a chance, but has been mia for quite some time <img> I would also still love to have something like this. I think it's a phpnuke mod. Note the image below reads subscribers. I'm wondering how difficult an integration like this would be as well. screenshot taken from [url=http]http://www.forumimages.com/[/url]

[flash=,:3vcihv6e]http://i63.photobucket.com/albums/h129/Threat009/livestats.gif[/flash:3vcihv6e]


The pic I grabbed from another forum so I have no idea where the original posting is.

Good news though I do have some of the script converted from another phpbb helpful user I am attaching the block zip here. Please see what you can do with it. I assume the style has to do with the block I will also attach other block images I have for it which are usable. The login information can just be taken from the userblock code so you could combine the two if you like. Here's a start I know the black one has to do with your template I do like images in the code blocks though. Here is the attachment...

http://www.xbox360gamingworld.com/Live_stats.zip
Last edited by Pogue Moran on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Pogue Moran
Members
Members
 
Posts: 74
Likes: 0 post
Liked in: 0 post
Joined: Sat Jun 24, 2006 4:48 pm
Cash on hand: 0.00

PostAuthor: Pogue Moran » Wed Jul 05, 2006 12:53 pm

"Pogue Moran";p="10527" wrote:
"Threat009";p="10464" wrote:Interesting.... I posted something very similiar to this a few months back. Ganbei, had told me he would whip something together for me when he had a chance, but has been mia for quite some time <img> I would also still love to have something like this. I think it's a phpnuke mod. Note the image below reads subscribers. I'm wondering how difficult an integration like this would be as well. screenshot taken from [url=http]http://www.forumimages.com/[/url]

[flash=,:2pvi1cs0]http://i63.photobucket.com/albums/h129/Threat009/livestats.gif[/flash:2pvi1cs0]


The pic I grabbed from another forum so I have no idea where the original posting is.

Good news though I do have some of the script converted from another phpbb helpful user I am attaching the block zip here. Please see what you can do with it. I assume the style has to do with the block I will also attach other block images I have for it which are usable. The login information can just be taken from the userblock code so you could combine the two if you like. Here's a start I know the black one has to do with your template I do like images in the code blocks though. Here is the attachment...

http://www.xbox360gamingworld.com/Live_stats.zip


Anyone figure out the rest of this? I still can't figure out how to get the rest of my color groups into this block along with part of the democracy mod. If I can figure this out I can remove the old ez portal blocks from the forum and do the forum wide blocks.
Last edited by Pogue Moran on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Pogue Moran
Members
Members
 
Posts: 74
Likes: 0 post
Liked in: 0 post
Joined: Sat Jun 24, 2006 4:48 pm
Cash on hand: 0.00


Return to IM Portal Support Forum

Who is online

Registered users: Bing [Bot], Google [Bot]