% /** * $RCSfile: index.jsp,v $ * $Revision: 1.6 $ * $Date: 2000/12/18 02:04:56 $ */ %> <%@ page import="java.util.*, com.Yasna.forum.*, com.Yasna.forum.util.*" errorPage="error.jsp" %> <%! ////////////////////////////////// // customize the look of this page // Colors of the table that displays a list of forums // 11-2-04 these are now redefined in the global.css //final static String forumTableBgcolor = "#336633"; //new posts border colour //final static String forumTableFgcolor = "#000000"; //final static String forumTableHeaderFgcolor = "#deecb3"; //colour of new posts row %> <% ////////////////////////////// // Logout a user if requested // check for the parameter "logout=true" if( ParamUtils.getBooleanParameter(request,"logout") ) { // invalidate their authentication token SkinUtils.removeUserAuthorization(request,response); // redirect them to the page from where they came response.sendRedirect(request.getHeader("REFERER")); return; } %> <% //////////////////////// // Authorization check // check for the existence of an authorization token Authorization authToken = SkinUtils.getUserAuthorization(request,response); // if the token was null, they're not authorized. Since this skin will // allow guests to view forums, we'll set a "guest" authentication // token if( authToken == null ) { authToken = AuthorizationFactory.getAnonymousAuthorization(); } %> <% /////////////////////// // page forum variables // do not delete these ForumFactory forumFactory = ForumFactory.getInstance(authToken); User user = forumFactory.getProfileManager().getUser(authToken.getUserID()); long userLastVisitedTime = SkinUtils.getLastVisited(request,response); %> <% ////////////////////// // Header file include // The header file looks for the variable "title" String title = "Yazd Forums: Example Skin"; %> <%@ include file="header.jsp" %> <% //////////////////// // Breadcrumb bar // The breadcrumb file looks for the variable "breadcrumbs" which // represents a navigational path, ie "Home > My Forum > Hello World" String[][] breadcrumbs = { { "Home", "" } }; %> <%@ include file="breadcrumb.jsp" %> <% ///////////// // Toolbar // The toolbar file looks for the following variables. To make a particular // "button" not appear, set a variable to null. boolean showToolbar = true; String viewLink = null; String postLink = null; String replyLink = null; String searchLink = null; // we can show a link to a user account if the user is logged in (handled // in the toolbar jsp) String accountLink = "userAccount.jsp"; %> <%@ include file="toolbar.jsp" %> <% //////////////////////////////////////////////////// // customize which forums are displayed on this page // There are two ways to decide which forums get diplayed to the user // // 1. Display a list of all forums the current user has permission to // view. For instance, if there are 4 forums in the system and // a "guest" has authorization to view 2 of them, then just those // two forums will be displayed. This works the same way for // registered users -- they'll only see the forums they have // access to. // // 2. Specify by name which forums to display. Again, if there are // 4 forums in the system and you specify all forums by name and // the skin user has access to only 2 of them, then only 2 forums // will be displayed // Set the following boolean variable to "false" to display a list // of forums in the system (case 1) or set it to "true" to specify // a list of forums by name (case 2) boolean loadForumsByName = false; // If you choose to load forums by name, specify the names by // adding them to the following list of forum names: ArrayList forumNames = new ArrayList(0); if( loadForumsByName ) { forumNames.add( "First Forum" ); forumNames.add( "Another Forum" ); } %>
Forums
<% ///////////////////// // check for messages // we might come to this page from another page and that page might // pass us a message. If so, grab it and display it (also remove it from persistence) String message = SkinUtils.retrieve(request,response,"message",true); if( message != null ) { %>
<% } %> <% // print out a greeting to a registered user. if( !user.isAnonymous() ) { %> Welcome back, <%= user.getName() %>! (If you're not <%= user.getName() %>, click here.) <% } %>
|
|||||
<% ///////////////////// // page footer %> <%@ include file="footer.jsp" %>