vForums Support :: Programming & Coding :: Code Requests & Support :: [F] Profile Help Please - View Topic
 |  |
| This topic was locked 14th Mar 08 at 7:07pm by Michael | Russell New Member

![[Avatar]](http://wimg.co.uk/Zfe.jpg) Posts: 27 Status: Offline Gender: Male Location: UK Age: 33 Joined:
pmwwwvForum | [F] Profile Help Please (12th Mar 08 at 5:42pm UTC) Help with a profile re erm structure. | | Well im trying to create a profile but i have come across a problem i think one of my vars are not working which is wrecking the whole code and i cant continue untill i have found the problem can someone please help, thanks.
 Code: - <script type="text/javascript">
- if(location.href.match(//view_profile/)){
-
- var display_name = get('display_name','id').innerHTML;
- var birthday = get('birthday','id').innerHTML;
- var age = get('age','id').innerHTML;
- var gender = get('gender','id').innerHTML;
- var posts = get('posts','id').innerHTML;
- var location = get('location','id').innerHTML;
- var date_registered = get('date_registered','id').innerHTML;
- var email = get('email','id').innerHTML;
- var xfire = get('xfire','id').innerHTML;
- var msn = get('msn','id').innerHTML;
- var aim = get('aim','id').innerHTML;
- var googletalk = get('googletalk','id').innerHTML;
- var icq = get('icq','id').innerHTML;
- var yahoo = get('yahoo','id').innerHTML;
- var website = get('website','id').innerHTML;
- var signature = get('signature','id').innerHTML;
- var last_online = get('last_online','id').innerHTML;
- var local_time = get('local_time','id').innerHTML;
- var last_ip = get('last_ip','id').innerHTML;
- var recent_posts = get('recent_posts','id').innerHTML;
- var account_notes = get('account_notes','id').innerHTML;
-
- var vp = '<table align="center" width="840" border="0" cellspacing="1" cellpadding="3" class="border"><tr><td colspan="3" class="title1"><strong>User Profile </strong></td></tr><tr><td class="title1"><strong>Personal Infomation </strong></td><td class="title1"><strong>Contact Infomation </strong></td><td class="title1"><strong>Recent Visitors</strong></td></tr><tr><td class="window1">'+display_name+'<br>'+birthday+'<br>'+age+'<br>'+gender+'<br>'+location+'<br>'+website+'<br>'+posts+'<br>'+date_registered+'</td><td class="window1">'+email+'<br>'+msn+'<br>'+aim+'<br>'+googletalk+'<br>'+icq+'<br>'+yahoo+'</td><td class="window1">Ill ad recent visitions php file here soon i will.</td></tr><tr><td colspan="2" class="window1">'+signature+'</td><td class="window1">'+last_online+'<br>'+local_time+'<br>'+last_ip+'<br>'+recent_posts+'<br>'+account_notes+'</td></tr></table>';
-
- get('full_profile','id').parentNode.innerHTML = '<table width="840" cellpadding="3" cellspacing="1" class="border" id="full_profile" align="center"><tr><td class="window1" valign="top">'+vp+'</td></tr></table>';
-
- }
- </script>
-
-
-
| |
| Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: Profile Help Please (12th Mar 08 at 5:43pm UTC) | | Do you have a forum where you are testing it as it would help me to see it? (also the 'select all' button is hiding! | |
| Russell New Member

![[Avatar]](http://wimg.co.uk/Zfe.jpg) Posts: 27 Status: Offline Gender: Male Location: UK Age: 33 Joined:
pmwwwvForum | | Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: Profile Help Please (12th Mar 08 at 5:55pm UTC) | | Simple mistake...
try fixing:
if(location.href.match(//view_profile/)){
Turn it to:
if(location.href.match(/\/view_profile/)){ | |
| Russell New Member

![[Avatar]](http://wimg.co.uk/Zfe.jpg) Posts: 27 Status: Offline Gender: Male Location: UK Age: 33 Joined:
pmwwwvForum | | Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: Profile Help Please (12th Mar 08 at 6:02pm UTC) | | one problem is that there are some fields that are either hidden or not visible to all members/staff etc...
So you'd have to do something like:
var birthday = (get('birthday','id'))? get('birthday','id').innerHTML : '';
That'd sort the error, and do that for all of the variables! | |
| Russell New Member

![[Avatar]](http://wimg.co.uk/Zfe.jpg) Posts: 27 Status: Offline Gender: Male Location: UK Age: 33 Joined:
pmwwwvForum | Re: Profile Help Please (13th Mar 08 at 12:42pm UTC) | | I have changed it to this, but still nothing
 Code: - <script type="text/javascript">
- if(location.href.match(/\/view_profile/)){
-
- var birthday = (get('birthday','id'))? get('birthday','id').innerHTML : '';
- var display_name = (get('display_name','id'))? get('display_name','id').innerHTML : '';
- var age = (get('age','id'))? get('age','id').innerHTML : '';
- var gender = (get('gender','id'))? get('gender','id').innerHTML : '';
- var posts = (get('posts','id'))? get('posts','id').innerHTML : '';
- var location = (get('location','id'))? get('location','id').innerHTML : '';
- var date_registered = (get('date_registered','id'))? get('date_registered','id').innerHTML : '';
- var email = (get('email','id'))? get('email','id').innerHTML : '';
- var xfire = (get('xfire','id'))? get('xfire','id').innerHTML : '';
- var msn = (get('msn','id'))? get('msn','id').innerHTML : '';
- var aim = (get('aim','id'))? get('aim','id').innerHTML : '';
- var googletalk = (get('googletalk','id'))? get('googletalk','id').innerHTML : '';
- var icq = (get('icq','id'))? get('icq','id').innerHTML : '';
- var yahoo = (get('yahoo','id'))? get('yahoo','id').innerHTML : '';
- var website = (get('website','id'))? get('website','id').innerHTML : '';
- var signature = (get('signature','id'))? get('signature','id').innerHTML : '';
- var last_online = (get('last_online','id'))? get('last_online','id').innerHTML : '';
- var local_time = (get('local_time','id'))? get('local_time','id').innerHTML : '';
- var last_ip = (get('last_ip','id'))? get('last_ip','id').innerHTML : '';
- var recent_posts = (get('recent_posts','id'))? get('recent_posts','id').innerHTML : '';
- var account_notes = (get('account_notes','id'))? get('account_notes','id').innerHTML : '';
-
- var vp = '<table align="center" width="840" border="0" cellspacing="1" cellpadding="3" class="border"><tr><td colspan="3" class="title1"><strong>User Profile </strong></td></tr><tr><td class="title1"><strong>Personal Infomation </strong></td><td class="title1"><strong>Contact Infomation </strong></td><td class="title1"><strong>Recent Visitors</strong></td></tr><tr><td class="window1">'+display_name+'<br>'+birthday+'<br>'+age+'<br>'+gender+'<br>'+location+'<br>'+website+'<br>'+posts+'<br>'+date_registered+'</td><td class="window1">'+email+'<br>'+msn+'<br>'+aim+'<br>'+googletalk+'<br>'+icq+'<br>'+yahoo+'</td><td class="window1">Ill ad recent visitions php file here soon i will.</td></tr><tr><td colspan="2" class="window1">'+signature+'</td><td class="window1">'+last_online+'<br>'+local_time+'<br>'+last_ip+'<br>'+recent_posts+'<br>'+account_notes+'</td></tr></table>';
-
- get('full_profile','id').parentNode.innerHTML = '<table width="840" cellpadding="3" cellspacing="1" class="border" id="full_profile" align="center"><tr><td class="window1" valign="top">'+vp+'</td></tr></table>';
-
- }
- </script>
| |
| Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: Profile Help Please (13th Mar 08 at 4:40pm UTC) | | Go through and check it, your syntax is all wrong.
get('birthday','i 0;'
for example... | |
| Russell New Member

![[Avatar]](http://wimg.co.uk/Zfe.jpg) Posts: 27 Status: Offline Gender: Male Location: UK Age: 33 Joined:
pmwwwvForum | Re: Profile Help Please (14th Mar 08 at 5:45pm UTC) | | for some reason is changed when i pasted??
but it looks as if its almost working but it keeps changing and the page never completely loads.
Example | |
| Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: Profile Help Please (14th Mar 08 at 6:30pm UTC) | | try adding:
break; before the last } | |
| Russell New Member

![[Avatar]](http://wimg.co.uk/Zfe.jpg) Posts: 27 Status: Offline Gender: Male Location: UK Age: 33 Joined:
pmwwwvForum | Re: Profile Help Please (14th Mar 08 at 6:37pm UTC) | | Well that has stopped the loading problem but now its like the code it not there at all. | |
| Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: Profile Help Please (14th Mar 08 at 6:38pm UTC) | | Sorry
Remove that. And change:
get('full_profile','id').parentNode.innerHTML = vp;
to :
get('full_profile','id').innerHTML = vp; | |
| Russell New Member

![[Avatar]](http://wimg.co.uk/Zfe.jpg) Posts: 27 Status: Offline Gender: Male Location: UK Age: 33 Joined:
pmwwwvForum | Re: Profile Help Please (14th Mar 08 at 6:42pm UTC) | | I think that almost worked but there is still this problem with "Invalid Module" and it adds loads of strange info onto the url. | |
| Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: Profile Help Please (14th Mar 08 at 6:47pm UTC) | | ok, you can't use 'location' as a variable. Rename it to something like: 'person_loc' that should fix it all! | |
| Russell New Member

![[Avatar]](http://wimg.co.uk/Zfe.jpg) Posts: 27 Status: Offline Gender: Male Location: UK Age: 33 Joined:
pmwwwvForum | Re: Profile Help Please (14th Mar 08 at 6:49pm UTC) | | oh ok thanks | |
| |
 |  |
|