Parse error. Missing { or } somewhere.

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
User avatar
SupremeWeapon
Registered User
Posts: 593
Joined: Mon Feb 17, 2003 12:48 pm
Location: Battle Creek, Mi
Contact:

Parse error. Missing { or } somewhere.

Post by SupremeWeapon »

*gets on knees and begs.... lol jk...

ive been working on a mod to allow users to have images beside there names ezboard style.

for you that dont know wot that means.


you have a little 10x10 icon beside your nick like so.

SupremeWeapon Image
Registered User
Image
Joined: 17 Feb 2003
Posts: 585
Location: Battle Creek, Mi

now i got all the coding done and had to over right the Admin_users.php as this is where i have the parse error. i have narrowed it down sort of and all is described in the following link (code is to massive to post here in one post)

https://12.241.136.2/styles_demo/phpBB2/ ... c.php?t=31
i know its either a { or a } because thats all i ever miss when coding.

you know how it is... long codes and bein tired as i was result in them. how ever after spending 3 days studying the code im still confused.


any one have any ideas?

i can give a download link to download what i currently have. for more information.


Thanks.
Image
User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik »

To focus this kind of error, just add /* */ around the blocks of line you modified, you will quick find the block in cause by getting down and down within those {}.
User avatar
SupremeWeapon
Registered User
Posts: 593
Joined: Mon Feb 17, 2003 12:48 pm
Location: Battle Creek, Mi
Contact:

Post by SupremeWeapon »

wow.... narrowed it down to.

Code: Select all

if( isset($HTTP_POST_VARS['icongallery']) && !$error )
	{
		if( !$error )
		{
			$user_id = intval($HTTP_POST_VARS['id']);

			$template->set_filenames(array(
				"body" => "admin/user_icon_gallery.tpl")
			);

			$dir = @opendir("../" . $board_config['icon_gallery_path']);

			$avatar_images = array();
			while( $file = @readdir($dir) )
			{
				if( $file != "." && $file != ".." && !is_file(phpbb_realpath("./../" . $board_config['icon_gallery_path'] . "/" . $file)) && !is_link(phpbb_realpath("./../" . $board_config['icon_gallery_path'] . "/" . $file)) )
				{
					$sub_dir = @opendir("../" . $board_config['icon_gallery_path'] . "/" . $file);

					$icon_row_count = 0;
					$icon_col_count = 0;

					while( $sub_file = @readdir($sub_dir) )
					{
						if( preg_match("/(\.gif$|\.png$|\.jpg)$/is", $sub_file) )
						{
							$icon_images[$file][$icon_row_count][$icon_col_count] = $file . "/" . $sub_file;

							$icon_col_count++;
							if( $icon_col_count == 5 )
							{
								$icon_row_count++;
								$icon_col_count = 0;
							}
						}
					}
				}
			}
	
			@closedir($dir);

			if( isset($HTTP_POST_VARS['iconcategory']) )
			{
				$category = $HTTP_POST_VARS['iconcategory'];
			}
			else
			{
				list($category, ) = each($icon_images);
			}
			@reset($icon_images);

			$s_categories = "";
			while( list($key) = each($icon_images) )
			{
				$selected = ( $key == $category ) ? "selected=\"selected\"" : "";
				if( count($icon_images[$key]) )
				{
					$s_categories .= '<option value="' . $key . '"' . $selected . '>' . ucfirst($key) . '</option>';
				}
			}

			$s_colspan = 0;
			for($i = 0; $i < count($icon_images[$category]); $i++)
			{
				$template->assign_block_vars("icon_row", array());

				$s_colspan = max($s_colspan, count($icon_images[$category][$i]));

				for($j = 0; $j < count($icon_images[$category][$i]); $j++)
				{
					$template->assign_block_vars("icon_row.icon_column", array(
						"ICON_IMAGE" => "../" . $board_config['icon_gallery_path'] . "/" . $icon_images[$category][$i][$j])
					);

					$template->assign_block_vars("icon_row.icon_option_column", array(
						"S_OPTIONS_icon" => $icon_images[$category][$i][$j])
					);
				}
			}
something is wrong in this block right here..... =/ if i look any harder my eyes will pop out lol
Image
User avatar
blueadmin
Registered User
Posts: 124
Joined: Wed May 14, 2003 4:58 pm
Location: Bradford, UK

Post by blueadmin »

at the

Code: Select all

if( isset($HTTP_POST_VARS['icongallery']) && !$error ) 
   { 
at the begining I cant see a closing } for it, could try that.
Ho Ho Ho merry christmas
You Stuck? Read this before askinghere and here
User avatar
SupremeWeapon
Registered User
Posts: 593
Joined: Mon Feb 17, 2003 12:48 pm
Location: Battle Creek, Mi
Contact:

Post by SupremeWeapon »

ok that fixes that. got the sql done while i was pullin my hair out over that file :o


now

Code: Select all

Fatal error: Cannot redeclare check_image_type() (previously declared in c:\phpdev\www\styles_demo\phpbb2\includes\usercp_avatar.php:24) in c:\phpdev\www\styles_demo\phpbb2\includes\usercp_icon.php on line 24

maybe i should just cut my hair cuz i almost dont have any left :o lol

i have a demo image here....

the above error looks fixed.

http://12.241.136.2/img/icon.gif

now on to the profile and why isnt it displayable =/
Image
wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric »

A file is being included twice. Once in includes/usercp_avatar.php and again in includes/usercp_icon.php.
Eric
User avatar
SupremeWeapon
Registered User
Posts: 593
Joined: Mon Feb 17, 2003 12:48 pm
Location: Battle Creek, Mi
Contact:

Post by SupremeWeapon »

wGEric wrote: A file is being included twice. Once in includes/usercp_avatar.php and again in includes/usercp_icon.php.


yup got tthat fixed :D now im in the other files geting bugs fixed. and the profile/viewtopic thingy fixed.
Image
Post Reply

Return to “[2.0.x] MOD Writers Discussion”