diff --git a/Code/Lib/Channel.php b/Code/Lib/Channel.php index c143f68b3..ccf7332f4 100644 --- a/Code/Lib/Channel.php +++ b/Code/Lib/Channel.php @@ -419,7 +419,7 @@ class Channel // The site channel gets the project logo as a profile photo. if ($arr['account_id'] === 'xxx') { - $photo_type = import_channel_photo_from_url(z_root() . '/images/' . PLATFORM_NAME . '.png', 0, $r[0]['channel_id']); + $photo_type = import_channel_photo_from_url(z_root() . '/images/' . REPOSITORY_ID . '.png', 0, $r[0]['channel_id']); } elseif ($z['photo_url']) { $photo_type = import_channel_photo_from_url($z['photo_url'], $arr['account_id'], $r[0]['channel_id']); @@ -938,7 +938,7 @@ class Channel // with a non-standard platform and version. $ret['compatibility'] = [ - 'project' => PLATFORM_NAME, + 'project' => REPOSITORY_ID, 'codebase' => 'zap', 'schema' => 'streams', 'version' => STD_VERSION, diff --git a/Code/Lib/Enotify.php b/Code/Lib/Enotify.php index c10adc1d7..099656693 100644 --- a/Code/Lib/Enotify.php +++ b/Code/Lib/Enotify.php @@ -68,7 +68,7 @@ class Enotify push_lang($recip['account_language']); // should probably have a channel language $banner = t('$Projectname Notification'); - $product = t('$projectname'); // PLATFORM_NAME; + $product = t('$projectname'); // REPOSITORY_ID; $siteurl = z_root(); $thanks = t('Thank You,'); $sitename = get_config('system', 'sitename'); diff --git a/Code/Lib/Libzot.php b/Code/Lib/Libzot.php index 06f86c479..211f81527 100644 --- a/Code/Lib/Libzot.php +++ b/Code/Lib/Libzot.php @@ -2486,7 +2486,7 @@ class Libzot 'sitekey' => $hub['hubloc_sitekey'], 'deleted' => (intval($hub['hubloc_deleted']) ? true : false) ]; - if ($hub['hubloc_url'] === z_root() && version_compare(ZOT_REVISION, '11.0') >= 0) { + if ($hub['hubloc_url'] === z_root() && version_compare(NOMAD_PROTOCOL_VERSION, '11.0') >= 0) { $tmp['driver'] = 'nomad'; } diff --git a/Code/Lib/System.php b/Code/Lib/System.php index 7ddc53fd5..f85e20a5e 100644 --- a/Code/Lib/System.php +++ b/Code/Lib/System.php @@ -14,7 +14,7 @@ class System if (is_array(App::$config) && is_array(App::$config['system']) && array_key_exists('platform_name', App::$config['system'])) { return App::$config['system']['platform_name']; } - return PLATFORM_NAME; + return REPOSITORY_ID; } public static function get_site_name(): string @@ -58,7 +58,7 @@ class System if (is_array(App::$config) && is_array(App::$config['system']) && array_key_exists('icon', App::$config['system'])) { return App::$config['system']['icon']; } - return z_root() . '/images/' . PLATFORM_NAME . '-64.png'; + return z_root() . '/images/' . REPOSITORY_ID . '-64.png'; } public static function get_project_favicon() @@ -66,7 +66,7 @@ class System if (is_array(App::$config) && is_array(App::$config['system']) && array_key_exists('favicon', App::$config['system'])) { return App::$config['system']['favicon']; } - return z_root() . '/images/' . PLATFORM_NAME . '.ico'; + return z_root() . '/images/' . REPOSITORY_ID . '.ico'; } @@ -117,13 +117,13 @@ class System return App::$config['system']['project_srclink']; } - return 'https://codeberg.org/streams/' . PLATFORM_NAME; + return 'https://codeberg.org/streams/' . REPOSITORY_ID; } public static function get_zot_revision() { - $x = [ 'revision' => ZOT_REVISION ]; + $x = [ 'revision' => NOMAD_PROTOCOL_VERSION ]; Hook::call('zot_revision', $x); return $x['revision']; } diff --git a/Code/Module/Import.php b/Code/Module/Import.php index 3e70a2f8e..a930a3436 100644 --- a/Code/Module/Import.php +++ b/Code/Module/Import.php @@ -251,7 +251,7 @@ class Import extends Controller foreach ($xchans as $xchan) { // Provide backward compatibility for zot11 based projects - if ($xchan['xchan_network'] === 'nomad' && version_compare(ZOT_REVISION, '10.0') <= 0) { + if ($xchan['xchan_network'] === 'nomad' && version_compare(NOMAD_PROTOCOL_VERSION, '10.0') <= 0) { $xchan['xchan_network'] = 'zot6'; } diff --git a/Code/Widget/Portfolio.php b/Code/Widget/Portfolio.php index 08bb84cd6..3b2500ed4 100644 --- a/Code/Widget/Portfolio.php +++ b/Code/Widget/Portfolio.php @@ -13,11 +13,10 @@ class Portfolio implements WidgetInterface public function widget(array $arguments): string { - - $owner_uid = App::$profile_uid; $sql_extra = permissions_sql($owner_uid); - + $album = ''; + $title = ''; if (!perm_is_allowed($owner_uid, get_observer_hash(), 'view_storage')) { return ''; @@ -118,7 +117,7 @@ class Portfolio implements WidgetInterface '$photos' => $photos, '$mode' => $mode, '$count' => $count, - '$album' => (($title) ? $title : $album), + '$album' => (($title) ?: $album), '$album_id' => rand(), '$album_edit' => [t('Edit Album'), $album_edit], '$can_post' => false, diff --git a/boot.php b/boot.php index fb57be5c3..d598765be 100755 --- a/boot.php +++ b/boot.php @@ -26,17 +26,11 @@ use Code\Lib\Url; require_once('version.php'); -define ( 'PLATFORM_NAME', 'streams' ); - -define ( 'DB_UPDATE_VERSION', 1262 ); -define ( 'ZOT_REVISION', '11.0' ); - -define ( 'PLATFORM_ARCHITECTURE', 'zap' ); - -define ( 'PROJECT_BASE', __DIR__ ); - -define ( 'ACTIVITYPUB_ENABLED', true ); - +const REPOSITORY_ID = 'streams'; +const DB_UPDATE_VERSION = 1262; +const PROJECT_BASE = __DIR__; +const ACTIVITYPUB_ENABLED = true; +const NOMAD_PROTOCOL_VERSION = '11.0'; // composer autoloader for all namespaced Classes require_once('vendor/autoload.php'); @@ -1147,7 +1141,7 @@ class App { } if (! x(self::$page,'title')) { - self::$page['title'] = ucfirst(App::$module) . ' | ' . ((array_path_exists('system/sitename',self::$config)) ? self::$config['system']['sitename'] : PLATFORM_NAME); + self::$page['title'] = ucfirst(App::$module) . ' | ' . ((array_path_exists('system/sitename',self::$config)) ? self::$config['system']['sitename'] : REPOSITORY_ID); } if (! self::$meta->get_field('og:title')) { diff --git a/include/import.php b/include/import.php index eb32cac6f..4a15d678d 100644 --- a/include/import.php +++ b/include/import.php @@ -385,7 +385,7 @@ function import_xchans($xchans) { foreach ($xchans as $xchan) { // Provide backward compatibility for zot11 based projects - if ($xchan['xchan_network'] === 'nomad' && version_compare(ZOT_REVISION, '10.0') <= 0) { + if ($xchan['xchan_network'] === 'nomad' && version_compare(NOMAD_PROTOCOL_VERSION, '10.0') <= 0) { $xchan['xchan_network'] = 'zot6'; } @@ -425,7 +425,7 @@ function import_hublocs($channel, $hublocs, $seize, $moving = false) foreach ($hublocs as $hubloc) { // Provide backward compatibility for zot11 based projects - if ($hubloc['hubloc_network'] === 'nomad' && version_compare(ZOT_REVISION, '10.0') <= 0) { + if ($hubloc['hubloc_network'] === 'nomad' && version_compare(NOMAD_PROTOCOL_VERSION, '10.0') <= 0) { $hubloc['hubloc_network'] = 'zot6'; } diff --git a/include/network.php b/include/network.php index 1373ff252..8917b9b0a 100644 --- a/include/network.php +++ b/include/network.php @@ -1098,7 +1098,7 @@ function deliverable_singleton($channel_id, $xchan) function get_repository_version($branch = 'release') { - $path = 'https://raw.codeberg.page/streams/' . PLATFORM_NAME . "/@$branch/version.php"; + $path = 'https://raw.codeberg.page/streams/' . REPOSITORY_ID . "/@$branch/version.php"; $x = Url::get($path); if ($x['success']) {