vForums Support > Programming & Coding :: Code Requests & Support :: > Guests can't view profiles
Guests can't view profiles - Posted By skindstad (skindstad) on 20th Apr 10 at 3:44pm
Yes, it's me again
Two things, if it's possible. Otherwise the first is most important
I'm in need of a code, so guests can't view members profile. I can't seem to find one around here and since my coding skills are pretty much zero in making new, then I'm totally lost. So any help will be greatly appreaciated
And another thing. I've discovered some problems with some of my boards, where I can't open the threads. It's basically the two top boards I've got on my forum. I think it's when I use colours and font sizes and other fancy stuff in the posts, the thread won't open when I want to enter it. Thought it had something to do with a code I had added, but one of the other members had trouble with it before I had added the code, so I don't know.
Re: Guests can't view profiles - Posted By dog199200 (dog199200) on 20th Apr 10 at 5:47pm
Ok about the second thing, report it to ross in the bug reports board. As for the first, umm let me see what i can do, I might be able to drag something up fairly easy.
Re: Guests can't view profiles - Posted By Michael (wrighty) on 21st Apr 10 at 10:35am
Bugs Boards - Please report the 2nd issue in there... and Ross will be able to resolve it for you fairly quickly. Just sounds like a problem with the UBBC parser.
(Make sure to post direct links to the threads).
If Broken doesn't get part 1 done, I'll do it later
Re: Guests can't view profiles - Posted By dog199200 (dog199200) on 21st Apr 10 at 3:25pm
I wont be able to, something came up this morning and I have to go out of town for a few days.
Re: Guests can't view profiles - Posted By Michael (wrighty) on 23rd Apr 10 at 5:50am
Try this:
Main Header:
<table align="center" width="0" cellspacing="1" cellpadding="3" class="border" id="guest_error" style="display:none;"><tr><td class="title1"><b>An Error has Occurred</b></td></tr><tr><td class="window1"><font size="2">Guests are not allowed to view member profiles. Please <a href = './action/login'>Login</a> or <a href = './action/register'>Register</a>.</font></td></tr></table>
<script type = 'text/javascript'>
if(location.href.match(/\/profile\/(.+?)($|\/)/) && vf_username == 'guest'){
document.write('<div style = "display: none;">');
get('guest_error', 'id').style.display = '';
get('guest_error', 'id).width = get('table', 'tag')[0].width;
}
</script>
Main Footer:
<script type = 'text/javascript'>
if(location.href.match(/\/profile\/(.+?)($|\/)/) && vf_username == 'guest')
document.write('</div>');
</script>
Re: Guests can't view profiles - Posted By Nick (nickb) on 24th Apr 10 at 12:21am
It works, but it's not the width of the forum it's longer than the forum.
Re: Guests can't view profiles - Posted By Michael (wrighty) on 24th Apr 10 at 7:14am
Altered the code.
Re: Guests can't view profiles - Posted By skindstad (skindstad) on 26th Apr 10 at 9:45am
It doesn't work in my end. I can still see the members profiles, when I'm not logged in.
Edit: Nevermind, found the mistake.
There was missing a '
in
get('guest_error', 'id').width = get('table', 'tag')[0].width
And now it works
Thanks a bunch for the help
Re: Guests can't view profiles - Posted By Nick (nickb) on 26th Apr 10 at 4:33pm
Aha, guess I shouldn't edit a forum's code using my iPod. >.< Got completely locked out, but have it fixed now since I got on my computer. and looks good.
I may have some use for this code later on, depending if this forum falls through later.
Re: Guests can't view profiles - Posted By Michael (wrighty) on 26th Apr 10 at 5:10pm
Woops my bad... I added that line in and didn't test it... Glad it works.