A family member uses CometChat on a Simple Machines Forum (SMF) forum to allow members of the forum to chat with one another online when they are visiting the forum. I installed a couple of Halloween themes for the forum, but she found that CometChat was not available with the new themes, though it was available with the default theme.
Checking changes that had been made quite to that theme's files when I installed
CometChat on the forum a few years ago, I found that the installation process
for CometChat had modified
the index.template.php
file for the default theme, which was stored
in the Themes/default
directory for the forum.
I found the following PHP code in that file:
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<link type="text/css" href="/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8"> >script type="text/javascript" src="/cometchat/cometchatjs.php" charset="utf-8"></script>
Since the CometChat additions to the file occurred immediately after the
head tag, to make CometChat available in the new theme, I added the
following immediately after <head>
in the
Themes/Halloween/index.template.php
file under the forum's directory on the server for the forum:
<link type="text/css" href="/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8"> <script type="text/javascript" src="/cometchat/cometchatjs.php" charset="utf-8"></script>
She was then able to log into the forum and change the default theme to the
Halloween theme with CometChat now being available with that theme. I made
a similar change to othere themes she wanted to use for the forum by updating
the index.template.php
file in the appropriate theme directory.
Note: If you see ';
immediately after <head>
, you need to put the
code for CometChat between the <head>
and the
';
.