Seite 1 von 1

Fehler beim einbau von php in html.....

Verfasst: 25.03.2006 20:12
von Thoman
ich versuch auch mal mein anliegen...

ich habe hier http://www.ssmf.net/L2/index.php ein blankes forum mit dem Ad Infinitum v1.06 style

habe versuche eine statusabfrage für einen gameserver einzufügen nur scheint das ganze net zu funktionieren...

:(

wo is mein fehler ?

hier mal der code aus der overall header.tpl

Code: Alles auswählen


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{S_CONTENT_DIRECTION}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="icon" href="templates/AdInfinitum/images/favicon.ico" />

{META}
{NAV_LINKS}
<title>{SITENAME} ~ {PAGE_TITLE}</title>
<!-- link rel="stylesheet" href="templates/AdInfinitum/{T_HEAD_STYLESHEET}" type="text/css" -->
<style type="text/css">
<!--
/*
  The original Ad Infinitum v1.06 skin for phpBB version 2+
  Created by Mike Lothar (c) 2004
  http://www.mikelothar.com
  Please don't remove this. :)

  NOTE: These CSS definitions are stored within the main page body so that you can use the phpBB2
  theme administration centre. When you have finalised your style you could cut the final CSS code
  and place it in an external file, deleting this section to save bandwidth.
*/

/* General page style. The scroll bar colours only visible in IE5.5+ */
body { 
	background-color: {T_BODY_BGCOLOR};
	scrollbar-face-color: {T_TR_COLOR3};
	scrollbar-highlight-color: {T_TR_COLOR1};
	scrollbar-shadow-color: {T_TR_COLOR1}; 
	scrollbar-3dlight-color: {T_TR_COLOR1};
	scrollbar-arrow-color:  {T_TR_COLOR1};
	scrollbar-track-color: {T_BODY_BGCOLOR}; 
	scrollbar-darkshadow-color: {T_TR_COLOR1}; 
}

body,table {
	font-size : 10px;
	font-family: {T_FONTFACE1};
}

/* General font families for common tags */
font,th,td,p { font-family: {T_FONTFACE1} }
a:link,a:active,a:visited { color : {T_BODY_LINK}; }
a:hover		{ text-decoration: underline; color : {T_BODY_HLINK}; }
hr	{ height: 0px; border: solid {T_BODY_BGCOLOR} 0px; border-top-width: 0px;}

/* This is the border line & background colour round the entire page */
.bodyline	{ 
	/* background-color: {T_BODY_BGCOLOR};  */
	border: 0px {T_BODY_BGCOLOR} solid; 
}

/* This is the outline round the main forum tables */
.forumline	{ 
	/* background-color: {T_BODY_BGCOLOR};  */
	border: 0px {T_BODY_BGCOLOR} solid; 
}

/* Main table cell colours and backgrounds */
td.row1	{ background-color: {T_TR_COLOR1}; border-style: solid; border: black; border-width: 1px 1px 1px 1px; }
td.row2	{ background-color: {T_TR_COLOR2}; border-style: solid; border: black; border-width: 1px 1px 1px 1px; }
td.row3	{ background-color: {T_TR_COLOR3}; border-style: solid; border: black; border-width: 1px 1px 1px 1px; }

/*
  This is for the table cell above the Topics, Post & Last posts on the index.php page
  By default this is the fading out gradiated silver background.
  However, you could replace this with a bitmap specific for each forum
*/
td.rowpic {
	/* background-color: {T_BODY_BGCOLOR}; */
}

/* Header cells - the blue and silver gradient backgrounds */
/* 
th			{ font-weight: bold; font-size: {T_FONTSIZE2}px; color : {T_BODY_LINK}; text-align: left; height: 25px;}
a.th			{ font-weight: bold; font-size: {T_FONTSIZE2}px; text-decoration: none; color : {T_BODY_LINK}; }
a.th:visited			{ font-weight: bold; font-size: {T_FONTSIZE2}px; text-decoration: none; color : {T_BODY_LINK}; }
a.th:hover		{ font-weight: bold; font-size: {T_FONTSIZE2}px; text-decoration: underline; color : {T_BODY_LINK}; }
*/

th	{
	color: {T_FONTCOLOR1}; font-size: {T_FONTSIZE1}px; font-weight : bold; 
	/* background-color: {T_BODY_BGCOLOR}; */
	height: 25px;
}

td.cat,td.catHead,td.catSides,td.catLeft,td.catRight,td.catBottom {
	/* background-color:{T_BODY_BGCOLOR}; */
	border: {T_TH_COLOR3}; border-style: solid; height: 28px;
}

/*
  Setting additional nice inner borders for the main table cells.
  The names indicate which sides the border will be on.
  Don't worry if you don't understand this, just ignore it :-)
*/
td.cat { 
   height: 29px; 
   border-width: 0px 0px 0px 0px; 
   background-color:{T_TR_COLOR1}; 
} 

td.catBottom { 
   height: 29px; 
   border-width: 0px 0px 0px 0px; 
   background-color:{T_TR_COLOR3}; 
} 

td.catHead { 
   height: 29px; 
   border-width: 0px 0px 0px 0px; 
   /* background-color:{T_BODY_BGCOLOR}; */
}

th.thHead,th.thSides,th.thTop,th.thLeft,th.thRight,th.thBottom,th.thCornerL,th.thCornerR {
	font-weight: bold; border: {T_TD_COLOR3}; border-style: solid; height: 28px;
}

td.row3Right,td.spaceRow {
	/* background-color: {T_BODY_BGCOLOR}; */
	border: {T_TH_COLOR3}; border-style: solid;
}

th.thHead,td.catHead { font-size: {T_FONTSIZE1}px; border-width: 0px 0px 0px 0px; }
th.thSides,td.catSides,td.spaceRow	 { border-width: 0px 0px 0px 0px; }
th.thRight,td.catRight,td.row3Right	 { border-width: 0px 0px 0px 0px; }
th.thLeft,td.catLeft	  { border-width: 0px 0px 0px 0px; }
th.thBottom,td.catBottom  { border-width: 0px 0px 0px 0px; }
th.thTop	 { border-width: 1px 0px 1px 0px; }
th.thCornerL { border-width: 1px 0px 1px 0px; }
th.thCornerR { border-width: 1px 0px 1px 0px; }

/* 
.thHead			{ font-weight: bold; font-size: {T_FONTSIZE2}px; color : {T_BODY_LINK}; text-align: left;}
a.thHead			{ font-weight: bold; font-size: {T_FONTSIZE2}px; text-decoration: none; color : {T_BODY_LINK}; }
a.thHead:visited			{ font-weight: bold; font-size: {T_FONTSIZE2}px; text-decoration: none; color : {T_BODY_LINK}; }
a.thHead:hover		{ font-weight: bold; font-size: {T_FONTSIZE2}px; text-decoration: underline; color : {T_BODY_LINK}; }
*/

/* The largest text used in the index page title and toptic title etc. */
.maintitle	{
	font-weight: bold; font-size: 22px; font-family: "{T_FONTFACE2}",{T_FONTFACE1};
	text-decoration: none; line-height : 120%; color : {T_BODY_TEXT};
}

/* General text */
.gen { font-size : {T_FONTSIZE1}px; }
.genmed { font-size : {T_FONTSIZE1}px; }
.genmed { font-size : {T_FONTSIZE1}px; color : #111111;}
.gensmall { font-size : {T_FONTSIZE1}px; }
.gen,.genmed,.gensmall { color : {T_BODY_TEXT}; }
a.gen,a.genmed,a.gensmall { color: {T_BODY_TEXT}; text-decoration: none; }
a.gen:visited,a.genmed:visited,a.gensmall:visited { color: {T_BODY_TEXT}; text-decoration: none; }
a.gen:hover,a.genmed:hover,a.gensmall:hover	{ color: {T_BODY_HLINK}; text-decoration: underline; }

/* The register, login, search etc links at the top of the page */
.mainmenu		{ font-size : {T_FONTSIZE1}px; color : {T_BODY_TEXT} }
a.mainmenu		{ font-size : {T_FONTSIZE1}px; text-decoration: none; color : {T_BODY_TEXT};  }
a.mainmenu:visited	{ font-size : {T_FONTSIZE1}px; text-decoration: none; color : {T_BODY_TEXT}; }
a.mainmenu:hover{ font-size : {T_FONTSIZE1}px; text-decoration: underline; color : {T_BODY_TEXT}; }

/* Forum category titles */
.cattitle		{ font-weight: bold; font-size: {T_FONTSIZE2}px ; color : {T_BODY_LINK}}
a.cattitle		{ text-decoration: none; color : {T_BODY_LINK}; }
a.cattitle:visited		{ text-decoration: none; color : {T_BODY_LINK}; }
a.cattitle:hover{ text-decoration: underline; }

/* Forum title: Text and link to the forums used in: index.php */
.forumlink		{ font-weight: bold; font-size: {T_FONTSIZE2}px; color : {T_BODY_LINK}; }
a.forumlink 	{ text-decoration: none; color : {T_BODY_LINK}; }
a.forumlink:visited 	{ text-decoration: none; color : {T_BODY_LINK}; }
a.forumlink:hover{ text-decoration: underline; color : {T_BODY_HLINK}; }

/* Used for the navigation text, (Page 1,2,3 etc) and the navigation bar when in a forum */
.nav			{ font-weight: bold; font-size: {T_FONTSIZE2}px; color : {T_BODY_LINK}; text-align: left;}
a.nav			{ font-weight: bold; font-size: {T_FONTSIZE2}px; text-decoration: none; color : {T_BODY_LINK}; text-align: left;}
a.nav:visited			{ font-weight: bold; font-size: {T_FONTSIZE2}px; text-decoration: none; color : {T_BODY_LINK}; text-align: left;}
a.nav:hover		{ font-weight: bold; font-size: {T_FONTSIZE2}px; text-decoration: underline; color : {T_BODY_LINK}; text-align: left;}

/* titles for the topics: could specify viewed link colour too */
.topictitle,h1,h2	{ font-weight: bold; font-size: {T_FONTSIZE2}px; color : {T_BODY_TEXT}; }
a.topictitle:link   { text-decoration: none; color : {T_BODY_LINK}; }
a.topictitle:visited { text-decoration: none; color : {T_BODY_VLINK}; }
a.topictitle:hover	{ text-decoration: underline; color : {T_BODY_HLINK}; }

/* Name of poster in viewmsg.php and viewtopic.php and other places */
.name			{ font-size : {T_FONTSIZE1}px; color : {T_BODY_TEXT};}

/* Location, number of posts, post date etc */
.postdetails		{ font-size : {T_FONTSIZE1}px; color : {T_BODY_TEXT}; }

/* The content of the posts (body of text) */
.postbody { font-size : {T_FONTSIZE1}px; line-height: 17px; color : {T_BODY_TEXT};}
a.postlink:link	{ text-decoration: none; color : {T_BODY_LINK} }
a.postlink:visited { text-decoration: none; color : {T_BODY_VLINK}; }
a.postlink:hover { text-decoration: underline; color : {T_BODY_HLINK}}

/* Quote & Code blocks */
.code { 
	font-family: {T_FONTFACE3}; font-size: 9px; color: {T_FONTCOLOR3};
	background-color: {T_TR_COLOR3}; border: {T_TD_COLOR1}; border-style: dotted;
	border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
}

.quote {
	font-family: {T_FONTFACE1}; font-size: 9px; color: {T_FONTCOLOR1}; line-height: 16px;
	background-color: {T_TR_COLOR3}; border: {T_TD_COLOR1}; border-style: dotted;
	border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
}

/* Copyright and bottom info */
.copyright		{ font-size: {T_FONTSIZE1}px; font-family: {T_FONTFACE1}; color: {T_FONTCOLOR1}; letter-spacing: -1px;}
a.copyright		{ color: {T_FONTCOLOR1}; text-decoration: none;}
a.copyright:visited		{ color: {T_FONTCOLOR1}; text-decoration: none;}
a.copyright:hover { color: {T_BODY_HLINK}; text-decoration: underline;}

/* Form elements */
input, textarea, text, select, border {
	color : {T_TR_COLOR1};
	font: normal {T_FONTSIZE1}px {T_FONTFACE1};
/*	border-color : {T_BODY_TEXT}; */
	text-indent : 2px;
	margin 0px;
	padding 0px;
/*	background-color : {T_TR_COLOR1}; */
}

.noborder {
	border-color : white;
	margin 0px;
	padding 0px;
	border-width: 0px;
	border-style: none;
}

/* The buttons used for bbCode styling in message post */
input.button {
/*	background-color : {T_TR_COLOR1}; */
/*	color : {T_BODY_TEXT}; */
	font-size: {T_FONTSIZE1}px; font-family: {T_FONTFACE1};
}

/* The main submit button option */
input.mainoption {
/*	background-color : {T_TD_COLOR1}; */
	font-weight : bold;
	font-size: {T_FONTSIZE1}px; font-family: {T_FONTFACE1};
}

/* None-bold submit button */
input.liteoption {
/*	background-color : {T_TD_COLOR1}; */
	font-weight : normal;
	font-size: {T_FONTSIZE1}px; font-family: {T_FONTFACE1};
}

/* This is the line in the posting page which shows the rollover
  help line. This is actually a text box, but if set to be the same
  colour as the background no one will know ;)
*/
.helpline { background-color: {T_TR_COLOR2}; border-style: none; color: {T_FONTCOLOR1};}

/* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */
@import url("templates/AdInfinitum/formIE.css"); 
-->
</style>
<!-- BEGIN switch_enable_pm_popup -->
<script language="Javascript" type="text/javascript">
<!--
	if ( {PRIVATE_MESSAGE_NEW_FLAG} )
	{
		window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
	}
//-->
</script>
<!-- END switch_enable_pm_popup -->
<script language="javascript" type="text/javascript"> 
<!-- 
  function resize_images() 
  { 
    for (i = 1; i < document.images.length; i++) 
    { 
      while ( !document.images[i].complete ) 
      { 
        break;
      } 
      if ( document.images[i].width > 540 ) 
      { 
        document.images[i].width = 540;
      } 
    } 
  } 
//--> 
</script> 
</head>
<body bgcolor="{T_BODY_BGCOLOR}" text="{T_BODY_TEXT}" link="{T_BODY_LINK}" vlink="{T_BODY_VLINK}" leftmargin="0" topmargin="0" onload="resize_images()">

<a name="top"></a><span class="mainmenu">
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0" align="center"> 


	<table width="780" height="100%" cellspacing="0" cellpadding="10" border="0" align="center"> 
	<tr> 
		<td class="bodyline" valign="top">
		
<table width="717" height="231" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div align="center"><a href="{U_INDEX}"><img src="templates/AdInfinitum/images/top_image.jpg" border="0" alt="{L_INDEX}" vspace="1" /></a></div></td>
  </tr>
</table>
<br />

<!-- Status Anfang -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th height="25"><span class="genmed"><b>Server Status</b></span></th>
</tr>
<tr>
<td class="row1" align="center"><span class="gensmall">
<?php
$ip = gethostbyname("85.214.19.172");

if($fp = @fsockopen($ip, 2106,$un,$sinn,2)) {
echo("<b>Login Server</b><br /><img src='/L2/templates/AdInfinitum/images/online.gif'>");
fclose($fp);
} else {
echo("<b>Login Server</b><br /><img src='/L2/templates/AdInfinitum/images/offline.gif'>");
}
echo "<br />\n";
echo("<left>");

if($fp = @fsockopen($ip, 7777,$un,$sinn,2)) {
echo("<b>Game Server</b><br /><img src='/L2/templates/AdInfinitum/images/online.gif'>");
fclose($fp);
} else {
echo("<b>Game Server</b><br /><img src='/L2/templates/AdInfinitum/images/offline.gif'>");
}
echo "<br />\n";
?>
<!-- Status Ende-->
</table>
<br />






<table width="715" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left" class="mainmenu"><a href="{U_FAQ}" class="mainmenu">{L_FAQ}</a>&nbsp;&nbsp;<a href="{U_SEARCH}" class="mainmenu">{L_SEARCH}</a>&nbsp;&nbsp;<a href="{U_MEMBERLIST}" class="mainmenu">{L_MEMBERLIST}</a>&nbsp;&nbsp;<a href="{U_GROUP_CP}" class="mainmenu">{L_USERGROUPS}</a>&nbsp;
	<!-- BEGIN switch_user_logged_in -->
	<a href="{U_PROFILE}" class="mainmenu">{L_PROFILE}</a>&nbsp;&nbsp;<a href="{U_PRIVATEMSGS}" class="mainmenu">{PRIVATE_MESSAGE_INFO}</a>
	<!-- END switch_user_logged_in -->
	</td><td align="right" class="mainmenu"><span class="mainmenu"><a href="{U_LOGIN_LOGOUT}" class="mainmenu">{L_LOGIN_LOGOUT}</a>
	<!-- BEGIN switch_user_logged_out -->
	&nbsp;&nbsp;<a href="{U_REGISTER}" class="mainmenu">{L_REGISTER}</a>
	<!-- END switch_user_logged_out --></td>
  </tr>
</table>

würde für einen hinweis oder hilfe euch sehr dankbar sein

Verfasst: 25.03.2006 20:20
von derd
Hallo,

du kannst kein php in eine tpl Datei verarbeiten. Da eine tpl Datei kein php verarbeiten kann.

Wenn müsstest du den php code zum Beispiel in die index.php einbinden und dann in der overall_header.tpl ausgeben lassen. Oder du bidest das ganze via iframe aus :P

Schau mal hier: http://derd.rof-aue.de/server.php dein script in eine php Datei eingebunden. Und siehe da es geht wünderbar.

Bye derd

Verfasst: 25.03.2006 20:27
von Thoman
hmm hatte aber den besagten code in diesem phpbb plus portal das war auch in einer tpl untergebracht da lief es aber.

kannst du mir bitte sagen wie ich den code in der overall_header einfügen muss da ich in sachen php wohl eher ein dummkopf bin ?

Verfasst: 25.03.2006 20:42
von derd
Sicher war das dann anders eingebunden.

Am schnellsten geht es so:

Die Datei schiebst du in dein Foren Verzeichnis:

http://derd.rof-aue.de/server.rar

Das bindest du in deine overall_header.tpl ein.

Code: Alles auswählen

<iframe src="http://www.ssmf.net/L2/server.php" height="180" width="130" framespacing="0" border="false" frameborder="0" scrolling="no" alt="iframe">

Verfasst: 25.03.2006 21:27
von Thoman
danke für die antwort :)

http://www.ssmf.net/L2/index.php

bekannter hat das so geregelt:

das in die overall_header.tpl
<!-- Status Anfang -->
<table width="717" align="center" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<td class="row1" align="center" valign="bottom"><span class="gensmall">
{SERVERSTATUS}
<!-- Status Ende-->
</table>
das ganze über include/page_header und dort den abfrage code rein

funktioniert auch ganz gut
dennoch danke für deine hilfe

Verfasst: 25.03.2006 21:33
von derd
Ja so gehts natürlich auch :P

Viele wege führen zum Ziel.

Bye derd