Skip to content

Commit

Permalink
Add flags to extension
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcgirr83 committed Aug 10, 2024
1 parent e76b15b commit 3bde9c4
Show file tree
Hide file tree
Showing 264 changed files with 244 additions and 22 deletions.
2 changes: 1 addition & 1 deletion adm/style/nationalflags_manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h3>{{ lang('ERROR') }}</h3>
</fieldset>
<fieldset>
<dl>
<dt>{{ lang('IMAGES_ON_SERVER') }}{{ lang('COLON') }}</dt>
<dt>{{ L_IMAGES_ON_SERVER }}{{ lang('COLON') }}</dt>
<dd>{{ FLAG_LIST }}</dd>
</dl>
</fieldset>
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.4. Must have version 2.0.0 of Collapsible Forum Categories to take advantage of that extension.",
"homepage": "https://github.com/rmcgirr83/nationalflags",
"version": "2.3.5",
"time": "2023-01-24",
"version": "2.4.0",
"time": "2024-08-10",
"keywords": [
"phpbb",
"extension",
Expand All @@ -23,14 +23,14 @@
}
],
"require": {
"php": ">=7.2",
"phpbb/phpbb": ">=3.3.4",
"php": ">=7.4",
"phpbb/phpbb": ">=3.3",
"composer/installers": "~1.0"
},
"extra": {
"display-name": "National Flags",
"soft-require": {
"phpbb/phpbb": ">=3.3.4"
"phpbb/phpbb": ">=3.3"
},
"version-check": {
"host": "www.phpbb.com",
Expand Down
13 changes: 9 additions & 4 deletions controller/admin_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class admin_controller
* define our constants
**/
const MAX_WIDTH = 32;
const MAX_HEIGHT = 32;
const MAX_HEIGHT = 24;

/** @var cache $cache */
protected $cache;
Expand Down Expand Up @@ -356,15 +356,17 @@ public function add_flag()
$this->log_message('LOG_FLAG_ADD', $flag_row['flag_name'], 'MSG_FLAG_ADDED');
}
}

