|
#1
|
|||
|
|||
News script SQL update
-- --------------------------------------------------------
-- -- Table structure for table `news` -- CREATE TABLE IF NOT EXISTS `news` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `userid` int(11) NOT NULL DEFAULT '0', `added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `body` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `added` (`added`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=10 ; -- -- Dumping data for table `news` -- INSERT INTO `news` (`id`, `userid`, `added`, `body`) VALUES (2, 2, '2016-11-25 10:56:02', '[align=center][/align]'), (9, 759, '2017-02-26 15:03:14', '[align=Left]Greetings [pokemon],\r\n\r\nWe have opened the doors again tell your friends, we are keeping them open for a limited time so get them in here if you like it here,\r\n\r\nthanks,\r\neBook Club[/align]\r\n<br />'); -- -------------------------------------------------------- Alter table news add `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, Alter table news add `UserID` int(10) unsigned NOT NULL, Alter table news add `Title` varchar(255) NOT NULL, Alter table news add `Body` text NOT NULL, Alter table news add `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', Alter table news add `ThreadID` int(10) unsigned DEFAULT NULL, Alter table news add `Important` tinyint(4) NOT NULL DEFAULT '0', CREATE TABLE `currency_conversion_rates` ( `Currency` char(3) NOT NULL, `Rate` decimal(9,4) DEFAULT NULL, `Time` datetime DEFAULT NULL, PRIMARY KEY (`Currency`) ) ENGINE=InnoDB CHARSET utf8; CREATE TABLE `do_not_upload` ( `ID` int(10) NOT NULL AUTO_INCREMENT, `Name` varchar(255) NOT NULL, `Comment` varchar(255) NOT NULL, `UserID` int(10) NOT NULL, `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `Sequence` mediumint(8) NOT NULL, PRIMARY KEY (`ID`), KEY `Time` (`Time`) ) ENGINE=InnoDB CHARSET utf8; -- -------------------------------------------------------- -- -- Table structure for table `funds` -- CREATE TABLE IF NOT EXISTS `funds` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `cash` decimal(8,2) NOT NULL DEFAULT '0.00', `user` int(10) unsigned NOT NULL DEFAULT '0', `added` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- CREATE TABLE `donations` ( `UserID` int(10) NOT NULL, `Amount` decimal(6,2) NOT NULL, `Email` varchar(255) NOT NULL, `Time` datetime NOT NULL, `Currency` varchar(5) NOT NULL DEFAULT 'USD', `Source` varchar(30) NOT NULL DEFAULT '', `Reason` mediumtext NOT NULL, `Rank` int(10) DEFAULT '0', `AddedBy` int(10) DEFAULT '0', `TotalRank` int(10) DEFAULT '0', KEY `UserID` (`UserID`), KEY `Time` (`Time`), KEY `Amount` (`Amount`) ) ENGINE=InnoDB CHARSET utf8; CREATE TABLE `donations_bitcoin` ( `BitcoinAddress` varchar(34) NOT NULL, `Amount` decimal(24,8) NOT NULL, KEY `BitcoinAddress` (`BitcoinAddress`,`Amount`) ) ENGINE=InnoDB CHARSET utf8; CREATE TABLE `blog` ( `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, `UserID` int(10) unsigned NOT NULL, `Title` varchar(255) NOT NULL, `Body` text NOT NULL, `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ThreadID` int(10) unsigned DEFAULT NULL, `Important` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`ID`), KEY `UserID` (`UserID`), KEY `Time` (`Time`) ) ENGINE=InnoDB CHARSET utf8; //Config.php $tbdev["no_view_xxx_browse"] = true; //Browse.php If($tbdev["no_view_xxx_browse"] = true) $query = "SELECT torrents.id, torrents.category, torrents.leechers, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.type, torrents.comments,torrents.numfiles,torrents.filen ame,torrents.owner, torrents.no_view_xxx_browse," . // "IF(torrents.numratings < {$TBDEV['minvotes']}, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, categories.name AS cat_name, categories.image AS cat_pic, users.username FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $orderby $limit"; "categories.name AS cat_name, categories.image AS cat_pic, users.username FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id AND torrents.no_view_xxx_browse=users.no_view_xxx_brow se $where $orderby {$pager['limit']}"; $res = mysql_query($query) or die(mysql_error()); } else { unset($res); } } [IMG] https://images2.imgbox.com/01/8f/KzBHqGAI_o.png [/IMG] Last edited by BamBam0077; 9th December 2021 at 15:51. Reason: https://images2.imgbox.com/01/8f/KzBHqGAI_o.png |
|
|