From 23fa3e08967f574db0a1334d6e6a914201c2a06a Mon Sep 17 00:00:00 2001
From: garvinhicking
Date: Mon, 21 Nov 2005 09:56:25 +0000
Subject: [PATCH] Language Update + Changes by Omid Mottaghi
---
include/admin/importers/blogger.inc.php | 38 +++---
include/admin/importers/generic.inc.php | 2 +-
include/admin/importers/movabletype.inc.php | 22 ++--
include/admin/plugins.inc.php | 39 +++---
lang/UTF-8/serendipity_lang_bg.inc.php | 9 +-
lang/UTF-8/serendipity_lang_cn.inc.php | 7 +-
lang/UTF-8/serendipity_lang_cs.inc.php | 7 +-
lang/UTF-8/serendipity_lang_cz.inc.php | 7 +-
lang/UTF-8/serendipity_lang_da.inc.php | 7 +-
lang/UTF-8/serendipity_lang_de.inc.php | 4 +-
lang/UTF-8/serendipity_lang_en.inc.php | 7 +-
lang/UTF-8/serendipity_lang_es.inc.php | 11 +-
lang/UTF-8/serendipity_lang_fa.inc.php | 5 +-
lang/UTF-8/serendipity_lang_fi.inc.php | 7 +-
lang/UTF-8/serendipity_lang_fr.inc.php | 5 +-
lang/UTF-8/serendipity_lang_hu.inc.php | 7 +-
lang/UTF-8/serendipity_lang_is.inc.php | 7 +-
lang/UTF-8/serendipity_lang_it.inc.php | 5 +-
lang/UTF-8/serendipity_lang_ja.inc.php | 7 +-
lang/UTF-8/serendipity_lang_ko.inc.php | 9 +-
lang/UTF-8/serendipity_lang_nl.inc.php | 7 +-
lang/UTF-8/serendipity_lang_no.inc.php | 7 +-
lang/UTF-8/serendipity_lang_pt.inc.php | 39 +++---
lang/UTF-8/serendipity_lang_pt_PT.inc.php | 125 ++++++++++----------
lang/UTF-8/serendipity_lang_ro.inc.php | 7 +-
lang/UTF-8/serendipity_lang_ru.inc.php | 17 +--
lang/UTF-8/serendipity_lang_se.inc.php | 5 +-
lang/UTF-8/serendipity_lang_tn.inc.php | 7 +-
lang/UTF-8/serendipity_lang_tw.inc.php | 7 +-
lang/UTF-8/serendipity_lang_zh.inc.php | 7 +-
lang/serendipity_lang_bg.inc.php | 7 +-
lang/serendipity_lang_cn.inc.php | 7 +-
lang/serendipity_lang_cs.inc.php | 7 +-
lang/serendipity_lang_cz.inc.php | 7 +-
lang/serendipity_lang_da.inc.php | 7 +-
lang/serendipity_lang_de.inc.php | 4 +-
lang/serendipity_lang_en.inc.php | 7 +-
lang/serendipity_lang_es.inc.php | 11 +-
lang/serendipity_lang_fa.inc.php | 5 +-
lang/serendipity_lang_fi.inc.php | 7 +-
lang/serendipity_lang_fr.inc.php | 5 +-
lang/serendipity_lang_hu.inc.php | 7 +-
lang/serendipity_lang_is.inc.php | 7 +-
lang/serendipity_lang_it.inc.php | 5 +-
lang/serendipity_lang_ja.inc.php | 7 +-
lang/serendipity_lang_ko.inc.php | 9 +-
lang/serendipity_lang_nl.inc.php | 7 +-
lang/serendipity_lang_no.inc.php | 7 +-
lang/serendipity_lang_pt.inc.php | 39 +++---
lang/serendipity_lang_pt_PT.inc.php | 125 ++++++++++----------
lang/serendipity_lang_ro.inc.php | 7 +-
lang/serendipity_lang_ru.inc.php | 17 +--
lang/serendipity_lang_se.inc.php | 5 +-
lang/serendipity_lang_tn.inc.php | 7 +-
lang/serendipity_lang_tw.inc.php | 7 +-
lang/serendipity_lang_zh.inc.php | 7 +-
56 files changed, 413 insertions(+), 364 deletions(-)
diff --git a/include/admin/importers/blogger.inc.php b/include/admin/importers/blogger.inc.php
index 00dd16d..49cee03 100644
--- a/include/admin/importers/blogger.inc.php
+++ b/include/admin/importers/blogger.inc.php
@@ -114,16 +114,16 @@ http://jaa.technova.com.mv
';
# get default pass from request
$defaultpass = $this->data['defaultpass'];
-
+
# get blogger uploaded file path from request and load file
$html = file_get_contents($this->data['bloggerfile']);
-
+
# find posts using pattern matching
preg_match_all("/STARTPOST(.*)ENDPOST/sU", $html, $posts);
-
+
# iterate through all posts
foreach($posts[1] as $post) {
-
+
# locate the post title
if (preg_match("/TITLE:(.*)/", $post, $title)) {
$title = trim($title[1]);
@@ -132,7 +132,7 @@ http://jaa.technova.com.mv';
$title = "";
echo "Empty title
";
}
-
+
# locate the post author
if (preg_match("/AUTHOR:(.*)/", $post, $author)) {
$author = trim($author[1]);
@@ -141,7 +141,7 @@ http://jaa.technova.com.mv';
$author = "";
echo "Unknown author
";
}
-
+
# locate the post date
if (preg_match("/DATE:(.*)/", $post, $date)) {
$date = strtotime(trim($date[1]));
@@ -150,7 +150,7 @@ http://jaa.technova.com.mv';
$date = time();
echo "Unknown posting time.
";
}
-
+
# locate the post body
if (preg_match("/BODY:(.*)-----/sU", $post, $body)) {
$body = trim($body[1]);
@@ -159,7 +159,7 @@ http://jaa.technova.com.mv';
$body = "";
echo "Empty Body!
";
}
-
+
# find all comments for the post using pattern matching
if (preg_match_all( "/COMMENT:(.*)----/sU", $post, $commentlist)) {
echo count($commentlist[1]) . " comments found.
";
@@ -167,7 +167,7 @@ http://jaa.technova.com.mv';
$commentlist = array();
echo "No comments found.
";
}
-
+
$result = serendipity_db_query("SELECT authorid FROM ". $serendipity['dbPrefix'] ."authors WHERE username = '". serendipity_db_escape_string($author) ."' LIMIT 1", true, 'assoc');
if (!is_array($result)) {
$data = array('right_publish' => 1,
@@ -180,7 +180,7 @@ http://jaa.technova.com.mv';
} else {
$authorid = $result['authorid'];
}
-
+
$entry = array('title' => $title,
'isdraft' => 'false',
@@ -191,13 +191,15 @@ http://jaa.technova.com.mv';
'author' => $author,
'authorid' => $authorid
);
-
- echo "Entry $id inserted.
";
+
+ echo "Entry insert...
";
if (!is_int($id = serendipity_updertEntry($entry))) {
echo "Inserting entry failed.
";
return $id;
+ } else {
+ echo "Entry $id inserted.
";
}
-
+
# iterate through all comments
$c = 0;
foreach($commentlist[1] as $comment) {
@@ -213,17 +215,17 @@ http://jaa.technova.com.mv';
$curl = (isset($curl[1]) ? trim($curl[1]) : '');
$cauthor = trim(strip_tags($cauthor[1]));
}
-
+
# locate the date
if (preg_match("/DATE:(.*)/", $comment, $cdate)) {
$cdate = strtotime($cdate[1]);
}
-
+
# locate the comment body
if (preg_match("/BODY:(.*)/s", $comment, $cbody)) {
$cbody = trim($cbody[1]);
}
-
+
$icomment = array('entry_id ' => $id,
'parent_id' => 0,
'timestamp' => $cdate,
@@ -238,11 +240,11 @@ http://jaa.technova.com.mv';
serendipity_db_insert('comments', $icomment);
}
-
+
serendipity_db_query("UPDATE ". $serendipity['dbPrefix'] ."entries SET comments = ". $c ." WHERE id = ". $id);
echo "Comment count set to: ". $c ."
";
}
-
+
echo "Import finished.
";
return true;
diff --git a/include/admin/importers/generic.inc.php b/include/admin/importers/generic.inc.php
index cefe5d9..66b6547 100644
--- a/include/admin/importers/generic.inc.php
+++ b/include/admin/importers/generic.inc.php
@@ -61,7 +61,6 @@ class Serendipity_Import_Generic extends Serendipity_Import {
function buildEntry($item, &$entry) {
global $serendipity;
- $entry = array();
$bodyonly = serendipity_get_bool($this->data['bodyonly']);
if ($item['description']) {
@@ -133,6 +132,7 @@ class Serendipity_Import_Generic extends Serendipity_Import {
$serendipity['noautodiscovery'] = 1;
while ($item = $c->getNextItem()) {
+ $entry = array();
if ($this->buildEntry($item, $entry)) {
serendipity_updertEntry($entry);
}
diff --git a/include/admin/importers/movabletype.inc.php b/include/admin/importers/movabletype.inc.php
index 712968b..f49df49 100644
--- a/include/admin/importers/movabletype.inc.php
+++ b/include/admin/importers/movabletype.inc.php
@@ -56,7 +56,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
function debug($string) {
static $debug = null;
static $c = 0;
-
+
if ($debug === null) {
if ($this->data['debug'] == 'true') {
$debug = true;
@@ -64,13 +64,13 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
$debug = false;
}
}
-
+
if ($debug) {
$c++;
echo '#' . $c . ' [' . date('d.m.Y H:i.s') . '] ' . $string . "
\n";
}
}
-
+
function getImportNotes(){
$notes = array();
if (!class_exists('serendipity_event_nl2br')){
@@ -94,10 +94,11 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
function doEntryWork(&$mt_entry, &$tasks){
global $serendipity;
+ $authors = array();
$entry = array();
$entry['categories'] = array();
$entryprops = array();
-
+
$this->debug("doEntryWork: " . print_r($mt_entry, true));
foreach($mt_entry as $name => $data) {
@@ -198,7 +199,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
$parsed_entry['s9y_body'] .= $line . "\n";
}
}
-
+
foreach($parsed_entry as $name => $data){
$data = trim($data);
$name = trim($name);
@@ -227,7 +228,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
$comment['timestamp'] = time();
}
break;
-
+
case 'TITLE':
break;
@@ -253,7 +254,6 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
// memory on large blogs
//$contents = file_get_contents($_FILES['serendipity']['tmp_name']['import']['mt_dat']);
- $authors = array();
$this->categories = serendipity_fetchCategories();
$tasks = array();
@@ -265,8 +265,6 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
$fh = fopen($_FILES['serendipity']['tmp_name']['import']['mt_dat'], 'r');
}
- $n = 0;
-
$entry = array();
$el = "";
$c_el = "";
@@ -299,7 +297,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
$el = $c_el = "";
}
}
-
+
if ($skip && (!preg_match('/^--------/', $line))) {
$this->debug("No next section match, and skip is activated. Skipping '$line'");
continue;
@@ -364,7 +362,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
$this->debug("Still in subsection of previous run: $c_el.");
$content = trim($line);
}
-
+
if (!empty($content)) {
if ($is_comment || $is_trackback) {
$this->debug("Appending to comments: $line");
@@ -395,7 +393,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
$entryprops = $entry['props'];
unset($entry['props']);
unset($entry['s9y_comments']);
-
+
if ( !is_int($r = serendipity_updertEntry($entry)) ) {
echo '' . $r . '
';
} else {
diff --git a/include/admin/plugins.inc.php b/include/admin/plugins.inc.php
index 20f116f..2397153 100644
--- a/include/admin/plugins.inc.php
+++ b/include/admin/plugins.inc.php
@@ -48,7 +48,6 @@ function show_plugins($event_only = false)
introspect_config_item($config_item, $cbag)) {
$value = $_POST['serendipity']['plugin'][$config_item];
-
+
$validate = $plugin->validate($config_item, $cbag, $value);
-
+
if ($validate === true) {
// echo $config_item . " validated: $validate
\n";
$plugin->set_config($config_item, $value);
@@ -298,7 +297,7 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
0 ) { ?>
- \n";
echo "
\n";
foreach($save_errors AS $save_error) {
@@ -536,7 +535,7 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
if (isset($serendipity['wysiwyg']) && $serendipity['wysiwyg'] && count($htmlnugget) > 0) {
$ev = array('nuggets' => $htmlnugget, 'skip_nuggets' => false);
serendipity_plugin_api::hook_event('backend_wysiwyg_nuggets', $ev);
-
+
if ($ev['skip_nuggets'] === false) {
?>