collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 1009
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: Users Online needs updating  (Read 3731 times)

0 Members and 1 Guest are viewing this topic.

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Users Online needs updating
« on: May 08, 2009, 05:56:56 PM »
Would someone be able to add spiders and users in chat to our users online block for us?


« Last Edit: July 17, 2009, 09:20:26 PM by TheListener »
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Users Online needs updating
« Reply #1 on: May 08, 2009, 11:34:42 PM »
Hum... What chat are you referring to?
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Users Online needs updating
« Reply #2 on: May 08, 2009, 11:49:12 PM »
We use Ajax chat which we are still learning ( installed a day ago)

but how do we get the bit which says how many are in chat into the whos online section on the portal?
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Users Online needs updating
« Reply #3 on: May 09, 2009, 12:31:29 AM »
Try this:
Code: [Select]
<?php
//WHO'S ONLINE DASHBOARD
global $txt$user_info$sourcedir$modSettings$context$settings$scripturl$db_prefix;

//users in chat
if (!WIRELESS){
$userIDs chatOnlineUsers();
$context['chat_links'] = array();
if (count($userIDs) > 0){
$query "SELECT mem.ID_MEMBER, mem.realName, mem.ID_GROUP, mg.onlineColor, mg.ID_GROUP
 FROM
{$db_prefix}members AS mem 
 LEFT JOIN 
{$db_prefix}membergroups AS mg ON 
 (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))WHERE "
;
foreach ($userIDs as $ID)
$query .= 'ID_MEMBER = '$ID ' OR ';
//remove the last OR
$query substr($query0strlen($query)-3);

$result db_query($query__FILE____LINE__);
while ($row mysql_fetch_assoc($result))
{
$link '<a href="' $scripturl '?action=profile;u=' $row['ID_MEMBER'];
if($row['onlineColor'] != ""){
$link.= '" style="color: ' $row['onlineColor'];
}
$link.= '">' $row['realName'] . '</a>';
    array_push($context['chat_links'], $link);
}
mysql_free_result($result);
}
//set the flag true for home page
$context['chat_isHome'] = true;
}
//end ajax chat

$query '
SELECT
lo.id_member, lo.log_time, mem.real_name, mem.member_name, mem.show_online,
mg.online_color, mg.id_group
FROM {$db_prefix}log_online AS lo
LEFT JOIN {$db_prefix}members AS mem ON (mem.id_member = lo.id_member)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.id_group = IF(mem.id_group = 0, mem.id_post_group, mem.id_group))'
);

$online['users'] = array();
$online['guests'] = 0;
$online['hidden'] = 0;
$online['buddies'] = 0;
$show_buddies = !empty($user_info['buddies']);

while ($row mysql_fetch_assoc($result))
{
if (!isset($row['real_name']))
$online['guests']++;
elseif (!empty($row['show_online']) || allowedTo('moderate_forum'))
{
if (!empty($row['online_color']))
$link '<a href="' $scripturl '?action=profile;u=' $row['id_member'] . '" style="color: ' $row['online_color'] . ';">' $row['real_name'] . '</a>';
else
$link '<a href="' $scripturl '?action=profile;u=' $row['id_member'] . '">' $row['real_name'] . '</a>';

if ($show_buddies && in_array($row['id_member'], $user_info['buddies']))
{
$online['buddies']++;
$link '<b>' $link '</b>';
}

$online['users'][$row['log_time'] . $row['member_name']] = array(
'id' => $row['id_member'],
'username' => $row['member_name'],
'name' => $row['real_name'],
'group' => $row['id_group'],
'href' => $scripturl '?action=profile;u=' $row['id_member'],
'link' => $link,
'hidden' => empty($row['show_online']),
'is_last' => false,
);
}
else
$online['hidden']++;
}
mysql_free_result($result);

if (!empty($online['users']))
{
krsort($online['users']);
$userlist array_keys($online['users']);
$online['users'][$userlist[count($userlist) - 1]]['is_last'] = true;
}
$online['num_users'] = count($online['users']) + $online['hidden'];
$online['total_users'] = $online['num_users'] + $online['guests'];

echo '
<ul style="padding: 0.2em 0.4em 0.2em 0.4em;">
<li>
'
sp_embed_image('dot'), ' Guests: '$online['guests'],'
</li>
<li>
'
sp_embed_image('dot'), ' Hidden: '$online['hidden'],'
</li>
<li>
'
sp_embed_image('dot'), ' Users: '$online['num_users'],'
</li>
<li>
'
sp_embed_image('dot'), ' In Chat: ' count($context['chat_links']) . '
</li>'
;

if(!empty($online['users'])) {

echo '
<li>
'
sp_embed_image('dot'), ' Users Online:
</li>'
;

foreach ($online['users'] as $user)
echo '
<li style="padding-left: 20px;">
'
sp_embed_image('user'), ' '$user['hidden'] ? '<em>' $user['link'] . '</em>' $user['link'],'
</li>'
;
}

// users in chat
if (isset($context['chat_links'])){
if (count($context['chat_links']) == )
  
echo '<br />' $txt['chat_no_user'];
elseif (count($context['chat_links']) == )
   echo '<br />  1' $txt['chat_aUser']. ':<br />'implode($context['chat_links']);
else
  
echo '<br /> ' count($context['chat_links']). $txt['chat_users']. ':<br />'implode(', '$context['chat_links']);
  }

echo '
</ul>'
;
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Users Online needs updating
« Reply #4 on: May 09, 2009, 12:43:59 AM »
Where should I put it?

Am no good at manual installing unless you mean it to go into a block.
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Users Online needs updating
« Reply #5 on: May 11, 2009, 04:59:59 AM »
I haven't tested it but it should go in a PHP block.
And slowly, you come to realize... It's all as it should be...

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Users Online needs updating
« Reply #6 on: May 11, 2009, 06:53:00 PM »
via ftp or in a block?
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline ???1031

  • ... feel not as a dev at the moment ...
  • Comrade
  • *
  • Posts: 789
  • Gender: Male
  • Overworked <<
  • SMF Version: None
  • SP Version: None
Re: Users Online needs updating
« Reply #7 on: May 12, 2009, 12:47:27 AM »
In a block =)
Again... I'm having time problems...Normal Monday to Friday I'm at office from 6:00-16:00 (On my local time ;P).

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Users Online needs updating
« Reply #8 on: May 12, 2009, 01:01:43 AM »
Nothing happened.  :(
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Users Online needs updating
« Reply #9 on: May 31, 2009, 05:49:45 AM »
Sources/SPortal1-1.php

Code: (Find) [Select]
<li>', sp_embed_image('dot'), ' ', $txt['users'], ': ', $stats['num_users'], '</li>';
Code: (Replace) [Select]
<li>', sp_embed_image('dot'), ' Spiders: ', $stats['num_spiders'], '</li>
<li>', sp_embed_image('dot'), ' ', $txt['users'], ': ', $stats['num_users'], '</li>
<li>', sp_embed_image('dot'), ' Users in chat: ', count(chatOnlineUsers()), '</li>';
And slowly, you come to realize... It's all as it should be...

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Users Online needs updating
« Reply #10 on: July 17, 2009, 09:21:23 PM »
Completey forgot about this topic.

Sorry Folks.
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast