X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=cgi-files%2FModules%2FDatabase%2FMySQL5.pm;h=80bc32322b6c7695e7e8ab3b7d13404c262a7a89;hb=f4287e42a5e96cffe70d84a3c659d5be3eab46d5;hp=c398c6dbf055c0c926b08058fb3fc444d4406c74;hpb=1553f195cb1ca50f1409afec52b29002e03b4511;p=kiriwrite%2F.git diff --git a/cgi-files/Modules/Database/MySQL5.pm b/cgi-files/Modules/Database/MySQL5.pm index c398c6d..80bc323 100644 --- a/cgi-files/Modules/Database/MySQL5.pm +++ b/cgi-files/Modules/Database/MySQL5.pm @@ -1498,6 +1498,8 @@ sub getpageinfo{ # options Specifies the following options in any order. # # # # PageFilename Specifies the page filename to get the page information from. # +# Reduced Specifies if the reduced version of the page information should # +# be retrieved. # ################################################################################# $error = ""; @@ -1514,42 +1516,76 @@ sub getpageinfo{ # Get the page from the database. my $page_filename = $passedoptions->{"PageFilename"}; + my $page_reduced = $passedoptions->{"Reduced"}; - $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(); + if ($page_reduced eq 1){ - # Check if the page exists in the database. + $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(); - while (@data_page = $string_handle->fetchrow_array()){ + # Check if the page exists in the database. - # Get the values from the array. + while (@data_page = $string_handle->fetchrow_array()){ - $pagefilename = decode_utf8($data_page[0]); - $pagename = decode_utf8($data_page[1]); - $pagedescription = decode_utf8($data_page[2]); - $pagesection = decode_utf8($data_page[3]); - $pagetemplate = decode_utf8($data_page[4]); - $pagedata = decode_utf8($data_page[5]); - $pagesettings = decode_utf8($data_page[6]); - $pagelastmodified = decode_utf8($data_page[7]); + # Get the values from the array. - # Put the values into the page hash. + $pagefilename = decode_utf8($data_page[0]); + $pagename = decode_utf8($data_page[1]); + $pagedescription = decode_utf8($data_page[2]); + $pagelastmodified = decode_utf8($data_page[3]); - %database_page = ( - "PageFilename" => $pagefilename, - "PageName" => $pagename, - "PageDescription" => $pagedescription, - "PageSection" => $pagesection, - "PageTemplate" => $pagetemplate, - "PageContent" => $pagedata, - "PageSettings" => $pagesettings, - "PageLastModified" => $class->dateconvert($pagelastmodified), - ); + # Put the values into the page hash. - $page_found = 1; + %database_page = ( + "PageFilename" => $pagefilename, + "PageName" => $pagename, + "PageDescription" => $pagedescription, + "PageLastModified" => $class->dateconvert($pagelastmodified), + ); - } + $page_found = 1; + + } + } 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(); + + # Check if the page exists in the database. + + while (@data_page = $string_handle->fetchrow_array()){ + + # Get the values from the array. + + $pagefilename = decode_utf8($data_page[0]); + $pagename = decode_utf8($data_page[1]); + $pagedescription = decode_utf8($data_page[2]); + $pagesection = decode_utf8($data_page[3]); + $pagetemplate = decode_utf8($data_page[4]); + $pagedata = decode_utf8($data_page[5]); + $pagesettings = decode_utf8($data_page[6]); + $pagelastmodified = decode_utf8($data_page[7]); + + # Put the values into the page hash. + + %database_page = ( + "PageFilename" => $pagefilename, + "PageName" => $pagename, + "PageDescription" => $pagedescription, + "PageSection" => $pagesection, + "PageTemplate" => $pagetemplate, + "PageContent" => $pagedata, + "PageSettings" => $pagesettings, + "PageLastModified" => $class->dateconvert($pagelastmodified), + ); + + $page_found = 1; + + } + + } + # Check if the page did exist. if (!$page_found){ @@ -1797,6 +1833,8 @@ sub editpage{ # Check if there is a page that already exists with the new # filename. + $page_found = 0; + 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 ); @@ -2385,11 +2423,11 @@ sub addfilter{ } - # Check if there were any filters in the filters database. + # Check if there were any filters in the filter database. if (!$filter_count && !$new_id){ - # There were no filters in the filters database so set + # There were no filters in the filter database so set # the new filter identification value to 1. $new_id = 1;