Update of /cvsroot/php-blog/serendipity/include/admin/importers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7315/include/admin/importers
Modified Files:
b2evolution.inc.php bmachine.inc.php geeklog.inc.php
nucleus.inc.php pmachine.inc.php sunlog.inc.php
textpattern.inc.php wordpress.inc.php
Log Message:
- Added ability to define a real name for each author
- Added serendipity_addAuthor() and serendipity_deleteAuthor functions
Version bump
Index: nucleus.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/importers/nucleus.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- nucleus.inc.php 21 Feb 2005 18:53:19 -0000 1.4
+++ nucleus.inc.php 24 Feb 2005 20:14:24 -0000 1.5
@@ -101,6 +101,7 @@
$users[$x] = mysql_fetch_assoc($res);
$data = array('right_publish' => ($users[$x]['user_level'] >= 1) ? 1 : 0,
+ 'realname' => $users[$x]['user_login'],
'username' => $users[$x]['user_login'],
'email' => $users[$x]['user_email'],
'password' => $users[$x]['user_pass']); // Nucleus uses md5, too.
@@ -161,7 +162,7 @@
foreach ($users as $user) {
if ($user['ID'] == $entries[$x]['iauthor']) {
$entry['authorid'] = $user['authorid'];
- $entry['author'] = $user['username'];
+ $entry['author'] = $user['realname'];
break;
}
}
@@ -190,27 +191,27 @@
while ($a = mysql_fetch_assoc($res)) {
foreach ($entries as $entry) {
if ($entry['inumber'] == $a['citem'] ) {
- $username = '';
+ $author = '';
$mail = '';
if (!empty($a['cmember'])) {
foreach($users AS $user) {
if ($user['ID'] == $a['cmember']) {
- $username = $user['user_login'];
+ $author = $user['user_login'];
$mail = $user['user_email'];
break;
}
}
}
- if (empty($username) && empty($mail)) {
- $username = $a['cuser'];
+ if (empty($author) && empty($mail)) {
+ $author = $a['cuser'];
$mail = $a['cmail'];
}
$comment = array('entry_id ' => $entry['entryid'],
'parent_id' => 0,
'timestamp' => strtotime($a['ctime']),
- 'author' => $username,
+ 'author' => $author,
'email' => $mail,
'url' => $a['chost'],
'ip' => $a['cip'],
Index: textpattern.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/importers/textpattern.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- textpattern.inc.php 21 Feb 2005 18:53:28 -0000 1.4
+++ textpattern.inc.php 24 Feb 2005 20:14:24 -0000 1.5
@@ -109,6 +109,7 @@
$users[$x] = mysql_fetch_assoc($res);
$data = array('right_publish' => ($users[$x]['user_level'] <= 4) ? 1 : 0,
+ 'realname' => $users[$x]['user_login'],
'username' => $users[$x]['user_login'],
'email' => $users[$x]['user_email'],
'password' => md5('txp')); // blame TXP for using PASSWORD().
@@ -182,14 +183,14 @@
while ($a = mysql_fetch_assoc($res)) {
foreach ($entries as $entry) {
if ($entry['ID'] == $a['parentid'] ) {
- $username = $a['name'];
+ $author = $a['name'];
$mail = $a['email'];
$url = $a['web'];
$comment = array('entry_id ' => $entry['entryid'],
'parent_id' => 0,
'timestamp' => strtotime($a['posted']),
- 'author' => $username,
+ 'author' => $author,
'email' => $mail,
'url' => $url,
'ip' => $a['ip'],
Index: pmachine.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/importers/pmachine.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- pmachine.inc.php 21 Feb 2005 18:53:19 -0000 1.2
+++ pmachine.inc.php 24 Feb 2005 20:14:24 -0000 1.3
@@ -92,10 +92,10 @@
}
/* Users */
- $res = @mysql_query("SELECT id AS ID,
- username AS user_login,
+ $res = @mysql_query("SELECT id AS ID,
+ username AS user_login,
`password` AS user_pass,
- email AS user_email,
+ email AS user_email,
status AS user_level,
url AS url
FROM {$this->data['prefix']}members", $pmdb);
@@ -107,6 +107,7 @@
$users[$x] = mysql_fetch_assoc($res);
$data = array('right_publish' => ($users[$x]['user_level'] >= 3) ? 1 : 0,
+ 'realname' => $users[$x]['user_login'],
'username' => $users[$x]['user_login'],
'email' => $users[$x]['user_email'],
'password' => $users[$x]['user_pass']); // pMachine uses md5, too.
@@ -122,9 +123,9 @@
}
/* Categories */
- $res = @mysql_query("SELECT id AS cat_ID,
- category AS cat_name,
- category AS category_description
+ $res = @mysql_query("SELECT id AS cat_ID,
+ category AS cat_name,
+ category AS category_description
FROM {$this->data['prefix']}categories ORDER BY id", $pmdb);
if (!$res) {
return sprintf(COULDNT_SELECT_CATEGORY_INFO, mysql_error($pmdb));
@@ -199,13 +200,13 @@
while ($a = mysql_fetch_assoc($res)) {
foreach ($entries as $entry) {
if ($entry['post_id'] == $a['post_id'] ) {
- $username = '';
+ $author = '';
$mail = '';
$url = '';
if (!empty($a['member_id'])) {
foreach($users AS $user) {
if ($user['ID'] == $a['member_id']) {
- $username = $user['user_login'];
+ $author = $user['user_login'];
$mail = $user['user_email'];
$url = $user['url'];
break;
@@ -216,7 +217,7 @@
$comment = array('entry_id ' => $entry['entryid'],
'parent_id' => 0,
'timestamp' => $a['t_stamp'],
- 'author' => $username,
+ 'author' => $author,
'email' => $mail,
'url' => $url,
'ip' => $a['comment_ip'],
Index: geeklog.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/importers/geeklog.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- geeklog.inc.php 21 Feb 2005 18:53:01 -0000 1.2
+++ geeklog.inc.php 24 Feb 2005 20:14:24 -0000 1.3
@@ -95,20 +95,21 @@
}
/* Users */
- $res = @mysql_query("SELECT uid AS ID,
- username AS user_login,
+ $res = @mysql_query("SELECT uid AS ID,
+ username AS user_login,
passwd AS user_pass,
- email AS user_email,
+ email AS user_email,
homepage AS user_url
FROM {$this->data['prefix']}users", $gdb);
if (!$res) {
return sprintf(COULDNT_SELECT_USER_INFO, mysql_error($gdb));
}
-
+
for ($x=0, $max_x = mysql_num_rows($res); $x < $max_x ; $x++ ) {
$users[$x] = mysql_fetch_assoc($res);
$data = array('right_publish' => 1,
+ 'realname' => $users[$x]['user_login'],
'username' => $users[$x]['user_login'],
'email' => $users[$x]['user_email'],
'userlevel' => USERLEVEL_ADMIN,
@@ -185,7 +186,7 @@
}
}
}
-
+
/* Comments */
$res = @mysql_query("SELECT * FROM {$this->data['prefix']}comments;", $gdb);
if (!$res) {
@@ -195,13 +196,13 @@
while ($a = mysql_fetch_assoc($res)) {
foreach ($entries as $entry) {
if ($entry['sid'] == $a['sid'] ) {
- $username = '';
+ $author = '';
$mail = '';
$url = '';
foreach($users AS $user) {
if ($user['ID'] == $a['uid']) {
- $username = $user['user_login'];
+ $author = $user['user_login'];
$mail = $user['user_email'];
$url = $user['user_url'];
break;
@@ -211,7 +212,7 @@
$comment = array('entry_id ' => $entry['entryid'],
'parent_id' => 0,
'timestamp' => strtotime($a['date']),
- 'author' => $username,
+ 'author' => $author,
'email' => $mail,
'url' => $url,
'ip' => $a['ip'],
Index: b2evolution.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/importers/b2evolution.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- b2evolution.inc.php 21 Feb 2005 18:52:58 -0000 1.2
+++ b2evolution.inc.php 24 Feb 2005 20:14:23 -0000 1.3
@@ -89,21 +89,22 @@
}
/* Users */
- $res = @mysql_query("SELECT ID AS ID,
- user_login AS user_login,
+ $res = @mysql_query("SELECT ID AS ID,
+ user_login AS user_login,
user_pass AS user_pass,
- user_email AS user_email,
+ user_email AS user_email,
user_level AS user_level,
user_url AS user_url
FROM evo_users", $b2db);
if (!$res) {
return sprintf(COULDNT_SELECT_USER_INFO, mysql_error($b2db));
}
-
+
for ($x=0, $max_x = mysql_num_rows($res); $x < $max_x ; $x++ ) {
$users[$x] = mysql_fetch_assoc($res);
$data = array('right_publish' => ($users[$x]['user_level'] >= 2) ? 1 : 0,
+ 'realname' => $users[$x]['user_login'],
'username' => $users[$x]['user_login'],
'email' => $users[$x]['user_email'],
'password' => $users[$x]['user_pass']); // MD5 compatible
@@ -165,16 +166,16 @@
}
}
}
-
+
/* Even more category stuff */
$res = @mysql_query("SELECT * FROM evo_postcats;", $b2db);
if (!$res) {
return sprintf(COULDNT_SELECT_CATEGORY_INFO, mysql_error($b2db));
}
-
+
for ($x=0, $max_x = mysql_num_rows($res) ; $x < $max_x ; $x++ ) {
$entrycat = mysql_fetch_assoc($res);
-
+
$entryid = 0;
$categoryid = 0;
foreach($entries AS $entry) {
@@ -183,7 +184,7 @@
break;
}
}
-
+
foreach($this->categories AS $category) {
if ($category['cat_ID'] == $entrycat['postcat_cat_ID']) {
$categoryid = $category['categoryid'];
@@ -195,7 +196,7 @@
'categoryid' => $categoryid);
serendipity_db_insert('entrycat', $this->strtrRecursive($data));
}
- }
+ }
/* Comments */
$res = @mysql_query("SELECT * FROM evo_comments;", $b2db);
@@ -206,13 +207,13 @@
while ($a = mysql_fetch_assoc($res)) {
foreach ($entries as $entry) {
if ($entry['ID'] == $a['comment_post_ID'] ) {
- $username = '';
+ $author = '';
$mail = '';
$url = '';
if (!empty($a['comment_author_ID'])) {
foreach($users AS $user) {
if ($user['ID'] == $a['comment_author_ID']) {
- $username = $user['user_login'];
+ $author = $user['user_login'];
$mail = $user['user_email'];
$url = $user['user_url'];
break;
@@ -220,8 +221,8 @@
}
}
- if (empty($username) && empty($mail)) {
- $username = $a['comment_author'];
+ if (empty($author) && empty($mail)) {
+ $author = $a['comment_author'];
$mail = $a['comment_author_email'];
$url = $a['comment_author_url'];
}
@@ -229,7 +230,7 @@
$comment = array('entry_id ' => $entry['entryid'],
'parent_id' => 0,
'timestamp' => strtotime($a['comment_date']),
- 'author' => $username,
+ 'author' => $author,
'email' => $mail,
'url' => $url,
'ip' => $a['comment_author_IP'],
@@ -280,7 +281,7 @@
$this->categories[] = $row;
$this->importCategories($row['cat_ID'], $row['categoryid']);
}
-
+
return true;
}
}
Index: wordpress.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/importers/wordpress.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- wordpress.inc.php 21 Feb 2005 18:53:29 -0000 1.11
+++ wordpress.inc.php 24 Feb 2005 20:14:24 -0000 1.12
@@ -100,6 +100,7 @@
$users[$x] = mysql_fetch_assoc($res);
$data = array('right_publish' => ($users[$x]['user_level'] >= 1) ? 1 : 0,
+ 'realname' => $users[$x]['user_login'],
'username' => $users[$x]['user_login'],
'password' => $users[$x]['user_pass']); // WP uses md5, too.
@@ -245,4 +246,4 @@
return 'Serendipity_Import_WordPress';
/* vim: set sts=4 ts=4 expandtab : */
-?>
\ No newline at end of file
+?>
Index: sunlog.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/importers/sunlog.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- sunlog.inc.php 21 Feb 2005 18:53:26 -0000 1.2
+++ sunlog.inc.php 24 Feb 2005 20:14:24 -0000 1.3
@@ -97,19 +97,20 @@
}
/* Users */
- $res = @mysql_query("SELECT id AS ID,
- name AS user_login,
- email AS user_email,
+ $res = @mysql_query("SELECT id AS ID,
+ name AS user_login,
+ email AS user_email,
homepage AS user_url
FROM {$this->data['prefix']}users", $sunlogdb);
if (!$res) {
return sprintf(COULDNT_SELECT_USER_INFO, mysql_error($sunlogdb));
}
-
+
for ($x=0, $max_x = mysql_num_rows($res); $x < $max_x ; $x++ ) {
$users[$x] = mysql_fetch_assoc($res);
$data = array('right_publish' => 1,
+ 'realname' => $users[$x]['user_login'],
'username' => $users[$x]['user_login'],
'email' => $users[$x]['user_email'],
'userlevel' => USERLEVEL_ADMIN,
@@ -157,16 +158,16 @@
return $entries[$x]['entryid'];
}
}
-
+
/* Even more category stuff */
$res = @mysql_query("SELECT * FROM {$this->data['prefix']}transfer_c;", $sunlogdb);
if (!$res) {
return sprintf(COULDNT_SELECT_CATEGORY_INFO, mysql_error($sunlogdb));
}
-
+
for ($x=0, $max_x = mysql_num_rows($res) ; $x < $max_x ; $x++ ) {
$entrycat = mysql_fetch_assoc($res);
-
+
$entryid = 0;
$categoryid = 0;
foreach($entries AS $entry) {
@@ -175,7 +176,7 @@
break;
}
}
-
+
foreach($this->categories AS $category) {
if ($category['id'] == $entrycat['category']) {
$categoryid = $category['categoryid'];
@@ -187,7 +188,7 @@
'categoryid' => $categoryid);
serendipity_db_insert('entrycat', $this->strtrRecursive($data));
}
- }
+ }
/* Comments */
$res = @mysql_query("SELECT * FROM {$this->data['prefix']}c_comments;", $sunlogdb);
@@ -198,13 +199,13 @@
while ($a = mysql_fetch_assoc($res)) {
foreach ($entries as $entry) {
if ($entry['id'] == $a['for_entry'] ) {
- $username = '';
+ $author = '';
$mail = '';
$url = '';
foreach($users AS $user) {
if ($user['ID'] == $a['user']) {
- $username = $user['user_login'];
+ $author = $user['user_login'];
$mail = $user['user_email'];
$url = $user['user_url'];
break;
@@ -214,7 +215,7 @@
$comment = array('entry_id ' => $entry['entryid'],
'parent_id' => 0,
'timestamp' => strtotime($a['insertdate']),
- 'author' => $username,
+ 'author' => $author,
'email' => $mail,
'url' => $url,
'ip' => '',
@@ -259,7 +260,7 @@
$this->categories[] = $row;
$this->importCategories($row['id'], $row['categoryid']);
}
-
+
return true;
}
}
Index: bmachine.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/importers/bmachine.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- bmachine.inc.php 21 Feb 2005 18:52:59 -0000 1.2
+++ bmachine.inc.php 24 Feb 2005 20:14:24 -0000 1.3
@@ -89,21 +89,22 @@
}
/* Users */
- $res = @mysql_query("SELECT id AS ID,
- user_login AS user_login,
+ $res = @mysql_query("SELECT id AS ID,
+ user_login AS user_login,
user_pass AS user_pass,
- user_email AS user_email,
+ user_email AS user_email,
level AS user_level,
user_url AS user_url
FROM bmc_users", $txpdb);
if (!$res) {
return sprintf(COULDNT_SELECT_USER_INFO, mysql_error($txpdb));
}
-
+
for ($x=0, $max_x = mysql_num_rows($res); $x < $max_x ; $x++ ) {
$users[$x] = mysql_fetch_assoc($res);
$data = array('right_publish' => ($users[$x]['user_level'] >= 2) ? 1 : 0,
+ 'realname' => $users[$x]['user_login'],
'username' => $users[$x]['user_login'],
'email' => $users[$x]['user_email'],
'password' => $users[$x]['user_pass']); // MD5 compatible
@@ -121,9 +122,9 @@
}
/* Categories */
- $res = @mysql_query("SELECT id AS cat_ID,
- cat_name AS cat_name,
- cat_info AS category_description
+ $res = @mysql_query("SELECT id AS cat_ID,
+ cat_name AS cat_name,
+ cat_info AS category_description
FROM bmc_cats ORDER BY id;", $txpdb);
if (!$res) {
return sprintf(COULDNT_SELECT_CATEGORY_INFO, mysql_error($txpdb));
@@ -198,13 +199,13 @@
while ($a = mysql_fetch_assoc($res)) {
foreach ($entries as $entry) {
if ($entry['id'] == $a['post'] ) {
- $username = '';
+ $author = '';
$mail = '';
$url = '';
if (!empty($a['author'])) {
foreach($users AS $user) {
if ($user['ID'] == $a['author']) {
- $username = $user['user_login'];
+ $author = $user['user_login'];
$mail = $user['user_email'];
$url = $user['user_url'];
break;
@@ -212,8 +213,8 @@
}
}
- if (empty($username) && empty($mail)) {
- $username = $a['auth_name'];
+ if (empty($author) && empty($mail)) {
+ $author = $a['auth_name'];
$mail = $a['auth_email'];
$url = $a['auth_url'];
}
@@ -221,7 +222,7 @@
$comment = array('entry_id ' => $entry['entryid'],
'parent_id' => 0,
'timestamp' => $a['date'],
- 'author' => $username,
+ 'author' => $author,
'email' => $mail,
'url' => $url,
'ip' => $a['auth_ip'],
|