NVDuy 0 Newbie Poster

I have a problem with Active Users Today on my forum, that is: if a
member's name has 2 words with a space or "&" sign in the middle, e.g.
lucky man or lucky&man, its just appear the first word (lucky) in
section Active Users Today, it doesn't appear the whole name (lucky
man). Code I used is:

<script>
tds = document.getElementsByTagName('td')
if ({ibf.member.id} > 0)
{
for (i=0;i<tds.length;i++)
{ 
if (tds[i].innerHTML.match('Logged in as:'))
{
a = tds[i].getElementsByTagName('a')[0]
if (a.href.match('showuser={ibf.member.id}'))
{ uname = a.innerHTML }
}}
}
else
{
uname = 'guest'
}
board_url = '{ibf.script_url}'.replace('http://','').slice
(0,'{ibf.script_url}'.replace('http://','').indexOf('/'))
document.write('<scri'+'pt 
src=http://slanter.moved.in/forum_cash/forum_onlinetoday/index.php?uid=
{ibf.member.id}&board='+board_url+'&uname='+uname+'></scrip'+'t>')

</script>

<tr>
           <td class='titlemedium2' colspan='2'><script>document.write
(board_visitors_array.length)</script> user(s) active today</td>
        </tr>
        <tr>
          <td width="5%" class='row4'></td>
          <td class='row2' width='95%'>
            <div class='thin'>
<script>
for (i=0;i<board_visitors_array.length;i++)
{
if (i>0) {document.write(', ')}
document.write('<a href="{ibf.script_url}
showuser='+board_visitors_array[i]+'">'+board_visitors_array_name[i]+'</a>')
}
</script>            </div>
          </td>
        </tr>

I think my problem is around the red part above. How to solve it, masters?
Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.