Mercurial > hg > LGToc
changeset 4:373c8ecad8b4
deploy to development server
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 24 Mar 2015 11:32:31 +0100 |
parents | 5d0bfd909857 |
children | 26ed9d1d6957 |
files | check_sections.php check_sections_details.php config.php config/Lib_mb_utf8.php config/config.php edit_section_db.php |
diffstat | 6 files changed, 114 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
--- a/check_sections.php Fri Mar 20 15:32:58 2015 +0100 +++ b/check_sections.php Tue Mar 24 11:32:31 2015 +0100 @@ -1,6 +1,6 @@ <?php -include_once('Lib_mb_utf8.php'); -include_once('config.php'); +include_once('config/Lib_mb_utf8.php'); +include_once('config/config.php'); include_once('edit_section_db.php'); set_time_limit(0); ini_set('memory_limit', '-1'); @@ -78,7 +78,7 @@ HAVING COUNT( * ) >=".$count.") ORDER BY count DESC "; */ - $query="(SELECT books.name AS book_name, books.level1, books.level2, books.period, books.id, sections.name, start_page, end_page, COUNT( * ) AS count + $query="(SELECT books.name AS book_name, books.level1, books.level2, books.period, books.id, sections_index.name, start_page, end_page, COUNT( * ) AS count FROM sections_index JOIN books ON sections_index.books_id = books.id WHERE NOT EXISTS @@ -99,6 +99,10 @@ HAVING COUNT( * ) >=".$count.") ORDER BY count DESC "; $result = mysql_query($query); + if (!$result) { + echo mysql_error(); + return; + } echo mysql_num_rows($result)." result(s)<br><br>"; echo "<table>"; echo "<tr>"; @@ -195,7 +199,7 @@ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <link href="css/search.css" type="text/css" rel="stylesheet"/> + <!-- <link href="css/search.css" type="text/css" rel="stylesheet"/> --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script> <!--<script src="js/check_sections.js" charset="utf-8"></script>!--> </head>
--- a/check_sections_details.php Fri Mar 20 15:32:58 2015 +0100 +++ b/check_sections_details.php Tue Mar 24 11:32:31 2015 +0100 @@ -1,6 +1,6 @@ <?php -include_once('Lib_mb_utf8.php'); -include_once('config.php'); +include_once('config/Lib_mb_utf8.php'); +include_once('config/config.php'); include_once('edit_section_db.php'); set_time_limit(0); ini_set('memory_limit', '-1');
--- a/config.php Fri Mar 20 15:32:58 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<?php - -$at_local = false; - -if (!$at_local) { - // host at localgazetteers-dev server - $systemNAME = "interface"; - $mysql_database = "Gazetteer"; - $mysql_server = "localhost"; - $mysql_user = "root"; - $mysql_password = "admin"; - $system_root_url = "http://localgazetteers-dev/extraction-interface"; - $lgserver_url = "http://localgazetteers-dev/LGServer/"; - -} else { - // localhost - $systemNAME = "interface"; - $mysql_database = "Gazetteers"; - $mysql_server = "localhost"; - $mysql_user = "root"; - $mysql_password = "root"; - $system_root_url = "http://localhost:1080/localgazetteers-dev/extraction-interface"; - $lgserver_url = "http://localgazetteers-dev/LGServer/"; -} - -?>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/Lib_mb_utf8.php Tue Mar 24 11:32:31 2015 +0100 @@ -0,0 +1,76 @@ +<?php + mb_regex_encoding('UTF-8'); + mb_internal_encoding('UTF-8'); + + // ****************************************************************************** + + function mb($s) { + return mb8($s); + } + + function mb16($s) { + //return mb_convert_encoding($s, 'UTF-16LE'); + return big5_to_utf16($s); + } + + function mb8($s) { + //return mb_convert_encoding($s, 'UTF-16LE'); + return big5_to_utf8($s); + } + + function u8b5($s) { + return utf8_to_big5($s); + } + + function b5u8($s) { + return big5_to_utf8($s); + } + + function u8u16($s) { + return utf8_to_utf16($s); + } + + function u16u8($s) { + return utf16_to_utf8($s); + } + + function b5u16($s) { + return big5_to_utf16($s); + } + + function u16b5($s) { + return utf16_to_big5($s); + } + + function big5_to_utf16($s) { + if (!$s) return ''; + return iconv("BIG-5", "UTF-16LE", $s); + } + + function utf16_to_big5($s) { + if (!$s) return ''; + return iconv("UTF-16LE", "BIG-5//IGNORE", $s); + } + + function utf16_to_utf8($s) { + if (!$s) return ''; + return iconv("UTF-16LE", "UTF-8", $s); + } + + function utf8_to_utf16($s) { + if (!$s) return ''; + return iconv("UTF-8", "UTF-16LE", $s); + } + + function big5_to_utf8($s) { + if (!$s) return ''; + return iconv("CP950", "UTF-8//IGNORE", $s); + } + + function utf8_to_big5($s) { + if (!$s) return ''; + return iconv("UTF-8", "CP950//IGNORE", $s); + } + + // ****************************************************************************** +?>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/config.php Tue Mar 24 11:32:31 2015 +0100 @@ -0,0 +1,26 @@ +<?php + +$at_local = false; + +if (!$at_local) { + // host at localgazetteers-dev server + $systemNAME = "interface"; + $mysql_database = "Gazetteer"; + $mysql_server = "localhost"; + $mysql_user = "root"; + $mysql_password = "admin"; + $system_root_url = "http://localgazetteers-dev/LGToc"; + $lgserver_url = "http://localgazetteers-dev/LGServer/"; + +} else { + // localhost + $systemNAME = "interface"; + $mysql_database = "Gazetteers"; + $mysql_server = "localhost"; + $mysql_user = "root"; + $mysql_password = "root"; + $system_root_url = "http://localhost:1080/localgazetteers-dev/LGToc"; + $lgserver_url = "http://localgazetteers-dev/LGServer/"; +} + +?>
--- a/edit_section_db.php Fri Mar 20 15:32:58 2015 +0100 +++ b/edit_section_db.php Tue Mar 24 11:32:31 2015 +0100 @@ -1,6 +1,6 @@ <?php -include_once('Lib_mb_utf8.php'); -include_once('config.php'); +include_once('config/Lib_mb_utf8.php'); +include_once('config/config.php'); set_time_limit(0); ini_set('memory_limit', '-1');