Skip to content

Commit

Permalink
Updated Development Database Update to Support all Changes up to this…
Browse files Browse the repository at this point in the history
… Point EXCEPT THE IP ANONYMIZATION
  • Loading branch information
eSilverStrike committed Jan 24, 2022
1 parent 812aca9 commit 77a9f24
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/xmlsitemap/install_updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ function xmlsitemap_update_ConfValues_1_0_1()
3, 1, 100, true, $me, 3);
$c->add('ping_bing', $_XMLSMAP_DEFAULT['ping_bing'], 'select', 0,
3, 1, 110, true, $me, 3);

return true;
}

function xmlsitemap_update_ConfValues_2_0_2()
Expand All @@ -58,6 +60,8 @@ function xmlsitemap_update_ConfValues_2_0_2()
// Add homepage to sitemap
$c->add('include_homepage', $_XMLSMAP_DEFAULT['include_homepage'],
'select', 0, 0, 1, 25, true, $me, 0);

return true;
}

function xmlsitemap_update_ConfValues_2_0_3()
Expand All @@ -71,4 +75,6 @@ function xmlsitemap_update_ConfValues_2_0_3()

// Drop $_XMLSMAP_CONF['exclude']
$c->del('exclude', $me);

return true;
}
30 changes: 30 additions & 0 deletions public_html/admin/install/devel-db-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
*/

// Since Geeklog 2.2.1 - Should set this now in case Geeklog has issues loading page
define('GL_INSTALL_ACTIVE', true);

require_once '../../lib-common.php';

// For Root users only
Expand All @@ -74,6 +77,33 @@ function update_DatabaseFor222()
// Add database Geeklog Core updates here.
// NOTE: Cannot use ones found in normal upgrade script as no checks are performed to see if already done.


// Move IP addresses to the new 'ip_addresses' table
// Check if table exists (Works only for MYSQL)
$result = DB_query("SHOW TABLES LIKE '{$_TABLES['ip_addresses']}'");
if ( DB_numRows($result) == 0 ) {
/* DOES NOT WORK - when lib-common is included above around line 286, the function SESS_sessionCheck is called which requires the IP address. The code for this does not support the older table structure where IPs are stored with the session data and not in its own ip_addresses table
$geeklog_sqlfile_upgrade = $_CONF['path'] . 'sql/updates/' . $_DB_dbms . '_2.2.1_to_2.2.2.php';
if (file_exists ($geeklog_sqlfile_upgrade)) {
require_once($geeklog_sqlfile_upgrade);
update_TablesContainingIPAddresses222();
}
*/
}

// Add missing route into routing table for articles that have page breaks (issue #746)
if (DB_count($_TABLES['routes'], 'route', '/article/@sid/@page') == 0) {
$_SQL[] = "INSERT INTO {$_TABLES['routes']} (method, rule, route, priority) VALUES (1, '/article/@sid/@page', '/article.php?story=@sid&page=@page', 1000)"; // Priority should default to 120 but we need to mage sure it comes after the route for article print
}

// Drop tables
$_TABLES['dateformats'] = $_DB_table_prefix . 'dateformats';
$_SQL[] = "DROP TABLE {$_TABLES['dateformats']}";
$_TABLES['cookiecodes'] = $_DB_table_prefix . 'cookiecodes';
$_SQL[] = "DROP TABLE {$_TABLES['cookiecodes']}";


// ***************************************
// Core Plugin Updates Here (including version update)

Expand Down

0 comments on commit 77a9f24

Please sign in to comment.