I have run into a bit of a problem. I installed my new SMF Forum and converted all the posts over from my old phpbb and that all went fine. In that old forum I also had Flashchat integrated with it including the icon that appears when a guest signs on.
I installed the newest Flashchat in the root of my new SMF folder and then proceeded to insert the following code (Example 1) in the index.template.php and then saved it. I got the code right off one of the posts on the SMF forum and double checked it several times to make sure it was correct before saving. I also installed the chat icon gif in the images folder.
However, when I went to connect to the forum I got a parsing error saying it couldn't open my index.template.php.
I then took that code out and reinserted my original code (Example 2) and now it won't open either. Again, I took this right off the post and double checked it again.
At the present time Example 2 code is in place and when I try to connect just to the forum I get this message-you see below-----The main web is copingwithhope.com. The forum is in copingwithhope.com/SMF and the chat is in copingwithhope.com/SMF/chat. Does anyone have any ideas what I may have done or why I couldn't get the file to integrate when I used the Sample 1 code?
Template Parse Error!
There was a problem loading the /Themes/default/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.
You may want to try to refresh this page or use the default theme.
Example 1:
else {
echo '<a href="', $GLOBALS['boardurl'], '/chat/flashchat.php">',
($settings['use_image_buttons'] ? '<img src="' . $settings['images_url']
. '/chat_icon.gif" alt="FlashChat" style="margin: 2px 0;"
border="0" />' : "FlashChat"),'</a>';
echo '<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'],
'">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url']
. '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108]
. '" style="margin: 2px 0;" border="0" />' : $txt[108]),'</a>';
}
Example 2 where I show the code starting just a bit above what was replaced
echo '
<a href="', $scripturl, '?action=login">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/login.gif" alt="' . $txt[34] . '" style="margin: 2px 0;" border="0" />' : $txt[34]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=register">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/register.gif" alt="' . $txt[97] . '" style="margin: 2px 0;" border="0" />' : $txt[97]), '</a>';
}
// Otherwise, they might want to [logout]...
{
else
echo '<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'],
'">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url']
. '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108]
. '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>';
}
Any help would be appreciated. I am sure it is something simple I have overlooked but have been looking at it for some time and have finally decided to put it down for a while.
well, your code in the second example is certainly wrong...
upload a clean copy of index.template.php from your original smf archive file. (assuming you have not installed any other mods...)
That being said, the first bit of code really looks like it should have worked... what are the 5 lines of code BEFORE that?
In the example above on the bottom I was only showing the code as it appeared just above the section I was replacing so you could see where I inserted the original back in. I did as you suggested and reinstalled that one file and was able to connect to the SMF using copingwithhope.com/SMF.
Then I went back in and deleted the relevant code and replaced it by copy and pasting it just like it was on the post here in the forum and when I tried to connect again using copingwithhope.com/SMF I got another error. Here is what the error says
Template Parse Error
There was a problem loading the /Themes/Default/index.template.php template or language file. Please check the syntax and try again-remember, single quotes (') often have to be escaped with a slash (\).To see more specific error information from PHP, try accessing the file directly.
You may want to refresh this page or use the default theme.
When I went to look directly at the error and clicked on that link the message then read
Parse error: parse error, unexpected $ in home/myusername/pubic_html/SMF/Themes/default/index.template.php on line 470.
So I remain perpelxed as when I replace the index.template.php with the original code I can connect to the forum using copingwithhope.com. However, when I delete the original code and cut and paste the code as supplied on the forum I then get the error messages so I am unable to fully integrate it where I can use the chat logo on the home page of the forum
I know when it is all said and done it will probably be something really simple but I have played around with this since yesterday and have yet to get it to work. Any and all help would be appreciated as though I have been working with my web for over a year I am relatively new to all these coding changes.
Thanks