Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Just a simple trick, for hiding unaccessable links
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Raziel
New Member

97 Posts

Posted - 08 October 2002 :  03:07:23  Show Profile
In the header file (inc_header.asp), you can hide some of the navigation-menu items for guests.
That way, only members can see the links they can access, and guests can't see the link for the page they can't access anyway.
And also, you can restrict pages, so that only members have access...

You can simply add the following (in red):

Note: that you have to remove " & _" from the " & vbNewLine & _", right before this line - i.e. the last word in the line before this one
----------
if strDBNTUserName = "" then
Response.Write ""
else

" |" & vbNewline & _
" <a href=""member_stats.asp""" & dWHeaderLinkStatus(4) & " tabindex=""-1""><acronym title=""Se forum statistik"">Forum statistik</acronym></a>" & vbNewline
end if
Notice, that you may have to add another "Response.Write" just before the next line!
----------
(I've made some changes to my links, so there are some differences, but don't mind them).
Now in the example I have the Forum statistics as something I do not want guests to have access to, so the links won't be there.
Of course, the guests can access the page anyway, if they have the address, and for that you can use the following code (found in the members.asp, and working fine).

In the file you want to restrict for MEMBERS ONLY, add the following:
----------
if strDBNTUserName = "" then
Err_Msg = "<li>Du skal være logget på for at se medlemslisten</li>"

Response.Write " <table width=""100%"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" " & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""default.asp"">Alle forum</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpenTopic,"","") & " Medlem-information</font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>Der opstod en fejl!</font></p>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>Du skal være logget på for at få adgang til denne side</font></p>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Tilbage til forum</a></font></p>" & vbNewLine & _
" <br />" & vbNewLine
WriteFooter
Response.End
end if


-- Still, you'll have to change the information it shows, and the message the guest'll get etc...

So, by adding this in any file (at the top, just after the include files), you can make it accessible only for your members...

- Simple eh?...

--- I'm really a newbee with asp programming, so don't mind that it's a simple "MOD" (if you could even call it that)... ---

Regards

Edited by - Raziel on 08 October 2002 16:06:12
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000 Version 3.4.07