PDA

View Full Version : Table On Forumhome -- Filling it with PHP/SQL Data


shanejeffery86
11 Apr 2008, 00:12
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:

http://img232.imageshack.us/img232/3503/examplewo0.jpg

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.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Any help would be appreciated.

Thanks.

lithrel
11 Apr 2008, 18:24
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.


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Then, your plugin should look like this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Hook: forumhome_complete

$winners will be replace by its value during fetch_template('FORUMHOME') in index.php

shanejeffery86
11 Apr 2008, 18:43
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.

How do I go about this?

Thank you very much for your help.

lithrel
11 Apr 2008, 18:51
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

MoT3rror
11 Apr 2008, 21:33
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.