[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

radr57
Registered User
Posts: 48
Joined: Wed Jan 17, 2007 5:21 am

Post by radr57 »

A problem with admin/admin_users.php
Parse error: parse error, unexpected T_VARIABLE in /home/*****/public_html/forum/admin/admin_users.php on line 1015

This is how it's supposed to be:
#
#-----[ 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>';

And this is how I have it:
//
// 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')
// 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>';
|| phpversion() == '4.0.4pl1' || !$board_config['allow_avatar_upload'] || ( phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ) ) ? '' : 'enctype="multipart/form-data"';

Is this right? Am I supposed to have the concatination like that?
wasku
Registered User
Posts: 56
Joined: Fri Dec 15, 2006 2:59 am
Location: Canadian eh
Contact:

Post by wasku »

hi i just installed the flag mod and now its messed up help!

how do i do this? I Have no idea how to execute manually.. what does that mean???

'Do it yourself' instructions need to be executed by you manually, EasyMOD can not perform these actions
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




and i keep gettin this error

Couldn't obtain flags information.

DEBUG MODE

SQL Error : 1146 Table 'wasku.phpbb_flags' doesn't exist

SELECT * FROM phpbb_flags ORDER BY flag_name

Line : 943
File : usercp_register.php
Last edited by wasku on Tue Feb 06, 2007 12:06 pm, edited 1 time in total.
wasku
Registered User
Posts: 56
Joined: Fri Dec 15, 2006 2:59 am
Location: Canadian eh
Contact:

Post by wasku »

sorry for the double post
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

wasku, have you install any MOD that requires database update?

You need to choose any one of the 3 methods to update your database. Easiest would be Method 1.

~Mac
wasku
Registered User
Posts: 56
Joined: Fri Dec 15, 2006 2:59 am
Location: Canadian eh
Contact:

Post by wasku »

Thanks! its working now! its so easy after you figure it out...

so much headches lol

One more question, what tpl file is the one that i can modify to move the flag beside the user name?


Image


thanks for the help
adrian43
Registered User
Posts: 1
Joined: Tue Feb 06, 2007 7:06 pm

Help

Post by adrian43 »

I can't access my admin panel on the left seft, i get this error mess
Parse error: syntax error, unexpected T_VARIABLE in /data/host5/users/web/lexicaltech/web/php/admin/admin_users.php on line 1015


I thinkg another user here is having the same problem.. please help...
skyline stu
Registered User
Posts: 3
Joined: Wed Feb 07, 2007 11:37 am

Post by skyline stu »

sorry to be a pain, but i had some trouble installing this mod on my forums.
i've got 3 skins / themes installed, darksky, igloo (default) and subsilver.

i tried installing this mod with easymod and it's basically crashed my forums :oops:

topics remain, but everytime you try and view a thread what i have included in the bottom of this post is shown as an error message.

i'm really not all that clued up on anything to do with php or programming or file structures etc. so forgive my lack of knowledge.
from looking at the write ups for other mods i've seen a few where this sort of error is given where easymod can't do everything and there's a couple of files that need to be manually processed?
is this the case here? if so could anyone tell me what i need to do to get them working again as i'd kinda like my forums working lol.

thanks in advance, and the errors i get are shown below.

Could not obtain post/user information.

DEBUG MODE

SQL Error : 1054 Unknown column 'u.user_from_flag' in 'field list'

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, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid FROM phpbb_posts p, phpbb_users u, phpbb_posts_text pt WHERE p.topic_id = 685 AND pt.post_id = p.post_id AND u.user_id = p.poster_id ORDER BY p.post_time ASC LIMIT 0, 20

Line : 399
File : viewtopic.php

8O
WWW.RUSH-JUNKIES.COM

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

Re: Help

Post by ycl6 »

adrian43 wrote: I can't access my admin panel on the left seft, i get this error mess
Parse error: syntax error, unexpected T_VARIABLE in /data/host5/users/web/lexicaltech/web/php/admin/admin_users.php on line 1015


I thinkg another user here is having the same problem.. please help...

The MOD action is AFTER, ADD, not IN-LINE AFTER, ADD

Code: Select all

#
#-----[ FIND ]------------------------------------------ 
#
		$form_enctype = ( !@$ini_val('file_uploads')
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
		// Country/Location Flags
		// Query to get the list of flags
		$sql = "SELECT *
~Mac
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

skyline stu wrote: Could not obtain post/user information.

DEBUG MODE

SQL Error : 1054 Unknown column 'u.user_from_flag' in 'field list'

You haven't insert the required database details.

Please read

Code: Select all

#
#-----[ 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
~Mac
radr57
Registered User
Posts: 48
Joined: Wed Jan 17, 2007 5:21 am

Post by radr57 »

radr57 wrote: A problem with admin/admin_users.php
Parse error: parse error, unexpected T_VARIABLE in /home/*****/public_html/forum/admin/admin_users.php on line 1015


FIXED (thanks to adrian43)

The instruction should read:
#
#-----[ FIND ]------------------------------------------
#
$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"';

#
#-----[ AFTER, ADD ]------------------------------------------
#
....
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

radr57 wrote: The instruction should read:
#
#-----[ FIND ]------------------------------------------
#
$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"';

#
#-----[ AFTER, ADD ]------------------------------------------
#
....

radr57,

Not really, partial FIND means the same as complete FIND action, and is an acceptable practice. You may encounter other MODs written in such a way in the future.

~Mac
radr57
Registered User
Posts: 48
Joined: Wed Jan 17, 2007 5:21 am

Post by radr57 »

Good to know.
MattiEsport
Registered User
Posts: 57
Joined: Sun Feb 11, 2007 11:34 am

Post by MattiEsport »

I have problem :\ www.esport.webd.pl i have installed that mod and i dont see any flags before nicks :/ help plz. My nick is 1.
Kaji01
Registered User
Posts: 6
Joined: Wed Feb 14, 2007 11:34 am

Post by Kaji01 »

All right, I've got the mod installed, and double-checked all of my code a couple times over (including the SQL update). I've got the flags appearing in the ACP, however they're not appearing in the forums, profiles, threads, or userlist. Any ideas on where to start looking for errors? Forum is located at http://www.lingwiki.com/mb/index.php if you want to poke around some.
hehehe...
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

Hi Kaji01,

Seems fine now, maybe you've fixed it already :)

~Mac
Post Reply

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