PDA

View Full Version : <br> tag for php


aveon
12-30-2006, 03:07 PM
hey guys i have a php string

$Data .= $glue.$User['username'];
$glue=",";


this shows active users like

this aveon,paul,chris,so ans so

but i want it to be like

that
aveon
paul
chris

i need to put br somewhere but i really dnt kno also is it possible to post usernames with murkup??

also here is the full php code

<?xml version="1.0" encoding="ISO-8859-1"?>

<plugins>
<plugin active="1" product="vbulletin">
<title>online_users</title>
<hookname>global_start</hookname>
<phpcode><![CDATA[$Data = ""; // Page Output Variable
$cache = array();

// Collect Data
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$UsersOnline = $db->query("
SELECT
user.username, (user.options) AS invisible, user.usergroupid,
session.userid,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM " . TABLE_PREFIX . "session AS session
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid)
WHERE session.lastactivity > $datecut and user.userid > 0
" . iif($vbulletin->options['displayloggedin'] == 1, "ORDER BY username ASC") . "
");
$glue="";
while($User = $db->fetch_array($UsersOnline) and strlen($Data)<80){
if(!$cache[$User['userid']]){
$cache[$User['userid']] = $User['userid'];

$Data .= $glue.$User['username'];
$glue=",";
}
}
$usersonline=$Data;
unset($cache);]]></phpcode>
</plugin>
</plugins>

peterska2
12-30-2006, 03:56 PM
$glue="<br />"; I'm sure thats right.

aveon
12-30-2006, 06:31 PM
$glue="<br />"; I'm sure thats right.


thnx peterska it worked but i still didint ge any answer for my other question for the usergroup murkup


$Data .= $glue.$User['username'];
$glue=",";

i tried to use

$glue.$bbuserinfo[musername];


but it didint work what do u guys think i shud use??

Dismounted
12-31-2006, 03:58 AM
$glue . $user['username']
Try that, PHP variables are case-sensitive.