From aa7465323123b7cf825eadba6981a7b786a3028f Mon Sep 17 00:00:00 2001 From: zeldaroot Date: Mon, 9 Dec 2019 04:07:33 +0200 Subject: [PATCH] Added random 3 letter --- lib/CP_cron.js | 13 ++++++++++--- lib/CP_structure.js | 11 +++++++++-- themes/default/views/admin/main.ejs | 27 +++++++++++++++++++-------- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/lib/CP_cron.js b/lib/CP_cron.js index 3047c3d..754160a 100644 --- a/lib/CP_cron.js +++ b/lib/CP_cron.js @@ -1805,7 +1805,7 @@ function dayToLetter() { var oneDay = 86400000; var day = ('00' + Math.floor(diff / oneDay)).slice(-3); var letter1 = ['a', 'e', 'i', 'o', 'u']; - var letter2 = ['b', 'c', 'd', 'p', 's', 'w', 'v', 'k', 'l', 'm']; + var letter2 = ['b', 'c', 'd', 'p', 's', 'w', 'v', 'n', 'l', 'm']; if (config.domain.split('.')[0].length % 2) { letter1 = letter1.reverse(); } @@ -1816,14 +1816,21 @@ function dayToLetter() { letter2[parseInt(day[0])] + letter1[parseInt(day[1]) % 5] + letter2[parseInt(day[2])] + - letter1[year % 5]; + (config.random === 3 ? '' : letter1[year % 5]); + if (parseInt(day[1]) >= 5) { + result = + letter1[parseInt(day[0]) % 5] + + letter2[parseInt(day[1])] + + letter1[parseInt(day[2]) % 5] + + (config.random === 3 ? '' : letter2[year % 10]); + } if (now.getDate() % 2) { result = result .split('') .reverse() .join(''); } - return result; + return result + '.'; } /** diff --git a/lib/CP_structure.js b/lib/CP_structure.js index e628e9f..7c97914 100644 --- a/lib/CP_structure.js +++ b/lib/CP_structure.js @@ -455,7 +455,7 @@ function structureMovie(movies, options) { var oneDay = 86400000; var day = ('00' + Math.floor(diff / oneDay)).slice(-3); var letter1 = ['a', 'e', 'i', 'o', 'u']; - var letter2 = ['b', 'c', 'd', 'p', 's', 'w', 'v', 'k', 'l', 'm']; + var letter2 = ['b', 'c', 'd', 'p', 's', 'w', 'v', 'n', 'l', 'm']; if (config.domain.split('.')[0].length % 2) { letter1 = letter1.reverse(); } @@ -466,7 +466,14 @@ function structureMovie(movies, options) { letter2[parseInt(day[0])] + letter1[parseInt(day[1]) % 5] + letter2[parseInt(day[2])] + - letter1[year % 5]; + (config.random === 3 ? '' : letter1[year % 5]); + if (parseInt(day[1]) >= 5) { + result = + letter1[parseInt(day[0]) % 5] + + letter2[parseInt(day[1])] + + letter1[parseInt(day[2]) % 5] + + (config.random === 3 ? '' : letter2[year % 10]); + } if (now.getDate() % 2) { result = result .split('') diff --git a/themes/default/views/admin/main.ejs b/themes/default/views/admin/main.ejs index 8b32852..79f6ea4 100644 --- a/themes/default/views/admin/main.ejs +++ b/themes/default/views/admin/main.ejs @@ -127,7 +127,10 @@
+