From 51987bfef4e13f3a35643d1bf80a1a1d7e6aee0a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 15 Jul 2011 11:23:30 +0000 Subject: [PATCH] Extension ext-mediadata continued, wrapper function introduced: - ext-mediadata: Rewritten output of engine software, version and repository data (used revision and when created) - Wrapper function getDateTimeFromRepository() introduced --- inc/config-global.php | 2 +- inc/functions.php | 4 ++-- inc/language/mediadata_de.php | 6 +++--- inc/modules/guest/what-mediadata.php | 3 --- inc/versions.php | 2 +- inc/wrapper-functions.php | 16 ++++++++++++++-- install/tables.sql | 2 +- templates/de/html/mediadata.tpl | 16 ++++++---------- 8 files changed, 28 insertions(+), 23 deletions(-) diff --git a/inc/config-global.php b/inc/config-global.php index 65a5c49cb4..60e9a8b5cc 100644 --- a/inc/config-global.php +++ b/inc/config-global.php @@ -90,7 +90,7 @@ setConfigEntry('VERSION', 'v0.2.1'); setConfigEntry('AUTHOR' , 'Roland Häder'); // CFG: TITLE -setConfigEntry('TITLE', 'Mailer Project'); +setConfigEntry('TITLE', 'Mailer-Project'); // CFG: COPY setConfigEntry('COPY', 'Copyright © 2003 - 2009, by Roland Häder,
2009 - 2011 by Mailer Developer Team'); diff --git a/inc/functions.php b/inc/functions.php index a14ad08390..8ebb913669 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -645,7 +645,7 @@ function generateRandomCode ($length, $code, $userid, $extraData = '') { if (isConfigEntrySet('file_hash')) { $keys .= getEncryptSeperator() . getFileHash(); } // END - if - $keys .= getEncryptSeperator() . getDateFromPatchTime(); + $keys .= getEncryptSeperator() . getDateFromRepository(); if (isConfigEntrySet('master_salt')) { $keys .= getEncryptSeperator() . getMasterSalt(); } // END - if @@ -890,7 +890,7 @@ function generateHash ($plainText, $salt = '', $hash = true) { $server = $_SERVER['PHP_SELF'] . getEncryptSeperator() . detectUserAgent() . getEncryptSeperator() . getenv('SERVER_SOFTWARE') . getEncryptSeperator() . detectRealIpAddress() . getEncryptSeperator() . detectRemoteAddr(); // Build key string - $keys = getSiteKey() . getEncryptSeperator() . getDateKey() . getEncryptSeperator() . getSecretKey() . getEncryptSeperator() . getFileHash() . getEncryptSeperator() . getDateFromPatchTime() . getEncryptSeperator() . getMasterSalt(); + $keys = getSiteKey() . getEncryptSeperator() . getDateKey() . getEncryptSeperator() . getSecretKey() . getEncryptSeperator() . getFileHash() . getEncryptSeperator() . getDateFromRepository() . getEncryptSeperator() . getMasterSalt(); // Additional data $data = $plainText . getEncryptSeperator() . uniqid(mt_rand(), true) . getEncryptSeperator() . time(); diff --git a/inc/language/mediadata_de.php b/inc/language/mediadata_de.php index 97741a811f..9d34d95dd2 100644 --- a/inc/language/mediadata_de.php +++ b/inc/language/mediadata_de.php @@ -70,9 +70,9 @@ addMessages(array( 'MEDIA_DATA_SCRIPT' => "Daten zur verwendeten Software", 'ENGINE_SOFTWARE' => "Verwendete Engine", - 'ENGINE_VERSION' => "Installierte Mailer Version", - 'ENGINE_PATCH_LEVEL' => "Patch-Level", - 'ENGINE_PATCH_CTIME' => "Letzte Aktualisierung", + 'ENGINE_VERSION' => "Installierte Version", + 'ENGINE_REVISION' => "Installierte Revision", + 'ENGINE_REVISION_CREATED' => "Revision erstellt", // Admin area 'ADMIN_CONFIG_MEDIADATA_TITLE' => "Einstellungen zu den Mediendaten", diff --git a/inc/modules/guest/what-mediadata.php b/inc/modules/guest/what-mediadata.php index 4582ca66d9..472c29be6e 100644 --- a/inc/modules/guest/what-mediadata.php +++ b/inc/modules/guest/what-mediadata.php @@ -300,9 +300,6 @@ $content['out_points'] = $OUT_POINTS; $content['out_user'] = $OUT_USER; $content['out_special'] = $OUT_SPECIAL; -// Patch timespamp -$content['patch_ctime'] = generateDateTime(getConfig('patch_ctime'), 2); - // Load template loadTemplate('mediadata', false, $content); diff --git a/inc/versions.php b/inc/versions.php index d09da31669..6e35f0562a 100644 --- a/inc/versions.php +++ b/inc/versions.php @@ -40,7 +40,7 @@ if (!defined('__SECURITY')) { die(); } // END - if -// If you understand regular expressions ^^^ you may know how I versionize... ;-) +// Set full version string setConfigEntry('FULL_VERSION', getRepositoryData('Tag')); // Current SVN revision and date diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 46822ca578..2eecd1a2ef 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -1273,11 +1273,23 @@ function encodeEntities ($str) { } // "Getter" for date from patch_ctime -function getDateFromPatchTime () { +function getDateFromRepository () { // Is it cached? if (!isset($GLOBALS[__FUNCTION__])) { // Then set it - $GLOBALS[__FUNCTION__] = generateDateTime(getConfig('patch_ctime'), '5'); + $GLOBALS[__FUNCTION__] = generateDateTime(getConfig('CURRENT_REPOSITORY_DATE'), '5'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// "Getter" for date/time from patch_ctime +function getDateTimeFromRepository () { + // Is it cached? + if (!isset($GLOBALS[__FUNCTION__])) { + // Then set it + $GLOBALS[__FUNCTION__] = generateDateTime(getConfig('CURRENT_REPOSITORY_DATE'), '2'); } // END - if // Return cache diff --git a/install/tables.sql b/install/tables.sql index b5d36fb5da..528c4deac4 100644 --- a/install/tables.sql +++ b/install/tables.sql @@ -53,7 +53,7 @@ CREATE TABLE `{?_MYSQL_PREFIX?}_config` ( `profile_update` BIGINT(20) UNSIGNED NOT NULL DEFAULT '15768000', `send_prof_update` ENUM('Y','N') NOT NULL DEFAULT 'Y', `resend_profile_update` BIGINT(20) UNSIGNED NOT NULL DEFAULT '172800', - `patch_level` VARCHAR(100) NOT NULL DEFAULT '78', + `patch_level` VARCHAR(100) NOT NULL DEFAULT '0', `patch_ctime` VARCHAR(10) NOT NULL DEFAULT 0, `guest_stats` ENUM('MEMBERS','MODULES','INACTIVE') NOT NULL DEFAULT 'MEMBERS', `ref_payout` TINYINT(3) UNSIGNED NOT NULL DEFAULT 5, diff --git a/templates/de/html/mediadata.tpl b/templates/de/html/mediadata.tpl index a7ff5db10d..93903e128f 100644 --- a/templates/de/html/mediadata.tpl +++ b/templates/de/html/mediadata.tpl @@ -112,21 +112,17 @@ -
{--ENGINE_SOFTWARE--}:
-
{?TITLE?}
+
{--ENGINE_SOFTWARE--}/{--ENGINE_VERSION--}:
+
{?TITLE?} v{?FULL_VERSION?}
- {--ENGINE_VERSION--}: - {?FULL_VERSION?} + {--ENGINE_REVISION--}: + {?CURRENT_REPOSITORY_REVISION?} - {--ENGINE_PATCH_LEVEL--}: - {?patch_level?} - - - {--ENGINE_PATCH_CTIME--}: - $content[patch_ctime] + {--ENGINE_REVISION_CREATED--}: + {%pipe,getDateTimeFromRepository%} -- 2.39.5