Forums Archive Index > SmartMenus v4.x General > PHP as target frame
Date: 18 Jun 2003 4:14 am
Hi i have a PHP page in mij whole website only the problem is i do not know whereto put the
body script and the head script
<script language=JavaScript>
function s_show(){return false}
function s_hide(){return false}
if(window.event+''=='undefined')event=0
ROOT='../../../../'
</script>
and this part
<script language=JavaScript1.2 src=../../../../smartmenus/s_loader.js></script>
Date: 18 Jun 2003 5:00 am
<script language=JavaScript>
function s_show(){return false}
function s_hide(){return false}
if(window.event+''=='undefined')event=0
ROOT='../../../../'
</script>
should be in the head and ...
<script language=JavaScript1.2 src=../../../../smartmenus/s_loader.js></script>
should be in the body.
Date: 18 Jun 2003 11:38 am
php does not have a head and body ?
Date: 18 Jun 2003 7:14 pm
The PHP has an output, right? That output is HTML- otherwise the browser won't be able to read it. So you will have to keep track on that output and see where the HEAD and BODY are.
I'm still not sure I got your question right. If you want, send me a small example and I will take a look at it and try to configure it.
Date: 18 Jun 2003 8:02 pm
no the website output is php
website are in index.php
Date: 18 Jun 2003 8:03 pm
this is an idex file of a forum
<?
// Ultimate PHP Board
// Author: Tim Hoeppner aka RR_Pilot, FixITguy
// Website: --> http://www.webrc.ca/php
// Version: 1.0
// Using textdb Version: 1.0 */
header ("refresh: 600");
if(!file_exists("./db/config2.php")) {
echo "installer has not been run yet. click <a href='install.php'>here</a> to install.";
exit;
}
include "func.inc.php";
include "header.php";
include "chat/func.php"; $users_in_chat = count(file("chat/".$list_file));
$cats = listall("./db/cat");
$categories = explode(",", $admin_catagory_sorting);
if(@trim($admin_catagory_sorting) != "" && count($categories) == count($cats)) {
$index = 0;
$i = 0;
$sorted = array();
while($i<count($cats)) {
$catdef = def($cats[$i], "./db/cat");
if($categories[$index] == $catdef["id"]) {
$sorted[] = $cats[$i];
$index++;
$i = 0;
} else {
$i += 1;
}
}
$cats = $sorted;
unset($sorted,$i,$catdef,$categories);
} else {
sort($cats);
}
reset($cats);
$forums = listall("./db/forum");
sort($forums);
reset($forums);
$t_t = 0;
$t_p = 0;
for($a=0;$a<count($cats);$a++)
{
$cate = def($cats[$a], "./db/cat");
echo "
<table cellspacing=0 cellpadding=0 width='$table_width_main' align=center>
<tbody>
<tr id=cat>
<td width=30><img height=15 src='skins/default/images/cat_top_left.gif' width=132 border=0></td>
<td valign=middle background=skins/default/images/cat_top_bg.gif border=0 height='15'>
<p align=center><b><font face='Verdana' size='1' color='#ffffff'><b>$cate[name]</b></font></b></p>
</td>
<td width=30>
<p align=right><img height=15 src='skins/default/images/cat_top_right.gif' width=134 border=0></p>
</td>
</tr>
</tbody>
</table>
<table width='$table_width_main' border='0' cellspacing='1' cellpadding='4' align='center' bgcolor='$border'>
<tr>
<td background=skins/default/images/title_bg.gif width='30' align='center' bgcolor='$header' valign='middle' ><font size='$font_m' face='$font_face' color='$font_color_header'>&</font></td>
<td background=skins/default/images/title_bg.gif bgcolor='$header' width=36% valign='middle' ><font size='$font_m' face='$font_face' color='$font_color_header'><B>Forum</B></font></td>
<td background=skins/default/images/title_bg.gif bgcolor='$header' width=7% valign='middle' align='center'><font size='$font_m' face='$font_face' color='$font_color_header'><B>Topics</B></font></td>
<td background=skins/default/images/title_bg.gif bgcolor='$header' width=7% valign='middle' align='center'><font size='$font_m' face='$font_face' color='$font_color_header'><B>Posts</B></font></td>
<td background=skins/default/images/title_bg.gif bgcolor='$header' width=30% valign='middle' align='center'><font size='$font_m' face='$font_face' color='$font_color_header'><B>Latest Topic</B></font></td>
<td background=skins/default/images/title_bg.gif bgcolor='$header' width=15% valign='middle' align='center'><font size='$font_m' face='$font_face' color='$font_color_header'><B>Moderators</B></font></td>
</tr>
";
@$q = $cate[id];
for($i=0;$i<count($forums);$i++)
{
@$stuff = def($forums[$i], "./db/forum");
$upb["def"] = "./db/p_forum";
@$rec1 = get($stuff[last_post], "./db/$stuff[id]");
if(isset($id_env))
{
if(@strtotime($rec1[last_post]) > @strtotime(@$lastvisit))
{
$v_icon = "on.gif";
} else {
$v_icon = "off.gif";
}
} else {
$v_icon = "off.gif";
}
if(@$stuff[cat] == $q)
{
if(@$stuff[mod] == "")
{
$mod = "unmoderated";
}else{
@$mod = $stuff[mod];
}
if(@$stuff[last_post] == "never")
{
$when="<tr align=center>
<td valign=center width='100%'><font size='$font_s' face='$font_face' color='#888888'>No Current Posts</font></td>
</tr>";
} else {
@$when="<tr align=left>
<td valign=center width='90%'><font size='$font_s' face='$font_face' color='#888888'>$rec1[last_post]</font><br><font size='$font_s' face='$font_face' color='$font_color_main'><a href='viewtopic.php?id=$stuff[id]&t_id=$stuff[last_post]'>$rec1[subject]</a> by: <a href='profile.php?action=get&id=$stuff[user_id]'><b>$stuff[user]</b></a></td>
</tr>";
}
@$t_t = $t_t + $stuff[topics];
@$t_p = $t_p + $stuff[posts];
if(@$stuff[topics] == "0"){
$v_icon = "off.gif";
}
echo "
<tr>
<td width='30' align='center' bgcolor='$table2'><img src='icon/$v_icon' ></td>
<td bgcolor='$table1' style=\"Cursor:Hand\" onClick=\"window.location.href='viewforum.php?id=$stuff[id]';\" onMouseOver=\"this.bgColor='#FFFFFF'\" onMouseOut=\"this.bgColor='$table1'\"><font size='$font_m' face='$font_face' color='$font_color_main'><a href='viewforum.php?id=$stuff[id]'>$stuff[forum]</a></font><br><font size='$font_s' face='$font_face' color='$font_color_main'>$stuff[des]</font></td>
<td bgcolor='$table2' align='center'><font size='$font_s' face='$font_face' color='$font_color_main'>$stuff[topics]</font></td>
<td bgcolor='$table1' align='center'><font size='$font_s' face='$font_face' color='$font_color_main'>$stuff[posts]</font></td>
<td bgcolor='$table2' align='center'><font size='$font_s' face='$font_face' color='$font_color_main'><table cellspacing=0 cellpadding=0 width='100%' align=right border=0><tbody>$when</tbody></table></font></td>
<td bgcolor='$table1' align='center'><font size='$font_s' face='$font_face' color='$font_color_main'>$mod</font></td>
</tr>";
}
}
echo "$skin_tablefooter";
}
//start Statistics Table
echo " <table cellspacing=0 cellpadding=0 width='$table_width_main' align=center>
<tbody>
<tr id=cat>
<td width=30><img height=15 src='skins/default/images/cat_top_left.gif' width=132 border=0></td>
<td valign=middle background=skins/default/images/cat_top_bg.gif border=0 height='15'>
<p align=center><b><font face='Verdana' size='1' color='#ffffff'><b>Forum Statistics</b></font></b></p>
</td>
<td width=30>
<p align=right><img height=15 src='skins/default/images/cat_top_right.gif' width=134 border=0></p>
</td>
</tr>
</tbody>
</table>
<table width='$table_width_main' border='0' cellspacing='1' cellpadding='4' align='center' bgcolor=#14213f>";
$whos = whos_online();
$whos_t = $whos["users"]+$whos["guests"];
echo "<tr>
<td background='skins/default/images/title_bg.gif' colspan='3' bgcolor='$category'><font size='$font_m' face='$font_face' color='$font_color_category'><b>Whos Online</b></font></td>
</tr>
<tr>
<td bgColor='$table2' valign='middle' width='49'><div align='center'><font face=verdana size=1><img src='icon/user.gif' width='23' height='20'></font></div></td>
<td colspan='2' width='95%' bgcolor='$table1'><font size='$font_s' face='$font_face' color='$font_color_main'>
Users online in the last 15 minutes: <b>$whos_t</b>
<br><b>$whos[users]</b> member(s) and <b>$whos[guests]</b> guest(s).
<br>$whos[who]
</font></td>
</tr>";
$mem = listall("./db/users");
$mem_d = def($mem[0], "./db/users");
echo "<tr>
<td background='skins/default/images/title_bg.gif' colspan='3' bgcolor='$category'><font size='$font_m' face='$font_face' color='$font_color_category'><b>Forum Stats</b></font></td>
</tr>
<tr>
<td bgColor='$table2' valign='middle' width='49'><div align='center'><font face=verdana size=1><img src='icon/stats.gif'></font></div></td>
<td colspan='2' width='95%' bgcolor='$table1'><font size='$font_s' face='$font_face' color='$font_color_main'>Total Topics: <B>$t_t</B>
<br>Total Posts: <B>$t_p</B>
<br>Total Members: <B>".count($mem)."</B>
<br>Newest Member: <B><a href='profile.php?action=get&id=$mem_d[id]'>$mem_d[user_name]</a></B>
<br>Users in Chatroom: <b>$users_in_chat</b>
<br>Forum Page Views: <B>$hits</B>
<br>Page Rendering Time: <B>";
$mt = explode(' ', microtime());
$script_end_time = $mt[0] + $mt[1];
echo "<font face=verdana size=1>".round($script_end_time - $script_start_time, 5)." seconds</font>";
echo "</B></font></td>
</tr>
<tr>
<td background='skins/default/images/title_bg.gif' colspan='3' bgcolor='$category'><font size='$font_m' face='$font_face' color='$font_color_category'><b>Forum Legend</b></font></td>
</tr>
<tr>
<td colspan='3' bgcolor='$table1'>
<table width='100%' border='0' cellspacing='0' cellpadding='3' align='left'>
<tr>
<td align='left' width='50%'><img src='icon/on.gif' > <font size='$font_s' face='$font_face' color='$font_color_main'>New
posts since last visit </font></td>
<td align='left' width='50%'><img src='icon/off.gif' > <font size='$font_s' face='$font_face' color='$font_color_main'>No
new posts since last visit</font></td>
</tr>
</table></table>$skin_tablefooter<br>";
//End Statistic Table
include "footer.php";
if (empty($user_env))
{
$user = "guest";
} else {
$user = "$user_env";
}
$month = date("m",time());
$year = date("Y",time());
if ($REMOTE_HOST == "")
{
$visitor_info = $REMOTE_ADDR;
} else {
$visitor_info = $REMOTE_HOST;
}
$base = "http://" . $HTTP_SERVER_VARS['SERVER_NAME'] . "$PHP_SELF";
$x1= "host $REMOTE_ADDR |grep Name";
$x2= $REMOTE_ADDR;
$fp = fopen("db/iplog", "a");
$date= "$month $year";
fputs($fp, "$visitor_info -$HTTP_USER_AGENT- $user- <br>Date/Time: $date$REMOTE_ADDR:$x2 $x1$base:--------------------------------Next Person<p><br>\r\n");fclose($fp);
?>
Date: 19 Jun 2003 3:33 am
I would imagine the file pointed to by the line include "header.php"; will contain all the header information that you need to alter.
Peter