[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
Nigelman
Registered User
Posts: 210
Joined: Sun Jun 12, 2005 3:59 pm
Contact:

Post by Nigelman »

I did that and ran this url after install.......

http://www.fukuokafishingadventures.com ... ate_en.php

but it just says remove delete install db update
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

Have you ever see this page

Image

~Mac
User avatar
RATT
Registered User
Posts: 734
Joined: Fri Aug 19, 2005 6:27 am

Post by RATT »

run the db_update_en.php outside of the install folder.Just upload it to ur roots directory and execute.
User avatar
Nigelman
Registered User
Posts: 210
Joined: Sun Jun 12, 2005 3:59 pm
Contact:

Post by Nigelman »

Ok that worked that info you gave and I was able to run the script but now my control panel has this error.....

Parse error: parse error, unexpected T_VARIABLE in /home/fukuokaf/public_html/fishingjapan/admin/admin_users.php on line 1027

Here's my coding for the admin/admin_users.php file:
http://pastebin.com/767605

This paste bin thing is cool!

Nigelman
User avatar
RATT
Registered User
Posts: 734
Joined: Fri Aug 19, 2005 6:27 am

Post by RATT »

um from wut i seen u completely missed the coding for this file.
snippet from your file

Code: Select all

			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Password_mismatch'];
		}

		if ($signature != '')
		{
Mod says to do this

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
		if ($signature != '')
#
#-----[ BEFORE, ADD ]-----------------------------------
#
		$empty_day = $bday_day == $lang['Default_Day'] || empty($bday_day);
		$empty_year = $bday_year == $lang['Default_Year'] || empty($bday_year);
		$temp_month = ( !$board_config['bday_require'] && $bday_month == 0 ) ? 1 : $bday_month;
		$temp_day = ( !$board_config['bday_require'] && $empty_day ) ? 1 : $bday_day;
		if ( !$board_config['bday_year'] )
		{
			$temp_year = $empty_year ? 4 : $bday_year;
		}
		else
		{
			$temp_year = $bday_year;
			if ( !$board_config['bday_require'] && $bday_month == 0 && $empty_year )
			{
				$temp_year = $empty_year ? 4 : 0;
			}
		}
		if ( !@checkdate( $temp_month, $temp_day, $temp_year ) )
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Birthday_invalid'];
		}
Another snippet from ur admin/admin_users.php

Code: Select all

		if( !$error )
		{
			$sql = "UPDATE " . USERS_TABLE . "
				SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", 
Mod says to do this

Code: Select all

#
#-----[ FIND ]------------------------------------------
# this is a partial match
#
			$sql = "UPDATE " . USERS_TABLE . "
				SET " . $username_sql
#
#-----[ IN-LINE FIND ]----------------------------------
#
, user_icq = '" . str_replace("\'", "''", $icq) . "'
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------
#
, user_birthday = " . sprintf('%02d%02d%04d',$bday_month,$bday_day,$bday_year) . "
may wanna recheck your editing as i think you followed instructions for another file to edit this one.
pouria
Registered User
Posts: 2
Joined: Sat Jun 10, 2006 2:04 pm

Post by pouria »

Warning: pparse(./../mkportal/conf_mk.php): failed to open stream: No such file or directory in /homepages/24/d165200371/htdocs/wsb4049862401/forum/includes/template.php on line 137
Last edited by pouria on Sat Jun 10, 2006 2:22 pm, edited 1 time in total.
pouria
Registered User
Posts: 2
Joined: Sat Jun 10, 2006 2:04 pm

Post by pouria »

Why am I getting this error msg:

Warning: pparse(./../mkportal/conf_mk.php): failed to open stream: No such file or directory in /homepages/24/d165200371/htdocs/wsb4049862401/forum/includes/template.php on line 137

It doesn't allow me to go to this step:

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.

pls tell me what to do. :( :(
User avatar
Kildarien
Registered User
Posts: 25
Joined: Fri Dec 10, 2004 5:11 am

Post by Kildarien »

Hi,

I just wanted to check some coding before i installed on my site, just a little worried about one part on where to place it.

Code from install text file:

Code: Select all

#
#-----[ 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';
		$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>';
My file with the edit done i'm needed a little help with to guide me in the right direction if someone could help me :)

admin_users.php

Code: Select all

                                //
		// Let's do an overall check for settings/versions which would prevent
		// us from doing file uploads....
		//
		$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"';
// 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>';
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

Kildarien, the FIND is a partial find, hence you add it below the code. You have done it right from what I see.

p.s. This is what AFTER, ADD means. If I need you to put the code right after the code, I'll use IN-LINE AFTER, ADD.

~Mac
User avatar
Kildarien
Registered User
Posts: 25
Joined: Fri Dec 10, 2004 5:11 am

Post by Kildarien »

Thanks for the information and your help on where to place it, i'm glad i put it in the right spot :wink:
phuncadelic
Registered User
Posts: 7
Joined: Wed Jun 07, 2006 4:50 pm

having problems running the db_update_en.php outside

Post by phuncadelic »

when I run it in the install folder I get the same error.
when I move it to the root folder and I go to that dir it gives me a blank page

still no new tables in the db


When I double click on the file to run it a command screen pops up and runs briefly but closes and I cant read what it says.

Any Ideas?
Ninjai
Registered User
Posts: 51
Joined: Sat Aug 02, 2003 4:57 am
Location: Irvine, CA
Contact:

Post by Ninjai »

Hi,

I followed the directions correctly and after running the db_update.php everything seems to check out. I can select my country and see the flag image as well, but clicking submit get's me this error.

Code: Select all

General Error
 
Could not update users table

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''us.gif', user_from_flag = 'us.gif', user_interests = '', user_sig = '', user_si' at line 2

UPDATE phpbb_users SET user_email = 'email@removed', user_icq = '', user_website = 'http://www.domain.com', user_occ = '', user_from = '#warrock on GameSurge.Net', 'us.gif', user_from_flag = 'us.gif', user_interests = '', user_sig = '', user_sig_bbcode_uid = '', user_viewemail = 0, user_aim = '', user_yim = '', user_msnm = '', user_attachsig = 1, user_allowsmile = 1, user_allowhtml = 0, user_allowbbcode = 1, user_allow_viewonline = 0, user_notify = 0, user_notify_pm = 0, user_popup_pm = 1, user_timezone = 0, user_dateformat = 'd M Y h:i a', user_lang = 'english', user_style = 5, user_active = 1, user_actkey = '' WHERE user_id = 2

Line : 550
File : usercp_register.php
Opening usercp_register.php at line 550 shows:

Code: Select all

message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
Your timely help in this is appreciated!
User avatar
Kildarien
Registered User
Posts: 25
Joined: Fri Dec 10, 2004 5:11 am

Post by Kildarien »

Hi again !

Everything is working and installed, except on the install it fail on one thing. Just has a problem with this flag :-(

Code: Select all

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

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Ivoire')' at line 1
If you can help it'll be appreciated yet again :D
Ninjai
Registered User
Posts: 51
Joined: Sat Aug 02, 2003 4:57 am
Location: Irvine, CA
Contact:

Post by Ninjai »

Now in addition to this every time i try to view a forum thread, all i get is a blank screen..and now going to the ACP nothing shows up on the left side...did this mod just screw over my db? Need HELP!

Also getting this when i ran the db_update.php

Code: Select all

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

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Ivoire')' at line 1
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

Not sure what happen there, but my script has a "\" before the ' sign

Code: Select all

$sql[] = 'INSERT INTO ' . $table_prefix . 'flags(flag_id,flag_image,flag_name) VALUES(\'\',\'iv.gif\',\'Cote d\'Ivoire\')';
I'll provide a copy of the *.sql file later today for those who would like to update their database manually.

~Mac
Post Reply

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