Help Docs

Comments SmartStack Manual


Introduction

The Yabdab Comment (MySQL) SmartStack allows RapidWeaver users to add a simple, self contained text comment system to a Stacks v1.3+ page ( http://www.yourhead.com ). Site visitors can submit comments to a published page, these comments will appear in chronological order. The site owner may, at their discretion, delete any comments via the SmartStack's web based admin feature.

Comment SmartStack requires a web host with PHP5+ and MySQL. (MobileMe hosting is not supported)


Installation

When you purchase the Comment SmartStack, you will receive a Disk Image that should automatically mount on your desktop.

Double click on the installer icon to have the stack automatically placed in your /user/Library/Application Support/RapidWeaver/Stacks folder

Installation is now complete and you can launch RapidWeaver.


Setup

It's important to understand the overall process that the Comment (MySQL) SmartStack uses to store and publish comments. This brief overview walks you through the entire process.

You can add a Comment SmartStack to any Stacks page. It's important to note that the Comment SmartStack must be PUBLISHED to function. You will not see any comments or comment entry information in RapidWeaver Preview mode. It's also important to make sure that the stacks page containing the SmartStack is named with the proper .php extension. Most hosts will not execute php code on a page unless it's named properly. To modify this, go to the Page Inspector and look at the General settings. You'll see the page named something like index.html or page0.html. Remove the .html extension and replace with .php. Index.php or Page0.php, for example, are fine.

To configure the SmartStack, select the stack in Preview mode and select the i icon on the left hand side of the selected stack. This will bring up the Stacks inspector.

The top of the Comment SmartStack inspector offers several options to configure the look of your published comments.

The bottom of the Comment SmartStack inspector is where you'll need to provide the stack some information about your hosting account. The stack needs this information to save comments to your web host. Comments are stored NOT as part of your RapidWeaver project, but rather directly to your hosted MySQL database.

The following information is REQUIRED to configure this stack:

  • MySQL Host: Your host's database server name. May be simply localhost or your host may provide a separate database server such as db.yourhost.com
  • MySQL Username: Your MySQL username for your host
  • MySQL Password: Your MySQL password for your host
  • MySQL DB: The name of the Database you have access to on this database server. You MUST use an existing database name. If you aren't sure if you have an existing database, check with your host
  • Table Prefix: Comment SmartStack (MySQL) will create a table in your existing database to store comments. The table it creates will be labled with the prefix you supply here to differentiate it from other data you may already have in this database. It is especially important to use unique prefixes if you'll be using multiple comment stacks on your page.
  • Edit Username: The username YOU wish to use to delete unwanted comments
  • Edit Password: The password YOU wish to use to delete unwanted comments
  • Date Format: The default value of F j, Y g:i a yields a comment timestamp formatted as: Month Day, Year, Hour:Minute:am/pm . The Date Format utilizes standard php timestamp string formatting. If you'd like to customize, just fill in your desired predefined date constant. Other popular predefined timestamp format values are:

    Examples at: http://php.net/manual/en/function.date.php

Note: MySQL information is available from your web host and will vary. Use the MySQL info provided by your host

You can also provide custom text for:

  • Header: Text which will appear at top of comment stack
  • Add Header: Text above Comment Entry field
  • Submit Button: Text label on the Comment submission button
  • Name Label: Text label displayed next to text field where user can supply a name
  • Comment Label: Text label displayed next to text area fields where comments are entered.

Sort and Display Order

You can use the last two options on the Stack Inspector to establish form placement and sort order.

  • Form on Top: By default, the Comment Submission form will appear at the TOP of the comment stack, above previously submitted comments. If you'd like to move the Comment Submission form to the BOTTOM of the stack, enable this checkbox.
  • Reverse Sort: By default, comments will be sorted in ascending order (oldest to newest). If you'd like to reverse the sort order and display comments in descending order (newest to oldest), enable this checkbox

Note: Do not use any html, javascript or css in your custom text. Use only plain text.
Once you've provided all the required information, you're ready to publish your page.


Script Setup

Once your page containing the Comment SmartStack is published, it's important that you open up your browser and navigate to the page containing the Comment SmartStack. The FIRST time the page is viewed in a browser, it runs a setup script behind the scenes. During setup, the first-run script in the stack utilizes the MySQL database info you provided to connect to the database and create its table (named ydss_prefix_comments in your database)

Be patient, it may take a few seconds the very first time to get everything setup.

If you receive the error "Could not connect to database" or "MySQL error 1142: CREATE command denied to user", this means that one or more components of your MySQL information are not correct in the stack. Please confirm your database servername, username, password and database name with your host.

Once the setup script has completed you'll see a text entry field where comments can be entered and saved.

If you need to REMOVE undesired comments, this can be done from the browser as well. Simply hover your mouse in the bottom right hand corner of your browser window. A hidden EDIT ENTRIES button will appear. Select this button and enter your Edit Username and Edit Password as configured in the Stack inspector. The page will reload in admin mode and comments can be individually deleted.

Note: Keep in mind that comments are stored ONLY on your web host - they are located in the your MySQL database. If you delete your MySQL database or the comments table within the database, you will delete all comments as well.