diff --git a/_developer_data/structure.sql b/_developer_data/structure.sql index 8376ceb..3d58f22 100644 --- a/_developer_data/structure.sql +++ b/_developer_data/structure.sql @@ -209,15 +209,17 @@ CREATE TABLE `sakura_posts` ( DROP TABLE IF EXISTS `sakura_premium`; CREATE TABLE `sakura_premium` ( - `id` bigint(255) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Automatically generated ID by MySQL for management.', `uid` bigint(255) unsigned NOT NULL COMMENT 'ID of the user that purchased Tenshi.', `startdate` int(11) unsigned NOT NULL COMMENT 'Timestamp of first purchase.', `expiredate` int(11) unsigned NOT NULL COMMENT 'Expiration timestamp.', - PRIMARY KEY (`id`), UNIQUE KEY `uid` (`uid`), CONSTRAINT `sakura_premium_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `sakura_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +INSERT INTO `sakura_premium` (`uid`, `startdate`, `expiredate`) VALUES +(2, 1435756632, 1441012632), +(18, 1435760007, 1443644007) +ON DUPLICATE KEY UPDATE `uid` = VALUES(`uid`), `startdate` = VALUES(`startdate`), `expiredate` = VALUES(`expiredate`); DROP TABLE IF EXISTS `sakura_profilefields`; CREATE TABLE `sakura_profilefields` ( @@ -412,4 +414,4 @@ CREATE TABLE `sock_online_users` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1; --- 2015-07-01 14:27:30 +-- 2015-07-01 14:42:04 diff --git a/_sakura/changelog.json b/_sakura/changelog.json index ed3417d..8b1f1c6 100644 --- a/_sakura/changelog.json +++ b/_sakura/changelog.json @@ -1389,6 +1389,14 @@ { "type": "ADD", "change": "Added automatic rank management for premium." + }, + { + "type": "UPD", + "change": "Redid the supporter page." + }, + { + "type": "FIX", + "change": "Moved expire variable for the complete page out of the url and take the data straight from the database." } ] diff --git a/_sakura/components/Users.php b/_sakura/components/Users.php index 0a33f33..ed362ac 100644 --- a/_sakura/components/Users.php +++ b/_sakura/components/Users.php @@ -1005,6 +1005,10 @@ class Users { // Check if user has Premium public static function checkUserPremium($id) { + // Check if the user has static premium + if(Permissions::check('SITE', 'STATIC_PREMIUM', $id, 1)) + return [1, 0, time() + 1]; + // Attempt to retrieve the premium record from the database $getRecord = Database::fetch('premium', false, [ 'uid' => [$id, '='] diff --git a/_sakura/templates/yuuno/errors/premiumComplete.tpl b/_sakura/templates/yuuno/errors/premiumComplete.tpl index 4307066..607c71e 100644 --- a/_sakura/templates/yuuno/errors/premiumComplete.tpl +++ b/_sakura/templates/yuuno/errors/premiumComplete.tpl @@ -2,6 +2,6 @@

Thank you for your contribution!

-

Your Tenshi will expire on {{ page.expiration|date("l \\t\\h\\e jS F o") }}.

+

Your Tenshi will expire on {{ page.expiration|date("l \\t\\h\\e jS \\o\\f F o") }}.

{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/main/support.tpl b/_sakura/templates/yuuno/main/support.tpl index f2e2e75..61ba2fa 100644 --- a/_sakura/templates/yuuno/main/support.tpl +++ b/_sakura/templates/yuuno/main/support.tpl @@ -5,63 +5,113 @@

Something went wrong while processing the transaction, your PayPal account wasn't charged.

{% endif %} -