The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Fetch post?
Is there anyways, whatsoever. That I will be able to fetch a post from the forums and put it on a custom page?
Like a code for this specific message? |
#2
|
||||
|
||||
Sure, with a query. If you have the postid, just make a query to the database for the message text. Just look up the query in showpost.php (the page for grabbing a single post, like you mentioned)
|
#3
|
|||
|
|||
Quote:
However I'm not good at this. Or knowing. Are you telling me I have to make a code via looking at the "showpost.php" and put it through the SQL thing and then put it in the template? I'd rather get a little more help here, please |
#4
|
||||
|
||||
Yes, I am saying you will have to do the "SQL thing" in order to grab the post. I'm suggesting you look in the showpost.php page because they used the same query there that you will need to use.
|
#5
|
|||
|
|||
Quote:
--------------- Added [DATE]1243728398[/DATE] at [TIME]1243728398[/TIME] --------------- It's really hard for me to figure out. Could it possibly be related to this? Code:
if ($postbit_obj->cachable) { /*insert query*/ $db->shutdown_query(" REPLACE INTO " . TABLE_PREFIX . "postparsed (postid, dateline, hasimages, pagetext_html, styleid, languageid) VALUES ( $post[postid], " . intval($threadinfo['lastpost']) . ", " . intval($postbit_obj->post_cache['has_images']) . ", '" . $db->escape_string($postbit_obj->post_cache['text']) . "', " . intval(STYLEID) . ", " . intval(LANGUAGEID) . " ) "); } |
#6
|
||||
|
||||
I hate to tell you, but it's the big huge one that starts on line 124. That is the basic query that gets *everything* needed to spit out the post - the post itself, the userinfo regarding the person who posted it, the sig, the avatar, etc.... You never said how much of the post you want - just the message text? If so, you can get rid of anything there regarding userinfo/avatar/signature/spamlog/userfield/editlog/sigparsed/usertextfield.
|
#7
|
||||
|
||||
[sql]SELECT *
FROM post AS p LEFT JOIN user USING (userid) LEFT JOIN userfield USING (userid) WHERE p.postid = X[/sql] That will fetch one specific post and associated user data. Note that the post will not have been parsed for BB code. If you have the knowledge/time, you may want to investigate fetching the cached post if available. |
#8
|
|||
|
|||
Quote:
Code:
SELECT * FROM post AS p LEFT JOIN user USING (userid) LEFT JOIN userfield USING (userid) WHERE p.postid = 12066 |
#9
|
||||
|
||||
Providing you use query_first() to perform the query, all the data is inside the variable you assign it to. Open up the post table in phpMyAdmin (or similar) and see the structure.
|
#10
|
|||
|
|||
I'm not good at this. I tried to look for something but I couldn't. Anymore help with be appreciated.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|