[2.0.21] Country Flags MOD

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
26
57%
Very Good
8
17%
Good
5
11%
Fair
2
4%
Poor
5
11%
 
Total votes: 46

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 » Mon Nov 20, 2006 3:11 pm

ScorpAL wrote: When mouse over on the flag we will see flag image name at alt instead Coubtry name.

How can I fix it?

Hmm... I seemed to forgot to submit the new version to MODDB. In the mean time, you may download 2.3.3 from Sourceforge

~Mac

ScorpAL
Registered User
Posts: 15
Joined: Mon Nov 20, 2006 11:15 am

Post by ScorpAL » Mon Nov 20, 2006 3:13 pm

ycl6,
thanx

ScorpAL
Registered User
Posts: 15
Joined: Mon Nov 20, 2006 11:15 am

Post by ScorpAL » Mon Nov 20, 2006 3:25 pm

----

ScorpAL
Registered User
Posts: 15
Joined: Mon Nov 20, 2006 11:15 am

Post by ScorpAL » Mon Nov 20, 2006 5:27 pm

I have bug with MOD Title: Country/Location Flags MOD [ 2.3.2 => 2.3.3 ]

File: memberlist.php
When I replace

Code: Select all

		$from = ( !empty($row['user_from_flag']) ) ? $from . '&nbsp;<img src="images/flags/' . $row['user_from_flag'] . '" alt="' . $row['user_from_flag'] . '" border="1" />' : $from;
with

Code: Select all

		$sql = "SELECT flag_name
			FROM " . FLAG_TABLE . "
			WHERE flag_image = '" . $row['user_from_flag'] . "'";

		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'No_such_flag');
		}

		if ( $flagrow = $db->sql_fetchrow($result) )
		{
			$flag_name = $flagrow['flag_name'];
		}
		$from = ( !empty($row['user_from_flag']) ) ? $from . '&nbsp;<img src="images/flags/' . $row['user_from_flag'] . '" alt="' . $flag_name . '" title="' . $flag_name . '" border="1" />' : $from;
I can see only one member per page.

How can I fix it?
Thanks.

ScorpAL
Registered User
Posts: 15
Joined: Mon Nov 20, 2006 11:15 am

Post by ScorpAL » Mon Nov 20, 2006 8:38 pm

Code: Select all

$sql = "SELECT flag_name 
         FROM " . FLAG_TABLE . " 
         WHERE flag_image = '" . $row['user_from_flag'] . "'"; 

      if ( !($result = $db->sql_query($sql)) ) 
      { 
         message_die(GENERAL_ERROR, 'No_such_flag'); 
      } 

      if ( $flagrow = $db->sql_fetchrow($result) ) 
      { 
         $flag_name = $flagrow['flag_name']; 
      } 
      $from = ( !empty($row['user_from_flag']) ) ? $from . '&nbsp;<img src="images/flags/' . $row['user_from_flag'] . '" alt="' . $flag_name . '" title="' . $flag_name . '" border="1" />' : $from;
hmmm.. I rename all $result at this part of code to $flag_result and it working :)



Another problem with viewtopic.php

This part of my code:

Code: Select all

//-- mod start : Garage ----------------------------------------------------------------------------------------------------
//-- modify
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_from_flag, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_birthday, u.user_next_birthday_greeting, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid, g.made_year, makes.make, models.model, g.id as garage_id
	FROM ( " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt )
		LEFT JOIN " . GARAGE_TABLE ." g ON ( g.member_id = p.poster_id and g.main_vehicle = 1)
		LEFT JOIN " . GARAGE_MAKES_TABLE . " makes ON (g.make_id = makes.id)
        LEFT JOIN " . GARAGE_MODELS_TABLE . " models ON (g.model_id = models.id)	
	WHERE p.topic_id = $topic_id
		$limit_posts_time
		AND pt.post_id = p.post_id
		AND u.user_id = p.poster_id
	ORDER BY p.post_time $post_time_order
	LIMIT $start, ".$board_config['posts_per_page'];
	//-- mod finish : Garage ---------------------------------------------------------------------------------------------------

if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, "Could not obtain post/user information.", '', __LINE__, __FILE__, $sql);
}

$postrow = array();
// [begin] First Post On Every Page Mod
if ( $forum_topic_data['topic_show_first_post'] && ( $start != 0) )
{
	$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_from_flag, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_birthday, u.user_next_birthday_greeting, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid, g.made_year, makes.make, models.model, g.id as garage_id
		FROM ( " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt )
			LEFT JOIN " . GARAGE_TABLE ." g ON ( g.member_id = p.poster_id and g.main_vehicle = 1)
			LEFT JOIN " . GARAGE_MAKES_TABLE . " makes ON (g.make_id = makes.id)
			LEFT JOIN " . GARAGE_MODELS_TABLE . " models ON (g.model_id = models.id)	
		WHERE p.post_id = " . $forum_topic_data['topic_first_post_id'] . "
			AND pt.post_id = p.post_id
			AND u.user_id = p.poster_id";
	if ( !($first_post_result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Could not obtain first post/user information.", '', __LINE__, __FILE__, $sql);
	}

	$postrow[] = $db->sql_fetchrow($first_post_result);
	$db->sql_freeresult($first_post_result);
}
// [end] First Post On Every Page Mod

When I add new codes from:

Code: Select all

#-----[ OPEN ]------------------------------------------ 
# 
viewtopic.php
#
#-----[ FIND ]------------------------------------------ 
#
$sql = "SELECT u.username,
	FROM " . POSTS_TABLE
	WHERE p.topic_id = $topic_id
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
pt.bbcode_uid
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
, ft.flag_name
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
POSTS_TEXT_TABLE . " pt
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
, " . FLAG_TABLE . " ft
#
#-----[ FIND ]------------------------------------------ 
#
		AND u.user_id = p.poster_id
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
		AND ft.flag_image = u.user_from_flag
to first and second part of my code I cant read some massages. Posts mistake his counter.

I use Garage MOD and First Topic on every page.

How can I fix it?

User avatar
mfrankena
Registered User
Posts: 128
Joined: Sun Apr 17, 2005 3:11 pm

Post by mfrankena » Tue Nov 21, 2006 4:56 pm

hmm for the 2.3.3. version all zip files seem to be corrupted. tried multiple downloads from sourceforge.....
Regards,
Martin

Sites: BF2CC Admin // 2142CC Admin // M.B.T. Admin // Homepage

ScorpAL
Registered User
Posts: 15
Joined: Mon Nov 20, 2006 11:15 am

Post by ScorpAL » Tue Nov 21, 2006 5:11 pm

mfrankena,
If you want to upgrade to 2.3.3

1. Download broken archive
2. Recover it with WinRAR
3. Use file update_en.txt from recovered archieve.

I update my forum and it work :)

Code: Select all

########################################################
## MOD Title: Country/Location Flags MOD [ 2.3.2 => 2.3.3 ]
## MOD Author: ycl6 < ycl6@users.sourceforge.net > (Y.C. LIN) http://macphpbbmod.sourceforge.net/
## MOD Description: Update instruction for 2.3.2
## MOD Version: 1.0.0

NOTE: This version can not work with

Code: Select all

############################################################## 
## MOD Title: First Post On Every Page
## MOD Author: Xpert < xpert@phpbbguru.net > (N/A) http://www.phpbbguru.net 
## MOD Description: This mod allows showing the first post of the topic on every page. Moderator or admin can set this at the first post of the topic. 
## MOD Version: 1.0.1 
and need some modifications.

I modify it and it work :)

aussiewal
Registered User
Posts: 169
Joined: Tue Nov 14, 2006 5:47 am
Location: Sydney, Australia

Post by aussiewal » Wed Nov 22, 2006 4:52 am

Asbestos wrote:
aussiewal wrote:
Asbestos wrote:This mod works in the template subSilver. I am using subza.

With the SubSilver template in use, I can see the Flag field in my profile, allowing me to select my country flag. When I go back to my main template, subza, I cannot see the flag field in my profile. In my ACP, I can go to Management in User Admin to manually update my flag.

This might mean I have to put some code into my subza template for the flag field to show up in the profile in the subza template....?

If so, what code do I use?

Thanks!


Did you use easymod to install this as it won't work for me.
It says I need to do some manual changes but the instrustions do not make any sense at all. I have been trying for 5 days now.

I's using the standard theme that comes with phpbb.

I'm new to php so I'm struggling a bit but still it can't be that hard but still can't work it out.

Will


The mod works great with the subsilver template. If you use a different forum template, you will have to make the changes to the template you want it installed on instead of the changes in the subsilver template.


Hi Asbestos

Sorry but I'm new to PHP, and having hassles still, I can get this mod to install through EasyMod but it says there is three things I need to do manually, I have no idea what it means, and the files it says I need to change manually I can't find.

Will

aussiewal
Registered User
Posts: 169
Joined: Tue Nov 14, 2006 5:47 am
Location: Sydney, Australia

Stable download

Post by aussiewal » Wed Nov 22, 2006 11:12 am

Hi

Does anyone know where I can get a copy of the current version of this mod that is stable.

I have attempted to install the previous version to no avail, now trying to download the latest version from varios places, and all are currupt.

Please! I have been trying to install this and get it working now for over a week.

Will

ScorpAL
Registered User
Posts: 15
Joined: Mon Nov 20, 2006 11:15 am

Post by ScorpAL » Wed Nov 22, 2006 11:27 am

Hi aussiewal

Download previous version Country/Location Flags MOD 2.3.2

Than upload all files listed below from 2.3.2 version to you forum directory

Code: Select all

## Included Files: 3 + 261 images
##	root/images/flags/*.gif
##	root/admin/admin_flags.php
##	root/templates/subSilver/admin/flags_list_body.tpl
##	root/templates/subSilver/admin/flags_edit_body.tpl

and then do this instructions from Country/Location Flags MOD 2.3.3

Code: Select all

########################################################
## MOD Title: Country/Location Flags MOD
## MOD Author: ycl6 < ycl6@users.sourceforge.net > (Y.C. LIN) http://macphpbbmod.sourceforge.net/
## MOD Author: Nuttzy99 < n/a > (Nuttzy) http://www.spellingcow.com/
## MOD Author: AbelaJohnB < n/a > (John B. Abela) n/a
## MOD Description: This mod allows your registered board members to select the flag of their country/location.
## MOD Version: 2.3.3
## 
## Installation Level: Intermediate
## Installation Time: 15 - 20 Minutes
##
## Files To Edit: 10
##	viewtopic.php
##	admin/admin_users.php
##	includes/constants.php
##	includes/usercp_viewprofile.php
##	includes/usercp_register.php
##	includes/usercp_avatar.php
##	language/lang_english/lang_main.php
##	language/lang_english/lang_admin.php
##	templates/subSilver/profile_add_body.tpl
##	templates/subSilver/admin/user_edit_body.tpl
##
## Included Files: 3 + 261 images
##	root/images/flags/*.gif
##	root/admin/admin_flags.php
##	root/templates/subSilver/admin/flags_list_body.tpl
##	root/templates/subSilver/admin/flags_edit_body.tpl
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
################################################################# 
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
############################################################## 
## Author Notes:
##
## 	Tested on 2.0.21. Can be installed using EasyMOD 0.3.0
##	Flag images are from CIA - The World Factbook - Flags of the World
##	http://www.cia.gov/cia/publications/factbook/docs/flagsoftheworld.html
##
## 	Monitor update status: http://sourceforge.net/project/filemodule_monitor.php?filemodule_id=187608
##
############################################################## 
## Version History:
##
##   2002-02-28 - Version ???
##      - Updated for phpBB 2.0 RC2 - Nuttzy
##
##   2002-04-01 - Version ???
##      - Updated for phpBB 2.0 RC4
##	- Right justified flags in members listing
##
##   2002-04-14 - Version 2.0.4
##	- Release for phpBB 2.0 final
##
##   2002-05-18 - Version 2.0.5
##	- Fixed a bug with edit profile sometimes reinitializing the settings - thanks sj26!
##	- Display flag when selecting from edit profile - coded by sj26
##	- Flags can be changed when editing a user in the admin panel
##	- Upgrade script from 2.0.4 released
##
##   2002-08-13 - Version 2.0.6
##	- Made for 2.0.2 of phpBB
##	- Made EasyMod alpha 2 compliant
##
##   2003-02-20 - Version 2.2.0
##	- Updated for phpBB 2.0.4
##	- Added admin tools to edit/add/remove flags
##
##   2006-04-15 - Version 2.3.0
##	- MOD took over by ycl6
##	- Updated for phpBB 2.0.20
##	- Added more countries/locations and flags
##	- Rewrote some of the codes and fix a couple of bugs
##
##   2006-05-05 - Version 2.3.1
##	- Fix a bug with flag setting become missing when profile is re-edited (thanks kenn)
##
##   2006-06-24 - Version 2.3.2
##	- Include EasyMOD compatible SQL update script separately
##
##   2006-09-24 - Version 2.3.3
##	- Display country name instead of flag name when hover over flag image
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

#
#-----[ COPY ]------------------------------------------ 
#
copy root/images/flags/*.gif to images/flags/
copy root/admin/*.php to admin/
copy root/templates/subSilver/admin/*.tpl to templates/subSilver/admin/
#
#-----[ DIY INSTRUCTIONS ]------------------------------------------ 
#
In order to insert the appropriate database entries, please choose one of the following methods:
Method 1: Copy root/install/db_update_en.php to install/db_update_en.php. Execute and delete after it has been run
Method 2: Use EasyMOD to run contrib/install/db_update_en.txt
Method 3: Copy the SQL query from contrib/install/db_update_en.txt and execute it manually
#
#-----[ OPEN ]------------------------------------------ 
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------ 
#
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
define('FLAG_TABLE', $table_prefix.'flags');	// Country/Location Flags
# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------ 
#
$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
// Country/Location Flags
$sql = "SELECT flag_name
	FROM " . FLAG_TABLE . "
	WHERE flag_image = '" . $profiledata['user_from_flag'] . "'";
if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'No_such_flag');
}

if ( $flagrow = $db->sql_fetchrow($result) )
{
	$flag_name = $flagrow['flag_name'];
}

$location = ( $profiledata['user_from'] ) ? $profiledata['user_from'] : '&nbsp;';
$flag = ( !empty($profiledata['user_from_flag']) ) ? '&nbsp;<img src="images/flags/' . $profiledata['user_from_flag'] . '" alt="' . $flag_name . '" title="' . $flag_name . '" border="1" />' : '';
$location .= $flag;
#
#-----[ FIND ]------------------------------------------ 
#
	'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : '&nbsp;',
#
#-----[ REPLACE WITH ]------------------------------------------ 
#
	'LOCATION' => $location,	// Country/Location Flags
# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------ 
#
	$user_timezone = ( isset($HTTP_POST_VARS['timezone']) ) ? doubleval($HTTP_POST_VARS['timezone']) : $board_config['board_timezone'];
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
	$user_flag = ( !empty($HTTP_POST_VARS['user_flag']) && $HTTP_POST_VARS['user_flag'] != 'blank.gif' ) ? htmlspecialchars($HTTP_POST_VARS['user_flag']) : '' ;	// Country/Location Flags
#
#-----[ FIND ]------------------------------------------ 
# 
#
			$sql = "UPDATE " . USERS_TABLE . "
				SET " . $username_sql . $passwd_sql
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
user_from = '" . str_replace("\'", "''", $location) . "',
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 user_from_flag = '" . str_replace("\'", "''", $user_flag) . "',
#
#-----[ FIND ]------------------------------------------ 
#
			$sql = "INSERT INTO " . USERS_TABLE . "	(user_id
				VALUES ($user_id
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
user_from,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 user_from_flag,
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
'" . str_replace("\'", "''", $location) . "',
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
'" . str_replace("\'", "''", $user_flag) . "',
#
#-----[ FIND ]------------------------------------------ 
#
	$location = $userdata['user_from'];
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
	$user_flag = $userdata['user_from_flag'];	// Country/Location Flags
#
#-----[ FIND ]------------------------------------------ 
#
	display_avatar_gallery($mode,
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
$location,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 $user_flag,
#
#-----[ FIND ]------------------------------------------ 
#
		$template->assign_block_vars('switch_edit_profile', array());
	}
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
	// Country/Location Flags
	// Query to get the list of flags
	$sql = "SELECT *
		FROM " . FLAG_TABLE . "
		ORDER BY flag_name";
	if(!$flags_result = $db->sql_query($sql))
	{
		message_die(GENERAL_ERROR, "Couldn't obtain flags information.", "", __LINE__, __FILE__, $sql);
	}

	// Build the html select statement
	$flag_start_image = 'blank.gif';
	$user_flag = ( !empty($user_flag) ) ? $user_flag : 'blank.gif';
	$flag_select = '<select name="user_flag" onChange="document.images[\'user_flag\'].src = \'images/flags/\' + this.value;">';
	$flag_select .= '<option value="blank.gif">' . $lang['Select_country'] . '</option>';
	while ( $flag_row = $db->sql_fetchrow($flags_result) )
	{
		$flag_name = $flag_row['flag_name'];
		$flag_image = $flag_row['flag_image'];
		$selected = ( $user_flag == $flag_image ) ? ' selected="selected"' : '';
		if ( !empty($flag_name) )
		{
			$flag_select .= '&nbsp;&nbsp;&nbsp;<option value="' . $flag_image . '"' . $selected . '>' . $flag_name . '</option>';
		}
		if ( isset( $user_flag) && ($user_flag == $flag_image))
		{
			$flag_start_image = $flag_image;
		}
	}
	$flag_select .= '</select>';
#
#-----[ FIND ]------------------------------------------ 
#
		'LOCATION' => $location,
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
		'L_FLAG' => $lang['Country_flag'],	// Country/Location Flags
		'FLAG_SELECT' => $flag_select,		// Country/Location Flags
		'FLAG_START' => $flag_start_image,	// Country/Location Flags
# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/usercp_avatar.php
#
#-----[ FIND ]------------------------------------------ 
#
function display_avatar_gallery($mode,
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
&$location,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 &$user_flag,
#
#-----[ FIND ]------------------------------------------ 
#
	$params = array(
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
'location',
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 'user_flag',
# 
#-----[ OPEN ]------------------------------------------ 
# 
viewtopic.php
#
#-----[ FIND ]------------------------------------------ 
#
$sql = "SELECT u.username,
	FROM " . POSTS_TABLE
	WHERE p.topic_id = $topic_id
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
u.user_from
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
, u.user_from_flag
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
pt.bbcode_uid
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
, ft.flag_name
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
POSTS_TEXT_TABLE . " pt
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
, " . FLAG_TABLE . " ft
#
#-----[ FIND ]------------------------------------------ 
#
		AND u.user_id = p.poster_id
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
		AND ft.flag_image = u.user_from_flag
#
#-----[ FIND ]------------------------------------------ 
#
	$poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Location'] . ': ' . $postrow[$i]['user_from'] : '';
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
	// Country/Location Flags
	$poster_from_flag = ( $postrow[$i]['user_from_flag'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? '<br /><img src="images/flags/' . $postrow[$i]['user_from_flag'] . '" alt="' . $postrow[$i]['flag_name'] . '" title="' . $postrow[$i]['flag_name'] . '" border="1" /><br />' : '';
#
#-----[ FIND ]------------------------------------------ 
#
		'POSTER_FROM' => $poster_from,
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
$poster_from
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 . $poster_from_flag
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]------------------------------------------ 
#
		$user_timezone = ( isset( $HTTP_POST_VARS['timezone']) ) ? doubleval( $HTTP_POST_VARS['timezone'] ) : $board_config['board_timezone'];
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
		$user_flag = ( !empty($HTTP_POST_VARS['user_flag']) && $HTTP_POST_VARS['user_flag'] != 'blank.gif' ) ? htmlspecialchars($HTTP_POST_VARS['user_flag']) : '' ;	// Country/Location Flags
#
#-----[ FIND ]------------------------------------------ 
#
			$sql = "UPDATE " . USERS_TABLE . "
				SET " . $username_sql
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
user_from = '" . str_replace("\'", "''", $location) . "',
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 user_from_flag = '" . str_replace("\'", "''", $user_flag) . "',
#
#-----[ FIND ]------------------------------------------ 
#
			$location = htmlspecialchars(stripslashes($location));
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
			$user_flag = htmlspecialchars(stripslashes($user_flag));	// Country/Location Flags
#
#-----[ FIND ]------------------------------------------ 
#
		$location = htmlspecialchars($this_userdata['user_from']);
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
		$user_flag = htmlspecialchars($this_userdata['user_from_flag']);	// Country/Location Flags
#
#-----[ FIND ]------------------------------------------ 
#
			$s_hidden_fields .= '<input type="hidden" name="location" value="' . str_replace("\"", """, $location) . '" />';
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
			$s_hidden_fields .= '<input type="hidden" name="user_flag" value="' . str_replace("\"", """, $user_flag) . '" />';	// Country/Location Flags
#
#-----[ FIND ]------------------------------------------ 
#
		$form_enctype = ( !@$ini_val('file_uploads')
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
		// Country/Location Flags
		// Query to get the list of flags
		$sql = "SELECT *
			FROM " . FLAG_TABLE . "
			ORDER BY flag_name";
		if(!$flags_result = $db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, "Couldn't obtain flags information.", "", __LINE__, __FILE__, $sql);
		}

		// Build the html select statement
		$flag_start_image = 'blank.gif';
		$user_flag = ( !empty($user_flag) ) ? $user_flag : 'blank.gif';
		$flag_select = '<select name="user_flag" onChange="document.images[\'user_flag\'].src = \'../images/flags/\' + this.value;">';
		$flag_select .= '<option value="blank.gif">' . $lang['Select_country'] . '</option>';
		while ( $flag_row = $db->sql_fetchrow($flags_result) )
		{
			$flag_name = $flag_row['flag_name'];
			$flag_image = $flag_row['flag_image'];
			$selected = ( $user_flag == $flag_image ) ? ' selected="selected"' : '';
			if ( !empty($flag_name) )
			{
				$flag_select .= '&nbsp;&nbsp;&nbsp;<option value="' . $flag_image . '"' . $selected . '>' . $flag_name . '</option>';
			}
			if ( isset( $user_flag) && ($user_flag == $flag_image))
			{
				$flag_start_image = $flag_image;
			}
		}
		$flag_select .= '</select>';
#
#-----[ FIND ]------------------------------------------ 
#
			'LOCATION' => $location,
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
			'L_FLAG' => $lang['Country_flag'],	// Country/Location Flags
			'FLAG_SELECT' => $flag_select,		// Country/Location Flags
			'FLAG_START' => $flag_start_image,	// Country/Location Flags
# 
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_english/lang_main.php
# 
#-----[ FIND ]------------------------------------------ 
#
?>
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
$lang['Country_flag'] = 'Flag';				// Country/Location Flags
$lang['Select_country'] = 'SELECT COUNTRY/LOCATION';	// Country/Location Flags
$lang['No_such_flag'] = 'No such flag exists';		// Country/Location Flags
# 
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_english/lang_admin.php
# 
#-----[ FIND ]------------------------------------------ 
#
?>
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
// Country/Location Flags
$lang['Flags'] = 'Flags';
$lang['Flags_title'] = 'Flag Administration';
$lang['Flags_explain'] = 'Using this form you can add, edit, view and delete flags. You can also create custom flags which can be applied to a user via the user management facility';
$lang['Add_new_flag'] = 'Add new flag';
$lang['Flag_name'] = 'Flag Name';
$lang['Flag_pic'] = 'Image';
$lang['Flag_image'] = 'Flag Image (in the images/flags/ directory)';
$lang['Flag_image_explain'] = 'Use this to define a small image associated with the flag';
$lang['Must_select_flag'] = 'You must select a flag';
$lang['Flag_updated'] = 'The flag was successfully updated';
$lang['Flag_added'] = 'The flag was successfully added';
$lang['Flag_removed'] = 'The flag was successfully deleted';
$lang['No_update_flags'] = 'The flag was successfully deleted. However, user accounts using this flag were not updated.  You will need to manually reset the flag on these accounts';
$lang['Flag_confirm'] = 'Delete Flag';
$lang['Confirm_delete_flag'] = 'Are you sure you want to remove the selected flag?';
$lang['Click_return_flagadmin'] = 'Click %sHere%s to return to Flag Administration';
# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------ 
#
		<input type="text" class="post" style="width: 200px"  name="location" size="25" maxlength="100" value="{LOCATION}" />
	  </td>
	</tr>
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
	<tr>
	  <td class="row1"><span class="gen">{L_FLAG}:</span></td>
	  <td class="row2"><span class="gensmall">
		<table><tr>
			<td>{FLAG_SELECT}&nbsp;&nbsp;&nbsp;</td>
	  		<td><img src="images/flags/{FLAG_START}" name="user_flag" /></td>
		</tr></table>
	  </span></td>
	</tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl
#
#-----[ FIND ]------------------------------------------ 
#
		<input class="post" type="text" name="location" size="35" maxlength="100" value="{LOCATION}" />
	  </td>
	</tr>
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
	<tr>
	  <td class="row1"><span class="gen">{L_FLAG}:</span></td>
	  <td class="row2"><span class="gensmall">
		<table><tr>
			<td>{FLAG_SELECT}&nbsp;&nbsp;&nbsp;</td>
	  		<td><img src="../images/flags/{FLAG_START}" name="user_flag" /></td>
		</tr></table>
	  </span></td>
	</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
#
# EoM
Last edited by ScorpAL on Wed Nov 22, 2006 11:35 am, edited 1 time in total.

ScorpAL
Registered User
Posts: 15
Joined: Mon Nov 20, 2006 11:15 am

Post by ScorpAL » Wed Nov 22, 2006 11:31 am

Sorry. I forgot file for database install in previous post

Code: Select all

########################################################
## MOD Title: Country/Location Flags MOD [SQL query execution file]
## MOD Author: ycl6 < ycl6@users.sourceforge.net > (Y.C. LIN) http://macphpbbmod.sourceforge.net/
## MOD Description: SQL query execution file. Can be used with EasyMOD.
## MOD Version: 1.0.1
## 
## Installation Level: Easy
## Installation Time: 1 Minute
##
## Files To Edit: 0
##
## Included Files: 0
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
################################################################# 
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
############################################################## 
## Author Notes:
##
## 	Tested on 2.0.21. Can be installed using EasyMOD 0.3.0
##
############################################################## 
## Version History:
##
##   2006-06-24 - Version 1.0.0
##	- Initial Release
##
##   2006-09-24 - Version 1.0.1
##	- SQL Query updated
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

# 
#-----[ SQL ]------------------------------------------ 
#
# Remember to change the table prefix used on your database

ALTER TABLE phpbb_users ADD user_from_flag VARCHAR(25) NULL;

CREATE TABLE phpbb_flags (
    flag_id INTEGER(10) NOT NULL AUTO_INCREMENT,
    flag_name VARCHAR(50),
    flag_image VARCHAR(25),
    PRIMARY KEY (flag_id)
);

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','','');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','af.gif','Afghanistan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ax.gif','Akrotiri');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','al.gif','Albania');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ag.gif','Algeria');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','aq.gif','American Samoa');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','an.gif','Andorra');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ao.gif','Angola');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','av.gif','Anguilla');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ac.gif','Antigua and Barbuda');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ar.gif','Argentina');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','am.gif','Armenia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','aa.gif','Aruba');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','at.gif','Ashmore and Cartier Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','as.gif','Australia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','au.gif','Austria');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','aj.gif','Azerbaijan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bf.gif','Bahamas, The');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ba.gif','Bahrain');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','fq.gif','Baker Island');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bg.gif','Bangladesh');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bb.gif','Barbados');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bs.gif','Bassas da India');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bo.gif','Belarus');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','be.gif','Belgium');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bh.gif','Belize');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bn.gif','Benin');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bd.gif','Bermuda');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bt.gif','Bhutan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bl.gif','Bolivia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bk.gif','Bosnia and Herzegovina');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bc.gif','Botswana');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bv.gif','Bouvet Island');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','br.gif','Brazil');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','io.gif','British Indian Ocean Territory');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','vi.gif','British Virgin Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bx.gif','Brunei');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bu.gif','Bulgaria');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','uv.gif','Burkina Faso');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bm.gif','Burma');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','by.gif','Burundi');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cb.gif','Cambodia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cm.gif','Cameroon');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ca.gif','Canada');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cv.gif','Cape Verde');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cj.gif','Cayman Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ct.gif','Central African Republic');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cd.gif','Chad');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ci.gif','Chile');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ch.gif','China');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','kt.gif','Christmas Island');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ip.gif','Clipperton Island');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ck.gif','Cocos (Keeling) Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','co.gif','Colombia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cn.gif','Comoros');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cg.gif','Congo, Democratic Republic of the');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cf.gif','Congo, Republic of the');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cw.gif','Cook Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cr.gif','Coral Sea Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cs.gif','Costa Rica');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','iv.gif','Cote d\'Ivoire');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','hr.gif','Croatia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cu.gif','Cuba');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cy.gif','Cyprus');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ez.gif','Czech Republic');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','da.gif','Denmark');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','dx.gif','Dhekelia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','dj.gif','Djibouti');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','do.gif','Dominica');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','dr.gif','Dominican Republic');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','tt.gif','East Timor');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ec.gif','Ecuador');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','eg.gif','Egypt');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','es.gif','El Salvador');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ek.gif','Equatorial Guinea');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','er.gif','Eritrea');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','en.gif','Estonia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','et.gif','Ethiopia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','eu.gif','Europa Island');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','fk.gif','Falkland Islands (Islas Malvinas)');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','fo.gif','Faroe Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','fj.gif','Fiji');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','fi.gif','Finland');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','fr.gif','France');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','fg.gif','French Guiana');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','fp.gif','French Polynesia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','fs.gif','French Southern and Antarctic Lands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gb.gif','Gabon');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ga.gif','Gambia, The');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gg.gif','Georgia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gm.gif','Germany');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gh.gif','Ghana');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gi.gif','Gibraltar');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','go.gif','Glorioso Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gr.gif','Greece');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gl.gif','Greenland');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gj.gif','Grenada');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gp.gif','Guadeloupe');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gq.gif','Guam');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gt.gif','Guatemala');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gk.gif','Guernsey');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gv.gif','Guinea');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','pu.gif','Guinea-Bissau');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','gy.gif','Guyana');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ha.gif','Haiti');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','hm.gif','Heard Island and McDonald Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','vt.gif','Holy See (Vatican City)');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ho.gif','Honduras');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','hk.gif','Hong Kong');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','hq.gif','Howland Island');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','hu.gif','Hungary');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ic.gif','Iceland');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','in.gif','India');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','id.gif','Indonesia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ir.gif','Iran');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','iz.gif','Iraq');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ei.gif','Ireland');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','im.gif','Isle of Man');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','is.gif','Israel');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','it.gif','Italy');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','jm.gif','Jamaica');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','jn.gif','Jan Mayen');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ja.gif','Japan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','dq.gif','Jarvis Island');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','je.gif','Jersey');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','jq.gif','Johnston Atoll');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','jo.gif','Jordan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ju.gif','Juan de Nova Island');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','kz.gif','Kazakhstan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ke.gif','Kenya');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','kq.gif','Kingman Reef');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','kr.gif','Kiribati');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','kn.gif','Korea, North');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ks.gif','Korea, South');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ku.gif','Kuwait');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','kg.gif','Kyrgyzstan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','la.gif','Laos');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','lg.gif','Latvia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','le.gif','Lebanon');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','lt.gif','Lesotho');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','li.gif','Liberia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ly.gif','Libya');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ls.gif','Liechtenstein');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','lh.gif','Lithuania');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','lu.gif','Luxembourg');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mc.gif','Macau');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mk.gif','Macedonia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ma.gif','Madagascar');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mi.gif','Malawi');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','my.gif','Malaysia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mv.gif','Maldives');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ml.gif','Mali');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mt.gif','Malta');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','rm.gif','Marshall Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mb.gif','Martinique');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mr.gif','Mauritania');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mp.gif','Mauritius');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mf.gif','Mayotte');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mx.gif','Mexico');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','fm.gif','Micronesia, Federated States of');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mq.gif','Midway Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','md.gif','Moldova');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mn.gif','Monaco');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mg.gif','Mongolia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mh.gif','Montserrat');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mo.gif','Morocco');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mz.gif','Mozambique');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','wa.gif','Namibia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','nr.gif','Nauru');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bq.gif','Navassa Island');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','np.gif','Nepal');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','nl.gif','Netherlands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','nt.gif','Netherlands Antilles');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','nc.gif','New Caledonia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','nz.gif','New Zealand');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','nu.gif','Nicaragua');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ng.gif','Niger');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ni.gif','Nigeria');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ne.gif','Niue');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','nf.gif','Norfolk Island');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','cq.gif','Northern Mariana Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','no.gif','Norway');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','mu.gif','Oman');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','pk.gif','Pakistan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ps.gif','Palau');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','lq.gif','Palmyra Atoll');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','pm.gif','Panama');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','pp.gif','Papua New Guinea');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','pa.gif','Paraguay');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','pe.gif','Peru');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','rp.gif','Philippines');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','pc.gif','Pitcairn Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','pl.gif','Poland');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','po.gif','Portugal');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','rq.gif','Puerto Rico');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','qa.gif','Qatar');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','re.gif','Reunion');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ro.gif','Romania');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','rs.gif','Russia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','rw.gif','Rwanda');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sh.gif','Saint Helena');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sc.gif','Saint Kitts and Nevis');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','st.gif','Saint Lucia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sb.gif','Saint Pierre and Miquelon');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','vc.gif','Saint Vincent and the Grenadines');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ws.gif','Samoa');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sm.gif','San Marino');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','tp.gif','Sao Tome and Principe');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sa.gif','Saudi Arabia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sg.gif','Senegal');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','yi.gif','Serbia and Montenegro');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','se.gif','Seychelles');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sl.gif','Sierra Leone');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sn.gif','Singapore');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','lo.gif','Slovakia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','si.gif','Slovenia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','bp.gif','Solomon Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','so.gif','Somalia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sf.gif','South Africa');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sx.gif','South Georgia and the South Sandwich Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sp.gif','Spain');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ce.gif','Sri Lanka');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','su.gif','Sudan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ns.gif','Suriname');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sv.gif','Svalbard');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','wz.gif','Swaziland');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sw.gif','Sweden');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sz.gif','Switzerland');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','sy.gif','Syria');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ti.gif','Tajikistan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','tz.gif','Tanzania');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','th.gif','Thailand');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','to.gif','Togo');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','tl.gif','Tokelau');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','tn.gif','Tonga');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','td.gif','Trinidad and Tobago');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','te.gif','Tromelin Island');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ts.gif','Tunisia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','tu.gif','Turkey');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','tx.gif','Turkmenistan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','tk.gif','Turks and Caicos Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','tv.gif','Tuvalu');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ug.gif','Uganda');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','up.gif','Ukraine');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ae.gif','United Arab Emirates');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','uk.gif','United Kingdom');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','us.gif','United States');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','um.gif','United States Pacific Island Wildlife Refuges');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','uy.gif','Uruguay');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','uz.gif','Uzbekistan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','nh.gif','Vanuatu');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ve.gif','Venezuela');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','vm.gif','Vietnam');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','vq.gif','Virgin Islands');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','wq.gif','Wake Island');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','wf.gif','Wallis and Futuna');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ym.gif','Yemen');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','za.gif','Zambia');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','zi.gif','Zimbabwe');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','tw.gif','Taiwan');

INSERT INTO phpbb_flags(flag_id,flag_image,flag_name) VALUES('','ee.gif','European Union');

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
#
# EoM

aussiewal
Registered User
Posts: 169
Joined: Tue Nov 14, 2006 5:47 am
Location: Sydney, Australia

Post by aussiewal » Wed Nov 22, 2006 11:52 am

Hey dude

Thanks but...

I have to use EasyMod as I know nothing about PHP.

I can't get it to install with easymod.

I will try what you suggested but I have been trying for over 5 days now and no luck.

I must be doing something really stupid for it not to work

It says it can be installed using EasyMod but it can't.

And the new version is corrup from all the sources I have tried to download it from.

Will

ScorpAL
Registered User
Posts: 15
Joined: Mon Nov 20, 2006 11:15 am

Post by ScorpAL » Wed Nov 22, 2006 1:04 pm

What error EASY MOD you say?

aussiewal
Registered User
Posts: 169
Joined: Tue Nov 14, 2006 5:47 am
Location: Sydney, Australia

Post by aussiewal » Wed Nov 22, 2006 11:23 pm

ScorpAL wrote: What error EASY MOD you say?


Hey dude

Thanks for helping me..

This is what I get through Easymod

In order to insert the appropriate database entries, please choose one of the following methods:

Method 1: Copy root/install/db_update_en.php to install/db_update_en.php. Execute and delete after it has been run

Method 2: Use EasyMOD to run contrib/install/db_update_en.txt

Method 3: Copy the SQL query from contrib/install/db_update_en.txt and execute it manually.


The files it is talking about I can't find.

I'm very new to PHP, and struggling badly to work it our.
I'm not a programmer, just been thrown in at the deep end with moving a website that is written in HTML, over to a CMS (geeklog), and including a forum. After this I need to convert the data over from an SMF Board to PHPBB.

AHHHHHHHH!

You know any good physiatrists?

Will

ScorpAL
Registered User
Posts: 15
Joined: Mon Nov 20, 2006 11:15 am

Post by ScorpAL » Thu Nov 23, 2006 7:41 am

Hi aussiewal

NEW INSTRUCTION FOR YOU:

1. Download previous version Country/Location Flags MOD 2.3.2

http://sourceforge.net/project/showfile ... _id=187608

2. Upload all files listed below from 2.3.2 version to you forum directory:

Code: Select all

## Included Files: 3 + 261 images 
##   root/images/flags/*.gif 
##   root/admin/admin_flags.php 
##   root/templates/subSilver/admin/flags_list_body.tpl 
##   root/templates/subSilver/admin/flags_edit_body.tpl
3. Copy text listed below and save as install_flag.php

Code: Select all

<?php
/**
 *
 * @package SQL Parser
 * @script install/db_update.php
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License
 *
 *
 * - WARNINGS:
 *   *** This script contains SQL/DLL statements that will modify your database!!!
 *   *** The SQL/DDL statements contained in this script are optimized for MySQL only!
 *
 * - Installation:
 *   1) Make backups of your database before proceeding!
 *   2) Create a subdirectory named "install" (without quotes) in your phpBB installation.
 *   3) Save this file as "db_update.php" and upload to your newly created install directory.
 *   4) Now, open the script using your browser of choice as in the following example:
 *      http://www.example.com/forums/install/db_update.php
 *      ...and follow instructions.
 *   5) Once, your DB has been updated, remove the install directory and this file.
 *
 * - Notes:
 *   - This script can only be run by board administrators.
 *   - First, a confirmation panel will show all SQL statements.
 *   - Your database will only be updated once the confirmation panel has been confirmed.
 *
 */

define('IN_PHPBB', true);
$phpbb_root_path = '../';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$gen_simple_header = true;

//
// Language entries used in this script.
//
$lang += array(
	'Update_confirm'			=> 'This panel will update your database with the SQL statements detailed below.<br /><br />Remember to make backups of your database before proceeding!<hr /><table><tr><td><pre>%s</pre></td></tr></table><hr />Click <i>Yes</i> to proceed or <i>No</i> to return to your board index.',
	'Updating_database'			=> 'Updating the Database',
	'Installation_complete'		=> 'Installation Complete',
	'Delete_this_file'			=> 'Please, be sure to delete your install directory and this file from your phpBB installation now.',
	'Successful'				=> 'Successful'
);

//
// Session Management.
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

//
// Only administrators here, please
//
if( !$userdata['session_logged_in'] )
{
	redirect(append_sid("login.$phpEx?redirect=".basename(__FILE__), true));
}
if( $userdata['user_level'] != ADMIN )
{
	if ( @file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx) )
	{
		include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx);
	}
	else
	{
		include($phpbb_root_path . 'language/lang_english/lang_admin.' . $phpEx);
	}
	message_die(GENERAL_MESSAGE, $lang['Not_admin']);
}

//
// Build Array of SQL Statements.
//
$sql = array();
$sql[] = 'ALTER TABLE ' . $table_prefix . 'users ADD user_from_flag VARCHAR(25) NULL';
$sql[] = 'CREATE TABLE ' . $table_prefix . 'flags (
    flag_id INTEGER(10) NOT NULL AUTO_INCREMENT,
    flag_name VARCHAR(50),
    flag_image VARCHAR(25),
    PRIMARY KEY (flag_id)
)';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'\',\'\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'af.gif\',\'Afghanistan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ax.gif\',\'Akrotiri\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'al.gif\',\'Albania\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ag.gif\',\'Algeria\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'aq.gif\',\'American Samoa\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'an.gif\',\'Andorra\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ao.gif\',\'Angola\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'av.gif\',\'Anguilla\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ac.gif\',\'Antigua and Barbuda\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ar.gif\',\'Argentina\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'am.gif\',\'Armenia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'aa.gif\',\'Aruba\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'at.gif\',\'Ashmore and Cartier Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'as.gif\',\'Australia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'au.gif\',\'Austria\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'aj.gif\',\'Azerbaijan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bf.gif\',\'Bahamas, The\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ba.gif\',\'Bahrain\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'fq.gif\',\'Baker Island\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bg.gif\',\'Bangladesh\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bb.gif\',\'Barbados\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bs.gif\',\'Bassas da India\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bo.gif\',\'Belarus\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'be.gif\',\'Belgium\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bh.gif\',\'Belize\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bn.gif\',\'Benin\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bd.gif\',\'Bermuda\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bt.gif\',\'Bhutan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bl.gif\',\'Bolivia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bk.gif\',\'Bosnia and Herzegovina\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bc.gif\',\'Botswana\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bv.gif\',\'Bouvet Island\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'br.gif\',\'Brazil\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'io.gif\',\'British Indian Ocean Territory\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'vi.gif\',\'British Virgin Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bx.gif\',\'Brunei\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bu.gif\',\'Bulgaria\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'uv.gif\',\'Burkina Faso\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bm.gif\',\'Burma\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'by.gif\',\'Burundi\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cb.gif\',\'Cambodia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cm.gif\',\'Cameroon\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ca.gif\',\'Canada\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cv.gif\',\'Cape Verde\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cj.gif\',\'Cayman Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ct.gif\',\'Central African Republic\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cd.gif\',\'Chad\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ci.gif\',\'Chile\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ch.gif\',\'China\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'kt.gif\',\'Christmas Island\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ip.gif\',\'Clipperton Island\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ck.gif\',\'Cocos (Keeling) Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'co.gif\',\'Colombia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cn.gif\',\'Comoros\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cg.gif\',\'Congo, Democratic Republic of the\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cf.gif\',\'Congo, Republic of the\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cw.gif\',\'Cook Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cr.gif\',\'Coral Sea Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cs.gif\',\'Costa Rica\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'iv.gif\',\'Cote d\'Ivoire\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'hr.gif\',\'Croatia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cu.gif\',\'Cuba\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cy.gif\',\'Cyprus\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ez.gif\',\'Czech Republic\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'da.gif\',\'Denmark\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'dx.gif\',\'Dhekelia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'dj.gif\',\'Djibouti\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'do.gif\',\'Dominica\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'dr.gif\',\'Dominican Republic\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'tt.gif\',\'East Timor\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ec.gif\',\'Ecuador\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'eg.gif\',\'Egypt\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'es.gif\',\'El Salvador\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ek.gif\',\'Equatorial Guinea\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'er.gif\',\'Eritrea\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'en.gif\',\'Estonia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'et.gif\',\'Ethiopia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'eu.gif\',\'Europa Island\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'fk.gif\',\'Falkland Islands (Islas Malvinas)\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'fo.gif\',\'Faroe Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'fj.gif\',\'Fiji\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'fi.gif\',\'Finland\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'fr.gif\',\'France\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'fg.gif\',\'French Guiana\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'fp.gif\',\'French Polynesia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'fs.gif\',\'French Southern and Antarctic Lands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gb.gif\',\'Gabon\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ga.gif\',\'Gambia, The\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gg.gif\',\'Georgia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gm.gif\',\'Germany\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gh.gif\',\'Ghana\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gi.gif\',\'Gibraltar\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'go.gif\',\'Glorioso Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gr.gif\',\'Greece\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gl.gif\',\'Greenland\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gj.gif\',\'Grenada\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gp.gif\',\'Guadeloupe\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gq.gif\',\'Guam\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gt.gif\',\'Guatemala\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gk.gif\',\'Guernsey\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gv.gif\',\'Guinea\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'pu.gif\',\'Guinea-Bissau\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'gy.gif\',\'Guyana\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ha.gif\',\'Haiti\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'hm.gif\',\'Heard Island and McDonald Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'vt.gif\',\'Holy See (Vatican City)\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ho.gif\',\'Honduras\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'hk.gif\',\'Hong Kong\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'hq.gif\',\'Howland Island\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'hu.gif\',\'Hungary\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ic.gif\',\'Iceland\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'in.gif\',\'India\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'id.gif\',\'Indonesia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ir.gif\',\'Iran\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'iz.gif\',\'Iraq\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ei.gif\',\'Ireland\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'im.gif\',\'Isle of Man\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'is.gif\',\'Israel\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'it.gif\',\'Italy\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'jm.gif\',\'Jamaica\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'jn.gif\',\'Jan Mayen\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ja.gif\',\'Japan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'dq.gif\',\'Jarvis Island\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'je.gif\',\'Jersey\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'jq.gif\',\'Johnston Atoll\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'jo.gif\',\'Jordan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ju.gif\',\'Juan de Nova Island\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'kz.gif\',\'Kazakhstan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ke.gif\',\'Kenya\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'kq.gif\',\'Kingman Reef\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'kr.gif\',\'Kiribati\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'kn.gif\',\'Korea, North\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ks.gif\',\'Korea, South\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ku.gif\',\'Kuwait\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'kg.gif\',\'Kyrgyzstan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'la.gif\',\'Laos\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'lg.gif\',\'Latvia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'le.gif\',\'Lebanon\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'lt.gif\',\'Lesotho\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'li.gif\',\'Liberia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ly.gif\',\'Libya\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ls.gif\',\'Liechtenstein\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'lh.gif\',\'Lithuania\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'lu.gif\',\'Luxembourg\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mc.gif\',\'Macau\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mk.gif\',\'Macedonia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ma.gif\',\'Madagascar\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mi.gif\',\'Malawi\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'my.gif\',\'Malaysia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mv.gif\',\'Maldives\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ml.gif\',\'Mali\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mt.gif\',\'Malta\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'rm.gif\',\'Marshall Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mb.gif\',\'Martinique\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mr.gif\',\'Mauritania\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mp.gif\',\'Mauritius\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mf.gif\',\'Mayotte\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mx.gif\',\'Mexico\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'fm.gif\',\'Micronesia, Federated States of\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mq.gif\',\'Midway Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'md.gif\',\'Moldova\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mn.gif\',\'Monaco\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mg.gif\',\'Mongolia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mh.gif\',\'Montserrat\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mo.gif\',\'Morocco\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mz.gif\',\'Mozambique\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'wa.gif\',\'Namibia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'nr.gif\',\'Nauru\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bq.gif\',\'Navassa Island\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'np.gif\',\'Nepal\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'nl.gif\',\'Netherlands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'nt.gif\',\'Netherlands Antilles\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'nc.gif\',\'New Caledonia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'nz.gif\',\'New Zealand\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'nu.gif\',\'Nicaragua\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ng.gif\',\'Niger\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ni.gif\',\'Nigeria\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ne.gif\',\'Niue\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'nf.gif\',\'Norfolk Island\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'cq.gif\',\'Northern Mariana Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'no.gif\',\'Norway\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'mu.gif\',\'Oman\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'pk.gif\',\'Pakistan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ps.gif\',\'Palau\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'lq.gif\',\'Palmyra Atoll\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'pm.gif\',\'Panama\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'pp.gif\',\'Papua New Guinea\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'pa.gif\',\'Paraguay\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'pe.gif\',\'Peru\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'rp.gif\',\'Philippines\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'pc.gif\',\'Pitcairn Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'pl.gif\',\'Poland\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'po.gif\',\'Portugal\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'rq.gif\',\'Puerto Rico\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'qa.gif\',\'Qatar\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'re.gif\',\'Reunion\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ro.gif\',\'Romania\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'rs.gif\',\'Russia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'rw.gif\',\'Rwanda\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sh.gif\',\'Saint Helena\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sc.gif\',\'Saint Kitts and Nevis\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'st.gif\',\'Saint Lucia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sb.gif\',\'Saint Pierre and Miquelon\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'vc.gif\',\'Saint Vincent and the Grenadines\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ws.gif\',\'Samoa\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sm.gif\',\'San Marino\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'tp.gif\',\'Sao Tome and Principe\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sa.gif\',\'Saudi Arabia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sg.gif\',\'Senegal\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'yi.gif\',\'Serbia and Montenegro\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'se.gif\',\'Seychelles\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sl.gif\',\'Sierra Leone\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sn.gif\',\'Singapore\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'lo.gif\',\'Slovakia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'si.gif\',\'Slovenia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'bp.gif\',\'Solomon Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'so.gif\',\'Somalia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sf.gif\',\'South Africa\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sx.gif\',\'South Georgia and the South Sandwich Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sp.gif\',\'Spain\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ce.gif\',\'Sri Lanka\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'su.gif\',\'Sudan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ns.gif\',\'Suriname\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sv.gif\',\'Svalbard\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'wz.gif\',\'Swaziland\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sw.gif\',\'Sweden\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sz.gif\',\'Switzerland\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'sy.gif\',\'Syria\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ti.gif\',\'Tajikistan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'tz.gif\',\'Tanzania\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'th.gif\',\'Thailand\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'to.gif\',\'Togo\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'tl.gif\',\'Tokelau\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'tn.gif\',\'Tonga\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'td.gif\',\'Trinidad and Tobago\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'te.gif\',\'Tromelin Island\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ts.gif\',\'Tunisia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'tu.gif\',\'Turkey\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'tx.gif\',\'Turkmenistan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'tk.gif\',\'Turks and Caicos Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'tv.gif\',\'Tuvalu\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ug.gif\',\'Uganda\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'up.gif\',\'Ukraine\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ae.gif\',\'United Arab Emirates\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'uk.gif\',\'United Kingdom\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'us.gif\',\'United States\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'um.gif\',\'United States Pacific Island Wildlife Refuges\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'uy.gif\',\'Uruguay\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'uz.gif\',\'Uzbekistan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'nh.gif\',\'Vanuatu\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ve.gif\',\'Venezuela\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'vm.gif\',\'Vietnam\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'vq.gif\',\'Virgin Islands\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'wq.gif\',\'Wake Island\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'wf.gif\',\'Wallis and Futuna\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ym.gif\',\'Yemen\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'za.gif\',\'Zambia\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'zi.gif\',\'Zimbabwe\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'tw.gif\',\'Taiwan\')';
$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'ee.gif\',\'European Union\')';
$sql_count = count($sql);

//
// Output confirmation page?
//
$cancel = isset($HTTP_POST_VARS['cancel']) ? true : false;
$confirm = isset($HTTP_POST_VARS['confirm']) ? true : false;
$mode = isset($HTTP_POST_VARS['mode']) ? trim(htmlspecialchars($HTTP_POST_VARS['mode'])) : '';

if( $cancel )
{
	redirect(append_sid("index.$phpEx", true));
}

if( !$confirm || $mode != 'db_update' )
{
	include($phpbb_root_path . 'includes/page_header.'.$phpEx);

	$template->set_filenames(array(
		'confirm_body' => 'confirm_body.tpl')
	);

	$message = sprintf($lang['Update_confirm'], implode(";\n\n", $sql));

	$s_hidden_fields = '<input type="hidden" name="mode" value="db_update" />';

	$template->assign_vars(array(
		'L_INDEX'			=> '',
		'MESSAGE_TITLE'		=> $lang['Information'],
		'MESSAGE_TEXT'		=> $message,
		'L_YES'				=> $lang['Yes'],
		'L_NO'				=> $lang['No'],
		'S_CONFIRM_ACTION'	=> append_sid(basename(__FILE__)),
		'S_HIDDEN_FIELDS'	=> $s_hidden_fields)
	);

	$template->pparse('confirm_body');

	include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}

//
// Send Page Header.
//
$page_title = $lang['Updating_database'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

//
// Execute SQL and get Results.
//
$sql_rows = '';
for( $i = 0; $i < $sql_count; $i++ )
{
	if( !($result = $db->sql_query($sql[$i])) )
	{
		$error = $db->sql_error();
		$color = '#FF0000';
		$success = $lang['Error'] . ':';
		$errmsg = ' ' . $error['message'];
	}
	else
	{
		$color = '#00AA00';
		$success = $lang['Successful'];
		$errmsg = '';
	}
	$class = ($i%2) == 0 ? 'row1' : 'row2';
	$sql_rows .= '<tr><td class="'.$class.'"><div class="genmed">' . $sql[$i] . ';<br /><br /><b style="color:' . $color . ';">' . $success . '</b>' . $errmsg . '</div></td></tr>';
}

//
// Build the Report.
//
$click_return_index = sprintf($lang['Click_return_index'], '<a class="genmed" href="' . append_sid($phpbb_root_path . "index.$phpEx") . '">', '</a>');

$html = <<<EOT
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="forumline">
	<tr>
		<th>{$page_title}</th>
	</tr>
	<tr>
		<td>
			<table cellpadding="8" cellspacing="1" border="0" align="center">
				{$sql_rows}
			</table>
		</td>
	</tr>
	<tr>
		<td class="row3"><img src="{$phpbb_root_path}images/spacer.gif" border="0" height="4" alt="" /></td>
	</tr>
	<tr>
		<th>{$lang['Installation_complete']}</th>
	</tr>
	<tr>
		<td align="center">
			<table cellpadding="8" cellspacing="0" border="0" align="center">
				<tr>
					<td>
						<b class="gen" style="color:#EE0000;">{$lang['Delete_this_file']}</b>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td class="catBottom" align="center">
			<span class="genmed">{$click_return_index}</span>
		</td>
	</tr>
</table>
EOT;
echo $html;

//
// Send Page Footer.
//
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
4. Create a subdirectory named "install" (without quotes) in your forum directory.

5. Upload install_flag.php to your newly created install directory.

6. Now, open the script using your browser of choice as in the following example: http://www.yoursite.com/forum/install/install_flag.php ...and follow instructions.

7. Once, your DB has been updated, remove the install directory and this file.

Post Reply

Return to “[2.0.x] MOD Database Releases”