faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

Entry

How to get full usernames in Active User Today scripts on forums

Apr 9th, 2008 20:36
ha mo, NV Duy,


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'><{F_ACTIVE}></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>
How to solve it, masters?
http://www.businessian.com
http://www.healthinhealth.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com