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
Return to the default flat view 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 previous message
Arafel is currently offline  Arafel   France
Messages: 18
Registered: July 2006
Location: France
Karma:
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

[Message index]
 
Read Message
Read Message
Read Message
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: Thu Nov 14 09:30:50 GMT 2024

Total time taken to generate the page: 0.04304 seconds