|
You are here: Home / Documentation / Building a Shout Box in Sitellite |
Building a Shout Box in SitelliteStep 4: Displaying the Shout BoxNow that we've got a way for our users to post messages to our Shout Box, we need a way to see them. For this, we'll create what Sitellite calls a "box". In the "boxes" folder, create a new sub-folder called "display". In the "display" folder, we'll be creating two files, an access.php file, and an index.php file. The access file will be identical to the one we used for the form:sitellite_status = approved The index.php file, which is where our actual PHP code goes, will contain: <?php As you can see, we also make reference in the index.php script to a "shoutbox.Filters" package, which doesn't yet exist. To create this, add a file named "Filters.php" to the "lib" folder, containing: <?php This defines the filter we'll use to format the posted_on date for displaying it. The last part of this step will be to create our "display.spt" template used to display the Shout Box. In a file named "display.spt" in the "html" folder, add the following: <div class="shoutbox" style="height: 250px; overflow: auto"> Now if you visit the following URL, you should be able to see your Shout Box in action: http://www.example.com/index/shoutbox-display-action However, it's not very useful on its own screen like that. The last step will be to add it to one of your sidebars. Page 1: What is a Shout Box? |
|
Copyright © 2008, SIMIAN systems Inc. All rights reserved. Privacy policy Some of the icons on this site were created by the Gnome Project. |