diff options
-rwxr-xr-x | boot.php | 2 | ||||
-rw-r--r-- | include/zot.php | 12 | ||||
-rw-r--r-- | install/schema_mysql.sql | 4 | ||||
-rw-r--r-- | install/schema_postgres.sql | 2 | ||||
-rw-r--r-- | install/update.php | 12 | ||||
-rw-r--r-- | mod/zfinger.php | 1 | ||||
-rw-r--r-- | version.inc | 2 |
7 files changed, 27 insertions, 8 deletions
@@ -49,7 +49,7 @@ define ( 'PLATFORM_NAME', 'redmatrix' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1157 ); +define ( 'DB_UPDATE_VERSION', 1158 ); /** * @brief Constant with a HTML line break. diff --git a/include/zot.php b/include/zot.php index 31fd4dbdd..a7209ab77 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2724,6 +2724,7 @@ function import_site($arr, $pubkey) { $sellpage = htmlspecialchars($arr['sellpage'],ENT_COMPAT,'UTF-8',false); $site_location = htmlspecialchars($arr['location'],ENT_COMPAT,'UTF-8',false); $site_realm = htmlspecialchars($arr['realm'],ENT_COMPAT,'UTF-8',false); + $site_project = htmlspecialchars($arr['project'],ENT_COMPAT,'UTF-8',false); // You can have one and only one primary directory per realm. // Downgrade any others claiming to be primary. As they have @@ -2742,13 +2743,14 @@ function import_site($arr, $pubkey) { || ($siterecord['site_sellpage'] != $sellpage) || ($siterecord['site_location'] != $site_location) || ($siterecord['site_register'] != $register_policy) + || ($siterecord['site_project'] != $site_project) || ($siterecord['site_realm'] != $site_realm)) { $update = true; // logger('import_site: input: ' . print_r($arr,true)); // logger('import_site: stored: ' . print_r($siterecord,true)); - $r = q("update site set site_location = '%s', site_flags = %d, site_access = %d, site_directory = '%s', site_register = %d, site_update = '%s', site_sellpage = '%s', site_realm = '%s' + $r = q("update site set site_location = '%s', site_flags = %d, site_access = %d, site_directory = '%s', site_register = %d, site_update = '%s', site_sellpage = '%s', site_realm = '%s', site_project = '%s' where site_url = '%s'", dbesc($site_location), intval($site_directory), @@ -2758,6 +2760,7 @@ function import_site($arr, $pubkey) { dbesc(datetime_convert()), dbesc($sellpage), dbesc($site_realm), + dbeswc($site_project), dbesc($url) ); if(! $r) { @@ -2774,8 +2777,8 @@ function import_site($arr, $pubkey) { } else { $update = true; - $r = q("insert into site ( site_location, site_url, site_access, site_flags, site_update, site_directory, site_register, site_sellpage, site_realm ) - values ( '%s', '%s', %d, %d, '%s', '%s', %d, '%s', '%s' )", + $r = q("insert into site ( site_location, site_url, site_access, site_flags, site_update, site_directory, site_register, site_sellpage, site_realm, site_project ) + values ( '%s', '%s', %d, %d, '%s', '%s', %d, '%s', '%s', '%s' )", dbesc($site_location), dbesc($url), intval($access_policy), @@ -2784,7 +2787,8 @@ function import_site($arr, $pubkey) { dbesc($directory_url), intval($register_policy), dbesc($sellpage), - dbesc($site_realm) + dbesc($site_realm), + dbesc($site_project) ); if(! $r) { logger('import_site: record create failed. ' . print_r($arr,true)); diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 397848e9e..ddc38486c 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -1280,6 +1280,7 @@ CREATE TABLE IF NOT EXISTS `site` ( `site_realm` char(255) NOT NULL DEFAULT '', `site_valid` smallint NOT NULL DEFAULT '0', `site_dead` smallint NOT NULL DEFAULT '0', + `site_project` char(255) NOT NULL DEFAULT '', PRIMARY KEY (`site_url`), KEY `site_flags` (`site_flags`), KEY `site_update` (`site_update`), @@ -1290,7 +1291,8 @@ CREATE TABLE IF NOT EXISTS `site` ( KEY `site_pull` (`site_pull`), KEY `site_realm` (`site_realm`), KEY `site_valid` (`site_valid`), - KEY `site_dead` (`site_dead`) + KEY `site_dead` (`site_dead`), + KEY `site_project` (`site_project`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 0b8ed52dc..1f9ce753f 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -983,6 +983,7 @@ CREATE TABLE "site" ( "site_realm" text NOT NULL DEFAULT '', "site_valid" smallint NOT NULL DEFAULT '0', "site_dead" smallint NOT NULL DEFAULT '0', + "site_project" text NOT NULL DEFAULT '', PRIMARY KEY ("site_url") ); create index "site_flags" on site ("site_flags"); @@ -994,6 +995,7 @@ create index "site_sellpage" on site ("site_sellpage"); create index "site_realm" on site ("site_realm"); create index "site_valid" on site ("site_valid"); create index "site_dead" on site ("site_dead"); +create index "site_project" on site ("site_project"); CREATE TABLE "source" ( "src_id" serial NOT NULL, diff --git a/install/update.php b/install/update.php index ffea36d54..cc8dc6ae5 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1157 ); +define( 'UPDATE_VERSION' , 1158 ); /** * @@ -1774,3 +1774,13 @@ function update_r1155() { function update_r1156() { return UPDATE_SUCCESS; } + +function update_r1157() { + $r1 = q("alter table site add site_project char(255) not null default '' "); + $r2 = q("create index site_project on site ( site_project ) "); + if($r1 && $r2) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + +} + diff --git a/mod/zfinger.php b/mod/zfinger.php index 6b93b3410..6d750b48d 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -248,6 +248,7 @@ function zfinger_init(&$a) { if($dirmode != DIRECTORY_MODE_NORMAL) $ret['site']['directory_url'] = z_root() . '/dirsearch'; + $ret['site']['project'] = PLATFORM_NAME; // hide detailed site information if you're off the grid diff --git a/version.inc b/version.inc index 6b5ede616..25638166c 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-10-17.1188 +2015-10-19.1190 |