Code: Select all
Parse error: parse error, unexpected T_VARIABLE in /phpBB2/admin/admin_users.php on line 2243
Code: Select all
$sql = "SELECT *
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 .= ' <option value="' . $flag_image . '"' . $selected . '">' . $flag_name . '</option>';
if ( isset( $user_flag) && ($user_flag == $flag_image))
{
$flag_start_image = $flag_image;
}
}
$flag_select .= '</select>';
Code: Select all
Parse error: parse error, unexpected T_VARIABLE in /home/hkmediao/public_html/forum/admin/admin_users.php on line 1013
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 .= ' <option value="' . $flag_image . '"' . $selected . '">' . $flag_name . '</option>';
if ( isset( $user_flag) && ($user_flag == $flag_image))
{
$flag_start_image = $flag_image;
}
}
$flag_select .= '</select>';
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 .= ' <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
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.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
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
Code: Select all
#
#-----[ FIND ]------------------------------------------
#
$form_enctype = ( !@$ini_val('file_uploads')
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Country/Location Flags
// Query to get the list of flags
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"';
Hi, my english is poor, me try explain fine.ycl6 wrote:Hi Jalal,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
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.
~Mac
ycl6 wrote:Problem is here
My MOD actions look like thisCode: 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
The first FIND is a partial FIND, and you need to do an AFTER, ADD, not replacing the lineCode: Select all
# #-----[ FIND ]------------------------------------------ # $form_enctype = ( !@$ini_val('file_uploads') # #-----[ AFTER, ADD ]------------------------------------------ # // Country/Location Flags // Query to get the list of flags
~MacCode: 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"';