diff --git a/composer.json b/composer.json index a14c1e0..42c8a7f 100644 --- a/composer.json +++ b/composer.json @@ -3,8 +3,8 @@ "type": "phpbb-extension", "description": "Allows a user to be able to choose a national flag and have a top (those with the most users selecting the flag) number of flags display on the index page of a phpBB forum. Header is link to a listing of all users of a flag. Clicking on user count of the flag displays the users that have that flag set. This extension requires at least phpBB version 3.2.6. Must have version 2.0.0 of Collapsible Forum Categories to take advantage of that extension.", "homepage": "https://github.com/rmcgirr83/nationalflags", - "version": "2.2.5", - "time": "2020-10-21", + "version": "2.2.6", + "time": "2020-12-11", "keywords": [ "phpbb", "extension", diff --git a/migrations/m13_update_data.php b/migrations/m13_update_data.php index 3445847..a201431 100644 --- a/migrations/m13_update_data.php +++ b/migrations/m13_update_data.php @@ -31,7 +31,7 @@ public function flag_update_image() { $sql_ary = [ [ - 'flag_name' => 'Curaçao', + 'flag_name' => 'Curaçao', 'flag_image' => 'cw.png', ], ]; diff --git a/migrations/m14_update_data.php b/migrations/m14_update_data.php new file mode 100644 index 0000000..b2eee5d --- /dev/null +++ b/migrations/m14_update_data.php @@ -0,0 +1,49 @@ +db_tools->sql_table_exists($this->table_prefix . 'flags')) + { + $sql_ary = [ + [ + 'flag_name' => 'Curaçao', + 'flag_image' => 'cw.png', + ], + ]; + foreach ($sql_ary as $num => $flag) + { + $sql = 'UPDATE ' . $this->table_prefix . 'flags + SET ' . $this->db->sql_build_array('UPDATE', [ + 'flag_name' => (string) $flag['flag_name']] + ) . + " WHERE flag_image = '" . (string) $flag['flag_image'] . "'"; + $this->db->sql_query($sql); + } + } + } +}