diff --git a/bin/fetcher.php b/bin/fetcher.php index 0bc182572..1c7da0ad1 100755 --- a/bin/fetcher.php +++ b/bin/fetcher.php @@ -1873,7 +1873,15 @@ class Fetcher implements CrawlConstants } $path = UrlParser::getPath($site[self::URL]); if(strlen($path) > 0 ) { - $meta_ids[] = 'path:'.$path; + $path_parts = explode("/", $path); + $pre_path = ""; + $meta_ids[] = 'path:/'; + foreach($path_parts as $part) { + if(strlen($part) > 0 ) { + $pre_path .= "/$part"; + $meta_ids[] = 'path:'.$pre_path; + } + } } $meta_ids[] = 'info:'.$site[self::URL]; $meta_ids[] = 'info:'.crawlHash($site[self::URL]); diff --git a/configs/createdb.php b/configs/createdb.php index ba711b4a8..4b4573e5b 100755 --- a/configs/createdb.php +++ b/configs/createdb.php @@ -75,7 +75,7 @@ if(!in_array(DBMS, array('sqlite', 'sqlite3'))) { $db->selectDB(DB_NAME); $db->execute("CREATE TABLE VERSION (ID INTEGER PRIMARY KEY)"); -$db->execute("INSERT INTO VERSION VALUES (3)"); +$db->execute("INSERT INTO VERSION VALUES (5)"); $db->execute("CREATE TABLE USER (USER_ID INTEGER PRIMARY KEY $auto_increment, ". "USER_NAME VARCHAR(16) UNIQUE, PASSWORD VARCHAR(16))"); diff --git a/index.php b/index.php index 5099e77f0..62314d9c9 100755 --- a/index.php +++ b/index.php @@ -97,7 +97,8 @@ if ( false === function_exists('lcfirst') ) { } $available_controllers = array( "admin", "archive", "cache", "crawl", - "fetch", "machine", "resource", "search", "settings", "statistics"); + "fetch", "machine", "resource", "search", "settings", "statistics", + "static",); if(!WEB_ACCESS) { $available_controllers = array("admin", "archive", "cache", "crawl", "fetch", "machine"); diff --git a/lib/upgrade_functions.php b/lib/upgrade_functions.php index 19424c1ba..1d31f4c66 100644 --- a/lib/upgrade_functions.php +++ b/lib/upgrade_functions.php @@ -243,14 +243,14 @@ function upgradeDatabaseVersion5(&$db) $db->execute("INSERT INTO VERSION VALUES (5)"); $static_page_path = LOCALE_DIR."/".DEFAULT_LOCALE."/pages"; - if(!file_exist($static_page_path)) { + if(!file_exists($static_page_path)) { mkdir($static_page_path); } - $default_bot_txt_path = "$static_page_path/pages/bot.thtml"; - $old__bot_txt_path = WORK_DIRECTORY."/bot.txt"; - if(file_exists($old__bot_txt_path) && ! file_exists($default_bot_txt_path)){ - rename($old__bot_txt_path, $default_bot_txt_path); + $default_bot_txt_path = "$static_page_path/bot.thtml"; + $old_bot_txt_path = WORK_DIRECTORY."/bot.txt"; + if(file_exists($old_bot_txt_path) && !file_exists($default_bot_txt_path)){ + rename($old_bot_txt_path, $default_bot_txt_path); } - $this->db->setWorldPermissionsRecursive($static_page_path); + $db->setWorldPermissionsRecursive($static_page_path); } ?> diff --git a/locale/ar/configure.ini b/locale/ar/configure.ini index 20b30678b..3e7a22f8e 100755 --- a/locale/ar/configure.ini +++ b/locale/ar/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "" ; signin_view.php line: 91 signin_view_return_yioop = "" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/de/configure.ini b/locale/de/configure.ini index 778954dc1..d61521146 100755 --- a/locale/de/configure.ini +++ b/locale/de/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "" ; signin_view.php line: 91 signin_view_return_yioop = "" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/en-US/configure.ini b/locale/en-US/configure.ini index 8dd715992..ff68ca2bb 100755 --- a/locale/en-US/configure.ini +++ b/locale/en-US/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "Inlinks" search_view_more_statistics = "More Statistics" ; ; search_view.php line: 212 +search_view_privacy = "Privacy" +; +; search_view.php line: 214 +search_view_blog = "Blog" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "Developed at SeekQuarry" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "Login" ; signin_view.php line: 91 signin_view_return_yioop = "Return to Yioop" ; +; static_view.php line: 67 +static_view_title = "PHP Search Engine - Yioop!" +; +; static_view.php line: 74 +static_view_blog = "Blog" +; +; static_view.php line: 75 +static_view_privacy = "Privacy" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "Developed at SeekQuarry" +; ; statistics_view.php line: 76 statistics_view_statistics = "Statistics" ; diff --git a/locale/es/configure.ini b/locale/es/configure.ini index 8788c6f3e..2fe05fe0a 100755 --- a/locale/es/configure.ini +++ b/locale/es/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "" ; signin_view.php line: 91 signin_view_return_yioop = "" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/fr-FR/configure.ini b/locale/fr-FR/configure.ini index 92ed1e1fa..f5d4ac1f5 100755 --- a/locale/fr-FR/configure.ini +++ b/locale/fr-FR/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "Liens retour" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "Un logiciel code source libre du SeekQuarry" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "Se connecter" ; signin_view.php line: 91 signin_view_return_yioop = "Retourner à Yioop" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/fr-FR/statistics.txt b/locale/fr-FR/statistics.txt index 09559c0dd..1bdc2c466 100755 --- a/locale/fr-FR/statistics.txt +++ b/locale/fr-FR/statistics.txt @@ -1 +1 @@ -d:11; \ No newline at end of file +d:10; \ No newline at end of file diff --git a/locale/he/configure.ini b/locale/he/configure.ini index 9762f8beb..7638e4ed8 100755 --- a/locale/he/configure.ini +++ b/locale/he/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "" ; signin_view.php line: 91 signin_view_return_yioop = "" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/hi/configure.ini b/locale/hi/configure.ini index 5ae952492..b5bcae615 100755 --- a/locale/hi/configure.ini +++ b/locale/hi/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "SeekQuarry द्वारा विकसित" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "लॉग इन करें" ; signin_view.php line: 91 signin_view_return_yioop = "वापस Yioop! पर" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/in-ID/configure.ini b/locale/in-ID/configure.ini index 5ac463ff0..1032f1ef2 100755 --- a/locale/in-ID/configure.ini +++ b/locale/in-ID/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "" ; signin_view.php line: 91 signin_view_return_yioop = "" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/it/configure.ini b/locale/it/configure.ini index d653072d9..2a7047309 100755 --- a/locale/it/configure.ini +++ b/locale/it/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "" ; signin_view.php line: 91 signin_view_return_yioop = "" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/ja/configure.ini b/locale/ja/configure.ini index 8d69683c2..b90c16052 100755 --- a/locale/ja/configure.ini +++ b/locale/ja/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "SeekQuarryで開発しました" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "ログイン" ; signin_view.php line: 91 signin_view_return_yioop = "ウィオップ!に戻る" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/ja/statistics.txt b/locale/ja/statistics.txt index 5f9a99dac..2e3c64c6e 100755 --- a/locale/ja/statistics.txt +++ b/locale/ja/statistics.txt @@ -1 +1 @@ -d:47; \ No newline at end of file +d:46; \ No newline at end of file diff --git a/locale/kn/configure.ini b/locale/kn/configure.ini index d2fb0cc0b..5d55a0d5c 100755 --- a/locale/kn/configure.ini +++ b/locale/kn/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "ಒಳ ಕೊಂಡಿ" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "SeekQuarryಯಲ್ಲಿ ಅಭಿವೃದ್ಧಿಸಲಾಗಿದೆ" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "ಒಳಪ್ರವೇಶಿಸಿ" ; signin_view.php line: 91 signin_view_return_yioop = "ಯೂಪ್'ಗೆ ಮರಳಿರಿ" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/kn/statistics.txt b/locale/kn/statistics.txt index b752bdd23..8698e9b2d 100755 --- a/locale/kn/statistics.txt +++ b/locale/kn/statistics.txt @@ -1 +1 @@ -d:28; \ No newline at end of file +d:27; \ No newline at end of file diff --git a/locale/ko/configure.ini b/locale/ko/configure.ini index 68681ac88..59354c0bb 100755 --- a/locale/ko/configure.ini +++ b/locale/ko/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "인링크" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "SeekQuarry에서 계발" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "로그인" ; signin_view.php line: 91 signin_view_return_yioop = "Yioop 으로 돌아가기" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/ko/statistics.txt b/locale/ko/statistics.txt index bc2959445..ee5ff6afc 100755 --- a/locale/ko/statistics.txt +++ b/locale/ko/statistics.txt @@ -1 +1 @@ -d:49; \ No newline at end of file +d:48; \ No newline at end of file diff --git a/locale/pl/configure.ini b/locale/pl/configure.ini index 6d7d8ca55..8e677fd3d 100755 --- a/locale/pl/configure.ini +++ b/locale/pl/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "" ; signin_view.php line: 91 signin_view_return_yioop = "" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/pt/configure.ini b/locale/pt/configure.ini index 7808dc83e..ed426f20b 100755 --- a/locale/pt/configure.ini +++ b/locale/pt/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "" ; signin_view.php line: 91 signin_view_return_yioop = "" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/ru/configure.ini b/locale/ru/configure.ini index 072ebc83f..f1107f7aa 100755 --- a/locale/ru/configure.ini +++ b/locale/ru/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "" ; signin_view.php line: 91 signin_view_return_yioop = "" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/th/configure.ini b/locale/th/configure.ini index 1b14c70b3..b7132c10e 100755 --- a/locale/th/configure.ini +++ b/locale/th/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "" ; signin_view.php line: 91 signin_view_return_yioop = "" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/tr/configure.ini b/locale/tr/configure.ini index 8299cf190..2f0e32dcf 100755 --- a/locale/tr/configure.ini +++ b/locale/tr/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "" ; signin_view.php line: 91 signin_view_return_yioop = "" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/vi-VN/configure.ini b/locale/vi-VN/configure.ini index 06d93538f..6fccd36ae 100755 --- a/locale/vi-VN/configure.ini +++ b/locale/vi-VN/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "Đăng nhập" ; signin_view.php line: 91 signin_view_return_yioop = "Trở lại trang Yioop" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/vi-VN/statistics.txt b/locale/vi-VN/statistics.txt index 3bd9f6b04..81ea401f0 100755 --- a/locale/vi-VN/statistics.txt +++ b/locale/vi-VN/statistics.txt @@ -1 +1 @@ -d:45; \ No newline at end of file +d:44; \ No newline at end of file diff --git a/locale/zh-CN/configure.ini b/locale/zh-CN/configure.ini index f24d7a246..e5870d86e 100755 --- a/locale/zh-CN/configure.ini +++ b/locale/zh-CN/configure.ini @@ -1135,6 +1135,12 @@ search_view_inlink = "" search_view_more_statistics = "" ; ; search_view.php line: 212 +search_view_privacy = "" +; +; search_view.php line: 214 +search_view_blog = "" +; +; search_view.php line: 217 search_view_developed_seek_quarry = "" ; ; settings_view.php line: 76 @@ -1173,6 +1179,18 @@ signin_view_login = "登入" ; signin_view.php line: 91 signin_view_return_yioop = "回到首頁" ; +; static_view.php line: 67 +static_view_title = "" +; +; static_view.php line: 74 +static_view_blog = "" +; +; static_view.php line: 75 +static_view_privacy = "" +; +; static_view.php line: 77 +static_view_developed_seek_quarry = "" +; ; statistics_view.php line: 76 statistics_view_statistics = "" ; diff --git a/locale/zh-CN/statistics.txt b/locale/zh-CN/statistics.txt index 91047a6e1..604edd026 100755 --- a/locale/zh-CN/statistics.txt +++ b/locale/zh-CN/statistics.txt @@ -1 +1 @@ -d:19; \ No newline at end of file +d:18; \ No newline at end of file diff --git a/models/locale_model.php b/models/locale_model.php index 78652a057..b89b358f7 100644 --- a/models/locale_model.php +++ b/models/locale_model.php @@ -531,6 +531,9 @@ class LocaleModel extends Model * then these strings are merged with existing extracted strings for each * locale as well as their translations (if an extract string has a * translation the translation is untouched by this process). + * Static pages which exist in Yioop's locales dir but not in the + * WORK_DIRECTORY locale dir are also copied. Existing static pages are not + * modified. * * @return array a pair consisting of the data from the general.ini file * together with an array of msg_ids msg_strings. @@ -551,6 +554,9 @@ class LocaleModel extends Model * locale it merges out the current general_ini and strings data. * It deletes identifiers that are not in strings, it adds new identifiers * and it leaves existing identifier translation pairs untouched. + * Static pages which exist in Yioop's locales dir but not in the + * WORK_DIRECTORY locale dir are also copied. Existing static pages are not + * modified. * * @param array $general_ini data that would typically come from the * general.ini file @@ -578,7 +584,7 @@ class LocaleModel extends Model /** - * Updates the configure.ini file for a particular locale. + * Updates the configure.ini file and static pages for a particular locale. * * The configure.ini has general information (at this point not really * being used) about all locales together with specific msg_id (identifiers @@ -588,6 +594,9 @@ class LocaleModel extends Model * (this might have existing translations), as well as new translation * data that might come from a localizer via a web form and * combines these to produce a new configure.ini file + * Static pages which exist in Yioop's locales dir but not in the + * WORK_DIRECTORY locale dir are also copied. Existing static pages are not + * modified. * * @param array $general_ini data from the general.ini file * @param array $strings line array data extracted from files in @@ -610,6 +619,10 @@ class LocaleModel extends Model $fallback_configure = parse_ini_file( $fallback_path . '/configure.ini', true); } + if(file_exists($fallback_path.'/pages')) { + $this->updateLocaleStaticPages($cur_path.'/pages', + $fallback_path.'/pages'); + } $n = array(); $n[] = <<<EOT ; ***** BEGIN LICENSE BLOCK ***** @@ -696,6 +709,31 @@ EOT; file_put_contents($cur_path.'/configure.ini', $out); } + /** + * Copies over static pages which exists in a fallback directory, but + * not in the actual directory of a locale. + * + * @param string $locale_pages_path static page directory to which will + * copy + * @param string $fallback_pages_path static page directory from which will + * copy + */ + function updateLocaleStaticPages($locale_pages_path, $fallback_pages_path) { + $change = false; + if(!file_exists($locale_pages_path)) { + mkdir($locale_pages_path); + $change = true; + } + foreach( glob($fallback_pages_path."/*.thtml") as $fallback_page_name) { + $basename = basename($fallback_page_name); + $locale_page_name = "$locale_pages_path/$basename"; + if(!file_exists($locale_page_name)) { + copy($fallback_page_name, $locale_page_name); + $change = true; + } + } + $this->db->setWorldPermissionsRecursive($locale_pages_path); + } /** * Searches the directories provided looking for files matching the diff --git a/models/profile_model.php b/models/profile_model.php index 00d209cb9..04a20517a 100644 --- a/models/profile_model.php +++ b/models/profile_model.php @@ -124,7 +124,7 @@ class ProfileModel extends Model * SeekQuarry/Yioop -- * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009, 2010 Chris Pollett chris@pollett.org + * Copyright (C) 2009-2012 Chris Pollett chris@pollett.org * * LICENSE: * @@ -151,7 +151,7 @@ class ProfileModel extends Model * @subpackage config * @license http://www.gnu.org/licenses/ GPL3 * @link http://www.seekquarry.com/ - * @copyright 2009, 2010 + * @copyright 2009-2012 * @filesource */ diff --git a/views/search_view.php b/views/search_view.php index c40d9892d..ef2e397a1 100755 --- a/views/search_view.php +++ b/views/search_view.php @@ -209,8 +209,12 @@ class SearchView extends View implements CrawlConstants e(tl('search_view_more_statistics')); ?></a>] <?php }?> </div> - <div><a href="http://www.seekquarry.com/"><?php - e(tl('search_view_developed_seek_quarry')); ?></a></div> + <div>- <a href="?c=static&p=blog"><?php + e(tl('search_view_blog')); ?></a> - + <a href="?c=static&p=privacy"><?php + e(tl('search_view_privacy')); ?></a> - + <a href="http://www.seekquarry.com/"><?php + e(tl('search_view_developed_seek_quarry')); ?></a> -</div> </div><?php if(!isset($data['PAGES'])) {