View Single Post
  #166  
Old 07-12-2005, 02:02 AM
sketch42's Avatar
sketch42 sketch42 is offline
 
Join Date: May 2004
Location: Brooklyn, NY
Posts: 361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
// ################################ Create NuTT Tables ###############################
if ($_REQUEST['step'] == 5)
{
        echo 
"Adding Table nutt_cats<br />";
        
        
$DB_site->query("CREATE TABLE `nutt_cats` (
                                        `id` mediumint(9) NOT NULL auto_increment,
                                        `title` varchar(50) NOT NULL default '',
                                        `options` int(10) NOT NULL default '0',
                                        `pic` varchar(255) NOT NULL default '',
                                        PRIMARY KEY  (`id`),
                                        KEY `id` (`id`)
                                        ) TYPE=MyISAM;"
);
        
        echo 
"Adding Table nutt_files<br />";
        
$DB_site->query("CREATE TABLE `nutt_files` (
                                        `id` int(10) NOT NULL auto_increment,
                                        `torrent` int(10) NOT NULL default '0',
                                        `filename` varchar(150) NOT NULL default '',
                                        `size` int(25) NOT NULL default '0',
                                        PRIMARY KEY  (`id`)
                                        ) TYPE=MyISAM;"
);
        
        echo 
"Adding Table nutt_peers<br />";
        
$DB_site->query("CREATE TABLE `nutt_peers` (
                                        `id` int(10) unsigned NOT NULL auto_increment,
                                        `torrent` int(10) unsigned NOT NULL default '0',
                                        `peer_id` varchar(20) NOT NULL default '',
                                        `ip` varchar(64) NOT NULL default '',
                                        `port` smallint(5) unsigned NOT NULL default '0',
                                        `uploaded` bigint(20) unsigned NOT NULL default '0',
                                        `downloaded` bigint(20) unsigned NOT NULL default '0',
                                        `to_go` bigint(20) unsigned NOT NULL default '0',
                                        `seeder` enum('yes','no') NOT NULL default 'no',
                                        `started` int(11) NOT NULL default '0',
                                        `last_action` int(11) NOT NULL default '0',
                                        `connectable` enum('yes','no') NOT NULL default 'yes',
                                        `userid` int(10) unsigned NOT NULL default '0',
                                        `agent` varchar(60) NOT NULL default '',
                                        `finishedat` int(10) unsigned NOT NULL default '0',
                                        `downloadoffset` bigint(20) unsigned NOT NULL default '0',
                                        `uploadoffset` bigint(20) unsigned NOT NULL default '0',
                                        `passkey` varchar(32) NOT NULL default '',
                                        PRIMARY KEY  (`id`),
                                        UNIQUE KEY `torrent_peer_id` (`torrent`,`peer_id`),
                                        KEY `torrent` (`torrent`),
                                        KEY `torrent_seeder` (`torrent`,`seeder`),
                                        KEY `last_action` (`last_action`),
                                        KEY `connectable` (`connectable`),
                                        KEY `userid` (`userid`)
                                        ) TYPE=MyISAM;"
);
        
        echo 
"Adding Table nutt_rate<br />";
        
$DB_site->query("CREATE TABLE `nutt_rate` (
                                        `id` int(11) NOT NULL auto_increment,
                                        `rate` int(11) NOT NULL default '0',
                                        `torrent` int(11) NOT NULL default '0',
                                        `userid` int(11) NOT NULL default '0',
                                        `ip` varchar(62) NOT NULL default '',
                                        `time` int(11) NOT NULL default '0',
                                        PRIMARY KEY  (`id`)
                                        ) TYPE=MyISAM;"
);
        
        echo 
"Adding Table nutt_torrents<br />";
        
$DB_site->query("CREATE TABLE `nutt_torrents` (
                                        `id` int(10) NOT NULL auto_increment,
                                        `threadid` int(10) NOT NULL default '0',
                                        `filename` varchar(255) NOT NULL default '',
                                        `owner` varchar(255) NOT NULL default '0',
                                        `ownerm` varchar(255) NOT NULL default '',
                                        `ownerid` int(10) NOT NULL default '0',
                                        `visible` varchar(5) NOT NULL default '',
                                        `deleted` varchar(10) NOT NULL default 'no',
                                        `hash` varchar(255) NOT NULL default '',
                                        `name` varchar(255) NOT NULL default '',
                                        `size` int(25) NOT NULL default '0',
                                        `numfiles` int(10) NOT NULL default '0',
                                        `type` varchar(10) NOT NULL default '',
                                        `descr` mediumtext NOT NULL,
                                        `cat` int(10) NOT NULL default '0',
                                        `save` varchar(255) NOT NULL default '',
                                        `added` int(25) NOT NULL default '0',
                                        `last_action` int(25) NOT NULL default '0',
                                        `downloaded` int(10) NOT NULL default '0',
                                        `seeders` int(10) NOT NULL default '0',
                                        `leechers` int(10) NOT NULL default '0',
                                        `rated` mediumtext NOT NULL,
                                        `comments` int(11) NOT NULL default '0',
                                        PRIMARY KEY  (`id`)
                                        ) TYPE=MyISAM;"
);

        echo 
