our $VERSION = "0.1.0";
my ($options, %options);
my $database_handle;
-my $string_handle;
+my $statement_handle;
my $error;
my $errorext;
my $database_filename;
# Check if the table exists.
- $string_handle = $database_handle->prepare('SHOW TABLES LIKE \'' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($filename) . '_database_info\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SHOW TABLES LIKE \'' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($filename) . '_database_info\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@table_data = $string_handle->fetchrow_array()){
+ while (@table_data = $statement_handle->fetchrow_array()){
$table_exists = 1;
# Disconnect from the server.
- if ($string_handle){
+ if ($statement_handle){
- $string_handle->finish();
+ $statement_handle->finish();
}
# Get the list of databases.
- $string_handle = $database_handle->prepare("SHOW TABLES") or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare("SHOW TABLES") or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
my @final_table_list;
my @database_table_list;
my @table_name;
my $table;
- while (@table_name = $string_handle->fetchrow_array()){
+ while (@table_name = $statement_handle->fetchrow_array()){
push(@database_table_list, decode_utf8($table_name[0]));
my ($databaseinfo, %databaseinfo);
my ($sqldata, @sqldata);
- $string_handle = $database_handle->prepare('SELECT name, description, notes, categories, kiriwrite_version_major, kiriwrite_version_minor, kiriwrite_version_revision FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_info LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT name, description, notes, categories, kiriwrite_version_major, kiriwrite_version_minor, kiriwrite_version_revision FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_info LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- @sqldata = $string_handle->fetchrow_array();
+ @sqldata = $statement_handle->fetchrow_array();
# Process the database information into a hash.
"Revision" => decode_utf8($sqldata[6])
);
- $string_handle->finish();
+ $statement_handle->finish();
return %databaseinfo;
$error = "";
$errorext = "";
- $string_handle = $database_handle->prepare('SELECT name, description, notes, categories, kiriwrite_version_major, kiriwrite_version_minor, kiriwrite_version_revision FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($second_database_filename) . '_database_info LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT name, description, notes, categories, kiriwrite_version_major, kiriwrite_version_minor, kiriwrite_version_revision FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($second_database_filename) . '_database_info LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- @sqldata = $string_handle->fetchrow_array();
+ @sqldata = $statement_handle->fetchrow_array();
# Process the database information into a hash.
"Revision" => decode_utf8($sqldata[6])
);
- $string_handle->finish();
+ $statement_handle->finish();
return %databaseinfo;
# Create the database structure (info and page tables);
- $string_handle = $database_handle->prepare('CREATE TABLE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbfilename) . '_database_info (
+ $statement_handle = $database_handle->prepare('CREATE TABLE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbfilename) . '_database_info (
name varchar(256) primary key,
description varchar(512),
notes mediumtext,
kiriwrite_version_minor int(4),
kiriwrite_version_revision int(4)
) DEFAULT CHARSET=utf8') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
- $string_handle = $database_handle->prepare('CREATE TABLE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbfilename) . '_database_pages (
+ $statement_handle = $database_handle->prepare('CREATE TABLE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbfilename) . '_database_pages (
filename varchar(256) primary key,
pagename varchar(512),
pagedescription varchar(512),
pagesettings int(1),
lastmodified datetime
) DEFAULT CHARSET=utf8') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
# Convert the values into SQL query formatted values and add an entry
# to the kiriwrite_database_info table.
- $string_handle = $database_handle->prepare('INSERT INTO ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbfilename) . '_database_info (name, description, notes, categories, kiriwrite_version_major, kiriwrite_version_minor, kiriwrite_version_revision) VALUES(
+ $statement_handle = $database_handle->prepare('INSERT INTO ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbfilename) . '_database_info (name, description, notes, categories, kiriwrite_version_major, kiriwrite_version_minor, kiriwrite_version_revision) VALUES(
\'' . $class->convert($dbname) . '\',
\'' . $class->convert($dbdescription) . '\',
\'' . $class->convert($dbnotes) . '\',
\'' . $class->convert($dbminorver) . '\',
\'' . $class->convert($dbrevisionver) . '\'
)') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
}
# Rename the tables.
- $string_handle = $database_handle->prepare('RENAME TABLE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_info TO ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbnewfilename) . '_database_info, ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages TO ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbnewfilename) . '_database_pages');
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('RENAME TABLE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_info TO ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbnewfilename) . '_database_info, ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages TO ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbnewfilename) . '_database_pages');
+ $statement_handle->execute();
}
# Get the current database information.
- $string_handle = $database_handle->prepare('SELECT name FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbnewfilename) . '_database_info LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT name FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbnewfilename) . '_database_info LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- my @database_oldinfo = $string_handle->fetchrow_array();
+ my @database_oldinfo = $statement_handle->fetchrow_array();
my $dboldname = decode_utf8($database_oldinfo[0]);
# Update the database information.
- $string_handle = $database_handle->prepare('UPDATE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbnewfilename) . '_database_info SET name = \'' . $class->convert($dbname) . '\',
+ $statement_handle = $database_handle->prepare('UPDATE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($dbnewfilename) . '_database_info SET name = \'' . $class->convert($dbname) . '\',
description = \'' . $class->convert($dbdescription) . '\',
notes = \'' . $class->convert($dbnotes) . '\',
categories = \'' . $class->convert($dbcategories) . '\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
}
# Delete the database tables.
- $string_handle = $database_handle->prepare('DROP TABLE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($databasename) . '_database_info') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('DROP TABLE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($databasename) . '_database_info') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if the _database_pages table exists and delete it if it exists.
- $string_handle = $database_handle->prepare('SHOW TABLES LIKE \'' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($databasename) . '_database_pages\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SHOW TABLES LIKE \'' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($databasename) . '_database_pages\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@table_data = $string_handle->fetchrow_array()){
+ while (@table_data = $statement_handle->fetchrow_array()){
$table_exists = 1;
# the _database_pages table really does exist so delete it.
- $string_handle = $database_handle->prepare('DROP TABLE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($databasename) . '_database_pages') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('DROP TABLE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($databasename) . '_database_pages') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
}
# Check if the template database exists.
- $string_handle = $database_handle->prepare('SHOW TABLES LIKE \'' . $class->convert($options{"TablePrefix"}) . '_templates\'') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SHOW TABLES LIKE \'' . $class->convert($options{"TablePrefix"}) . '_templates\'') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@templatedb_check = $string_handle->fetchrow_array()){
+ while (@templatedb_check = $statement_handle->fetchrow_array()){
$templatedb_exists = 1;
my $class = shift;
- $string_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_templates ORDER BY filename ASC') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_templates ORDER BY filename ASC') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
my @database_template;
my @templates_list;
my $template_filename;
- while (@database_template = $string_handle->fetchrow_array()){
+ while (@database_template = $statement_handle->fetchrow_array()){
# Get certain values from the array.
my $filename = $passedoptions->{"TemplateFilename"};
- $string_handle = $database_handle->prepare('SELECT filename, templatename, templatedescription, templatelayout, datemodified FROM ' . $class->convert($options{"TablePrefix"}) . '_templates WHERE filename = \'' . $class->convert($filename) . '\'') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename, templatename, templatedescription, templatelayout, datemodified FROM ' . $class->convert($options{"TablePrefix"}) . '_templates WHERE filename = \'' . $class->convert($filename) . '\'') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@template_data = $string_handle->fetchrow_array()){
+ while (@template_data = $statement_handle->fetchrow_array()){
# Get certain values from the array.
# Check if the template database exists.
- $string_handle = $database_handle->prepare('SHOW TABLES LIKE \'' . $class->convert($options{"TablePrefix"}) . '_templates\'') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SHOW TABLES LIKE \'' . $class->convert($options{"TablePrefix"}) . '_templates\'') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@templatedb_check = $string_handle->fetchrow_array()){
+ while (@templatedb_check = $statement_handle->fetchrow_array()){
$templatedb_exists = 1;
if (!$templatedb_exists){
- $string_handle = $database_handle->prepare('CREATE TABLE ' . $class->convert($options{"TablePrefix"}) . '_templates (
+ $statement_handle = $database_handle->prepare('CREATE TABLE ' . $class->convert($options{"TablePrefix"}) . '_templates (
filename varchar(256) primary key,
templatename varchar(512),
templatedescription varchar(512),
templatelayout mediumtext,
datemodified datetime
) DEFAULT CHARSET=utf8') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
}
if (!$templatedb_exists){
- $string_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_templates WHERE filename = \'' . $class->convert($template_filename) . '\' LIMIT 1') or ($blankfile = 1);
+ $statement_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_templates WHERE filename = \'' . $class->convert($template_filename) . '\' LIMIT 1') or ($blankfile = 1);
if ($blankfile eq 0){
- $string_handle->execute();
+ $statement_handle->execute();
- while (@page_exists = $string_handle->fetchrow_array()){
+ while (@page_exists = $statement_handle->fetchrow_array()){
$error = "TemplatePageExists";
return;
}
- $string_handle = $database_handle->prepare('INSERT INTO ' . $class->convert($options{"TablePrefix"}) . '_templates (filename, templatename, templatedescription, templatelayout, datemodified) VALUES(
+ $statement_handle = $database_handle->prepare('INSERT INTO ' . $class->convert($options{"TablePrefix"}) . '_templates (filename, templatename, templatedescription, templatelayout, datemodified) VALUES(
\'' . $class->convert($template_filename) . '\',
\'' . $class->convert($template_name) . '\',
\'' . $class->convert($template_description) . '\',
\'' . $class->convert($template_layout) . '\',
\'' . $class->convert($template_date) . '\'
)') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
}
# Check if the template exists.
- $string_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_templates WHERE filename = \'' . $class->convert($template_filename) . '\' LIMIT 1') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_templates WHERE filename = \'' . $class->convert($template_filename) . '\' LIMIT 1') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@template_info = $string_handle->fetchrow_array()){
+ while (@template_info = $statement_handle->fetchrow_array()){
$template_found = 1;
# Update the template information.
- $string_handle = $database_handle->prepare('UPDATE ' . $class->convert($options{"TablePrefix"}) . '_templates SET
+ $statement_handle = $database_handle->prepare('UPDATE ' . $class->convert($options{"TablePrefix"}) . '_templates SET
filename = \'' . $class->convert($new_template_filename) . '\',
templatename = \'' . $class->convert($new_template_name) . '\',
templatedescription = \'' . $class->convert($new_template_description) . '\',
datemodified = \'' . $class->convert($templatenewdate) . '\'
WHERE filename = \'' . $class->convert($template_filename) . '\'
') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
}
# Check if the template exists.
- $string_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_templates WHERE filename = \'' . $class->convert($template_filename) . '\' LIMIT 1') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_templates WHERE filename = \'' . $class->convert($template_filename) . '\' LIMIT 1') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@pagedata = $string_handle->fetchrow_array()){
+ while (@pagedata = $statement_handle->fetchrow_array()){
$template_count++;
# Delete the template from the template database.
- $string_handle = $database_handle->prepare('DELETE FROM ' . $class->convert($options{"TablePrefix"}) . '_templates WHERE filename = \'' . $class->convert($template_filename) . '\'') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('DELETE FROM ' . $class->convert($options{"TablePrefix"}) . '_templates WHERE filename = \'' . $class->convert($template_filename) . '\'') or ( $error = "TemplateDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
}
my $class = shift;
- $string_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
my @database_pagefilenames;
my @database_pagefilenames_final;
# Process the collected pages.
- while (@database_pagefilenames = $string_handle->fetchrow_array){
+ while (@database_pagefilenames = $statement_handle->fetchrow_array){
# Add each page to the list of pages in the database.
if ($page_reduced eq 1){
- $string_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, lastmodified FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, lastmodified FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if the page exists in the database.
- while (@data_page = $string_handle->fetchrow_array()){
+ while (@data_page = $statement_handle->fetchrow_array()){
# Get the values from the array.
} else {
- $string_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if the page exists in the database.
- while (@data_page = $string_handle->fetchrow_array()){
+ while (@data_page = $statement_handle->fetchrow_array()){
# Get the values from the array.
# Check to see if the filename given already exists
# in the page database.
- $string_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if a page with the filename given really does
# exist.
- while (@database_page = $string_handle->fetchrow_array()){
+ while (@database_page = $statement_handle->fetchrow_array()){
# A page does exist so increment the count to 1.
# Add the page to the selected database.
- $string_handle = $database_handle->prepare('INSERT INTO ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages (filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified) VALUES (
+ $statement_handle = $database_handle->prepare('INSERT INTO ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages (filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified) VALUES (
\'' . $class->convert($page_filename) . '\',
\'' . $class->convert($page_name) . '\',
\'' . $class->convert($page_description) . '\',
\'' . $class->convert($page_settings) . '\',
\'' . $class->convert($page_date) . '\'
)') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
}
# Check if the page exists before deleting it.
- $string_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@page_info = $string_handle->fetchrow_array()){
+ while (@page_info = $statement_handle->fetchrow_array()){
$page_found = 1;
# Delete the page.
- $string_handle = $database_handle->prepare('DELETE FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('DELETE FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
}
# Check if the page with the filename given exists.
- $string_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if the page really does exist.
- while (@page_info = $string_handle->fetchrow_array()){
+ while (@page_info = $statement_handle->fetchrow_array()){
# The page information is found.
if ($page_filename ne $page_newfilename){
- $string_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_newfilename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_newfilename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if a page really is using the new filename.
- while (@page_info = $string_handle->fetchrow_array()){
+ while (@page_info = $statement_handle->fetchrow_array()){
# The page information is found.
# Edit the selected page.
- $string_handle = $database_handle->prepare('UPDATE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages SET filename = \'' . $class->convert($page_newfilename) . '\', pagename = \'' . $class->convert($page_newname) . '\', pagedescription = \'' . $class->convert($page_newdescription) . '\', pagesection = \'' . $class->convert($page_newsection) . '\', pagetemplate = \'' . $class->convert($page_newtemplate) . '\', pagedata = \'' . $class->convert($page_newcontent) . '\', pagedata = \'' . $class->convert($page_newcontent) . '\', pagesettings = \'' . $class->convert($page_newsettings) . '\', lastmodified = \'' . $page_date . '\' WHERE filename = \'' . $class->convert($page_filename) . '\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('UPDATE ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages SET filename = \'' . $class->convert($page_newfilename) . '\', pagename = \'' . $class->convert($page_newname) . '\', pagedescription = \'' . $class->convert($page_newdescription) . '\', pagesection = \'' . $class->convert($page_newsection) . '\', pagetemplate = \'' . $class->convert($page_newtemplate) . '\', pagedata = \'' . $class->convert($page_newcontent) . '\', pagedata = \'' . $class->convert($page_newcontent) . '\', pagesettings = \'' . $class->convert($page_newsettings) . '\', lastmodified = \'' . $page_date . '\' WHERE filename = \'' . $class->convert($page_filename) . '\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
}
# Check if the page with the filename given exists.
- $string_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "OldDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "OldDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if the page really does exist.
- while (@page_info = $string_handle->fetchrow_array()){
+ while (@page_info = $statement_handle->fetchrow_array()){
# Get the values from the array.
$page_found = 0;
@page_info = ();
- $string_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($second_database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "NewDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($second_database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "NewDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@page_info = $string_handle->fetchrow_array()){
+ while (@page_info = $statement_handle->fetchrow_array()){
$page_found = 1;
# Add the page to the new database.
- $string_handle = $database_handle->prepare('INSERT INTO ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($second_database_filename) . '_database_pages (filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified) VALUES (
+ $statement_handle = $database_handle->prepare('INSERT INTO ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($second_database_filename) . '_database_pages (filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified) VALUES (
\'' . $class->convert($database_page{"PageFilename"}) . '\',
\'' . $class->convert($database_page{"PageName"}) . '\',
\'' . $class->convert($database_page{"PageDescription"}) . '\',
\'' . $class->convert($database_page{"PageSettings"}) . '\',
\'' . $class->convert($database_page{"PageLastModified"}) . '\'
)') or ( $error = "NewDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
# Delete the page from the old database.
- $string_handle = $database_handle->prepare('DELETE FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($database_page{"PageFilename"}) . '\'') or ( $error = "OldDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('DELETE FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($database_page{"PageFilename"}) . '\'') or ( $error = "OldDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
}
# Check if the page with the filename given exists.
- $string_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "OldDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "OldDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if the page really does exist.
- while (@page_info = $string_handle->fetchrow_array()){
+ while (@page_info = $statement_handle->fetchrow_array()){
# Get the values from the array.
$page_found = 0;
@page_info = ();
- $string_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($second_database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "NewDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($second_database_filename) . '_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "NewDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@page_info = $string_handle->fetchrow_array()){
+ while (@page_info = $statement_handle->fetchrow_array()){
$page_found = 1;
# Add the page to the new database.
- $string_handle = $database_handle->prepare('INSERT INTO ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($second_database_filename) . '_database_pages (filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified) VALUES (
+ $statement_handle = $database_handle->prepare('INSERT INTO ' . $class->convert($options{"TablePrefix"}) . '_' . $class->convert($second_database_filename) . '_database_pages (filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified) VALUES (
\'' . $class->convert($database_page{"PageFilename"}) . '\',
\'' . $class->convert($database_page{"PageName"}) . '\',
\'' . $class->convert($database_page{"PageDescription"}) . '\',
\'' . $class->convert($database_page{"PageSettings"}) . '\',
\'' . $class->convert($database_page{"PageLastModified"}) . '\'
)') or ( $error = "NewDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
}
# Check if the template database exists.
- $string_handle = $database_handle->prepare('SHOW TABLES LIKE \'' . $class->convert($options{"TablePrefix"}) . '_filters\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SHOW TABLES LIKE \'' . $class->convert($options{"TablePrefix"}) . '_filters\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@filterdb_check = $string_handle->fetchrow_array()){
+ while (@filterdb_check = $statement_handle->fetchrow_array()){
$filterdb_exists = 1;
# Get the list of filters available.
- $string_handle = $database_handle->prepare('SELECT id, priority FROM ' . $class->convert($options{"TablePrefix"}) . '_filters ORDER BY priority ASC') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT id, priority FROM ' . $class->convert($options{"TablePrefix"}) . '_filters ORDER BY priority ASC') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@filter_data = $string_handle->fetchrow_array()){
+ while (@filter_data = $statement_handle->fetchrow_array()){
# Add the filter to the list of available filters.
my $filter_id = $passedoptions->{"FilterID"};
- $string_handle = $database_handle->prepare('SELECT id, priority, findsetting, replacesetting, notes FROM ' . $class->convert($options{"TablePrefix"}) . '_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT id, priority, findsetting, replacesetting, notes FROM ' . $class->convert($options{"TablePrefix"}) . '_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Get the filter information.
- while (@filter_data = $string_handle->fetchrow_array()){
+ while (@filter_data = $statement_handle->fetchrow_array()){
$filter_info{"FilterID"} = decode_utf8($filter_data[0]);
$filter_info{"FilterPriority"} = decode_utf8($filter_data[1]);
# Check if the template database exists.
- $string_handle = $database_handle->prepare('SHOW TABLES LIKE \'' . $class->convert($options{"TablePrefix"}) . '_filters\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SHOW TABLES LIKE \'' . $class->convert($options{"TablePrefix"}) . '_filters\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@filterdb_check = $string_handle->fetchrow_array()){
+ while (@filterdb_check = $statement_handle->fetchrow_array()){
$filterdb_exists = 1;
# Create the filter database table.
- $string_handle = $database_handle->prepare('CREATE TABLE ' . $class->convert($options{"TablePrefix"}) . '_filters (
+ $statement_handle = $database_handle->prepare('CREATE TABLE ' . $class->convert($options{"TablePrefix"}) . '_filters (
id int(7) primary key,
priority int(5),
findsetting varchar(1024),
replacesetting varchar(1024),
notes text
) DEFAULT CHARSET=utf8') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
}
# Find the lowest filter identification number available.
- $string_handle = $database_handle->prepare('SELECT id FROM ' . $class->convert($options{"TablePrefix"}) . '_filters ORDER BY id ASC') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT id FROM ' . $class->convert($options{"TablePrefix"}) . '_filters ORDER BY id ASC') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@database_filters = $string_handle->fetchrow_array()){
+ while (@database_filters = $statement_handle->fetchrow_array()){
$filter_id = decode_utf8($database_filters[0]);
$new_id = $filter_id + 1;
- $string_handle = $database_handle->prepare('SELECT id FROM ' . $class->convert($options{"TablePrefix"}) . '_filters WHERE id = \'' . $class->convert($new_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT id FROM ' . $class->convert($options{"TablePrefix"}) . '_filters WHERE id = \'' . $class->convert($new_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Get the filter identification number.
- while (@filterid_check = $string_handle->fetchrow_array()){
+ while (@filterid_check = $statement_handle->fetchrow_array()){
$filter_found = 1;
# Add the filter to the filter database.
- $string_handle = $database_handle->prepare('INSERT INTO ' . $class->convert($options{"TablePrefix"}) . '_filters (id, priority, findsetting, replacesetting, notes) VALUES (
+ $statement_handle = $database_handle->prepare('INSERT INTO ' . $class->convert($options{"TablePrefix"}) . '_filters (id, priority, findsetting, replacesetting, notes) VALUES (
\'' . $class->convert($new_id) . '\',
\'' . $class->convert($filter_priority) . '\',
\'' . $class->convert($filter_find) . '\',
\'' . $class->convert($filter_replace) .'\',
\'' . $class->convert($filter_notes) . '\'
)') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
}
# Check if the filter exists before editing it.
- $string_handle = $database_handle->prepare('SELECT id FROM ' . $class->convert($options{"TablePrefix"}) . '_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT id FROM ' . $class->convert($options{"TablePrefix"}) . '_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if the filter exists.
- while (@filter_data = $string_handle->fetchrow_array()){
+ while (@filter_data = $statement_handle->fetchrow_array()){
$filter_exists = 1;
# Edit the selected filter.
- $string_handle = $database_handle->prepare('UPDATE ' . $class->convert($options{"TablePrefix"}) . '_filters SET
+ $statement_handle = $database_handle->prepare('UPDATE ' . $class->convert($options{"TablePrefix"}) . '_filters SET
findsetting = \'' . $class->convert($filter_newfind) . '\',
replacesetting = \'' . $class->convert($filter_newreplace) . '\',
priority = \'' . $class->convert($filter_newpriority) . '\',
notes = \'' . $class->convert($filter_newnotes) . '\'
WHERE id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
return;
# Check if the filter exists before deleting.
- $string_handle = $database_handle->prepare('SELECT id FROM ' . $class->convert($options{"TablePrefix"}) . '_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT id FROM ' . $class->convert($options{"TablePrefix"}) . '_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@filter_data = $string_handle->fetchrow_array()){
+ while (@filter_data = $statement_handle->fetchrow_array()){
$filter_exists = 1;
# Delete the filter from the filter database.
- $string_handle = $database_handle->prepare('DELETE FROM ' . $class->convert($options{"TablePrefix"}) . '_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('DELETE FROM ' . $class->convert($options{"TablePrefix"}) . '_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
}
our $VERSION = "0.1.0";
my ($options, %options);
my $database_handle;
-my $string_handle;
+my $statement_handle;
my $error = "";
my $errorext = "";
my $database_filename;
my $second_database_filename;
my $second_database_handle;
-my $second_string_handle;
+my $second_statement_handle;
my $templatedb_loaded = 0;
my $templatedb_exists = 1;
-my $template_string_handle;
+my $template_statement_handle;
my $template_database_handle;
my $filterdb_loaded = 0;
my $filterdb_exists = 1;
-my $filterdb_string_handle;
+my $filterdb_statement_handle;
my $filterdb_database_handle;
$error = "";
$errorext = "";
- $string_handle = $database_handle->prepare('SELECT name, description, notes, categories, kiriwrite_version_major, kiriwrite_version_minor, kiriwrite_version_revision FROM kiriwrite_database_info LIMIT 1') or (
+ $statement_handle = $database_handle->prepare('SELECT name, description, notes, categories, kiriwrite_version_major, kiriwrite_version_minor, kiriwrite_version_revision FROM kiriwrite_database_info LIMIT 1') or (
$error = "DatabaseError", $errorext = $database_handle->errstr, return
);
- $string_handle->execute();
+ $statement_handle->execute();
- @sqldata = $string_handle->fetchrow_array();
+ @sqldata = $statement_handle->fetchrow_array();
# Process the database information into a hash.
"Revision" => $sqldata[6]
);
- $string_handle->finish();
- undef $string_handle;
+ $statement_handle->finish();
+ undef $statement_handle;
return %databaseinfo;
$error = "";
$errorext = "";
- $second_string_handle = $second_database_handle->prepare('SELECT name, description, notes, categories, kiriwrite_version_major, kiriwrite_version_minor, kiriwrite_version_revision FROM kiriwrite_database_info LIMIT 1') or (
+ $second_statement_handle = $second_database_handle->prepare('SELECT name, description, notes, categories, kiriwrite_version_major, kiriwrite_version_minor, kiriwrite_version_revision FROM kiriwrite_database_info LIMIT 1') or (
$error = "DatabaseError", $errorext = $second_database_handle->errstr, return
);
- $second_string_handle->execute();
+ $second_statement_handle->execute();
- @sqldata = $second_string_handle->fetchrow_array();
+ @sqldata = $second_statement_handle->fetchrow_array();
# Process the database information into a hash.
"Revision" => $sqldata[6]
);
- $second_string_handle->finish();
- undef $second_string_handle;
+ $second_statement_handle->finish();
+ undef $second_statement_handle;
return %databaseinfo;
$database_handle = DBI->connect("dbi:SQLite:dbname=" . $options{"Directory"} . '/' . $dbfilename . ".db.sqlite");
$database_handle->{unicode} = 1;
- $string_handle = $database_handle->prepare('CREATE TABLE kiriwrite_database_info(
+ $statement_handle = $database_handle->prepare('CREATE TABLE kiriwrite_database_info(
name varchar(256) primary key,
description varchar(512),
notes text,
kiriwrite_version_minor int(4),
kiriwrite_version_revision int(4)
)') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
- $string_handle = $database_handle->prepare('CREATE TABLE kiriwrite_database_pages(
+ $statement_handle = $database_handle->prepare('CREATE TABLE kiriwrite_database_pages(
filename varchar(256) primary key,
pagename varchar(512),
pagedescription varchar(512),
pagesettings int(1),
lastmodified datetime
)') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
# Convert the values into SQL query formatted values and add an entry
# to the kiriwrite_database_info table.
- $string_handle = $database_handle->prepare('INSERT INTO kiriwrite_database_info (name, description, notes, categories, kiriwrite_version_major, kiriwrite_version_minor, kiriwrite_version_revision) VALUES(
+ $statement_handle = $database_handle->prepare('INSERT INTO kiriwrite_database_info (name, description, notes, categories, kiriwrite_version_major, kiriwrite_version_minor, kiriwrite_version_revision) VALUES(
\'' . $class->convert($dbname) . '\',
\'' . $class->convert($dbdescription) . '\',
\'' . $class->convert($dbnotes) . '\',
\'' . $class->convert($dbminorver) . '\',
\'' . $class->convert($dbrevisionver) . '\'
)') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
}
# Get the current database information.
- $string_handle = $database_handle->prepare('SELECT name FROM kiriwrite_database_info LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT name FROM kiriwrite_database_info LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- my @database_oldinfo = $string_handle->fetchrow_array();
+ my @database_oldinfo = $statement_handle->fetchrow_array();
my $dboldname = $database_oldinfo[0];
# Update the database information.
- $string_handle = $database_handle->prepare('UPDATE kiriwrite_database_info SET name = \'' . $class->convert($dbname) . '\',
+ $statement_handle = $database_handle->prepare('UPDATE kiriwrite_database_info SET name = \'' . $class->convert($dbname) . '\',
description = \'' . $class->convert($dbdescription) . '\',
notes = \'' . $class->convert($dbnotes) . '\',
categories = \'' . $class->convert($dbcategories) . '\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
- undef $string_handle;
+ undef $statement_handle;
return;
}
my $class = shift;
- $string_handle = $database_handle->prepare('SELECT filename FROM kiriwrite_database_pages') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM kiriwrite_database_pages') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
my @database_pagefilenames;
my @database_pagefilenames_final;
# Process the collected pages.
- while (@database_pagefilenames = $string_handle->fetchrow_array){
+ while (@database_pagefilenames = $statement_handle->fetchrow_array){
# Add each page to the list of pages in the database.
}
- undef $string_handle;
+ undef $statement_handle;
return @database_pagefilenames_final;
}
if ($page_reduced eq 1){
- $string_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, lastmodified FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, lastmodified FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
# Check if the page exists in the database.
- while (@data_page = $string_handle->fetchrow_array()){
+ while (@data_page = $statement_handle->fetchrow_array()){
# Get the values from the array.
} else {
- $string_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
# Check if the page exists in the database.
- while (@data_page = $string_handle->fetchrow_array()){
+ while (@data_page = $statement_handle->fetchrow_array()){
# Get the values from the array.
}
- undef $string_handle;
+ undef $statement_handle;
return %database_page;
}
# Check to see if the filename given already exists
# in the page database.
- $string_handle = $database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if a page with the filename given really does
# exist.
- while (@database_page = $string_handle->fetchrow_array()){
+ while (@database_page = $statement_handle->fetchrow_array()){
# A page does exist so increment the count to 1.
# Add the page to the selected database.
- $string_handle = $database_handle->prepare('INSERT INTO kiriwrite_database_pages (filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified) VALUES (
+ $statement_handle = $database_handle->prepare('INSERT INTO kiriwrite_database_pages (filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified) VALUES (
\'' . $class->convert($page_filename) . '\',
\'' . $class->convert($page_name) . '\',
\'' . $class->convert($page_description) . '\',
\'' . $class->convert($page_settings) . '\',
\'' . $class->convert($page_date) . '\'
)') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle->execute();
- undef $string_handle;
+ undef $statement_handle;
}
# Check if the page exists before deleting it.
- $string_handle = $database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
- while (@page_info = $string_handle->fetchrow_array()){
+ while (@page_info = $statement_handle->fetchrow_array()){
$page_found = 1;
# Delete the page.
- $string_handle = $database_handle->prepare('DELETE FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('DELETE FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
}
# Check if the page with the filename given exists.
- $string_handle = $database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if the page really does exist.
- while (@page_info = $string_handle->fetchrow_array()){
+ while (@page_info = $statement_handle->fetchrow_array()){
# The page information is found.
if ($page_filename ne $page_newfilename){
- $string_handle = $database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_newfilename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_newfilename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if a page really is using the new filename.
- while (@page_info = $string_handle->fetchrow_array()){
+ while (@page_info = $statement_handle->fetchrow_array()){
# The page information is found.
# Edit the selected page.
- $string_handle = $database_handle->prepare('UPDATE kiriwrite_database_pages SET filename = \'' . $class->convert($page_newfilename) . '\', pagename = \'' . $class->convert($page_newname) . '\', pagedescription = \'' . $class->convert($page_newdescription) . '\', pagesection = \'' . $class->convert($page_newsection) . '\', pagetemplate = \'' . $class->convert($page_newtemplate) . '\', pagedata = \'' . $class->convert($page_newcontent) . '\', pagedata = \'' . $class->convert($page_newcontent) . '\', pagesettings = \'' . $class->convert($page_newsettings) . '\', lastmodified = \'' . $page_date . '\' WHERE filename = \'' . $class->convert($page_filename) . '\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('UPDATE kiriwrite_database_pages SET filename = \'' . $class->convert($page_newfilename) . '\', pagename = \'' . $class->convert($page_newname) . '\', pagedescription = \'' . $class->convert($page_newdescription) . '\', pagesection = \'' . $class->convert($page_newsection) . '\', pagetemplate = \'' . $class->convert($page_newtemplate) . '\', pagedata = \'' . $class->convert($page_newcontent) . '\', pagedata = \'' . $class->convert($page_newcontent) . '\', pagesettings = \'' . $class->convert($page_newsettings) . '\', lastmodified = \'' . $page_date . '\' WHERE filename = \'' . $class->convert($page_filename) . '\'') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
}
# Check if the page with the filename given exists.
- $string_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "OldDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "OldDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if the page really does exist.
- while (@page_info = $string_handle->fetchrow_array()){
+ while (@page_info = $statement_handle->fetchrow_array()){
# Get the values from the array.
$page_found = 0;
@page_info = ();
- $second_string_handle = $second_database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "NewDatabaseError", $errorext = $second_database_handle->errstr, return );
- $second_string_handle->execute();
+ $second_statement_handle = $second_database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "NewDatabaseError", $errorext = $second_database_handle->errstr, return );
+ $second_statement_handle->execute();
- while (@page_info = $second_string_handle->fetchrow_array()){
+ while (@page_info = $second_statement_handle->fetchrow_array()){
$page_found = 1;
# Add the page to the new database.
- $second_string_handle = $second_database_handle->prepare('INSERT INTO kiriwrite_database_pages (filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified) VALUES (
+ $second_statement_handle = $second_database_handle->prepare('INSERT INTO kiriwrite_database_pages (filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified) VALUES (
\'' . $class->convert($database_page{"PageFilename"}) . '\',
\'' . $class->convert($database_page{"PageName"}) . '\',
\'' . $class->convert($database_page{"PageDescription"}) . '\',
\'' . $class->convert($database_page{"PageSettings"}) . '\',
\'' . $class->convert($database_page{"PageLastModified"}) . '\'
)') or ( $error = "NewDatabaseError", $errorext = $second_database_handle->errstr, return );
- $second_string_handle->execute();
+ $second_statement_handle->execute();
# Delete the page from the old database.
- $string_handle = $database_handle->prepare('DELETE FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($database_page{"PageFilename"}) . '\'') or ( $error = "OldDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('DELETE FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($database_page{"PageFilename"}) . '\'') or ( $error = "OldDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
}
# Check if the page with the filename given exists.
- $string_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "OldDatabaseError", $errorext = $database_handle->errstr, return );
- $string_handle->execute();
+ $statement_handle = $database_handle->prepare('SELECT filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "OldDatabaseError", $errorext = $database_handle->errstr, return );
+ $statement_handle->execute();
# Check if the page really does exist.
- while (@page_info = $string_handle->fetchrow_array()){
+ while (@page_info = $statement_handle->fetchrow_array()){
# Get the values from the array.
$page_found = 0;
@page_info = ();
- $second_string_handle = $second_database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "NewDatabaseError", $errorext = $second_database_handle->errstr, return );
- $second_string_handle->execute();
+ $second_statement_handle = $second_database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_filename) . '\' LIMIT 1') or ( $error = "NewDatabaseError", $errorext = $second_database_handle->errstr, return );
+ $second_statement_handle->execute();
- while (@page_info = $second_string_handle->fetchrow_array()){
+ while (@page_info = $second_statement_handle->fetchrow_array()){
$page_found = 1;
# Add the page to the new database.
- $second_string_handle = $second_database_handle->prepare('INSERT INTO kiriwrite_database_pages (filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified) VALUES (
+ $second_statement_handle = $second_database_handle->prepare('INSERT INTO kiriwrite_database_pages (filename, pagename, pagedescription, pagesection, pagetemplate, pagedata, pagesettings, lastmodified) VALUES (
\'' . $class->convert($database_page{"PageFilename"}) . '\',
\'' . $class->convert($database_page{"PageName"}) . '\',
\'' . $class->convert($database_page{"PageDescription"}) . '\',
\'' . $class->convert($database_page{"PageSettings"}) . '\',
\'' . $class->convert($database_page{"PageLastModified"}) . '\'
)') or ( $error = "NewDatabaseError", $errorext = $second_database_handle->errstr, return );
- $second_string_handle->execute();
+ $second_statement_handle->execute();
}
if ($filterdb_loaded eq 1){
- undef $filterdb_string_handle;
+ undef $filterdb_statement_handle;
$filterdb_database_handle->disconnect();
}
# Get the list of filters available.
- $filterdb_string_handle = $filterdb_database_handle->prepare('SELECT id FROM kiriwrite_filters ORDER BY priority ASC') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
- $filterdb_string_handle->execute();
+ $filterdb_statement_handle = $filterdb_database_handle->prepare('SELECT id FROM kiriwrite_filters ORDER BY priority ASC') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
+ $filterdb_statement_handle->execute();
- while (@filter_data = $filterdb_string_handle->fetchrow_array()){
+ while (@filter_data = $filterdb_statement_handle->fetchrow_array()){
# Add the filter to the list of available filters.
}
- undef $filterdb_string_handle;
+ undef $filterdb_statement_handle;
return @filter_list;
}
my $filter_id = $passedoptions->{"FilterID"};
- $filterdb_string_handle = $filterdb_database_handle->prepare('SELECT id, priority, findsetting, replacesetting, notes FROM kiriwrite_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
- $filterdb_string_handle->execute();
+ $filterdb_statement_handle = $filterdb_database_handle->prepare('SELECT id, priority, findsetting, replacesetting, notes FROM kiriwrite_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
+ $filterdb_statement_handle->execute();
# Get the filter information.
- while (@filter_data = $filterdb_string_handle->fetchrow_array()){
+ while (@filter_data = $filterdb_statement_handle->fetchrow_array()){
$filter_info{"FilterID"} = $filter_data[0];
$filter_info{"FilterPriority"} = $filter_data[1];
# Return the filter information.
- undef $filterdb_string_handle;
+ undef $filterdb_statement_handle;
return %filter_info;
}
# Check if the filter table exists.
- $filterdb_string_handle = $filterdb_database_handle->prepare('SELECT id FROM kiriwrite_filters ORDER BY id ASC') or ( $nofiltertable = 1 );
+ $filterdb_statement_handle = $filterdb_database_handle->prepare('SELECT id FROM kiriwrite_filters ORDER BY id ASC') or ( $nofiltertable = 1 );
# Check if there is really no filter table.
# Create the filter database table.
- $filterdb_string_handle = $filterdb_database_handle->prepare('CREATE TABLE kiriwrite_filters (
+ $filterdb_statement_handle = $filterdb_database_handle->prepare('CREATE TABLE kiriwrite_filters (
id int(7) primary key,
priority int(5),
findsetting varchar(1024),
replacesetting varchar(1024),
notes text
)') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
- $filterdb_string_handle->execute();
+ $filterdb_statement_handle->execute();
}
# Find the lowest filter identification number available.
- $filterdb_string_handle = $filterdb_database_handle->prepare('SELECT id FROM kiriwrite_filters ORDER BY id ASC') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
- $filterdb_string_handle->execute();
+ $filterdb_statement_handle = $filterdb_database_handle->prepare('SELECT id FROM kiriwrite_filters ORDER BY id ASC') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
+ $filterdb_statement_handle->execute();
- while (@database_filters = $filterdb_string_handle->fetchrow_array()){
+ while (@database_filters = $filterdb_statement_handle->fetchrow_array()){
$filter_id = $database_filters[0];
$new_id = $filter_id + 1;
- $filterdb_string_handle = $filterdb_database_handle->prepare('SELECT id FROM kiriwrite_filters WHERE id = \'' . $class->convert($new_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
- $filterdb_string_handle->execute();
+ $filterdb_statement_handle = $filterdb_database_handle->prepare('SELECT id FROM kiriwrite_filters WHERE id = \'' . $class->convert($new_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
+ $filterdb_statement_handle->execute();
# Get the filter identification number.
- while (@filterid_check = $filterdb_string_handle->fetchrow_array()){
+ while (@filterid_check = $filterdb_statement_handle->fetchrow_array()){
$filter_found = 1;
# Add the filter to the filter database.
- $filterdb_string_handle = $filterdb_database_handle->prepare('INSERT INTO kiriwrite_filters (id, priority, findsetting, replacesetting, notes) VALUES (
+ $filterdb_statement_handle = $filterdb_database_handle->prepare('INSERT INTO kiriwrite_filters (id, priority, findsetting, replacesetting, notes) VALUES (
\'' . $class->convert($new_id) . '\',
\'' . $class->convert($filter_priority) . '\',
\'' . $class->convert($filter_find) . '\',
\'' . $class->convert($filter_replace) .'\',
\'' . $class->convert($filter_notes) . '\'
)') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
- $filterdb_string_handle->execute();
+ $filterdb_statement_handle->execute();
}
# Check if the filter exists before editing it.
- $filterdb_string_handle = $filterdb_database_handle->prepare('SELECT id FROM kiriwrite_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
- $filterdb_string_handle->execute();
+ $filterdb_statement_handle = $filterdb_database_handle->prepare('SELECT id FROM kiriwrite_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
+ $filterdb_statement_handle->execute();
# Check if the filter exists.
- while (@filter_data = $filterdb_string_handle->fetchrow_array()){
+ while (@filter_data = $filterdb_statement_handle->fetchrow_array()){
$filter_exists = 1;
# Edit the selected filter.
- $filterdb_string_handle = $filterdb_database_handle->prepare('UPDATE kiriwrite_filters SET
+ $filterdb_statement_handle = $filterdb_database_handle->prepare('UPDATE kiriwrite_filters SET
findsetting = \'' . $class->convert($filter_newfind) . '\',
replacesetting = \'' . $class->convert($filter_newreplace) . '\',
priority = \'' . $class->convert($filter_newpriority) . '\',
notes = \'' . $class->convert($filter_newnotes) . '\'
WHERE id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
- $filterdb_string_handle->execute();
+ $filterdb_statement_handle->execute();
- undef $filterdb_string_handle;
+ undef $filterdb_statement_handle;
return;
}
# Check if the filter exists before deleting.
- $filterdb_string_handle = $filterdb_database_handle->prepare('SELECT id FROM kiriwrite_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
- $filterdb_string_handle->execute();
+ $filterdb_statement_handle = $filterdb_database_handle->prepare('SELECT id FROM kiriwrite_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
+ $filterdb_statement_handle->execute();
- while (@filter_data = $filterdb_string_handle->fetchrow_array()){
+ while (@filter_data = $filterdb_statement_handle->fetchrow_array()){
$filter_exists = 1;
# Delete the filter from the filter database.
- $filterdb_string_handle = $filterdb_database_handle->prepare('DELETE FROM kiriwrite_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
- $filterdb_string_handle->execute();
+ $filterdb_statement_handle = $filterdb_database_handle->prepare('DELETE FROM kiriwrite_filters where id = \'' . $class->convert($filter_id) . '\'') or ( $error = "FilterDatabaseError", $errorext = $filterdb_database_handle->errstr, return );
+ $filterdb_statement_handle->execute();
- undef $filterdb_string_handle;
+ undef $filterdb_statement_handle;
}
if ($templatedb_loaded eq 1){
- undef $template_string_handle;
+ undef $template_statement_handle;
$template_database_handle->disconnect();
}
$error = "";
$errorext = "";
- $template_string_handle = $template_database_handle->prepare('SELECT filename FROM kiriwrite_templates ORDER BY filename ASC') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
- $template_string_handle->execute();
+ $template_statement_handle = $template_database_handle->prepare('SELECT filename FROM kiriwrite_templates ORDER BY filename ASC') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
+ $template_statement_handle->execute();
my @database_template;
my @templates_list;
my $template_filename;
- while (@database_template = $template_string_handle->fetchrow_array()){
+ while (@database_template = $template_statement_handle->fetchrow_array()){
# Get certain values from the array.
my $filename = $passedoptions->{"TemplateFilename"};
- $template_string_handle = $template_database_handle->prepare('SELECT filename, templatename, templatedescription, templatelayout, datemodified FROM kiriwrite_templates WHERE filename = \'' . $class->convert($filename) . '\'') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
- $template_string_handle->execute();
+ $template_statement_handle = $template_database_handle->prepare('SELECT filename, templatename, templatedescription, templatelayout, datemodified FROM kiriwrite_templates WHERE filename = \'' . $class->convert($filename) . '\'') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
+ $template_statement_handle->execute();
- while (@template_data = $template_string_handle->fetchrow_array()){
+ while (@template_data = $template_statement_handle->fetchrow_array()){
# Get certain values from the array.
if ($templatedb_exists eq 0){
- $template_string_handle = $template_database_handle->prepare('SELECT filename FROM kiriwrite_templates WHERE filename = \'' . $class->convert($template_filename) . '\' LIMIT 1') or ($blankfile = 1);
+ $template_statement_handle = $template_database_handle->prepare('SELECT filename FROM kiriwrite_templates WHERE filename = \'' . $class->convert($template_filename) . '\' LIMIT 1') or ($blankfile = 1);
if ($blankfile eq 0){
- $template_string_handle->execute();
+ $template_statement_handle->execute();
- while (@page_exists = $template_string_handle->fetchrow_array()){
+ while (@page_exists = $template_statement_handle->fetchrow_array()){
$error = "TemplatePageExists";
return;
# Check to see if a template can be added.
- $template_string_handle = $template_database_handle->prepare('INSERT INTO kiriwrite_templates (filename, templatename, templatedescription, templatelayout, datemodified) VALUES(
+ $template_statement_handle = $template_database_handle->prepare('INSERT INTO kiriwrite_templates (filename, templatename, templatedescription, templatelayout, datemodified) VALUES(
\'' . $class->convert($template_filename) . '\',
\'' . $class->convert($template_name) . '\',
\'' . $class->convert($template_description) . '\',
if (!$notemplatetable){
- $template_string_handle->execute();
+ $template_statement_handle->execute();
}
}
- $template_string_handle = $template_database_handle->prepare('create table kiriwrite_templates(
+ $template_statement_handle = $template_database_handle->prepare('create table kiriwrite_templates(
filename varchar(256) primary key,
templatename varchar(512),
templatedescription varchar(512),
templatelayout text,
datemodified datetime
);') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
- $template_string_handle->execute();
+ $template_statement_handle->execute();
- $template_string_handle = $template_database_handle->prepare('INSERT INTO kiriwrite_templates (filename, templatename, templatedescription, templatelayout, datemodified) VALUES(
+ $template_statement_handle = $template_database_handle->prepare('INSERT INTO kiriwrite_templates (filename, templatename, templatedescription, templatelayout, datemodified) VALUES(
\'' . $class->convert($template_filename) . '\',
\'' . $class->convert($template_name) . '\',
\'' . $class->convert($template_description) . '\',
\'' . $class->convert($template_layout) . '\',
\'' . $class->convert($template_date) . '\'
)') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
- $template_string_handle->execute();
+ $template_statement_handle->execute();
}
# Check if the template exists.
- $template_string_handle = $template_database_handle->prepare('SELECT filename FROM kiriwrite_templates WHERE filename = \'' . $class->convert($template_filename) . '\' LIMIT 1') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
- $template_string_handle->execute();
+ $template_statement_handle = $template_database_handle->prepare('SELECT filename FROM kiriwrite_templates WHERE filename = \'' . $class->convert($template_filename) . '\' LIMIT 1') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
+ $template_statement_handle->execute();
- while (@pagedata = $template_string_handle->fetchrow_array()){
+ while (@pagedata = $template_statement_handle->fetchrow_array()){
$template_count++;
# Delete the template from the template database.
- $template_string_handle = $template_database_handle->prepare('DELETE FROM kiriwrite_templates WHERE filename = \'' . $class->convert($template_filename) . '\'') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
- $template_string_handle->execute();
+ $template_statement_handle = $template_database_handle->prepare('DELETE FROM kiriwrite_templates WHERE filename = \'' . $class->convert($template_filename) . '\'') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
+ $template_statement_handle->execute();
}
# Check if the template exists.
- $template_string_handle = $template_database_handle->prepare('SELECT filename FROM kiriwrite_templates WHERE filename = \'' . $class->convert($template_filename) . '\' LIMIT 1') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
- $template_string_handle->execute();
+ $template_statement_handle = $template_database_handle->prepare('SELECT filename FROM kiriwrite_templates WHERE filename = \'' . $class->convert($template_filename) . '\' LIMIT 1') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
+ $template_statement_handle->execute();
- while (@template_info = $template_string_handle->fetchrow_array()){
+ while (@template_info = $template_statement_handle->fetchrow_array()){
$template_found = 1;
# Update the template information.
- $template_string_handle = $template_database_handle->prepare('UPDATE kiriwrite_templates SET
+ $template_statement_handle = $template_database_handle->prepare('UPDATE kiriwrite_templates SET
filename = \'' . $class->convert($new_template_filename) . '\',
templatename = \'' . $class->convert($new_template_name) . '\',
templatedescription = \'' . $class->convert($new_template_description) . '\',
datemodified = \'' . $class->convert($templatenewdate) . '\'
WHERE filename = \'' . $class->convert($template_filename) . '\'
') or ( $error = "TemplateDatabaseError", $errorext = $template_database_handle->errstr, return );
- $template_string_handle->execute();
+ $template_statement_handle->execute();
}
# This function is not needed in this database module.
- undef $string_handle;
+ undef $statement_handle;
}