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: 1051
  • 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]

Thanks for having an interest with our portal. If you have any requests for features, have a look at the Feature Requests board.

Author Topic: Showing Crowns on SimplePortal (On Block: Who's Online)  (Read 5493 times)

0 Members and 1 Guest are viewing this topic.

Offline Xynasty

  • Semi Newbie
  • *
  • Posts: 11
  • Gender: Male
  • SMF Version: 1.1.11
  • SP Version: 2.3.3
Showing Crowns on SimplePortal (On Block: Who's Online)
« on: October 24, 2010, 04:36:29 PM »
Hello.

I have no idea how to do this. :(
I really need help on how to put the crowns on my "Who's Online" block on SimplePortal (on my forum portal).

So, I installed this Mod: http://custom.simplemachines.org/mods/index.php?mod=1801

And after, I put crowns for each groups.
The crowns are showing everywhere but not on SimplePortal block: Who's Online.
So, I would like someone to help me / teach me how to make it work with SimplePortal so my crowns can show there. I've seen this working on other forums but I just don't know how. Maybe I need another mod to do it.

Here's the picture of my "Who's Online" block:



So yeah, I need the crowns to show besides the usernames. They show perfectly on the forum.

If you can help me via MSN, my MSN is Ineedhelpfrugooscape@Hotmail.com


Thank you.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Showing Crowns on SimplePortal (On Block: Who's Online)
« Reply #1 on: October 25, 2010, 09:18:30 AM »
It sounds like you want a "Crowns for SimplePortal" mod as a companion the the Crowns mod.
 
Crown's install instructions are shown at:
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1801;attach=104894;smf_version=2.0_RC3
 
This tells you the changes the package makes to your SMF files.
 
You can see the changes in the files index.template.php, Memberlist.template.php, and Who.template.php
 
You will need to make similar changes to function sp_whosOnline.
 
 
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Xynasty

  • Semi Newbie
  • *
  • Posts: 11
  • Gender: Male
  • SMF Version: 1.1.11
  • SP Version: 2.3.3
Re: Showing Crowns on SimplePortal (On Block: Who's Online)
« Reply #2 on: October 25, 2010, 09:02:56 PM »
It sounds like you want a "Crowns for SimplePortal" mod as a companion the the Crowns mod.
 
Crown's install instructions are shown at:
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1801;attach=104894;smf_version=2.0_RC3
 
This tells you the changes the package makes to your SMF files.
 
You can see the changes in the files index.template.php, Memberlist.template.php, and Who.template.php
 
You will need to make similar changes to function sp_whosOnline.

Thanks !
But the changes in the 3 files you told me will need to be changed like the "sp_whosOnline" ? Sorry but I don't really know how to get this to work and I really want it. It would be nice if there would be a Crowns for SimplePortal mod like you said. :P

I have looked through the sp_whosOnline method and I have no idea how to make changes.

Thanks for the help !

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Showing Crowns on SimplePortal (On Block: Who's Online)
« Reply #3 on: October 26, 2010, 08:41:09 AM »
To show crowns, function sp_whosOnline needs to be changed.
 
You can see how crowns are shown in the forum's "Who's Online" page (/index.php?action=who) by looking into those other files.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Xynasty

  • Semi Newbie
  • *
  • Posts: 11
  • Gender: Male
  • SMF Version: 1.1.11
  • SP Version: 2.3.3
Re: Showing Crowns on SimplePortal (On Block: Who's Online)
« Reply #4 on: October 27, 2010, 11:15:23 PM »
To show crowns, function sp_whosOnline needs to be changed.
 
You can see how crowns are shown in the forum's "Who's Online" page (/index.php?action=who) by looking into those other files.

Okay thanks.
Is this the first time someone ask for Crowns help ?

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Showing Crowns on SimplePortal (On Block: Who's Online)
« Reply #5 on: October 28, 2010, 07:09:01 AM »
I did a search on crowns -- yours is the only crowns question I found.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Xynasty

  • Semi Newbie
  • *
  • Posts: 11
  • Gender: Male
  • SMF Version: 1.1.11
  • SP Version: 2.3.3
Re: Showing Crowns on SimplePortal (On Block: Who's Online)
« Reply #6 on: October 31, 2010, 02:00:45 PM »
Okay here's my 'sp_whosOnline' function:

Code: [Select]
function sp_whosOnline($parameters, $id, $return_parameters = false)
{
global $db_prefix, $user_info, $context, $scripturl, $modSettings, $txt;

$block_parameters = array(
'online_today' => 'check'
);

if ($return_parameters)
return $block_parameters;

$online_today = !empty($parameters['online_today']);

$stats = ssi_whosOnline('array');

echo '
<ul class="sp_list">
<li>', sp_embed_image('dot'), ' ', $txt['guests'], ': ', $stats['guests'], '</li>
<li>', sp_embed_image('dot'), ' ', $txt['hidden'], ': ', $stats['hidden'], '</li>
<li>', sp_embed_image('dot'), ' ', $txt['users'], ': ', $stats['num_users'], '</li>';

if (!empty($stats['users']))
{
echo '
<li>', sp_embed_image('dot'), ' ', allowedTo('who_view') && !empty($modSettings['who_enabled']) ? '<a href="' . $scripturl . '?action=who">' : '', $txt[158], allowedTo('who_view') && !empty($modSettings['who_enabled']) ? '</a>' : '', ':</li>
</ul>
<div class="sp_online_flow">
<ul class="sp_list">';

foreach ($stats['users'] as $user)
echo '
<li class="sp_list_indent">', sp_embed_image($user['name'] == 'H' ? 'tux' : 'user'), ' ', $user['hidden'] ? '<em>' . $user['link'] . '</em>' : $user['link'], '</li>';

echo '
</ul>
</div>';
}
else
{
echo '
</ul>
<br />
<div class="sp_fullwidth sp_center">', $txt['error_sp_no_online'], '</div>';
}

if ($online_today && !empty($txt['uot_users_online_today']))
{
$date = @getdate(forum_time(false));
$midnight = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']) - ($modSettings['time_offset'] * 3600);

$s = strpos($user_info['time_format'], '%S') === false ? '' : ':%S';
if (strpos($user_info['time_format'], '%H') === false && strpos($user_info['time_format'], '%T') === false)
$time_fmt = '%I:%M' . $s . ' %p';
else
$time_fmt = '%H:%M' . $s;

$result = db_query("
SELECT
mem.ID_MEMBER, mem.lastLogin, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP, mg.groupName
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 mem.lastLogin >= $midnight", __FILE__, __LINE__);

$stats['num_hidden_users_online_today'] = 0;
$stats['users_online_today'] = array();
$stats['list_users_online_today'] = array();

while ($row = mysql_fetch_assoc($result))
{
if (empty($row['showOnline']))
{
$stats['num_hidden_users_online_today'] = $stats['num_hidden_users_online_today'] + 1;
if (!$user_info['is_admin'])
continue;
}

$userday = strftime('%d', forum_time(true));
$loginday = strftime('%d', forum_time(true, $row['lastLogin']));
$yesterday = $userday == $loginday ? '' : $txt['uot_yesterday'];

$lastLogin = $yesterday . strftime($time_fmt, forum_time(true, $row['lastLogin']));
$title = ' title="' . $lastLogin . '"';

if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"' . $title . ' style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"' . $title . '>' . $row['realName'] . '</a>';

$is_buddy = in_array($row['ID_MEMBER'], $user_info['buddies']);
if ($is_buddy)
$link = '<b>' . $link . '</b>';

$stats['users_online_today'][$row['lastLogin'] . $row['memberName']] = array(
'id' => $row['ID_MEMBER'],
'username' => $row['memberName'],
'name' => $row['realName'],
'group' => $row['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => $link,
'is_buddy' => $is_buddy,
'hidden' => empty($row['showOnline']),
);

$stats['list_users_online_today'][$row['lastLogin'] . $row['memberName']] = empty($row['showOnline']) ? '<i>' . $link . '</i>' : $link;
}
mysql_free_result($result);

krsort($stats['users_online_today']);
krsort($stats['list_users_online_today']);

$stats['num_users_online_today'] = count($stats['users_online_today']);
if (!$user_info['is_admin'])
$stats['num_users_online_today'] = $stats['num_users_online_today'] + $stats['num_hidden_users_online_today'];

if (empty($stats['num_users_online_today']))
return;

echo '
<ul class="sp_list">
<li>', sp_embed_image('dot'), ' ', $txt['sp-online_today'], ': ', $stats['num_users_online_today'], '</li>
</ul>
<div class="sp_online_flow">
<ul class="sp_list">';

foreach ($stats['users_online_today'] as $user)
echo '
<li class="sp_list_indent">', sp_embed_image($user['name'] == 'H' ? 'tux' : 'user'), ' ', $user['hidden'] ? '<em>' . $user['link'] . '</em>' : $user['link'], '</li>';

echo '
</ul>
</div>';
}
}

What should I change or add ? I'm not really good and I tried things. I was only getting errors. I don't wanna f**k up my forum.  :|

I found something similar and something that should be able when we install the "Crowns" mod:

Code: [Select]
' . (!empty($member['group_item']['crown']) && empty($modSettings['hide_who_is_online']) ? $member['group_item']['crown'] : '') . $member['name'] . '</a>', '</span>';
This is in Who.template.php.

Can you help me please ?

Thanks !

Edit-> Removed obscene language
« Last Edit: August 04, 2014, 03:43:58 PM by Underdog »

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Showing Crowns on SimplePortal (On Block: Who's Online)
« Reply #7 on: November 01, 2010, 12:43:43 PM »
Trying is a good way to learn. And you can do it without messing up your forum.
Reading is good, too. w3schools.com has a nice totorial, and php.net has the php manual.
 
Here are some ideas to avoid messing up your forum while you try things out.
1) Install a second forum.  It can be at /testforum/index.php, for example
2) Do some of your testing in a custom php block that only shows up on a custom page, so you can quickly figure things out without messing up other pages.
3) You can create copies of functions you want to work on, then rename the copies, so you can easily compare the original to the "in progress" one, since they are both still available.
 
---
1) You need to make sure the CROWN information is collected from the database
2) You need to write out that CROWN information the way you want to see it.
 
* you identified the stuff you want in Who.template.php.  Who.template.php is where the information gathered up in Who.php gets printed out. Who.php gets its CROWN information via a function in Load.php.
* sp_whosOnline basically prints out information by ssi_whosOnline
 
The crown mod adds stuff to Load.php, but leaves SSI.php alone.
If you want a SimplePortal block to call ssi_whosOnline, you'll have to modify ssi_whosOnline to gather the information you want.  You can see what that is by looking at what the mod does to Load.php.
 
 
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?