User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 402,907 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,090 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 709 | Replies: 0
Reply
Join Date: Aug 2007
Posts: 1
Reputation: NVDuy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
NVDuy NVDuy is offline Offline
Newbie Poster

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

  #1  
Aug 21st, 2007
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.
Last edited by NVDuy : Aug 21st, 2007 at 10:04 pm.
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 3:36 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC