Hey. So I've seen mods that allow me to display a particular post anywhere on a website but I need something simpler and want to do it myself.
What I'd like to know is if there's some documentation (or maybe someone can help) on how to grab the contents of a particular post. Actually I'd like to have a post, specified by a custom user profile field, displayed right in the user's profile.
Surely it's possible and not overly difficult and i'm vaguely familiar already with some of the API but short of sifting through viewtopic.php until I figure out how it's grabbing content, can anyone point me in the right place?
Show single post on another page?
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Re: Show single post on another page?
There is a kB article on how to write a webpage that hooks into the phpBB architecture. This is useful background reading, but apart from that sifting through viewtopic.php and how it uses the various include topics is precisely how you need to proceed. It's only 1600 lines of code.
You may also need to drill down into the various include/function... files as as well as styles/prosilver/template/viewtopic_body.html. This is preprocessed into pretty unreadable (because its not really meant to be read) PHP with a corresponding name in the cache directory. This renders the page. In this HTML the loop that renders the post starts with <!-- BEGIN postrow -->. So postrow.MESSAGE contains the message HTML; postrow.POST_AUTHOR_FULL is the author HTML and postrow.U_POST_AUTHOR the author name, etc.
In viewtopic.php, the posts are fetched in the line $result = $db->sql_query_limit($sql, $sql_limit, $sql_start) and then the result sets stored in the array $post_list. Now look for where $message is retrieved in the line $message = censor_text($row['post_text']) and groomed by bbcode conversion etc. before being stored in the nth post row in the array assignment $postrow = array( ....
Hope that this helps point you in the right direction
You may also need to drill down into the various include/function... files as as well as styles/prosilver/template/viewtopic_body.html. This is preprocessed into pretty unreadable (because its not really meant to be read) PHP with a corresponding name in the cache directory. This renders the page. In this HTML the loop that renders the post starts with <!-- BEGIN postrow -->. So postrow.MESSAGE contains the message HTML; postrow.POST_AUTHOR_FULL is the author HTML and postrow.U_POST_AUTHOR the author name, etc.
In viewtopic.php, the posts are fetched in the line $result = $db->sql_query_limit($sql, $sql_limit, $sql_start) and then the result sets stored in the array $post_list. Now look for where $message is retrieved in the line $message = censor_text($row['post_text']) and groomed by bbcode conversion etc. before being stored in the nth post row in the array assignment $postrow = array( ....
Hope that this helps point you in the right direction
Forum Admin OpenOffice.org User Groups
Re: Show single post on another page?
"Only 1600" /o\
I've read about how to make a page that hooks into the architecture and stuff. That took very little time. Authenticating using auth and stuff I can already do, though I don't need it. I guess I was hoping there would be an equivalent api method for grabbing posts (I'm surprised there isn't) as there is for grabbing user data. Maybe there should be? I mean after all it's what the forums do.
You have pointed me the right way though. I'll take a look and ask again if I get stuck. Thanks.
I've read about how to make a page that hooks into the architecture and stuff. That took very little time. Authenticating using auth and stuff I can already do, though I don't need it. I guess I was hoping there would be an equivalent api method for grabbing posts (I'm surprised there isn't) as there is for grabbing user data. Maybe there should be? I mean after all it's what the forums do.
You have pointed me the right way though. I'll take a look and ask again if I get stuck. Thanks.
Re: Show single post on another page?
Yes, only 1600. If you find this bad then I suggest that you avoid FLOSS projects as reading the source is usually the only advanced documentation I did some tweaks to the Visual Basic subsystem and RTS in OOo and this subsystem was about 100K lines.Frug wrote:"Only 1600" /o\
No there isn't. Why not write an XML "getpost" function, and you can then call it and parse the answer using DOM. You could even post it back here. I mean after all it's what FLOSS packages are all aboutFrug wrote:I guess I was hoping there would be an equivalent api method for grabbing posts (I'm surprised there isn't) as there is for grabbing user data.
But on a governance note, this forum really isn't about getting development help for individual implementations, but more rather about development issue that might ultimately enhance the product. You need to try the main support forum for specific help.
Forum Admin OpenOffice.org User Groups
Re: Show single post on another page?
dont know if you can help but im looking for code that will alow me to
take last few posts under a topic, and make them show on an external web page
like youtube has a video and under it has people talking about it...
i figure show a few posts and if people want to jump in the conversation they just click the link to take them to the board and the reply button and all
i can read code but not write it
thnx in advance...
take last few posts under a topic, and make them show on an external web page
like youtube has a video and under it has people talking about it...
i figure show a few posts and if people want to jump in the conversation they just click the link to take them to the board and the reply button and all
i can read code but not write it
thnx in advance...
Re: Show single post on another page?
These forums are for developers who want to discuss "general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!" Sorry.lbvagrant wrote:i can read code but not write it
Forum Admin OpenOffice.org User Groups
Re: Show single post on another page?
i apologize...
then where do we ask for such help?
then where do we ask for such help?
Re: Show single post on another page?
On phpBB.com like you have done already.