[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

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

Re: [2.0.21] Country Flags MOD

Post by ycl6 » Mon Jul 09, 2007 12:37 pm

I'm sorry.

I don't use CPanel Mini, so I'm not sure how it works to display member's profile info.

~Mac

junks2001
Registered User
Posts: 16
Joined: Sun Sep 12, 2004 8:04 am

Re: [2.0.21] Country Flags MOD

Post by junks2001 » Mon Jul 09, 2007 9:27 pm

I'm getting this error when I go into admin. :shock:

Code: Select all

Parse error: parse error, unexpected T_VARIABLE in /phpBB2/admin/admin_users.php on line 2243
Here's the code on that line.

Code: Select all

$sql = "SELECT *
This is the full snippet.

Code: Select all

		// 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';

		$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"' : '';

			$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>';
Any idea how resolve this?

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

Re: [2.0.21] Country Flags MOD

Post by ycl6 » Tue Jul 10, 2007 12:51 pm

Hi junks2001,

I don't see any problem with that part of the code, have you install anything else that also edits admin_users.php?

I think the problem that cause the error message happen happen earlier, before line 2243.

~Mac

orij1nal
Registered User
Posts: 20
Joined: Wed Jul 11, 2007 8:24 pm

Re: [2.0.21] Country Flags MOD

Post by orij1nal » Thu Jul 12, 2007 6:28 pm

After installing the Country Flag mod (viewtopic.php?t=388656) I went into my ACP and I got this error message:

Code: Select all

Parse error: parse error, unexpected T_VARIABLE in /home/hkmediao/public_html/forum/admin/admin_users.php on line 1013
. So I went back in to admin_users.php and redid everything again step by step and I still get this error, does anyone know whats causing this?

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

Re: [2.0.21] Country Flags MOD

Post by ycl6 » Fri Jul 13, 2007 12:49 am

Do you have other MODs installed recently that also modify admin_users.php?

If you want, make a download link of your file, I can try to look at the file.

~Mac

orij1nal
Registered User
Posts: 20
Joined: Wed Jul 11, 2007 8:24 pm

Re: [2.0.21] Country Flags MOD

Post by orij1nal » Fri Jul 13, 2007 12:56 am

Alright here's the link http://www.mediafire.com/?9rzzym7lxme , I took out some of the codes that were supposed to be added in since it was interrupting with my forum.

maesk
Registered User
Posts: 2
Joined: Sun Aug 05, 2007 10:23 am

Re: [2.0.21] Country Flags MOD

Post by maesk » Tue Aug 07, 2007 2:06 pm

The mod is awesome but i have only one problem if someone want to register he sees everything of flag mod exept the dropdown. Did i forget somthing?
I think the problem is in usercp_register.
is it right that this code has to be in a mode(editprofile)?

Code: Select all

if ( $mode == 'editprofile' )
	{
		$template->assign_block_vars('switch_edit_profile', array());
		// 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';
		$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"' : '';
			$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>';
thanks a lot

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

Re: [2.0.21] Country Flags MOD

Post by ycl6 » Tue Aug 07, 2007 3:01 pm

Did you change the corresponding TPL file (profile_add_body.tpl) too?

Also check these in includes/usercp_register.php

Code: Select all

#
#-----[ 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
~Mac

junks2001
Registered User
Posts: 16
Joined: Sun Sep 12, 2004 8:04 am

Re: [2.0.21] Country Flags MOD

Post by junks2001 » Tue Aug 14, 2007 5:43 pm

ycl6 wrote:Hi junks2001,

I don't see any problem with that part of the code, have you install anything else that also edits admin_users.php?

I think the problem that cause the error message happen happen earlier, before line 2243.

~Mac
I'm not familar at all with php as far as programming... can you please take a look just to see if you see another error or anything that sticks out to you? I have edited my admin_users.php for other mods, however it was working with those other mods until this one.

TIA

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

Re: [2.0.21] Country Flags MOD

Post by ycl6 » Wed Aug 15, 2007 3:57 am

Provide a download link for your file.

~Mac

junks2001
Registered User
Posts: 16
Joined: Sun Sep 12, 2004 8:04 am

Re: [2.0.21] Country Flags MOD

Post by junks2001 » Thu Aug 16, 2007 7:04 pm

Download

Thank you for looking at it! :geek:

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

Re: [2.0.21] Country Flags MOD

Post by ycl6 » Wed Aug 22, 2007 12:01 am

Problem is here

Code: Select all

		$ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
		$form_enctype = ( !@$ini_val('file_uploads')		// Country/Location Flags
		// Query to get the list of flags
My MOD actions look like this

Code: Select all

#
#-----[ FIND ]------------------------------------------ 
#
		$form_enctype = ( !@$ini_val('file_uploads')
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
		// Country/Location Flags
		// Query to get the list of flags
The first FIND is a partial FIND, and you need to do an AFTER, ADD, not replacing the line

Code: Select all

		$ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
		$form_enctype = ( !@$ini_val('file_uploads') || phpversion() == '4.0.4pl1' || !$board_config['allow_avatar_upload'] || ( phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ) ) ? '' : 'enctype="multipart/form-data"';
~Mac

Takato Matsuda
Registered User
Posts: 17
Joined: Sat Jun 28, 2003 2:18 am

Re: [2.0.21] Country Flags MOD

Post by Takato Matsuda » Thu Aug 23, 2007 8:38 am

ycl6 wrote:
jalaln wrote:Ok, here is how it's not working:

If a topic contains only post(s) made by a user that has selected his or her country's flag, the topic will display normally.

But, if a topic contains post(s) from a user that has not selected his or her country's flag, the topic will display:

No posts exist for this topic
Hi Jalal,

I can't replicate the error you described. This is how I test it.

I open a new forum, Test Forum 2. Post a new topic with an account that doesn't have flag selected. Topic can be viewed.

Then I used another account without flag to post a reply, topic can be viewed.

Lastly, I used an account with flag to post a reply, topic can be viewed.

Image

~Mac
Hi, my english is poor, me try explain fine.

Me have the same error.

No show users without flag.

What is the problem ?

update:

Sorry, and Thank you. The error is produced for no apply:

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

in database. ok Ready and work !

junks2001
Registered User
Posts: 16
Joined: Sun Sep 12, 2004 8:04 am

Re: [2.0.21] Country Flags MOD

Post by junks2001 » Fri Aug 24, 2007 7:55 pm

YOU'RE AWESOM!!!! THANK YOU!!
ycl6 wrote:Problem is here

Code: Select all

		$ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
		$form_enctype = ( !@$ini_val('file_uploads')		// Country/Location Flags
		// Query to get the list of flags
My MOD actions look like this

Code: Select all

#
#-----[ FIND ]------------------------------------------ 
#
		$form_enctype = ( !@$ini_val('file_uploads')
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
		// Country/Location Flags
		// Query to get the list of flags
The first FIND is a partial FIND, and you need to do an AFTER, ADD, not replacing the line

Code: Select all

		$ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
		$form_enctype = ( !@$ini_val('file_uploads') || phpversion() == '4.0.4pl1' || !$board_config['allow_avatar_upload'] || ( phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ) ) ? '' : 'enctype="multipart/form-data"';
~Mac

User avatar
Anyasha
Registered User
Posts: 704
Joined: Mon Aug 07, 2006 4:02 am
Name: Anyasha

Re: [2.0.21] Country Flags MOD

Post by Anyasha » Sat Sep 08, 2007 8:37 pm

Is there any way to make a certain flag (preferably the US flag in my case) the default instead of "None/Other"? My board is for an American band and almost all the members are American, and I'd like to have that flag already showing when they register.
Kiss me, I'm Polish!

Post Reply

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

Who is online

Users browsing this forum: No registered users and 11 guests

cron