The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How do you create a table upon Mod installation?
I'm new to vBulletin but have PHP experience. I'm trying to create a mod. In my exported XML file I have the following:
Code:
<installcode><![CDATA[ require_once(DIR . '/global.php'); $db->hide_errors(); $sql_create = "CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "myproduct_settings` ( ... $vbulletin->db->query_write($sql_create); $db->show_errors(); ]]></installcode> Also, how can I get debug information? I added the line: PHP Code:
Thanks --------------- Added [DATE]1248907863[/DATE] at [TIME]1248907863[/TIME] --------------- An update about this. I found a few other posts on the forum where they also couldn't add a new table upon installation with no useful replies. As a test, I took the exact code that was in the installation and put it in a new test.php file. When I ran the PHP file, it worked correctly. Is there a reason that vBulletin would not allow new tables to be created for products or is this just a bug? How do I go about reporting a bug if it is? --------------- Added [DATE]1248910795[/DATE] at [TIME]1248910795[/TIME] --------------- Oh geez, after looking through the vBulletin code for Importing a new Product in plugin.php I realized that the <installcode> only gets executed if the version is * or the current version is null or the version is newer. I was keeping 1.0 in the version box the whole time. After changing it to '*', the code executed correctly (I must have had some kind of error in the first version I originally used). Argh! There goes half a day. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|