General Community > Scripting Help
adding an include into the template- how?
(1/1)
GWP:
Anyone know why i cannot get an "include" to work on my forum template?
My forum is in /root/smforum/template.php
News is at: /root/news/mainnews.php3
This is the code i put in the template file
--- Quote --- <yabb time><br />
<yabb showchat>
<?php
include("../news/mainnews.php3");
?>
</font></td>
</tr>
</table></td>
--- End quote ---
Or maybe you know of another way to do it?
I have tried adding the code from the news.php3 file itself, but i get the same happen.
Thanks
GWP
GWP:
That wouldn't work so i tried this (with help from the yabbse forum from Spaceman-Spiff)
--- Quote ---function yydocs()
{
global $currentboard;
if ($currentboard == 111)
{
echo '
<?php
// This script is an example of display, in another page of your website,
// the list or number of users connected to the chat
// Lines below must be at the top of your file and completed according
// to your settings
// relative path from this page to your chat directory
$ChatPath = "../../chatphp/chat";
// HTML link to launch the chat (used by constants below)
// $ChatLaunch = "<A HREF=\"phpMyChat.php3\" TARGET=\"_self\">chatting</A>";
$ShowPrivate = "0"; // 1 to display users even if they are in a private room,
// 0 else
$DisplayUsers = "0"; // 0 to display only the number of connected users
// 1 to display a list of users
define("NB_USERS_IN","users are chatting."); // used if $DisplayUsers = 0
define("USERS_LOGIN","User ".$ChatLaunch." at this time:"); // used if $DisplayUsers = 1
define("NO_USER","Nobody is chatting.");
require("./${ChatPath}/lib/connected_users.lib.php3");
?>
<TABLE BORDER=0 CELLPADDING=0>
<TR>
<TD>
<?php
display_connected($ShowPrivate,$DisplayUsers,($DisplayUsers ? USERS_LOGIN : NB_USERS_IN),NO_USER);
?>
</TD>
</TR>
</TABLE>';
}
--- End quote ---
All i get is the script displayed in words after: chatting</A>";
If i run the php page by itself, it works fine?
Any php wizards out ther can help me?
Navigation
[0] Message Index
Go to full version