ycl6 wrote: Hope that you will like this.
Code: Select all
#
# Update Country Flag MOD 2.2.0 => 2.3.1
#
#-----[ COPY ]------------------------------------------
#
copy root/admin/*.php to admin/
copy root/templates/subSilver/admin/*.tpl to templates/subSilver/admin/
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
$flag = ( !empty($profiledata['user_from_flag']) ) ? " <img src="images/flags/" . $profiledata['user_from_flag'] . "" alt="" . $profiledata['user_from_flag'] . "">" : "";
#
#-----[ REPLACE WITH ]------------------------------------------
#
$flag = ( !empty($profiledata['user_from_flag']) ) ? ' <img src="images/flags/' . $profiledata['user_from_flag'] . '" alt="' . $profiledata['user_from_flag'] . '" title="' . $profiledata['user_from_flag'] . '" border="1" />' : '';
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
$user_flag = ( !empty($HTTP_POST_VARS['user_flag']) ) ? $HTTP_POST_VARS['user_flag'] : '' ;
#
#-----[ REPLACE WITH ]------------------------------------------
#
$user_flag = ( !empty($HTTP_POST_VARS['user_flag']) && $HTTP_POST_VARS['user_flag'] != 'blank.gif' ) ? htmlspecialchars($HTTP_POST_VARS['user_flag']) : '';
#
#-----[ FIND ]------------------------------------------
#
#
$sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql . $passwd_sql
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_from_flag = '$user_flag',
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
user_from_flag = '" . str_replace("'", "''", $user_flag) . "',
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . USERS_TABLE . " (user_id
VALUES ($user_id
#
#-----[ IN-LINE FIND ]------------------------------------------
#
'$user_flag',
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
'" . str_replace("'", "''", $user_flag) . "',
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT *
FROM " . FLAG_TABLE . "
ORDER BY flag_id";
#
#-----[ IN-LINE FIND ]------------------------------------------
#
ORDER BY flag_id";
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
ORDER BY flag_name";
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT *
FROM " . FLAG_TABLE . "
ORDER BY flag_id";
if(!$flags_result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain flags information.", "", __LINE__, __FILE__, $sql);
}
$flag_row = $db->sql_fetchrowset($ranksresult);
$num_flags = $db->sql_numrows($ranksresult) ;
// build the html select statement
$flag_start_image = 'blank.gif' ;
$selected = ( isset($user_flag) ) ? '' : ' selected="selected"' ;
$flag_select = "<select name="user_flag" onChange="document.images['user_flag'].src = 'images/flags/'
+ this.value;" >";
$flag_select .= "<option value="blank.gif"$selected>" . $lang['Select_Country'] . "</option>";
for ($i = 0; $i < $num_flags; $i++)
{
$flag_name = $flag_row[$i]['flag_name'];
$flag_image = $flag_row[$i]['flag_image'];
$selected = ( isset( $user_flag) ) ? (($user_flag == $flag_image) ? 'selected="selected"' : '' ) : '' ;
$flag_select .= "t<option value="$flag_image"$selected>$flag_name</option>";
if ( isset( $user_flag) && ($user_flag == $flag_image))
{
$flag_start_image = $flag_image ;
}
}
$flag_select .= '</select>';
#
#-----[ REPLACE WITH ]------------------------------------------
#
$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>';
#
#-----[ FIND ]------------------------------------------
#
'L_FLAG' => $lang['Country_Flag'],
#
#-----[ REPLACE WITH ]------------------------------------------
#
'L_FLAG' => $lang['Country_flag'],
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$poster_from_flag = ( $postrow[$i]['user_from_flag'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? "<img src="images/flags/" . $postrow[$i]['user_from_flag'] . "" alt="" . $postrow[$i]['user_from_flag'] . "" border="0" width="32" height="20" /><br />" : "";
#
#-----[ REPLACE WITH ]------------------------------------------
#
$poster_from_flag = ( $postrow[$i]['user_from_flag'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? '<br /><img src="images/flags/' . $postrow[$i]['user_from_flag'] . '" alt="' . $postrow[$i]['user_from_flag'] . '" border="1" /><br />' : '';
#
#-----[ OPEN ]------------------------------------------
#
memberlist.php
#
#-----[ FIND ]------------------------------------------
#
$from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' ';
#
#-----[ REPLACE WITH ]------------------------------------------
#
$from = ( !empty($row['user_from']) ) ? $row['user_from'] : '';
$from = ( !empty($row['user_from_flag']) ) ? $from . ' <img src="images/flags/' . $row['user_from_flag'] . '" alt="' . $row['user_from_flag'] . '" border="1" />' : $from;
#
#-----[ FIND ]------------------------------------------
#
$flag = ( !empty($row['user_from_flag']) ) ? " <img src="images/flags/" . $row['user_from_flag'] . "" alt="" . $row['user_from_flag'] . "">" : ' <img src="images/flags/blank.gif" alt="">';
#
#-----[ REPLACE WITH ]------------------------------------------
# Just remove/delete the lines (replacing with an empty line)
#
#-----[ FIND ]------------------------------------------
#
'FLAG' => $flag,
#
#-----[ REPLACE WITH ]------------------------------------------
# Just remove/delete the lines (replacing with an empty line)
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]------------------------------------------
#
$user_flag = ( !empty($HTTP_POST_VARS['user_flag']) ) ? $HTTP_POST_VARS['user_flag'] : '' ;
#
#-----[ REPLACE WITH ]------------------------------------------
#
$user_flag = ( !empty($HTTP_POST_VARS['user_flag']) && $HTTP_POST_VARS['user_flag'] != 'blank.gif' ) ? htmlspecialchars($HTTP_POST_VARS['user_flag']) : '';
#
#-----[ FIND ]------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_from_flag = '$user_flag',
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
user_from_flag = '" . str_replace("'", "''", $user_flag) . "',
#
#-----[ FIND ]------------------------------------------
#
$location = htmlspecialchars(stripslashes($location));
#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_flag = htmlspecialchars(stripslashes($user_flag));
#
#-----[ FIND ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="user_flag" value="' . $user_flag . '" />';
#
#-----[ REPLACE WITH ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="user_flag" value="' . str_replace(""", """, $user_flag) . '" />';
#
#-----[ FIND ]------------------------------------------
#
// query to get the list of flags
$sql = "SELECT *
FROM " . FLAG_TABLE . "
ORDER BY flag_id";
if(!$flags_result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain flags information.", "", __LINE__, __FILE__, $sql);
}
$flag_row = $db->sql_fetchrowset($ranksresult);
$num_flags = $db->sql_numrows($ranksresult) ;
// build the html select statement
$flag_start_image = 'blank.gif' ;
$selected = ( isset($user_flag) ) ? '' : ' selected="selected"' ;
$flag_select = "<select name="user_flag" onChange="document.images['user_flag'].src = '../images/flags/'
+ this.value;" >";
$flag_select .= "<option value="blank.gif"$selected>" . $lang['Select_Country'] . "</option>";
for ($i = 0; $i < $num_flags; $i++)
{
$flag_name = $flag_row[$i]['flag_name'];
$flag_image = $flag_row[$i]['flag_image'];
$selected = ( isset( $user_flag) ) ? (($user_flag == $flag_image) ? 'selected="selected"' : '' ) : '' ;
$flag_select .= "t<option value="$flag_image"$selected>$flag_name</option>";
if ( isset( $user_flag) && ($user_flag == $flag_image))
{
$flag_start_image = $flag_image ;
}
}
$flag_select .= '</select>';
#
#-----[ REPLACE WITH ]------------------------------------------
#
// 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>';
#
#-----[ FIND ]------------------------------------------
#
'L_FLAG' => $lang['Country_Flag'],
#
#-----[ REPLACE WITH ]------------------------------------------
#
'L_FLAG' => $lang['Country_flag'],
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Country_Flag'] = 'Country Flag';
$lang['Select_Country'] = 'SELECT COUNTRY' ;
#
#-----[ REPLACE WITH ]------------------------------------------
#
$lang['Country_flag'] = 'Flag';
$lang['Select_country'] = 'SELECT COUNTRY/LOCATION';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}">
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{postrow.POSTER_FROM_FLAG}
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
# Just remove/delete the lines (replacing with an empty line)
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_FLAG}:</span></td>
<td class="row2"><span class="gensmall">
<table><tr>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
<td>{FLAG_SELECT} </td>
<td><img src="images/flags/{FLAG_START}" width="32" height="20" name="user_flag" /></td>
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
<td>{FLAG_SELECT} </td>
<td><img src="images/flags/{FLAG_START}" name="user_flag" /></td>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/memberlist_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<table class="gen"><tr><td align=center width="100%">
#
#-----[ REPLACE WITH ]------------------------------------------
# Just remove/delete the lines (replacing with an empty line)
#
#-----[ IN-LINE FIND ]------------------------------------------
#
</td><td align=right>{memberrow.FLAG}</td></tr></table>
#
#-----[ REPLACE WITH ]------------------------------------------
# Just remove/delete the lines (replacing with an empty line)
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_FLAG}:</span></td>
<td class="row2"><span class="gensmall">
#
#-----[ IN-LINE FIND ]------------------------------------------
#
<td>{FLAG_SELECT} </td>
<td><img src="../images/flags/{FLAG_START}" width="32" height="20" name="user_flag" /></td>
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
<td>{FLAG_SELECT} </td>
<td><img src="../images/flags/{FLAG_START}" name="user_flag" /></td>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Code: Select all
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_skype, 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, u.user_allow_viewonline, u.user_session_time, 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 = 562 AND pt.post_id = p.post_id AND u.user_id = p.poster_id ORDER BY p.post_time ASC LIMIT 0, 10
Line : 400
File : viewtopic.php
#
#-----[ DIY INSTRUCTIONS ]------------------------------------------
#
Copy root/install/db_update_en.php to install/db_update_en.php
Execute and delete after it has been run
Code: Select all
Parse error: syntax error, unexpected '.', expecting ')' in /home2/liam15/public_html/forum/viewtopic.php on line 1167
Liamhfc wrote: Hi, I installed this manually and keeping getting these errors
I get the one bellow when i try to view a topic.
Code: Select all
Parse error: syntax error, unexpected '.', expecting ')' in /home2/liam15/public_html/forum/viewtopic.php on line 1167
And this one when i try to access my Admin Panel
Any idea what i did wrong?Code: Select all
Parse error: syntax error, unexpected T_VARIABLE in /home2/liam15/public_html/forum/admin/admin_users.php
Liamhfc wrote: Hi, I installed this manually and keeping getting these errors
I get the one bellow when i try to view a topic.
Code: Select all
Parse error: syntax error, unexpected '.', expecting ')' in /home2/liam15/public_html/forum/viewtopic.php on line 1167