by Russ TannerGallery Comment Cruncher

Version 1.00

Prefilling Field Values

topWhat is This?

Let's say you manage a few different galleries. It's pretty inconvenient to have to type in your database credentials every time you want to manage a different gallery.

Prefilling fields solves this problem.

Just create a web page with links pointing to Comment Cruncher. Make each link contain a query string that prefills your database credentials for you.

topHow To Prefill Field Values

Let's say you want to prefill the database credential fields using links from another page. In this case, your links would look something like this:

http://example.com/protected-directory/cc.php
?DBServer=MyServer&DBUsername=MyUsername&DBPassword=MyPassword&DBName=MyName

Let's take a look at the query string (everything on the second line).

There are 4 variables defined in the query string: DBServer, DBUsername, DBPassword, and DBName. The values that you assign to these variables will automatically be displayed in the Server, Username, Password, and Name fields of the main page. That's all there is to it. Now you can create any number of links into Comment Cruncher to prefill your credentials for every Gallery you manage.

Don't forget to replace the host (example.come) and directory (protected-directory) to values that are appropriate for your server.

If you decide to prefill field values, make sure your calling page (the page with the links) is hidden in a password-protected area so you aren't exposing your database credentials to the world.

You can also prefill the table and column prefix fields. For example:

http://example.com/protected-directory/cc.php
?TablePrefix=MyTablePrefix&ColumnPrefix=MyColumnPrefix

In fact, you can prefill any fields on the main page except for the Delete-Lists (Subject, Body, Author, IP). These lists are populated from files that are stored in the same directory at the Comment Cruncher script.

Here is a comprehensive list of form fields you can prefill. These values may be POSTed or GETed.

Database Credentials

  • DBServer - Database Server
  • DBUsername - Database Username
  • DBPassword - Database Password
  • DBName - Database Name

Table & Column Prefixes

  • TablePrefix - Table Prefix
  • ColumnPrefix - Column Prefix

Analytics: Find Comments

  • FindComments_Column - The table column we're searching.
  • FindComments_Value - The value we're searching for.
  • FindComments_Max - The maximum number of returned rows.

FindComments_Column must be set to the actual table column name. The drop-down box will automatically be changed to the related "friendly" value so long as the user has Javascipt enabled.

Valid values are:

  • "subject" - Sets drop-down to "Subject"
  • "comment" - Sets drop-down to "Body"
  • "author" - Sets drop-down to "Author"
  • "host" - Sets drop-down to "IP Address"
  • "id" - Sets drop-down to "Comment ID"

Analytics: Find Duplicates

  • FindDuplicates_Column - The table column we're searching. This must be set to the actual table column name. Valid values are: "subject", "comment", "author", "host", "id"
  • FindDuplicates_Value - The value we're searching for.
  • FindDuplicates_Count - The number of duplicates we're searching for.
  • FindDuplicates_Max - The maximum number of returned rows.

FindDuplicates_Column must be set to the actual table column name. The drop-down box will automatically be changed to the related "friendly" value so long as the user has Javascipt enabled.

Valid values are:

  • "subject" - Sets drop-down to "Subject"
  • "comment" - Sets drop-down to "Body"
  • "author" - Sets drop-down to "Author"
  • "host" - Sets drop-down to "IP Address"

Note that "id" is not a valid column for finding duplicates because the "id" column is unique; It never has duplicates. When searching for comments by ID, use the Find Comments feature.

top