The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How can I fetch a post?
How can I fetch a post to put on my custom page liek this:
HTML Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> <title>$vboptions[bbtitle]</title> $headinclude </head> <body> $header $navbar <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"> <table class="tborder" id="group0" cellpadding="6" cellspacing="1" border="0" width="100%"> <thead> <tr> <td class="tcat" colspan="3" rowspan="3"></td> </tr> </thead> <tr> <td class="alt2Active" id="u15" width="25%"> <!-- Image for game --> <div> <p> <font size="1" face="Verdana"> <center> <img src="" width="200" height="250"> <br></center> <br><b>Title:</b> <br><b>Console:</b> XBox 360 <br><b>Genre:</b> Beat 'em up<br><b>Players:</b> 1 <br> <br><b>Release dates:</b> <br>North America: <br>Europe: <br>Japan: </font> </p> </div> </td> <td class="alt1" width="75%" > [B]FETCHED POST HERE![/B] </div> </td> </table> $footer </body> </html> |
#2
|
||||
|
||||
You would have to write a query to grab the post. I assume you have a php page to go along with that template, so you would put the query into the php page.
|
#3
|
|||
|
|||
Quote:
Code:
SELECT * FROM post AS p LEFT JOIN user USING (userid) LEFT JOIN userfield USING (userid) WHERE p.postid = 12066 And not only that, I'm pretty sure the post odesn't "jump" up on the page on it's own. I'm pretty sure I need to add soem type of code in the template as well. I hope you can help me. |
#4
|
||||
|
||||
You would put the query after it says "Start Main Page".... or basically after the global.php page is included and before the template is evaled. You can see what a query should look like by looking at other modifications or in the vbulletin php pages. You just need to use the query_first type of query (like I said, look it up in the vbulletin php pages). Really, the best way to learn how to do this is to see how it is done in vbulletin or a modification.
|
#5
|
||||
|
||||
yup, run your select query, and then do something like a:
PHP Code:
|
#6
|
|||
|
|||
Quote:
$post = fetch_postinfo($postid); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|