SimplePortal

Customization => Custom Coding => Topic started by: shade3134 on June 25, 2010, 07:10:03 PM

Title: Who's Online Block adjustment
Post by: shade3134 on June 25, 2010, 07:10:03 PM
How do I make the "Who's Online" block just show the names of users online as a list? And not numbers or categorized?
Title: Re: Who's Online Block adjustment
Post by: Nathaniel on June 25, 2010, 11:11:45 PM
Moved to the Custom Coding board.

Code: ("Find (Sources/PortalBlocks.php)") [Select]
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>';

Code: ("Replace") [Select]
echo '
<ul class="sp_list">';
Title: Re: Who's Online Block adjustment
Post by: shade3134 on June 26, 2010, 07:06:23 PM
Moved to the Custom Coding board.

Code: ("Find (Sources/PortalBlocks.php)") [Select]
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>';

Code: ("Replace") [Select]
echo '
<ul class="sp_list">';
That exact code with those lines aren't listed inside my PortalBlocks.php.

Simple Portal: 2.3.2
Title: Re: Who's Online Block adjustment
Post by: Nathaniel on June 26, 2010, 11:27:45 PM
I have confirmed that that exact code is located within the "Sources/PortalBlocks.php" file for a clean SimplePortal install. Don't try searching for the entire block of code, its likely that your editor will fail at doing that (also make sure that you aren't using notepad, notepad++ is much better alternative), try searching for "<ul class="sp_list">" then check that the code around it matches the 'find' code.
Title: Re: Who's Online Block adjustment
Post by: shade3134 on June 27, 2010, 08:56:29 AM
They aren't listed together like that in mine. And they would have a different $stats like $stats_user_guest or something. When I replaced them, I just took their lines out to see if that worked and I keep getting an error on my site now. Could you upload an attachment of a copy? Because I just overwrote my backup thinking it was my original trying this....
Title: Re: Who's Online Block adjustment
Post by: shade3134 on June 29, 2010, 09:32:39 PM
I am still having trouble with this. I cannot find the exact code you listed in that exact positioning. Even so, the time I remotely thing it may be right, it might have a different tag somewhere in it.
Title: Re: Who's Online Block adjustment
Post by: shade3134 on July 01, 2010, 08:09:39 PM
Bump.
Title: Re: Who's Online Block adjustment
Post by: shade3134 on July 01, 2010, 08:14:04 PM
See, NOT exact:

(http://img6.imageshack.us/img6/8837/helpwf.jpg)

There's not even an echo' above it.
Title: Re: Who's Online Block adjustment
Post by: Nathaniel on July 02, 2010, 09:54:37 PM
There must be an echo above the 'ul' tag, that is not shown in your screenshot.

If your file contains code for showing the spiders online, then you must be using SMF 2 not SMF 1.1.x (or you must have made a custom edit to that file). Apologies for the misunderstanding, although it would be good if you could update the "SMF Version" profile field in your SP.net profile area.

Finding and removing the code below should do what you want (for SMF 2):
Code: ("Remove (Sources/PortalBlocks.php)") [Select]
echo '
<li>', sp_embed_image('dot'), ' ', $txt['hidden'], ': ', $stats['num_users_hidden'], '</li>
<li>', sp_embed_image('dot'), ' ', $txt['users'], ': ', $stats['num_users_online'], '</li>';
Title: Re: Who's Online Block adjustment
Post by: shade3134 on July 03, 2010, 12:55:06 PM
Thanks!! Except the list is in the center at the bottom. How do I move it to the left?
Title: Re: Who's Online Block adjustment
Post by: Nathaniel on July 03, 2010, 10:29:12 PM
Normally the list should be aligned to the left, you could try adding 'text-align: left;' to the style option for the body of that block.
SimplePortal 2.3.8 © 2008-2024, SimplePortal