# FILE: database.tmpl # DESCRIPTION: Database Interface screen # Copyright (c) 2002, DiscusWare, LLC, all rights reserved # ------------------------------------------------------------------------------------------- <#define array @menubar(number,name)#> 0 Setup <#if $connect->{status} == 1#> 1 Initialize <#if $connect->{status} == 1#> 2 Import <#if $connect->{status} == 1#> 3 Export 4 Toggle <#if $connect->{status} == 1#> 5 Stats <#/define#> <#define array @tables (name,description,file)#> counters Internal counters data.txt/postindex.txt locks File locking (All file locks) <#if pro#> log Posting log *-log.txt <#if pro#> passwd Moderator database passwd.txt<#if pro#>/md-accts.txt<#endif#> <#if pro#> search Search engine index *-search.txt <#if pro#> users User database users.txt<#if pro#>/us-accts.txt<#endif#> <#if pro && $DCONF->{tree_as_sql}#> tree Tree data tree.txt <#/define#> <#define array @skin_alt (_index, color)#> 1 #c0c0c0 2 #d0d0d0 <#/define#> Database Interface Manager $fs
Database Interface Manager

<#foreach $barid (@menubar)#> <#if $general->{menu} == $barid->{number}#> <#endloop#>
<#else#> <#endif#> $barid->{name}

<#if $stuff->{what} > 0#> <#define array @actions (_index, what)#> 1 saved database parameters 2 imported selected text files into database 3 initialized database tables 4 exported selected database tables into text files 5 toggled database usage <#/define#>
$fs Note: Successfully <#pick what $stuff->{what} from @actions(1,2,3,4,5)#>

<#endif#> <#if $stuff->{toggle} == 1#>

{#if $browser->{ieX}#}

Data Source Saved

{#else#}
$fsData Source Saved
{#endif#}

Your setting of data source has been saved. If you recently synchronized your database and text files by importing or exporting your data, you may continue working. If you receive a "Bad Login" message, you must log in again with the password from your selected data source.


<#exit#> <#endif#> <#if $general->{menu} == 0#> <#if pro && $GLOBAL_OPTIONS{database} == 1#>

WARNING: You are currently using the database to supply your user and moderator data. Changing the setup at this time could cause you to lose your access to the administration program.

<#endif#>
{#if $browser->{ieX}#}

Database Setup

{#else#}
$fsDatabase Setup
{#endif#}

$text

<#if $connect->{status} == 1#>
With the parameters shown here, a connection was successfully initiated to database!
<#else#> <#if $connect->{status} == 2#>

NOTE: Database name must be supplied in order to connect.

<#else#>

Warning! With the parameters shown here, the program could not connect to database! Error was: $connect->{message}

This error is a problem with your database setup and is not a problem with the Discus software itself. Please consult the administration instructions for Database Manager for tips you can try.

<#endif#> <#endif#>

Specify the name of the database and the username and (optional) password that you use to connect to this database. You can also specify a prefix that all tables used by this discussion board will use, and you can specify the full path to the MySQL socket on your server (consult the administration instructions for details).

<#endif#> <#if $general->{menu} >= 1 && $general->{menu} <= 3 && $connect->{status} != 1#>

"<#pick name $general->{menu} from @menubar (2,3,4)#>" Unavailable!

This screen may be used only when a connection has successfully been established to the database. Please use this interface to set up a connection.

<#exit#> <#endif#> <#if $general->{menu} == 1#>
{#if $browser->{ieX}#}

Initialize Database Tables

{#else#}
$fsInitialize Database Tables
{#endif#} <#if $GLOBAL_OPTIONS{database} == 0#>

This section allows you to initialize the database so it can accept input. Be careful, because when you initialize a table, you delete all existing information in that table!

<#else#>

This screen allows you to initialize database tables. Since you are currently using the database to store your data, you cannot initialize the tables at this time.

<#endif#>

<#if $GLOBAL_OPTIONS{database} == 0#> <#foreach $table (@tables)#> <#define $name = $table->{name}#> <#if $GLOBAL_OPTIONS{database} == 0#> <#endif#> <#endloop#>
Table Purpose Status RowsInitialize
\u$table->{name} $table->{description} <#if $exists->{$name} == 1#>Ready<#else#>Not Initialized<#endif#> <#if $count->{$name} == 0#>0<#else#>$count->{$name}<#endif#> {$table->{name}} == 0#} CHECKED{#endif#}>

<#if $GLOBAL_OPTIONS{database} == 0#>

<#endif#>
<#endif#> <#if $general->{menu} == 2#>
{#if $browser->{ieX}#}

Import Data

{#else#}
$fsImport Data
{#endif#} <#if $GLOBAL_OPTIONS{database} == 1#>

You cannot import information from text files into the database at this time. This is because you are currently using the data in the database to power your board. If you want to import information from text files, first toggle the database OFF.


<#else#>

This section allows you to take your existing data from the text files and import it into your database. For safety, you can import data only into a freshly initialized table. You can initialize tables if needed.

<#foreach $table (@tables)#> <#define $name = $table->{name}#> <#if $table->{name} eq "counters"#> <#else#> <#endif#> <#if $table->{name} eq "counters"#> <#else#> <#if $table->{name} eq "locks"#> <#else#> <#endif#> <#endif#> <#endloop#>
Table Corresponding File Status Rows Import
\u$table->{name} $table->{file} <#if $exists->{$name} == 1#> Ready <#else#> Not Initialized <#endif#> <#if $exists->{$name} == 1#> <#if $count->{$name} > 0#> Data Exists <#else#> Ready <#endif#> <#else#> Not Initialized <#endif#> <#if $count->{$name} == 0#>0<#else#>$count->{$name}<#endif#> <#if $exists->{$name} == 0#><#else#><#endif#><#if $count->{$name} > 0 || $exists->{$name} == 0#><#else#><#endif#>

<#endif#>
<#endif#> <#if $general->{menu} == 3#>
{#if $browser->{ieX}#}

Export Data

{#else#}
$fsExport Data
{#endif#} <#if $GLOBAL_OPTIONS{database} == 0#>

You cannot export information from the database into text files at this time. This is because you are currently using the data in the text files to power your board. If you want to export information to text files, first toggle the database ON.


<#else#>

This section allows you to take your existing data from database and place it into plain text files. These text files can then be easily backed up or transferred to another server.

<#foreach $table (@tables)#> <#define $name = $table->{name}#> <#if $table->{name} eq "locks" || $count->{$name} == 0 || $exists->{$name} == 0#> <#else#> <#endif#> <#endloop#>
Table Corresponding File Status Rows Export
\u$table->{name} $table->{file} <#if $exists->{$name} == 1#> <#if $count->{$name} == 0#> No Data <#else#> Ready <#endif#> <#else#> Not Initialized <#endif#> <#if $count->{$name} == 0#>0<#else#>$count->{$name}<#endif#> 

<#endif#>
<#endif#> <#if $general->{menu} == 4#>
{#if $browser->{ieX}#}

Toggle Database On/Off

{#else#}
$fsToggle Database On/Off
{#endif#}

This controls whether the program stores its primary data in text files or in the database. You should turn on the database only after you have imported all data from the text files into the database.

<#endif#> <#if $general->{menu} == 5#>
{#if $browser->{ieX}#}

Database Statistics

{#else#}
$fsDatabase Statistics
{#endif#} <#if $general->{mysql_version} ne ""#>

Your MySQL version is: $general->{mysql_version}.

<#endif#> <#if $#stables >= 1#> <#else#>

Statistics Error: No tables were found in the database. This could occur for one of the following two reasons:

1. Not Initialized: You have not initialized this database. You can do so through the Initialize tab.

2. Statistics Not Supported: In rare cases, your database may be set up so that it does not respond to the SHOW TABLE STATUS command, which is a SQL command used to list the tables and statistics about the tables in your database. Please contact your web host (not DiscusWare) if you are concerned that your database does not support SHOW TABLE STATUS.

Note every aspect of the Discus database functionality, except this statistics screen, will still work properly, even if your database does not support SHOW TABLE STATUS.


<#endif#>
<#endif#>