vForums Support > Programming & Coding :: Code Requests & Support :: > Member-Only / Staff-Only

Member-Only / Staff-Only - Posted By rosebud (rosebud) on 23rd Jun 08 at 11:36pm
I know if I wanted to I could make the pick which individual forum I want to be for members-only to see. However, most of the forums I have I'd like for guests to see as a way to encourage them to join and engage in the conversation.

Basically this type of code would be where only members can view the thread and guests cannot.

I also thought it might be a good idea to have a "staff-only" as part of this if it's possible.

Re: Member-Only / Staff-Only - Posted By Graham (amusedtodeath) on 24th Jun 08 at 12:04am
Instead of a code, what about just making a board specifically for members-only chat? It could also be used as an incentive for guests to sign up and see what's being discussed {Smile}

Re: Member-Only / Staff-Only - Posted By rosebud (rosebud) on 24th Jun 08 at 2:02am
I know that I have the option to do that as stated in my post, but you're missing my point. I don't want to close off some of the individual boards to guests, but there are certain threads I would like closed off. I am not talking about a general forum. I am talking about a board for bands with different individual sections. I don't want to close off some of the individual band boards. I still want the guests to see those discussion and engage, but I have a plan for my members where I'd like certain threads to be closed off from guests. Think of it as like livejournal where you can make your posts friends-locked, but guests can read your other posts if they aren't. Only this would be members-locked. This would actually help organize my board for what I have in mind. If I were to make another board for what I am trying to do that would actually disorganize my board.

Re: Member-Only / Staff-Only - Posted By Marc (cr0w) on 24th Jun 08 at 11:20am
Ahh, I see what you mean. I'll get this to you after my exam today. {Smile}

*Needs to get ready as the bus arrives in 10 minutes* {Tongue Out}

Re: Member-Only / Staff-Only - Posted By rosebud (rosebud) on 27th Jun 08 at 9:15pm
Thank-you!! ^^

Re: Member-Only / Staff-Only - Posted By Marc (cr0w) on 28th Jun 08 at 1:04am
Sorry, I'd missed this thread; I've got some work to get finished tonight, but if I don't get to it today then I will tomorrow. {Smile}

Re: Member-Only / Staff-Only - Posted By rosebud (rosebud) on 5th Jul 08 at 6:12pm
I am still interested in this code. I just didn't know what to say.

Re: Member-Only / Staff-Only - Posted By Marc (cr0w) on 5th Jul 08 at 6:52pm
I'm assuming you'd like this to work for multiple threads? {Smile}

Re: Member-Only / Staff-Only - Posted By rosebud (rosebud) on 6th Jul 08 at 8:18pm
Yes, please.

Re: Member-Only / Staff-Only - Posted By Marc (cr0w) on 7th Jul 08 at 1:23am
I'll get to this soon. {Smile}

Re: Member-Only / Staff-Only - Posted By rosebud (rosebud) on 9th Jul 08 at 5:39am
Okay. *waiting*

Re: Member-Only / Staff-Only - Posted By Marc (cr0w) on 10th Jul 08 at 6:29am
Board footer:

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*
  4. Restrict Topics For Guests
  5. Coded by Cr0w
  6. Copyright 2008
  7. */
  8.  
  9. var topics = "13|14";
  10.  
  11. // No more edits
  12. if(vf_username == "guest" && location.href.match("topic/") && location.href.match(topics)){
  13. get('forum_table','id').style.display = "none";
  14. var tbl = '<table cellspacing="1" cellpadding="3" class="border" align="center" width="' + vf_width + '">';
  15. tbl += '<tr><td class="title1" style="font-weight: bold">';
  16. tbl += 'An Error Has Occurred';
  17. tbl += '</td></tr>';
  18. tbl += '<tr><td class="window1">';
  19. tbl += 'You must <a href="/action/login/">login</a> or <a href="/action/register/">register</a> to view this topic.';
  20. tbl += '</td></tr></table>';
  21. document.write(tbl);
  22. }
  23. //-->
  24. </script>
 


Seperate topics with a | (Ex: 14|15|17|23|1223 ) {Smile}

Re: Member-Only / Staff-Only - Posted By Michael (wrighty) on 10th Jul 08 at 8:59am
Marc, you left in 'alert(1); alert(2):' ... not sure if it's intentional?

Re: Member-Only / Staff-Only - Posted By Marc (cr0w) on 10th Jul 08 at 10:17am
 
Marc, you left in 'alert(1); alert(2):' ... not sure if it's intentional?


Oops, ran into a weird bug when coding it up; forgot to remove them. {Tongue Out}

Thanks Wrighty. {Smile}

Re: Member-Only / Staff-Only - Posted By rosebud (rosebud) on 18th Jul 08 at 7:22pm
Oh! Thank-you!! =]