vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [F] Profile Help Please - View Topic
Topic Rating: *****
Printable View
This topic was locked 14th Mar 08 at 7:07pm by Michael
Russell
New Member
*

[Avatar]

Posts: 27
Status: Offline
Gender: Male
Location: UK
Age: 33
Joined:  
Reputation: 7%  


pmwwwtwittervForum
[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:
 
  1. <script type="text/javascript">
  2. if(location.href.match(//view_profile/)){
  3.  
  4. var display_name = get('display_name','id').innerHTML;
  5. var birthday = get('birthday','id').innerHTML;
  6. var age = get('age','id').innerHTML;
  7. var gender = get('gender','id').innerHTML;
  8. var posts = get('posts','id').innerHTML;
  9. var location = get('location','id').innerHTML;
  10. var date_registered = get('date_registered','id').innerHTML;
  11. var email = get('email','id').innerHTML;
  12. var xfire = get('xfire','id').innerHTML;
  13. var msn = get('msn','id').innerHTML;
  14. var aim = get('aim','id').innerHTML;
  15. var googletalk = get('googletalk','id').innerHTML;
  16. var icq = get('icq','id').innerHTML;
  17. var yahoo = get('yahoo','id').innerHTML;
  18. var website = get('website','id').innerHTML;
  19. var signature = get('signature','id').innerHTML;
  20. var last_online = get('last_online','id').innerHTML;
  21. var local_time = get('local_time','id').innerHTML;
  22. var last_ip = get('last_ip','id').innerHTML;
  23. var recent_posts = get('recent_posts','id').innerHTML;
  24. var account_notes = get('account_notes','id').innerHTML;
  25.  
  26. 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>';
  27.  
  28. 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>';
  29.  
  30. }
  31. </script>
  32.  
  33.  
  34.  
 
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
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! {Sad}
Russell
New Member
*

[Avatar]

Posts: 27
Status: Offline
Gender: Male
Location: UK
Age: 33
Joined:  
Reputation: 7%  


pmwwwtwittervForum
Re: Profile Help Please (12th Mar 08 at 5:47pm UTC)
http://russell.vforums.co.uk/

and select all should now be viewable {Wink}
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
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]

Posts: 27
Status: Offline
Gender: Male
Location: UK
Age: 33
Joined:  
Reputation: 7%  


pmwwwtwittervForum
Re: Profile Help Please (12th Mar 08 at 5:57pm UTC)
http://russell.vforums.co.uk/action/view_profile/user/admin/

I dont think anything has changed
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
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! {Smile}
Russell
New Member
*

[Avatar]

Posts: 27
Status: Offline
Gender: Male
Location: UK
Age: 33
Joined:  
Reputation: 7%  


pmwwwtwittervForum
Re: Profile Help Please (13th Mar 08 at 12:42pm UTC)
I have changed it to this, but still nothing {Sad}

Code:
 
  1. <script type="text/javascript">
  2. if(location.href.match(/\/view_profile/)){
  3.  
  4. var birthday = (get('birthday','id'))? get('birthday','id').innerHTML : '';
  5. var display_name = (get('display_name','id'))? get('display_name','id').innerHTML : '';
  6. var age = (get('age','id'))? get('age','id').innerHTML : '';
  7. var gender = (get('gender','id'))? get('gender','id').innerHTML : '';
  8. var posts = (get('posts','id'))? get('posts','id').innerHTML : '';
  9. var location = (get('location','id'))? get('location','id').innerHTML : '';
  10. var date_registered = (get('date_registered','id'))? get('date_registered','id').innerHTML : '';
  11. var email = (get('email','id'))? get('email','id').innerHTML : '';
  12. var xfire = (get('xfire','id'))? get('xfire','id').innerHTML : '';
  13. var msn = (get('msn','id'))? get('msn','id').innerHTML : '';
  14. var aim = (get('aim','id'))? get('aim','id').innerHTML : '';
  15. var googletalk = (get('googletalk','id'))? get('googletalk','id').innerHTML : '';
  16. var icq = (get('icq','id'))? get('icq','id').innerHTML : '';
  17. var yahoo = (get('yahoo','id'))? get('yahoo','id').innerHTML : '';
  18. var website = (get('website','id'))? get('website','id').innerHTML : '';
  19. var signature = (get('signature','id'))? get('signature','id').innerHTML : '';
  20. var last_online = (get('last_online','id'))? get('last_online','id').innerHTML : '';
  21. var local_time = (get('local_time','id'))? get('local_time','id').innerHTML : '';
  22. var last_ip = (get('last_ip','id'))? get('last_ip','id').innerHTML : '';
  23. var recent_posts = (get('recent_posts','id'))? get('recent_posts','id').innerHTML : '';
  24. var account_notes = (get('account_notes','id'))? get('account_notes','id').innerHTML : '';
  25.  
  26. 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>';
  27.  
  28. 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>';
  29.  
  30. }
  31. </script>
 
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
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... {Unsure}
Russell
New Member
*

[Avatar]

Posts: 27
Status: Offline
Gender: Male
Location: UK
Age: 33
Joined:  
Reputation: 7%  


pmwwwtwittervForum
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]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Profile Help Please (14th Mar 08 at 6:30pm UTC)
try adding:

break; before the last }
Russell
New Member
*

[Avatar]

Posts: 27
Status: Offline
Gender: Male
Location: UK
Age: 33
Joined:  
Reputation: 7%  


pmwwwtwittervForum
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]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
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]

Posts: 27
Status: Offline
Gender: Male
Location: UK
Age: 33
Joined:  
Reputation: 7%  


pmwwwtwittervForum
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]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
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! {Smile}
Russell
New Member
*

[Avatar]

Posts: 27
Status: Offline
Gender: Male
Location: UK
Age: 33
Joined:  
Reputation: 7%  


pmwwwtwittervForum
Re: Profile Help Please (14th Mar 08 at 6:49pm UTC)
oh ok thanks
 Printable View

All times are GMT+0 :: The current time is 3:37am
Page generated in 0.6885 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums