homepage Welcome to WebmasterWorld Guest from 54.211.68.132
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Parse Error
Installing mod, not working...
vigilantweather




msg:1247889
 11:42 pm on Mar 9, 2006 (gmt 0)

Hi, I am new to php... I'm installing a subforum mod and this is my error (keeps coming back to different lines, this one won't go away):

Parse error: parse error, unexpected T_VARIABLE in /home/vigilant/public_html/phpBB2/includes/functions.php on line 234

Here are lines 230 through 240 of that file:

//if (!$forum_rows[$j]['forum_parent'] && ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $is_auth[$forum_rows[$j]['forum_id']]['auth_view'] )
//{
// Begin Simple Subforums MOD
$id = $forum_rows[$j]['forum_id'];
// End Simple Subforums MOD

$selected = ( $forum_rows[$j]['forum_id'] == $match_forum_id )? 'selected="selected"' : '';
$boxstring_forums .= '<option value="' . $forum_rows[$j]['forum_id'] . '"' . $selected . '>' . $forum_rows[$j]['forum_name'] . '</option>';

//
Note that line 234 is the one that begins with $id =

Anyone know what I did wrong?

Please respond ASAP, as we are trying to get this working quickly!

Any help is appreciated.

Thanks in advance.

 

jatar_k




msg:1247890
 11:44 pm on Mar 9, 2006 (gmt 0)

well there is nothing wrong with that line

I am assuming that if statement is all one line and just wrapped in your post

maybe try the few lines above that which aren't commented

vigilantweather




msg:1247891
 2:57 am on Mar 10, 2006 (gmt 0)

Here is some of my functions.php code... does it make sense, because I have no clue... here's my error:

Parse error: parse error, unexpected T_VARIABLE in /home/vigilant/public_html/phpBB2/includes/functions.php on line 233

And Code for includes/functions.php

$boxstring = '<select name="' . POST_FORUM_URL . '" onchange="if(this.options[this.selectedIndex].value!= -1){ forms[\'jumpbox\'].submit() }"><option value="-1">' . $lang['Select_forum'] . '</option>';

$forum_rows = array();
while ( $row = $db->sql_fetchrow($result) )
{
$forum_rows[] = $row;

// Begin Simple Subforums MOD
$forums_list[] = $row;
// End Simple Subforums MOD
}

if ( $total_forums = count($forum_rows) )
{
for($i = 0; $i < $total_categories; $i++)
{
$boxstring_forums = '';
for($j = 0; $j < $total_forums; $j++)
{
if ( $forum_rows[$j]['forum_parent'] && ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $forum_rows[$j]['auth_view'] <= AUTH_REG )

//if ( $forum_rows[$j]['forum_parent'] && ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $is_auth[$forum_rows[$j]['forum_id']]['auth_view'] )
//{
// Begin Simple Subforums MOD
$id = $forum_rows[$j]['forum_id'];
// End Simple Subforums MOD

$selected = ( $forum_rows[$j]['forum_id'] == $match_forum_id )? 'selected="selected"' : '';
$boxstring_forums .= '<option value="' . $forum_rows[$j]['forum_id'] . '"' . $selected . '>' . $forum_rows[$j]['forum_name'] . '</option>';

//
// Add an array to $nav_links for the Mozilla navigation bar.
// 'chapter' and 'forum' can create multiple items, therefore we are using a nested array.
//
$nav_links['chapter forum'][$forum_rows[$j]['forum_id']] = array (
'url' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$j]['forum_id']),
'title' => $forum_rows[$j]['forum_name']
);

// Begin Simple Subforums MOD
for( $k = 0; $k < $total_forums; $k++ )
{
if ( $forum_rows[$k]['forum_parent'] == $id && $forum_rows[$k]['cat_id'] == $category_rows[$i]['cat_id'] && $forum_rows[$k]['auth_view'] <= AUTH_REG )
{
//if ( $forum_rows[$k]['forum_parent'] == $id && $forum_rows[$k]['cat_id'] == $category_rows[$i]['cat_id'] && $is_auth[$forum_rows[$k]['forum_id']]['auth_view'] )
//{
$selected = ( $forum_rows[$k]['forum_id'] == $match_forum_id )? 'selected="selected"' : '';
$boxstring_forums .= '<option value="' . $forum_rows[$k]['forum_id'] . '"' . $selected . '>-- ' . $forum_rows[$k]['forum_name'] . '</option>';

//
// Add an array to $nav_links for the Mozilla navigation bar.
// 'chapter' and 'forum' can create multiple items, therefore we are using a nested array.
//
$nav_links['chapter forum'][$forum_rows[$k]['forum_id']] = array (
'url' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$k]['forum_id']),
'title' => $forum_rows[$k]['forum_name']
);

}
}
// End Simple Subforums MOD

}
}

if ( $boxstring_forums!= '' )
{
$boxstring .= '<option value="-1">&nbsp;</option>';
$boxstring .= '<option value="-1">' . $category_rows[$i]['cat_title'] . '</option>';
$boxstring .= '<option value="-1">----------------</option>';
$boxstring .= $boxstring_forums;
}
}
}

$boxstring .= '</select>';
}
else
{
$boxstring .= '<select name="' . POST_FORUM_URL . '" onchange="if(this.options[this.selectedIndex].value!= -1){ forms[\'jumpbox\'].submit() }"></select>';
}

Hope that helps you help me :D

Thanks.

omoutop




msg:1247892
 12:50 pm on Mar 10, 2006 (gmt 0)

Fix the " and ' in your first lines ..
$boxstring = '<select name="' . POST_FORUM_URL . '".......

Escape all with \ (\" and \') since u got many errors there.

Same errors later on, near end of code you posted

if ( $boxstring_forums!= '' )
{
....
....
}
else
{
....
}

Check those and see if any errors occur

vigilantweather




msg:1247893
 8:18 pm on Mar 10, 2006 (gmt 0)

Guessing at what was wrong (I have no clue!) I did a bit of editing... and now my error is all the way back a few lines!

Error:

Parse error: parse error, unexpected T_STRING in /home/vigilant/public_html/phpBB2/includes/functions.php on line 209

Line 209:

$boxstring = '<select name=" POST_FORUM_URL " onchange="if(this.options[this.selectedIndex].value!= -1){ forms['jumpbox'].submit() }"><option value="-1">' . $lang['Select_forum'] . </option>;

Help!
Thanks.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved