vForums Support > Programming & Coding :: Code Requests & Support :: > [F] Display for certain groups

[F] Display for certain groups - Posted By ashkir (ashkir) on 6th Jan 08 at 5:22am
Hiya everyone. I'll make each of my requests different threads. =)

First one. I would like a code to display certian text/stuff to guests. And certain text/stuff to members. Why? I'm using this for a custom menu. ^_^

Thanks.

Re: Display for certain groups - Posted By Marc (cr0w) on 6th Jan 08 at 7:38am
 
Hiya everyone. I'll make each of my requests different threads. =)

First one. I would like a code to display certian text/stuff to guests. And certain text/stuff to members. Why? I'm using this for a custom menu. ^_^

Thanks.


Code:
 
  1. <span id="guestHidden">
  2. GUEST  STUFF HERE
  3. </span>
  4. <span id="memberHidden">
  5. MEMBER STUFF HERE
  6. </span>
  7.  
  8. <script type="text/javascript">
  9. <!--
  10. //Member/Guest Stuff
  11.  
  12. if(vf_username=="guest"){
  13. document.write(document.getElementById("guestHidden").innerHTML);
  14. }
  15. else{
  16. document.write(document.getElementById("memberHidden").innerHTML);
  17. }
  18. //-->
  19. </script>
 


Have fun. {Wink}

Re: Display for certain groups - Posted By ashkir (ashkir) on 6th Jan 08 at 7:59am
Thanks Cr0w!

Re: Display for certain groups - Posted By ashkir (ashkir) on 6th Jan 08 at 11:08am
Okay. I'm using it now. Its displaying both guest and member stuff in FF and IE for me. And it displays them both twice.



Code:
 
  1. <span id="guestHidden">
  2. <font color="#FFFFFF"><b>Direction</b></font><br /><a href="action/register/" style="text-decoration: none"><font color="#FFFFFF">Become</font></a><br /><a href="action/login/" style="text-decoration: none"><font color="#FFFFFF">Login</font></a><hr width="80%" />
  3. </span>
  4. <span id="memberHidden">
  5. <font color="#FFFFFF"><b>The World</b></font><br /><a href="board/Edek/" style="text-decoration: none"><font color="#FFFFFF">Edek</font></a><br /><a href="board/Kiu" style="text-decoration: none"><font color="#FFFFFF">Kiu</font></a><br /><a href="board/Zinr" style="text-decoration: none"><font color="#FFFFFF">Zinr</font></a><br /><a href="board/Kaso/" style="text-decoration: none"><font color="#FFFFFF">Kaso</font></a><br /><a href="board/general/" style="text-decoration: none"><font color="#FFFFFF">OoC</font></a><br /><hr width="80%" /><font color="#FFFFFF"><b>You</b></font><br /><a href="action/view_profile/" style="text-decoration: none"><font color="#FFFFFF">Profile</font></a><br /><a href="/action/members/" style="text-decoration: none"><font color="#FFFFFF">Members</font></a><br /><a href="action/pm/" style="text-decoration: none"><font color="#FFFFFF">Letters</font></a><br /><a href="action/logout/" style="text-decoration: none"><font color="#FFFFFF">Logout</font></a><hr width="80%" />
  6. </span>
  7.  
  8.  
  9.  
  10.  
  11. <script type="text/javascript">
  12. <!--
  13. //Member/Guest Stuff
  14.  
  15. if(vf_username=="guest"){
  16. document.write(document.getElementById("guestHidden").innerHTML);
  17. }
  18. else{
  19. document.write(document.getElementById("memberHidden").innerHTML);
  20. }
  21. //-->
  22. </script>
 



Re: Display for certain groups - Posted By Michael (wrighty) on 6th Jan 08 at 11:19am
Code:
 
  1. <span id="guestHidden" style="display:none">
  2. <font color="#FFFFFF"><b>Direction</b></font><br /><a href="index.cgi?page=apply" style="text-decoration: none"><font color="#FFFFFF">Become</font></a><br /><a href="index.cgi?action=login" style="text-decoration: none"><font color="#FFFFFF">Login</font></a><hr width="80%" />
  3. </span>
  4. <span id="memberHidden" style="display:none">
  5. <font color="#FFFFFF"><b>The World</b></font><br /><a href="index.cgi?board=char" style="text-decoration: none"><font color="#FFFFFF">Characters</font></a><br /><a href="" style="text-decoration: none"><font color="#FFFFFF">Edek</font></a><br /><a href="index.cgi?board=Kiu" style="text-decoration: none"><font color="#FFFFFF">Kiu</font></a><br /><a href="" style="text-decoration: none"><font color="#FFFFFF">Zinr</font></a><br /><a href="" style="text-decoration: none"><font color="#FFFFFF">Kaso</font></a><hr width="80%" /><font color="#FFFFFF"><b>You</b></font><br /><a href="index.cgi?action=modifyprofile" style="text-decoration: none"><font color="#FFFFFF">Profile</font></a><br /><a href="index.cgi?action=members" style="text-decoration: none"><font color="#FFFFFF">Members</font></a><br /><a href="index.cgi?action=pms" style="text-decoration: none"><font color="#FFFFFF">Letters</font></a><br /><a href="index.cgi?action=logout" style="text-decoration: none"><font color="#FFFFFF">Logout</font></a><hr width="80%" />
  6. </span>
  7.  
  8. <script type="text/javascript">
  9. <!--
  10. //Member/Guest Stuff
  11.  
  12. if(vf_username=="guest"){
  13. document.write(document.getElementById("guestHidden").innerHTML);
  14. }
  15. else{
  16. document.write(document.getElementById("memberHidden").innerHTML);
  17. }
  18. //-->
  19. </script>
 



Cr0w didn't hide them! {Smile}

Re: Display for certain groups - Posted By ashkir (ashkir) on 6th Jan 08 at 11:36am
Thanks Wrighty. Testing now. ^_^

Edit: It works! =D My site is nearly complete =D Then almost ready to leave Alpha mode to got o BETA. ^_^

Re: Display for certain groups - Posted By Michael (wrighty) on 6th Jan 08 at 11:51am
Happy it worked! {Smile}