The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Table On Forumhome -- Filling it with PHP/SQL Data
Hey guys. After trying to make this work in the header of my site, I have given up. It is making for a ton of alignment and sizing issues.
What I want to do now is have the PHP code make a new table and place it on the ForumHome page in line with the actual forums. Here is a mockup of what I am talking about: The new table needs to have a column span of 2 because I want to seperate the loot winner and the actual name of the loot. Here is my current code. I am using this as a plugin at the moment. PHP Code:
Any help would be appreciated. Thanks. |
#2
|
|||
|
|||
If you can, give the mysql vb user access to your eqdkp_items table, you won't need to create another connection to your database.
Don't echo anything in your plugin. You should just use the template system. So, put a variable in your FORUMHOME template, where you want your table to appear; let's call it $winners. HTML Code:
<if condition="!empty($winners)"> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr><th colspan="2">Latest loot</th></tr> $winners </table> </if> PHP Code:
$winners will be replace by its value during fetch_template('FORUMHOME') in index.php |
#3
|
|||
|
|||
Quote:
Thank you very much for your help. |
#4
|
|||
|
|||
On phpmyadmin, privileges => edit the user used by your forum
see 'Database-specific privileges' Select the database that contain your eqdkp_items table, and give SELECT right on the database or the table. edit: just added YOUR_DB before the table name in the sql query, don't forget to change it |
#5
|
|||
|
|||
If the table is in the same database as your vbulletin, you don't need to worry about giving the MySQL user access to the table.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|