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

Home » FUDforum » How To » How to extract a message from the msg_X0000 file ?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
How to extract a message from the msg_X0000 file ? [message #40267] Wed, 30 January 2008 21:19 Go to next message
Arafel is currently offline  Arafel   France
Messages: 18
Registered: July 2006
Location: France
Karma: 0
Junior Member
Hello, i'm trying to use a subforum to post news on it and publish them on my website.

I know:
-How to get the thread
-How to get the first message
-In which file the content of the message is
-The lenght of the message

But i don't know how to extract only the content of the message.

foff is post's first offset in the file ?
Shall i use a:

"SELECT sum(lenght) FROM fud**_msg WHERE file_id = '10000' AND id < '".$thepostiwant_id."' ORDER BY id"

Then use fread and use %8192 until i reach the beginning of the content that i need ?

(considering i want a message's content that is in file id 10000)

Is there an other way ?

Thanks for awnsering and my apologies for my bad english.


Edit:

Ok, i used fopen, fseek with foff and fgets, i had to do a while strlen(result) < length

And as fgets param, i used length-strlen(result)+1

[Updated on: Wed, 30 January 2008 23:21]

Report message to a moderator

Re: How to extract a message from the msg_X0000 file ? [message #40270 is a reply to message #40267] Thu, 31 January 2008 17:09 Go to previous messageGo to next message
Ilia is currently offline  Ilia   United States
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You can use FUDAPI for this purpose. However, if you want to do it directly you need to use foff (file offset) and length parameter. Then you look at the file_id for the message and you know which file you need to open, seek to offset and read length bytes.

FUDforum Core Developer
Re: How to extract a message from the msg_X0000 file ? [message #40370 is a reply to message #40267] Wed, 20 February 2008 21:32 Go to previous message
Arafel is currently offline  Arafel   France
Messages: 18
Registered: July 2006
Location: France
Karma: 0
Junior Member
Thanks, i succeeded.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: how can i set the time to local clock?
Next Topic: Preview image in topic
Goto Forum:
  

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

Current Time: Sun Dec 01 09:10:43 GMT 2024

Total time taken to generate the page: 0.02570 seconds