Who's Online page

Forum
Last Post
Threads / Messages

KittHaven

Member
Member
Joined
May 21, 2013
Messages
478
Points
28
Age
25
Location
Devon, UK
Mysidian Dollar
8,292
Hey guys. How would you make it so that the Who's Online page on your site displays names like this:

USERNAME, USERNAME, USERNAME, USERNAME (etc)

So like each name is seperated by only a comma and is on the same line and not underneath each other like in the table (the default one where there is multiple fields filled in). It would only go onto the new line if/when the last name is too big to fit in the space left on the page, in which case it would go underneath the first name.

Basically I have already removed the other fields as I didn't think that my members would like their gender being displayed, or their money (as has been the case on a few sites, people have started begging those with loads of money to donate to them) And the nickname and how many pets people had fields just seemed pointless to me, for my site at least. At the moment it displays names like this:

USERNAME,
USERNAME,
USERNAME,
(etc)

How would I go about fixing it? I have been tinkering with the code but nothing I do/look up seems to help... would it be to do with the CSS, or the view file? Or something? XD

Thanks,

~Parayna
 
Try commenting out $onlineLink->setLineBreak(TRUE); in view/onlineview.php? If you add a comma after the span with the username, it'll be showing up after even the last one, but that can't be helped (and works out well, if you left in the Total Visitors:). In addition to the comma you added after the username, you'll want to add a space, too. ^^

The class .onlinelistt is giving the span holding the username a width of 17%. It's being defined in **root**/css/online.css, so you can safely remove the width line.

It's hard for me to test this since I'm the only member on my site. @_@ But to recap, the entire while statement in onlineview.php should now look like this:

PHP:
while($username = $stmt->fetchColumn()){
		    $user = new Member($username);
		    $user->getprofile();
			$onlineLink = new Link("profile/view/{$username}");
			$onlineLink->setClass("onlinelist");
			$onlineText = "<span class='onlinelistt'>{$user->username}, </span>";					  
			$onlineLink->setText($onlineText);
            $document->add($onlineLink);					 
	    }

And I think you already found the line to modify in lang/lang_online.php to remove the top of the pseudo-table that was going on, so I won't need to go into that. ^^
 
Last edited:

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top