Page 23 of 25

Re: [2.0.21] Country Flags MOD

Posted: Mon Jul 09, 2007 12:37 pm
by ycl6
I'm sorry.

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

~Mac

Re: [2.0.21] Country Flags MOD

Posted: Mon Jul 09, 2007 9:27 pm
by junks2001
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?

Re: [2.0.21] Country Flags MOD

Posted: Tue Jul 10, 2007 12:51 pm
by ycl6
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

Re: [2.0.21] Country Flags MOD

Posted: Thu Jul 12, 2007 6:28 pm
by orij1nal
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?

Re: [2.0.21] Country Flags MOD

Posted: Fri Jul 13, 2007 12:49 am
by ycl6
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

Re: [2.0.21] Country Flags MOD

Posted: Fri Jul 13, 2007 12:56 am
by orij1nal
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.

Re: [2.0.21] Country Flags MOD

Posted: Tue Aug 07, 2007 2:06 pm
by maesk
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

Re: [2.0.21] Country Flags MOD

Posted: Tue Aug 07, 2007 3:01 pm
by ycl6
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

Re: [2.0.21] Country Flags MOD

Posted: Tue Aug 14, 2007 5:43 pm
by junks2001
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

Re: [2.0.21] Country Flags MOD

Posted: Wed Aug 15, 2007 3:57 am
by ycl6
Provide a download link for your file.

~Mac

Re: [2.0.21] Country Flags MOD

Posted: Thu Aug 16, 2007 7:04 pm
by junks2001
Download

Thank you for looking at it! :geek:

Re: [2.0.21] Country Flags MOD

Posted: Wed Aug 22, 2007 12:01 am
by ycl6
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

Re: [2.0.21] Country Flags MOD

Posted: Thu Aug 23, 2007 8:38 am
by Takato Matsuda
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 !

Re: [2.0.21] Country Flags MOD

Posted: Fri Aug 24, 2007 7:55 pm
by junks2001
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

Re: [2.0.21] Country Flags MOD

Posted: Sat Sep 08, 2007 8:37 pm
by Anyasha
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.