$flag_list = $this->list_flag_names();
$flag_count = sizeof(explode(",", $flag_list));
$this->template->assign_vars([
'L_TITLE' => $this->language->lang('FLAG_ADD'),
'L_IMAGES_ON_SERVER' => $this->language->lang('IMAGES_ON_SERVER', $flag_count),
'U_ACTION' => $this->u_action . '&amp;action=add',
'U_BACK' => $this->u_action,
'FLAG_NAME' => $flag_row['flag_name'],
'FLAG_IMAGE' => $flag_row['flag_image'],
'ERROR_MSG' => (sizeof($errors)) ? implode('<br>', $errors) : '',
'FLAG_LIST' => $this->list_flag_names(),
'FLAG_LIST' => $flag_list,

'S_ADD_FLAG' => true,
'S_ERROR' => (sizeof($errors)) ? true : false,
Expand Down Expand Up @@ -434,8 +436,11 @@ public function edit_flag($flag_id)
}

$found_flag = $this->ext_path_web . 'flags/' . $row['flag_image'];
$flag_list = $this->list_flag_names();
$flag_count = sizeof(explode(",", $flag_list));
$this->template->assign_vars([
'L_TITLE' => $this->language->lang('FLAG_EDIT'),
'L_IMAGES_ON_SERVER' => $this->language->lang('IMAGES_ON_SERVER', $flag_count),
'U_ACTION' => $this->u_action . "&amp;flag_id=$flag_id&amp;action=edit",
'U_BACK' => $this->u_action . '&amp;mode=manage',
'ERROR_MSG' => (sizeof($errors)) ? implode('<br>', $errors) : '',
Expand All @@ -445,7 +450,7 @@ public function edit_flag($flag_id)
'FLAG_ID' => $row['flag_id'],
'FLAG_DEFAULT' => $row['flag_default'],
'FOUND_FLAG' => (!empty($found_flag)) ? $found_flag : '',
'FLAG_LIST' => $this->list_flag_names(),
'FLAG_LIST' => $flag_list,

'S_ADD_FLAG' => true,
'S_UPLOAD_FLAG' => $this->can_upload_flag(),
Expand Down
2 changes: 1 addition & 1 deletion ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ext extends \phpbb\extension\base
*/
public function is_enableable()
{
$enableable = (phpbb_version_compare(PHPBB_VERSION, '3.3.4', '>=') && version_compare(PHP_VERSION, '7.2.*', '>'));
$enableable = (phpbb_version_compare(PHPBB_VERSION, '3.3', '>=') && version_compare(PHP_VERSION, '7.4.*', '>'));
if (!$enableable)
{
$language = $this->container->get('language');
Expand Down
Binary file modified flags/ad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/ae.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/af.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/ag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/ai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/al.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/am.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/ao.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/aq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/ar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/as.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/at.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/au.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/aw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/ax.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/az.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/ba.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/bb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/bd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/be.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/bf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/bh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/bi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/bj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flags/bl.png
Binary file modified flags/bm.png
Binary file modified flags/bn.png
Binary file modified flags/bo.png
Binary file added flags/bq.png
Binary file modified flags/br.png
Binary file modified flags/bs.png
Binary file modified flags/bt.png
Binary file added flags/bv.png
Binary file modified flags/bw.png
Binary file modified flags/by.png
Binary file modified flags/bz.png
Binary file modified flags/ca.png
Binary file modified flags/cc.png
Binary file modified flags/cd.png
Binary file modified flags/cf.png
Binary file modified flags/cg.png
Binary file modified flags/ch.png
Binary file modified flags/ci.png
Binary file modified flags/ck.png
Binary file modified flags/cl.png
Binary file modified flags/cm.png
Binary file modified flags/cn.png
Binary file modified flags/co.png
Binary file modified flags/cr.png
Binary file modified flags/cu.png
Binary file modified flags/cv.png
Binary file modified flags/cw.png
Binary file modified flags/cx.png
Binary file modified flags/cy.png
Binary file modified flags/cz.png
Binary file modified flags/de.png
Binary file modified flags/dj.png
Binary file modified flags/dk.png
Binary file modified flags/dm.png
Binary file modified flags/do.png
Binary file modified flags/dz.png
Binary file modified flags/ec.png
Binary file modified flags/ee.png
Binary file modified flags/eg.png
Binary file modified flags/eh.png
Binary file modified flags/er.png
Binary file modified flags/es.png
Binary file modified flags/et.png
Binary file modified flags/fi.png
Binary file modified flags/fj.png
Binary file modified flags/fk.png
Binary file modified flags/fm.png
Binary file modified flags/fo.png
Binary file modified flags/fr.png
Binary file modified flags/ga.png
Binary file added flags/gb-eng.png
Binary file added flags/gb-nir.png
Binary file added flags/gb-sct.png
Binary file added flags/gb-wls.png
Binary file modified flags/gb.png
Binary file modified flags/gd.png
Binary file modified flags/ge.png
Binary file added flags/gf.png
Binary file modified flags/gg.png
Binary file modified flags/gh.png
Binary file modified flags/gi.png
Binary file modified flags/gl.png
Binary file modified flags/gm.png
Binary file modified flags/gn.png
Binary file added flags/gp.png
Binary file modified flags/gq.png
Binary file modified flags/gr.png
Binary file modified flags/gs.png
Binary file modified flags/gt.png
Binary file modified flags/gu.png
Binary file modified flags/gw.png
Binary file modified flags/gy.png
Binary file modified flags/hk.png
Binary file added flags/hm.png
Binary file modified flags/hn.png
Binary file modified flags/hr.png
Binary file modified flags/ht.png
Binary file modified flags/hu.png
Binary file modified flags/id.png
Binary file modified flags/ie.png
Binary file modified flags/il.png
Binary file modified flags/im.png
Binary file modified flags/in.png
Binary file added flags/io.png
Binary file modified flags/iq.png
Binary file modified flags/ir.png
Binary file modified flags/is.png
Binary file modified flags/it.png
Binary file modified flags/je.png
Binary file modified flags/jm.png
Binary file modified flags/jo.png
Binary file modified flags/jp.png
Binary file modified flags/ke.png
Binary file modified flags/kg.png
Binary file modified flags/kh.png
Binary file modified flags/ki.png
Binary file modified flags/km.png
Binary file modified flags/kn.png
Binary file modified flags/kp.png
Binary file modified flags/kr.png
Binary file modified flags/kw.png
Binary file modified flags/ky.png
Binary file modified flags/kz.png
Binary file modified flags/la.png
Binary file modified flags/lb.png
Binary file modified flags/lc.png
Binary file modified flags/li.png
Binary file modified flags/lk.png
Binary file modified flags/lr.png
Binary file modified flags/ls.png
Binary file modified flags/lt.png
Binary file modified flags/lu.png
Binary file modified flags/lv.png
Binary file modified flags/ly.png
Binary file modified flags/ma.png
Binary file modified flags/mc.png
Binary file modified flags/md.png
Binary file modified flags/me.png
Binary file modified flags/mf.png
Binary file modified flags/mg.png
Binary file modified flags/mh.png
Binary file modified flags/mk.png
Binary file modified flags/ml.png
Binary file modified flags/mm.png
Binary file modified flags/mn.png
Binary file modified flags/mo.png
Binary file modified flags/mp.png
Binary file modified flags/mq.png
Binary file modified flags/mr.png
Binary file modified flags/ms.png
Binary file modified flags/mt.png
Binary file modified flags/mu.png
Binary file modified flags/mv.png
Binary file modified flags/mw.png
Binary file modified flags/mx.png
Binary file modified flags/my.png
Binary file modified flags/mz.png
Binary file modified flags/na.png
Binary file modified flags/nc.png
Binary file modified flags/ne.png
Binary file modified flags/nf.png
Binary file modified flags/ng.png
Binary file modified flags/ni.png
Binary file modified flags/nl.png
Binary file modified flags/no.png
Binary file modified flags/np.png
Binary file modified flags/nr.png
Binary file modified flags/nu.png
Binary file modified flags/nz.png
Binary file modified flags/om.png
Binary file modified flags/pa.png
Binary file modified flags/pe.png
Binary file modified flags/pf.png
Binary file modified flags/pg.png
Binary file modified flags/ph.png
Binary file modified flags/pk.png
Binary file modified flags/pl.png
Binary file added flags/pm.png
Binary file modified flags/pn.png
Binary file modified flags/pr.png
Binary file modified flags/ps.png
Binary file modified flags/pt.png
Binary file modified flags/pw.png
Binary file modified flags/py.png
Binary file modified flags/qa.png
Binary file added flags/re.png
8 changes: 2 additions & 6 deletions flags/readme.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
Flag icons - http://www.famfamfam.com
Flag icons - https://flagpedia.net/download/icons

These icons are public domain, and as such are free for any use (attribution appreciated but not required).

Note that these flags are named using the ISO3166-1 alpha-2 country codes where appropriate. A list of codes can be found at http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

If you find these icons useful, please donate via paypal to [email protected] (or click the donate button available at http://www.famfamfam.com/lab/icons/silk)

Contact: [email protected]
Note that these flags are named using the ISO3166-1 alpha-2 country codes where appropriate. A list of codes can be found at http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
Binary file modified flags/ro.png
Binary file modified flags/rs.png
Binary file modified flags/ru.png
Binary file modified flags/rw.png
Binary file modified flags/sa.png
Binary file modified flags/sb.png
Binary file modified flags/sc.png
Binary file modified flags/sd.png
Binary file modified flags/se.png
Binary file modified flags/sg.png
Binary file modified flags/sh.png
Binary file modified flags/si.png
Binary file added flags/sj.png
Binary file modified flags/sk.png
Binary file modified flags/sl.png
Binary file modified flags/sm.png
Binary file modified flags/sn.png
Binary file modified flags/so.png
Binary file modified flags/sr.png
Binary file modified flags/ss.png
Binary file modified flags/st.png
Binary file modified flags/sv.png
Binary file added flags/sx.png
Binary file modified flags/sy.png
Binary file modified flags/sz.png
Binary file modified flags/tc.png
Binary file modified flags/td.png
Binary file modified flags/tf.png
Binary file modified flags/tg.png
Binary file modified flags/th.png
Binary file modified flags/tj.png
Binary file modified flags/tk.png
Binary file modified flags/tl.png
Binary file modified flags/tm.png
Binary file modified flags/tn.png
Binary file modified flags/to.png
Binary file modified flags/tr.png
Binary file modified flags/tt.png
Binary file modified flags/tv.png
Binary file modified flags/tw.png
Binary file modified flags/tz.png
Binary file modified flags/ua.png
Binary file modified flags/ug.png
Binary file added flags/um.png
Binary file modified flags/us.png
Binary file modified flags/uy.png
Binary file modified flags/uz.png
Binary file modified flags/va.png
Binary file modified flags/vc.png
Binary file modified flags/ve.png
Binary file modified flags/vg.png
Binary file modified flags/vi.png
Binary file modified flags/vn.png
Binary file modified flags/vu.png
Binary file modified flags/wf.png
Binary file modified flags/ws.png
Binary file added flags/xk.png
Binary file modified flags/ye.png
Binary file modified flags/yt.png
Binary file modified flags/za.png
Binary file modified flags/zm.png
Binary file modified flags/zw.png
2 changes: 1 addition & 1 deletion language/en/acp/nationalflags_acp.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
'FLAG_UPLOAD_NOTICE' => 'Uploading an image will overwrite an image file already located on the server if one exists. The image file <strong>is</strong> case sensitive.',
'FLAG_UPLOAD_NO_OVERWRITE' => 'You will not be able to overwrite an already existing image with the same name and extension as shown below.',
'FLAG_FOUND' => 'Flag found',
'IMAGES_ON_SERVER' => 'Image names on server',
'IMAGES_ON_SERVER' => '%d Image names on server',

//Settings
'FLAGS_REQUIRED' => 'Required field',
Expand Down
28 changes: 25 additions & 3 deletions language/en/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@
'BERMUDA' => 'Bermuda',
'BHUTAN' => 'Bhutan',
'BOLIVIA' => 'Bolivia',
'BONAIRE' => 'Bonaire',
'BONAIRE_SINT_EUSTATIUS_&AMP;_SABA' => 'Bonaire Sint Eustatius &amp; Saba',
'BOSNIA_&AMP;_HERZEGOVINA' => 'Bosnia &amp; Herzegovina',
'BOTSWANA' => 'Botswana',
'BOUVET_ISLAND' => 'Bouvet Island',
'BRAZIL' => 'Brazil',
'BRITISH_INDIAN_OCEAN_TERRITORY' => 'British Indian Ocean Territory',
'BRUNEI' => 'Brunei',
'BULGARIA' => 'Bulgaria',
'BURKINA_FASO' => 'Burkina Faso',
Expand All @@ -96,7 +98,7 @@
'CHAD' => 'Chad',
'CHILE' => 'Chile',
'CHINA' => 'China',
'COLUMBIA' => 'Columbia',
'COLUMBIA' => 'Colombia',
'COMOROS' => 'Comoros',
'CONGO' => 'Congo',
'CONGO_DEMOCRATIC_REPUBLIC' => 'Congo Democratic Republic',
Expand All @@ -114,6 +116,7 @@
'ECUADOR' => 'Ecuador',
'EGYPT' => 'Egypt',
'EL_SALVADOR' => 'El Salvador',
'ENGLAND' => 'England',
'EQUATORIAL_GUINEA' => 'Equatorial Guinea',
'ERITREA' => 'Eritrea',
'ESTONIA' => 'Estonia',
Expand All @@ -123,12 +126,14 @@
'FIJI' => 'Fiji',
'FINLAND' => 'Finland',
'FRANCE' => 'France',
'FRENCH_GUIANA' => 'French Guiana',
'GABON' => 'Gabon',
'GAMBIA' => 'Gambia',
'GEORGIA' => 'Georgia',
'GERMANY' => 'Germany',
'GHANA' => 'Ghana',
'GREAT_BRITAIN' => 'Great Britain',
'GUADELOUPE' => 'Guadeloupe',
'GREECE' => 'Greece',
'GREENLAND' => 'Greenland',
'GRENADA' => 'Grenada',
Expand All @@ -138,6 +143,7 @@
'GUINEA_BISSAU' => 'Guinea Bissau',
'GUYANA' => 'Guyana',
'HAITI' => 'Haiti',
'HEARD_&AMP;_MCDONALD_ISLANDS' => 'Heard &amp; McDonald Islands',
'HONDURAS' => 'Honduras',
'HONG_KONG' => 'Hong Kong',
'HUNGARY' => 'Hungary',
Expand Down Expand Up @@ -186,6 +192,7 @@
'MONACO' => 'Monaco',
'MONGOLIA' => 'Mongolia',
'MONTSERRAT' => 'Montserrat',
'MONTENEGRO' => 'Montenegro',
'MOROCCO' => 'Morocco',
'MOZAMBIQUE' => 'Mozambique',
'MYANMAR' => 'Myanmar',
Expand All @@ -199,6 +206,7 @@
'NIGER' => 'Niger',
'NIGERIA' => 'Nigeria',
'NORFOLK_ISLAND' => 'Norfolk Island',
'NORTHERN_IRELAND' => 'Northern Ireland',
'NORWAY' => 'Norway',
'OMAN' => 'Oman',
'PAKISTAN' => 'Pakistan',
Expand All @@ -214,17 +222,23 @@
'PORTUGAL' => 'Portugal',
'PUERTO_RICO' => 'Puerto Rico',
'QATAR' => 'Qatar',
'REUNION' => 'Reunion',
'ROMANIA' => 'Romania',
'RUSSIA' => 'Russia',
'RWANDA' => 'Rwanda',
'SAINT_PIERRE_&AMP;_MIQUELON' => 'Saint Pierre &amp; Miquelon',
'SAMOA' => 'Samoa',
'SAN_MARINO' => 'San Marino',
'SAO_TOME_&AMP;_PRINCIPE' => 'Sao Tome &amp; Principe',
'SAUDI_ARABIA' => 'Saudi Arabia',
'SERBIA' => 'Serbia',
'SVALBARD_$AMP;_JAN_MAYEN' => 'Svalbard and Jan Mayen',
'SCOTLAND' => 'Scotland',
'SENEGAL' => 'Senegal',
'SEYCHELLES' => 'Seychelles',
'SIERRA_LEONE' => 'Sierra Leone',
'SINGAPORE' => 'Singapore',
'SINT_MAARTEN_(DUTCH_PART)' => 'Sint Maarten (Dutch Part)',
'SLOVAKIA' => 'Slovakia',
'SLOVENIA' => 'Slovenia',
'SOLOMON_ISLANDS' => 'Solomon Islands',
Expand Down Expand Up @@ -257,6 +271,7 @@
'UGANDA' => 'Uganda',
'UKRAINE' => 'Ukraine',
'UNITED_ARAB_EMIRATES' => 'United Arab Emirates',
'UNITED_STATE_MINOR_OUTLYING_ISLANDS' => 'United States Minor Outlying islands',
'UNITED_STATES_OF_AMERICA' => 'United States of America',
'URUGUAY' => 'Uruguay',
'UZBEKISTAN' => 'Uzbekistan',
Expand Down Expand Up @@ -285,5 +300,12 @@
'TOKELAU' => 'Tokelau',
'WALLIS_AND_FUTUNA_ISLANDS' => 'Wallis and Futuna Islands',
'MAYOTTE' => 'Mayotte',
'SERBIA' => 'Serbia',
'ANTARCTICA' => 'Antarctica',
'ALAND_ISLANDS' => 'Åland Islands',
'GUERNSEY' => 'Guernsey',
'SOUTH_GEORGIA_&AMP;_THE_SOUTH_SANDWICH_ISLANDS' => 'South Georgia &amp; the South Sandwich Islands',
'JERSEY' => 'Jersey',
'NORTHERN_MARIANA_ISLANDS' => 'Northern Mariana Islands',
'HOLY_SEE' => 'Holy See',
'SAINT_BARTHELEMY' => 'Saint Barthélemy',
]);
130 changes: 130 additions & 0 deletions migrations/m17_add_data.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<?php
/**
*
* @package National Flags
* @copyright (c) 2024 Rich Mcgirr (RMcGirr83)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

namespace rmcgirr83\nationalflags\migrations;

class m17_add_data extends \phpbb\db\migration\migration
{

static public function depends_on()
{
return ['\rmcgirr83\nationalflags\migrations\m16_update_data'];
}

public function update_data()
{
return [
['custom', [
[&$this, 'flag_add_flags']
]],
];
}

public function flag_add_flags()
{
if ($this->db_tools->sql_table_exists($this->table_prefix . 'flags'))
{
$sql_ary = [
[
'flag_name' => 'Bouvet Island',
'flag_image' => 'bv.png',
],
[
'flag_name' => 'French Guiana',
'flag_image' => 'gf.png',
],
[
'flag_name' => 'Guadeloupe',
'flag_image' => 'gp.png',
],
[
'flag_name' => 'Heard &amp; McDonald Islands',
'flag_image' => 'hm.png',
],
[
'flag_name' => 'British Indian Ocean Territory',
'flag_image' => 'io.png',
],
[
'flag_name' => 'Saint Pierre &amp; Miquelon',
'flag_image' => 'pm.png',
],
[
'flag_name' => 'Reunion',
'flag_image' => 're.png',
],
[
'flag_name' => 'Svalbard &amp; Jan Mayen',
'flag_image' => 'sj.png',
],
[
'flag_name' => 'Sint Maarten (Dutch Part)',
'flag_image' => 'sx.png',
],
[
'flag_name' => 'United States Minor Outlying Islands',
'flag_image' => 'um.png',
],
[
'flag_name' => 'Serbia',
'flag_image' => 'rs.png',
],
[
'flag_name' => 'Montenegro',
'flag_image' => 'me.png',
],
[
'flag_name' => 'England',
'flag_image' => 'gb-eng.png',
],
[
'flag_name' => 'Scotland',
'flag_image' => 'gb-sct.png',
],
[
'flag_name' => 'Northern Ireland',
'flag_image' => 'gb-nir.png',
],
[
'flag_name' => 'Antarctica',
'flag_image' => 'aq.png',
],
[
'flag_name' => 'Aland Islands',
'flag_image' => 'ax.png',
],
[
'flag_name' => 'Bonaire Sint Eustatius &amp; Saba',
'flag_image' => 'bq.png',
],
[
'flag_name' => 'Guernsey',
'flag_image' => 'gg.png',
],
[
'flag_name' => 'South Georgia &amp; the South Sandwich Islands',
'flag_image' => 'gs.png',
],
[
'flag_name' => 'Jersey',
'flag_image' => 'je.png',
],
[
'flag_name' => 'Northern Mariana Islands',
'flag_image' => 'mp.png',
],
[
'flag_name' => 'Holy See',
'flag_image' => 'va.png',
],
];
$this->db->sql_multi_insert($this->table_prefix . 'flags', $sql_ary);
}
}
}
Loading

0 comments on commit 3bde9c4

Please sign in to comment.