Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2012
    Posts
    1

    Unanswered: Help with code I messed up

    Here is a big snippet, check the bottom for a small one of the problem:

    PHP Code:
    $user_cache[$poster_id] = array(
                    
    'joined'        => $user->format_date($row['user_regdate']),
                    
    'posts'            => $row['user_posts'],
                    
    'warnings'        => (isset($row['user_warnings'])) ? $row['user_warnings'] : 0,
                    
    'from'            => (!empty($row['user_from'])) ? $row['user_from'] : '',

                    
    'sig'                    => $user_sig,
                    
    'sig_bbcode_uid'        => (!empty($row['user_sig_bbcode_uid'])) ? $row['user_sig_bbcode_uid'] : '',
                    
    'sig_bbcode_bitfield'    => (!empty($row['user_sig_bbcode_bitfield'])) ? $row['user_sig_bbcode_bitfield'] : '',

                    
    'viewonline'    => $row['user_allow_viewonline'],
                    
    'allow_pm'        => $row['user_allow_pm'],

                    
    'avatar'        => ($user->optionget('viewavatars')) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '',
                    
    'age'            => '',

                    
    'rank_title'        => '',
                    
    'rank_image'        => '',
                    
    'rank_image_src'    => '',

                    
    'username'            => $row['username'],
                    
    'user_colour'        => $row['user_colour'],

                    
    'online'        => false,
                    
    'profile'        => append_sid("{$phpbb_root_path}memberlist.$phpEx""mode=viewprofile&u=$poster_id"),
                    
    'www'            => $row['user_website'],
                    
    'aim'            => ($row['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx""mode=contact&action=aim&u=$poster_id") : '',
                    
    'msn'            => ($row['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx""mode=contact&action=msnm&u=$poster_id") : '',
                    
    'yim'            => ($row['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' urlencode($row['user_yim']) . '&.src=pg' '',
                    
    'jabber'        => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx""mode=contact&action=jabber&u=$poster_id") : '',
                    
    'search'        => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx",
                    
    'user_type'        => $row['user_type'],
                    
    'user_permissions'    => $row['user_permissions'],
                    
    "author_id=$poster_id&sr=posts") : '',

                    
    'author_full'        => get_username_string('full'$poster_id$row['username'], $row['user_colour']),
                    
    'author_colour'        => get_username_string('colour'$poster_id$row['username'], $row['user_colour']),
                    
    'author_username'    => get_username_string('username'$poster_id$row['username'], $row['user_colour']),
                    
    'author_profile'    => get_username_string('profile'$poster_id$row['username'], $row['user_colour']),
                ); 
    Here is the problem piece (Line 2)

    PHP Code:
    'search'        => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx",
    'user_type'        => $row['user_type'],
    'user_permissions'    => $row['user_permissions'],
    "author_id=$poster_id&sr=posts") : ''
    I get the error: Parse error: syntax error, unexpected T_DOUBLE_ARROW in /phpbb/viewtopic.php on line 1172

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    that sor of message usually means that the parser was expecting something else, usually punctuation before it reached that symbols. and often the actual fault is on a preceeding line.
    my guess is you are missing a closing bracket ) on the previous line after append_sid
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •