FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Import data from XML to fud, HOW??
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Import data from XML to fud, HOW?? [message #18712] Thu, 03 June 2004 23:38 Go to next message
rafath is currently offline  rafath   Poland
Messages: 14
Registered: June 2004
Karma: 0
Junior Member
Hello

Unfortunatelly I have xml dump of data from BBphorum. I want put this into Fudforum, but I dont know how exactly. I have only messages from bbphorum, its look like:
Quote:

<RECORD>
      <post_id>65281</post_id>
      <parent_id>62921</parent_id>
      <topic_id>6569</topic_id>
      <forum_id>23</forum_id>
      <poster_id>2599</poster_id>
      <post_title>Re: Forum ...</post_title>
      <post_text><![CDATA[V2l0YW0gd3N6eXN0a2ljaCBhIHN6Y3plZ/NsbmllIHR5Y2gsIGt083J5Y2gganW/IHpuYW0gYmxpv2VqIHogaW5uZWdvIGZvcnVtIGN6eWxpOiBLYXRrYSwgQWRhbVcsIEphbmtlcywgVmFsZW8uDTxicj5KZXN0ZW0gbm93eSBuYSB0eW0gZm9ydW0gaSBtYW0gbmFkemllauosIL9lIGLqZHppZSBuYXMgZHW/byBkdb9vIHdp6mNlai4NPGJyPlBvemRyYXdpYW0uDTxicj5vcmlvbg==]]></post_text>
      <post_time>20021223T13:17:24000</post_time>
      <poster_ip>217.98.33.28</poster_ip>
</RECORD>




I know how I should build insert (which table fud26_msg or fud26_thread?), but dont know how (and where) should I put the body message and recognize that this message is from user id=65281.

Any ideas?

sorry 4 my english.
Re: Import data from XML to fud, HOW?? [message #18722 is a reply to message #18712] Fri, 04 June 2004 12:58 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Does the user #2599 exist on FUDforum?

To add messages you can use the fud_msg_edit class the add() method.


FUDforum Core Developer
Re: Import data from XML to fud, HOW?? [message #18726 is a reply to message #18722] Fri, 04 June 2004 14:13 Go to previous messageGo to next message
rafath is currently offline  rafath   Poland
Messages: 14
Registered: June 2004
Karma: 0
Junior Member
Ilia wrote on Fri, 04 June 2004 08:58

Does the user #2599 exist on FUDforum?

No, but I'll put my name Smile

Quote:


To add messages you can use the fud_msg_edit class the add() method.


Where is it (file)?
Re: Import data from XML to fud, HOW?? [message #18727 is a reply to message #18726] Fri, 04 June 2004 14:18 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
include/theme/default/imsg_edt.inc

FUDforum Core Developer
Re: Import data from XML to fud, HOW?? [message #18729 is a reply to message #18727] Fri, 04 June 2004 14:54 Go to previous messageGo to next message
rafath is currently offline  rafath   Poland
Messages: 14
Registered: June 2004
Karma: 0
Junior Member
OK thx very much!

Now I have another problem Sad, Could U explain me, what does mean this variables (in add function):

$forum_id is my <forum_id>23</forum_id>,
$message_threshold - what is it? (or which data this need),
$forum_opt - what is it?
$perm - is here any default option?
$autoapprove=true


thx for helping me.
Re: Import data from XML to fud, HOW?? [message #18730 is a reply to message #18729] Fri, 04 June 2004 15:02 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
$forum_opt & $message_threshold leave both as 0
$autoapprove=true is ok.

$perm is the permission bitmask of the user making the post.


FUDforum Core Developer
Re: Import data from XML to fud, HOW?? [message #18732 is a reply to message #18730] Fri, 04 June 2004 15:17 Go to previous messageGo to next message
rafath is currently offline  rafath   Poland
Messages: 14
Registered: June 2004
Karma: 0
Junior Member
Ilia wrote on Fri, 04 June 2004 11:02

$forum_opt & $message_threshold leave both as 0



But how I can put the body message into function? There is function write_body($this->body, $length, $offset);

so body I have to put into class, but I have this records plenty (ca 20 000). I Have to know, how quickly i can put this into database (with putting body message into the file).

My plan is easy: buils sql queries and put this in import this into database. But I dont know how I can put body messages to the file.
Re: Import data from XML to fud, HOW?? [message #18733 is a reply to message #18732] Fri, 04 June 2004 15:20 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Can't be done easily. You need to prewrite the bodies to the file then store the length & offset and add that to the queries.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Is this possible?
Next Topic: notifications seem to always show same incorrect URL?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun May 19 04:29:29 GMT 2024

Total time taken to generate the page: 0.02906 seconds