Page 18 of 25

Posted: Sun Feb 04, 2007 2:04 am
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?

Posted: Tue Feb 06, 2007 2:56 am
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

Posted: Tue Feb 06, 2007 2:57 am
by wasku
sorry for the double post

Posted: Tue Feb 06, 2007 2:30 pm
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

Posted: Tue Feb 06, 2007 2:39 pm
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

Help

Posted: Tue Feb 06, 2007 7:10 pm
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...

Posted: Wed Feb 07, 2007 3:34 pm
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

Re: Help

Posted: Thu Feb 08, 2007 12:50 am
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

Posted: Thu Feb 08, 2007 12:51 am
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

Posted: Thu Feb 08, 2007 5:06 pm
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 ]------------------------------------------
#
....

Posted: Fri Feb 09, 2007 11:18 am
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

Posted: Sat Feb 10, 2007 3:13 am
by radr57
Good to know.

Posted: Sun Feb 11, 2007 11:40 am
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.

Posted: Wed Feb 14, 2007 7:26 pm
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.

Posted: Fri Feb 16, 2007 3:42 pm
by ycl6
Hi Kaji01,

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

~Mac