CyberiaPC.com Community Forums Main Page
RSS Feeds: Late(st) News | Zenith Picture Gallery | Most Recent Community Topics | Tips, Tricks and Other Useful Stuff

Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
> PHP Coding, Need some assistance in fixing an error
everythingsbs
post Jul 20 2006, 06:32 PM
Post #1


MaD_cOw has nothing on me at MODing!
Group Icon

Group: Moderators
Posts: 916
Joined: 4-June 04
From: California
Member No.: 1,362

United States




How's it going?

I've been editing phpbb boards script lately for a friend of mine' website. I follow the installation guide for adding the code. I finished adding all of the code, upload all of the new files, and check it and it works fine. Then I try to log into the admin cp and i get a Parse error:

CODE
Parse error: parse error, unexpected T_IF in /homepages/27/d171386843/htdocs/forums/admin/admin_users.php on line 840


So I took a look at it but I don't know exactly what a "parse error" is. So I was wondering if somone could enlighten me on this, and also provide a fix too.

Here's the line of code where the error pops up:
CODE
[L839]            $avatar_sql = ", user_avatar = '" . str_replace("\'", "''", $user_avatar_remoteurl) . "', user_avatar_type = " . USER_AVATAR_REMOTE;                         [l840]


Now I added "[L839]" so you can see the lines. I added the entire string, so hopfully that helps.

Thanks.

Ryan


--------------------
QUOTE("Richard Hammond - Top Gear")
We're gonna to die now, that's it."
Go to the top of the page
 
+Quote Post
amir
post Jul 20 2006, 07:08 PM
Post #2


SuperNova III Member
Group Icon

Group: Support Team
Posts: 2,141
Joined: 2-November 02
From: Toronto
Member No.: 302

Canada




You need to reveal a few more lines of the code since i think the text is wrapped meaning that all lines without any line break are split into a few shorter lines & you really didn't include the errorneous line. (or may be it's what this board did to the code)
Go to the top of the page
 
+Quote Post
everythingsbs
post Jul 20 2006, 07:55 PM
Post #3


MaD_cOw has nothing on me at MODing!
Group Icon

Group: Moderators
Posts: 916
Joined: 4-June 04
From: California
Member No.: 1,362

United States




Amir,

Thanks for the help. I'll upload the entire page itself. It seems that section of code is quiet long.

Ryan
Attached File(s)
Attached File  admin_users.php ( 65.71K ) Number of downloads: 30
 


--------------------
QUOTE("Richard Hammond - Top Gear")
We're gonna to die now, that's it."
Go to the top of the page
 
+Quote Post
usr.c
post Jul 20 2006, 08:09 PM
Post #4


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




Did you forget to close a block with a curly brace right before line 840?


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch
I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com
Go to the top of the page
 
+Quote Post
everythingsbs
post Jul 20 2006, 08:45 PM
Post #5


MaD_cOw has nothing on me at MODing!
Group Icon

Group: Moderators
Posts: 916
Joined: 4-June 04
From: California
Member No.: 1,362

United States




I checked and didn't see anything. I can't figure it out though. hrmm..

Ryan


--------------------
QUOTE("Richard Hammond - Top Gear")
We're gonna to die now, that's it."
Go to the top of the page
 
+Quote Post
usr.c
post Jul 20 2006, 08:51 PM
Post #6


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




Lines 839-840:

CODE
else if( !isset( $HTTP_POST_VARS['submit'] ) && $mode != 'save' && !isset( $HTTP_POST_VARS['avatargallery'] ) && !isset( $HTTP_POST_VARS['submitavatar'] ) && !isset( $HTTP_POST_VARS['cancelavatar'] )
        if( isset( $HTTP_GET_VARS[POST_USERS_URL]) || isset( $HTTP_POST_VARS[POST_USERS_URL]) )

Note the missing { at the end of line 839. Add it and see if it helps.


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch
I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com
Go to the top of the page
 
+Quote Post
everythingsbs
post Jul 21 2006, 12:33 AM
Post #7


MaD_cOw has nothing on me at MODing!
Group Icon

Group: Moderators
Posts: 916
Joined: 4-June 04
From: California
Member No.: 1,362

United States




Ali, I sent you a PM.

I've been trying to figure it out and I dontknow PHP at all. I looked up online "php for dummines" pretty much and I don't know where to place the last { .

Ryan


--------------------
QUOTE("Richard Hammond - Top Gear")
We're gonna to die now, that's it."
Go to the top of the page
 
+Quote Post
usr.c
post Jul 21 2006, 03:23 AM
Post #8


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




Hey, Replace those two lines with:

CODE
else if( !isset( $HTTP_POST_VARS['submit'] ) && $mode != 'save' && !isset( $HTTP_POST_VARS['avatargallery'] ) && !isset( $HTTP_POST_VARS['submitavatar'] ) && !isset( $HTTP_POST_VARS['cancelavatar'] ) {
        if( isset( $HTTP_GET_VARS[POST_USERS_URL]) || isset( $HTTP_POST_VARS[POST_USERS_URL]) )

the else if statement was missing an opening curly brace at the end of it. Let me know what happens.


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch
I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com
Go to the top of the page
 
+Quote Post
everythingsbs
post Jul 21 2006, 06:27 AM
Post #9


MaD_cOw has nothing on me at MODing!
Group Icon

Group: Moderators
Posts: 916
Joined: 4-June 04
From: California
Member No.: 1,362

United States




Ali,

I updated the lines with what you gave me and got this error:

CODE
Parse error: parse error, unexpected '{' in /homepages/27/d171386843/htdocs/forums/admin/admin_users.php on line 839


Ryan


--------------------
QUOTE("Richard Hammond - Top Gear")
We're gonna to die now, that's it."
Go to the top of the page
 
+Quote Post
amir
post Jul 21 2006, 01:00 PM
Post #10


SuperNova III Member
Group Icon

Group: Support Team
Posts: 2,141
Joined: 2-November 02
From: Toronto
Member No.: 302

Canada




Try removing that brace & put a closing round bracket at the end of line 839:
CODE
else if( !isset( $HTTP_POST_VARS['submit'] ) && $mode != 'save' && !isset( $HTTP_POST_VARS['avatargallery'] ) && !isset( $HTTP_POST_VARS['submitavatar'] ) && !isset( $HTTP_POST_VARS['cancelavatar'] )


so that it would be

CODE
$HTTP_POST_VARS['cancelavatar'] ) )



Disable wrapping in ur text editor so that line numbers would be refering to correct lines.

I'm wondering how phpbb could contain such errors?!
Go to the top of the page
 
+Quote Post
everythingsbs
post Jul 21 2006, 09:35 PM
Post #11


MaD_cOw has nothing on me at MODing!
Group Icon

Group: Moderators
Posts: 916
Joined: 4-June 04
From: California
Member No.: 1,362

United States




Well the script that I was installing, is giving me much more errors then I intended. I can't get users to register, I can't update the profile info, and I keep getting a SQL error. So I am going to override the files that I modified with the default files.

Thanks amir and Ali for your help, but now I do fee like it was semi wasted. I did learn something though, and I thank you guys for it.

Ryan


--------------------
QUOTE("Richard Hammond - Top Gear")
We're gonna to die now, that's it."
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd May 2013 - 11:35 AM