vForums Support > Programming & Coding :: Code Requests & Support :: > [F] [Marc] Support Please

[F] [Marc] Support Please - Posted By CåñåÐå™ (canada) on 6th Apr 08 at 3:31pm
Marc the code works , but when i go to my profile and i Modify it and i go to click Modify Profile it logs me out and it says "You must be logged in to view user profiles" ??

I took the code out to see if it was the code or a vforums System bug And i did the same things i stayed login, it is the code that's logging me out .

I have the code out right now .

Code:
 
  1. <script>
  2. <!--
  3. /* Stop Guests From Viewing Profiles */
  4.  
  5. var tbl = get('table','tag');
  6. if(location.href.match(/action\/view_profile\//) || location.search.match(/action=view_profile/)){
  7.     for(t=6;t<tbl.length;t++){
  8.         tbl[t].style.display = 'none';
  9.     }
  10.     document.write('<table width="'+vf_width+'" class="border" align="center" cellspacing="1" cellpadding="3"><tr><td align="center" class="title1">An Error Has Occurred</td></tr><tr><td class="window1">You must be logged in to view user profiles.</td></tr></table>');
  11. }
  12. //-->
  13. </script>
  14.  
 

Re: [Marc] Support Please - Posted By Michael (wrighty) on 6th Apr 08 at 3:36pm
try this instead:

<script>
<!--
/* Stop Guests From Viewing Profiles */

var tbl = get('table','tag');
if(location.href.match(/action\/view_profile\//) && vf_username == 'guest'){
for(t=6;t<tbl.length;t++){
tbl[t].style.display = 'none';
}
document.write('<table width="'+vf_width+'" class="border" align="center" cellspacing="1" cellpadding="3"><tr><td align="center" class="title1">An Error Has Occurred</td></tr><tr><td class="window1">You must be logged in to view user profiles.</td></tr></table>');
}
//-->
</script>

Re: [Marc] Support Please - Posted By CåñåÐå™ (canada) on 6th Apr 08 at 3:42pm
That worked Wrighty thank you {Grin} .

Re: [Marc] Support Please - Posted By Michael (wrighty) on 6th Apr 08 at 4:07pm
{Smile}
Glad to help! ^_^

Re: [F] [Marc] Support Please - Posted By Marc (cr0w) on 7th Apr 08 at 2:15am
Oops, I forgot to do a username check! {Tongue Out}

Also, I had non-SEO URL checking in mine which makes it more secure as it can still be accessed using old URL's, Wrighty. {Wink}