| Author |
Message |
question
Beginner


Joined: Jan 13, 2008 Posts: 7
|
Posted: Tue Jan 15, 2008 9:51 am Post subject: Viewtopic.php Issue |
|
|
I am currently getting this error when I attempt to read a post.
Code: › Parse error: syntax error, unexpected T_ELSE in /home/.zwindler/astaradmin/allstarsportssoftball.com/viewtopic.php on line 168
Now this is the file where you had to make edits after the trigger_error portion which shows up numerous times within the file, but there were not instructions as to whether or not the edits should be done to all of the instances of this code or one of them or a specific one. Could you possibly look at my viewtopic.php file and tell me what the issue is? Thanks. |
|
| Back to top |
|
|
AdBot
|
| Post subject: Viewtopic.php Issue |
|
|
|
|
|
| Back to top |
|
 |
question
Beginner


Joined: Jan 13, 2008 Posts: 7
|
Posted: Tue Jan 15, 2008 9:55 am Post subject: Re: Viewtopic.php Issue |
|
|
Line 168...
Code: ›
// Check for global announcement correctness?
if (!$row['forum_id'] && !$forum_id)
{
trigger_error('NO_TOPIC');
}
// Grab Gallery link permission
$sql = 'SELECT link FROM ' . GALLERY2_TABLE;
$row = $db->sql_fetchrow($db->sql_query_limit($sql, 1));
$gallery_link = $row['link'];
else if ($row['forum_id'])
{
$forum_id = $row['forum_id'];
}
}
This is apparently the chunk it is having an issue with. I tried to post the whole file but it is too long. I have the gallery link permission chunk of code after all instances of the trigger_error no topic piece...is this correct? |
|
| Back to top |
|
|
question
Beginner


Joined: Jan 13, 2008 Posts: 7
|
Posted: Tue Jan 15, 2008 10:12 am Post subject: Re: Viewtopic.php Issue |
|
|
Ok so I played with it some more and I think I have it working now.
I changed the below chunk to now have 3 } instead of only 2 like it had in my code above.
Code: ›
$forum_id = $row['forum_id'];
}
}
Now looks like...
Code: ›
$forum_id = $row['forum_id'];
}
}
}
I can now view posts again. |
|
| Back to top |
|
|
jettyrat
Moderator


Joined: Nov 28, 2005 Posts: 1139
|
Posted: Tue Jan 15, 2008 10:14 am Post subject: Re: Viewtopic.php Issue |
|
|
Actually the "trigger_error('NO_TOPIC');" only shows up once in the file with the same number of tabs in my editor, but I'll add some more surrounding code to the mod file for clarification. Also, the mod files go in order so once you apply a portion of the mod, you won't use it again in the same file.
You should remove all instances of the "// Grab Gallery link permissions" mod except the first one in the file; it should look like this:Code: › // Do we have a topic or post id?
if (!$topic_id && !$post_id)
{
trigger_error('NO_TOPIC');
}
// Grab Gallery link permission
$sql = 'SELECT link FROM ' . GALLERY2_TABLE;
$row = $db->sql_fetchrow($db->sql_query_limit($sql, 1));
$gallery_link = $row['link']; |
|
| Back to top |
|
|
question
Beginner


Joined: Jan 13, 2008 Posts: 7
|
Posted: Tue Jan 15, 2008 11:40 am Post subject: Re: Viewtopic.php Issue |
|
|
jettyrat wrote: › Actually the "trigger_error('NO_TOPIC');" only shows up once in the file with the same number of tabs in my editor, but I'll add some more surrounding code to the mod file for clarification. Also, the mod files go in order so once you apply a portion of the mod, you won't use it again in the same file.
You should remove all instances of the "// Grab Gallery link permissions" mod except the first one in the file; it should look like this: Code: › // Do we have a topic or post id?
if (!$topic_id && !$post_id)
{
trigger_error('NO_TOPIC');
}
// Grab Gallery link permission
$sql = 'SELECT link FROM ' . GALLERY2_TABLE;
$row = $db->sql_fetchrow($db->sql_query_limit($sql, 1));
$gallery_link = $row['link'];
That makes sense. At least I know that I can go ahead and remove those extra instances.
So when you search your viewtopic.php file you only find trigger_error('NO_TOPIC'); one time? That is odd. |
|
| Back to top |
|
|
jettyrat
Moderator


Joined: Nov 28, 2005 Posts: 1139
|
Posted: Tue Jan 15, 2008 12:20 pm Post subject: Re: Viewtopic.php Issue |
|
|
| I only find it one time with the same number of tabs as is in the mod file. The others are spaced differently... |
|
| Back to top |
|
|
question
Beginner


Joined: Jan 13, 2008 Posts: 7
|
Posted: Tue Jan 15, 2008 2:43 pm Post subject: Re: Viewtopic.php Issue |
|
|
jettyrat wrote: › I only find it one time with the same number of tabs as is in the mod file. The others are spaced differently...
Ah...now that explains it. I didnt search with the tabs...I only searched for the text itself.
Thanks for the clarification. |
|
| Back to top |
|
|
|
|
|
|
|