TomNook08
Member
Posts: 52
Joined: Mar 2009
Reputation: 0
|
RE: Catalog System
I just got my very first error
I attached a picture and here is the code...
PHP Code:
<?php /** * Plugin Copyright * TomNook08 of MyBBSource */
if(!defined("IN_MYBB")) { die("This file cannot be accessed directly."); } //Add Your Hooks $plugins->add_hook("member_profile_end", "Show_Catalog");
//REQUIRED function catalog_info() { return array( 'name' => 'Item Catalog', 'description' => 'Adds Items from the Animal Crossing games to the users profile.', 'website' => 'http://www.mybbsource.com', 'author' => 'TomNook08', 'authorsite' => 'mailto:[email protected]', 'version' => '1.0', 'compatibility' => '14*',
); }
function catalog_activate() { global $db; $catalog_admin = array( 'gid' => 'NULL', 'name' => 'catalogadmin', 'title' => 'Catalog Admin', 'description' => 'Settings For The Catalog System.', 'disporder' => $rows+1, 'isdefault' => 'no', );
$db->insert_query('settinggroups', $catalog_admin); $gid = $db->insert_id();
$catalog_setting_1 = array( 'sid' => 'NULL', 'name' => 'enablecatalog', 'title' => 'Enable Catalog System?', 'description' => 'If set to off, no one will get a catalog', 'optionscode' => 'onoff', 'value' => 'on', 'disporder' => 1, 'gid' => intval($gid), );
$catalog_setting_2 = array( 'sid' => 'NULL', 'name' => 'showwhichgames', 'title' => 'Show Which Game', 'description' => 'Set to 1 to show only ACGC items, 2 to show only ACWW items, 3 to show ACCF/LGTTC items, or 0 for all 3 games', 'optionscode' => 'text', 'value' => '0', 'disporder' => 2, 'gid' => intval($gid), ); $catalog_setting_3 = array(
'sid' => 'NULL', 'name' => 'adminitems', 'title' => 'Admin Remove Items?', 'description' => 'Do you want admins to be able to remove items?', 'optionscode' => 'onoff', 'value' => 'off', 'disporder' => 3, 'gid' => intval($gid), ); $db->query("CREATE TABLE `".TABLE_PREFIX."catalog` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `memberid` INT NOT NULL)"); $db->insert_query('settings', $catalog_setting_1); $db->insert_query('settings', $catalog_setting_2); $db->insert_query('settings', $catalog_setting_3); require MYBB_ROOT."/inc/adminfunctions_templates.php"; find_replace_templatesets("member_profile", '#{\$signature}#', "{\$signature}\n{\$catalog}"); $template = array( "title" => "catalog", "template" => "<head> <title>{\$mybb->settings[\'bbname\']} - Catalog</title> {\$headerinclude} </head> <body> {\$header} <table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\" style=\"clear: both;\"> <tr> <td class=\"thead\"><strong>My Catalog</strong></td> </tr> <tr> <td class=\"trow1\"><br /> </td> </tr> </table> {\$footer} </body> </html> ", "sid" => -1 ); $db->insert_query("templates", $template); //stuff to do on activation of the plugin } function catalog_deactive() { global $db; $db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='catalogadmin'"); $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN( 'enablecatalog', 'showwhichgames', 'adminitems', )"); $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='catalog'"); $db->query("DROP TABLE ".TABLE_PREFIX."catalog"); require MYBB_ROOT."/inc/adminfunctions_templates.php"; find_replace_templatesets("member_profile", '#{\$catalog}(\r?)(\n?)#', '', 0); }
function Show_Catalog() { global $memprofile,$mybb,$theme,$db,$lang,$templates; //DO SOMETHING WHEN THE HOOK IS CALLED }
?>
001.png (Size: 10.51 KB / Downloads: 13)
Oh perfect it stretched the page XD
I'm an Animal Crossing Fanatic!!!
(Nintendo's Famous Game)
(This post was last modified: 03-12-2009 11:46 PM by TomNook08.)
|
|