"<br />NuTT Tables Added!<br /><br />";

        
//         insert data
        
$DB_site->query("INSERT INTO `nutt_cats` VALUES (1, 'MP3', 0, 'mp3.gif')");
        
$DB_site->query("INSERT INTO `nutt_cats` VALUES (2, 'Single', 0, 'single.gif')");
        
$DB_site->query("INSERT INTO `nutt_cats` VALUES (3, 'Album', 0, 'album.gif')");
        
$DB_site->query("INSERT INTO `nutt_cats` VALUES (4, 'PV', 0, 'pv.gif')");
        
$DB_site->query("INSERT INTO `nutt_cats` VALUES (5, 'DVD', 0, 'dvd.gif')");
        
$DB_site->query("INSERT INTO `nutt_cats` VALUES (6, 'Images', 0, 'img.gif')");
        
$DB_site->query("INSERT INTO `nutt_cats` VALUES (7, 'TV', 0, 'tv.gif')");
        
$DB_site->query("INSERT INTO `nutt_cats` VALUES (8, 'Performance', 0, 'perf.gif')");
        
$DB_site->query("INSERT INTO `nutt_cats` VALUES (9, 'Misc', 0, 'misc.gif')");

        echo 
"<br />NuTT Tables Populated!<br /><br />";

        
$DB_site->query("ALTER TABLE ".TABLE_PREFIX."usergroup ADD nuttpermissions INT(10) UNSIGNED DEFAULT '0' NOT NULL");
        
$DB_site->query("UPDATE ".TABLE_PREFIX."usergroup SET nuttpermissions='511' WHERE usergroupid='6'");
        
$DB_site->query("ALTER TABLE ".TABLE_PREFIX."user ADD uploaded BIGINT(20) DEFAULT '0' NOT NULL");
        
$DB_site->query("ALTER TABLE ".TABLE_PREFIX."user ADD downloaded BIGINT(20) DEFAULT '0' NOT NULL");
        
$DB_site->query("ALTER TABLE ".TABLE_PREFIX."user ADD tempuploaded BIGINT(20) DEFAULT '0' NOT NULL");
        
$DB_site->query("ALTER TABLE ".TABLE_PREFIX."user ADD tempdownloaded BIGINT(20) DEFAULT '0' NOT NULL");
        
$DB_site->query("ALTER TABLE ".TABLE_PREFIX."user ADD tempreset INT(10) UNSIGNED DEFAULT '0' NOT NULL");
        
$DB_site->query("ALTER TABLE ".TABLE_PREFIX."user ADD passkey VARCHAR(32) DEFAULT '0' NOT NULL");
        
$DB_site->query("ALTER TABLE ".TABLE_PREFIX."user ADD agent VARCHAR(255) DEFAULT '0' NOT NULL");

        echo 
"<br />vBulletin Tables Updated!<br /><br />";
        

this is from the nut_install.php , i need to know is it as simple as changing this
PHP Code:
$DB_site->query("CREATE TABLE `nutt_rate` (
                                        `id` int(11) NOT NULL auto_increment,
                                        `rate` int(11) NOT NULL default '0',
                                        `torrent` int(11) NOT NULL default '0',
                                        `userid` int(11) NOT NULL default '0',
                                        `ip` varchar(62) NOT NULL default '',
                                        `time` int(11) NOT NULL default '0',
                                        PRIMARY KEY  (`id`)
                                        ) TYPE=MyISAM;"
); 
to this???
PHP Code:
$DB_site->query("CREATE TABLE . TABLE PREFIX. `nutt_rate` (
                                        `id` int(11) NOT NULL auto_increment,
                                        `rate` int(11) NOT NULL default '0',
                                        `torrent` int(11) NOT NULL default '0',
                                        `userid` int(11) NOT NULL default '0',
                                        `ip` varchar(62) NOT NULL default '',
                                        `time` int(11) NOT NULL default '0',
                                        PRIMARY KEY  (`id`)
                                        ) TYPE=MyISAM;"
); 
And if so what other files do i need to edit that call to the tables
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01269 seconds
  • Memory Usage 1,909KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete