INAN Documentation - boxes.inc

[ Home | Sinaps | Glial | Downloads | Documentation | FAQ | Features | Join ]

SourceForge
Project Page
Powered by
SourceForge Logo

Overview

Content on INAN pages is contained in boxes. The functions for drawing boxes is contained in the file sinaps/include/boxes.inc. I have taken a fairly simple approach to the problem and defined different functions for drawing different types of boxes. Functions are detailed below. Optional arguments are indicated with italics.

Boxes API

void gDrawAdminBox() :

Draws the administrative tools box seen in the left-hand column of the INAN administrative page. The box contains a set of tools for managing the INAN system. It checks cookies for user priviliges to try and prevent people from forging headers to access these functions.

void gDrawCurrentLinkBox() :

Draws the current link box seen in the right-hand column of a INAN page. The box contains the most recent entry in the links database table as a hyperlink if one exists, or a message "Sorry, no link today!" if the table is empty.

void gDrawCurrentNewsBox() :

Draws the current news box seen in the right-hand column of a INAN page. The box contains the most recent entry in the news item database table as a hyperlink if one exists, or a message "Sorry, no news today!" if the table is empty.

void gDrawCurrentPollBox() :

Draws the current poll box seen in the right-hand column of a INAN page. The box contains the most recent entry in the pollss database table as a hyperlink if one exists, or a message "Sorry, no poll today!" if the table is empty.

void gDrawCurrentPresentationBox() :

Draws the current presentation box seen in the right-hand column of a INAN page. The box contains the most recent entry in the presentations database table as a hyperlink if one exists, or a message "Sorry, no presentation today!" if the table is empty.

void gDrawCurrentReviewBox() :

Draws the current review box seen in the right-hand column of a INAN page. The box contains the most recent entry in the reviews database table as a hyperlink if one exists, or a message "Sorry, no review today!" if the table is empty.

void gDrawFeaturedBox( string title, string text, string url, string image ) :

Draws a box containing a featured item that you would like to draw attention to. The box is titled title, and contains an optional graphic, image centered over text text that is a hyperlink to url. If an image is included, it is also hyperlinked to url.

void gDrawLeftHandBox() :

This is a wrapper function that I use to populate the left- hand column on INAN pages. By using this function, I only have to edit it to change the appearance of all of the pages on my site.

void gDrawLogBox() :

This function check to see if a user is logged in. If they are, it draws the logout box (gDrawLogoutBox()) in the left-hand column, and if they are not logged in, it draws the login box (gDrawLoginBox()). This is a convenient function b/c it keeps you form having to perform this check on individual pages.

void gDrawLoginBox() :

Draws the login box seen in the left-hand column of a INAN page. This function actually draws the form for userid and password entry, but login.php processes the form contents.

void gDrawLogoutBox() :

Draws the logout box seen in the left-hand column of a INAN page. This function actually draws logout button if a user is logged in, but logout.php performs the actual logout.

void gDrawNavigationBox() :

Draws the navigation box seen in the left-hand column of a INAN page. At the moment, the only way to change the content of the navigation box is to edit the function directly. While this is not difficult, it is awkward, and I am considering ways to simplify the process of editing the box.

void gDrawPoweredByBox( string title, string image, string url ) :

I kind of like those little "Powered By" buttons that you see on a lot of web sites, so I wrote a function that draws one. The title parameter is used as the name of the box, and the image string is used to determine what image is placed in the box. If a URL is passed in the url string, then the image is also a link, and you can click on it go to that website.

void gDrawPreferencesBox() :

Draws the preferences box seen in the left-hand column of a INAN page. At the moment, the preferences box is not used for anything. I intend to implement a system that will let users customize their interface, but I have not really worked on it yet. This box will eventually allow users to change their settings quickly and painlessly.

void gDrawPollToolBox() :

Draws the box containing user tools for viewing and searching the polls database. When this box is open, it replaces the Current Poll box in the right-hand column.

void gDrawPresentationToolBox() :

Draws the box containing user tools for viewing and searching the presentationss database. When this box is open, it replaces the Current Presentation box in the right-hand column.

void gDrawRecentVisitorsBox() :

Draws the recent visitors box seen in the right-hand column of a INAN page. The box contains the most recent entry in the guestbook database table as a hyperlink if one exists, or a message "Sorry, no visitors signed in today!" if the table is empty.

void gDrawRightHandBox( string menu ) :

This is a wrapper function that I use to populate the right- hand column on INAN pages. By using this function, I only have to edit it to change the appearance of all of the pages on my site. The argument menu is used by the gDrawCurrent() functions. When you select, say, the current poll, the poll is displayed in the main content box, and a Poll Tools box is opened in the right-hand column in place of the Current Poll box. The menu argument is used to open the Tools boxes (there is a '... Tools' box for each 'Current ...' box type). By default, no tool box is opened.

void gDrawSpacerBox( int nrows ) :

Draws a box of nrows "invisible" rows. I originally wrote this to use in formatting the left- and right-hand columns, but did not end up using it for anything after all. If you forget to pass a value for nrows, the function draws one (1) row.

void gDrawUserBox( string title, string contents ) :

I was going to provide some sort of box that users could define with their own content and title. This is that box. At the moment, you have to pass any content you want in the box through the string contents. If you omit the function arguments, you end up with a box titled "User Box" that contains the string "Under construction!". I provide default arguments to prevent PHP from bombing out if you forget to pass something, but you will look pretty silly using the default values.

void gDrawWelcomeBox() : DEPRECATED!

Draws a left-hand-column box containing a short welcome message when a user logs in. I decided that I do not want to use this for anything on my sites, but it is lurking here if you want to use it.

Top

This page last updated Thursday, 16 November 2000.