View Full Version : Basic HTML Page
Watson
07-06-2004, 06:40 PM
Sorry but I aint understanding this guide. heh.
I want to make a simple html page, so that I can put it in the nav menu(if I ever get it to work)
I dont want the html page to be displayed in a module, I wanna be able to open more pages in the middle section of my site
Watson
Brian
07-06-2004, 06:57 PM
Follow the steps in the User's Manual on adding a new page. It really isn't that hard. ;)
Sanjiyan
07-13-2004, 05:57 PM
I have followed how to add a new page, I got it to make a new page, but how do I put the php/html into the middle section of the page?
Brian
07-13-2004, 06:19 PM
Page Template
If you would like for this page to display a certain vBulletin template, simply enter the name of that template here. If a template is entered here then your "Custom Page Content" module will be used to display the content of that template. Simply leave this field blank if you do not wish to have a custom template on this page.
Note: You must have your 'Custom Page Content' module enabled for this page, otherwise this setting will have no effect.
Sanjiyan
07-23-2004, 02:54 PM
I am trying to add this to a template and it gives me the following error:
The following error occurred when attempting to evaluate this template:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/sanjiyan/public_html/f7/forum/includes/adminfunctions_template.php(3055) : eval()'d code on line 43
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
Below is the code I am trying to insert into the template
<HTML>
<HEAD>
<meta http-equiv="Content-Language" content="en-gb">
<style>
th { background-color: #e1e1e2; font: 80% Arial, Helvetica, sans-serif; color: white; }
th.empty { background-color: silver; font: 10% Arial, Helvetica, sans-serif; color: silver; }
th.black { background-color: #e1e1e2; font: 80% Arial, Helvetica, sans-serif; color: white; }
th.green { background-color: #597D4F; font: 10% Arial, Helvetica, sans-serif; color: #597D4F; }
td.empty { background-color: silver; font: 10% Arial, Helvetica, sans-serif; color: silver; }
td.good { font: x-small Arial, Helvetica, sans-serif; border: 0.25pt solid #000000; color: green; }
td.bad { font: x-small Arial, Helvetica, sans-serif; border: 0.25pt solid #000000; color: orange; }
td.ugly { font: x-small Arial, Helvetica, sans-serif; border: 0.25pt solid #000000; color: red; }
td.volgood { background-color: #009900; font: 80% Arial, Helvetica, sans-serif; color: green; }
td.volbad { background-color: #e1e1e2; font: 80% Arial, Helvetica, sans-serif; color: orange; }
td.volugly { background-color: #e1e1e2; font: 80% Arial, Helvetica, sans-serif; color: red; }
.plain { font: x-small Arial, Helvetica, sans-serif; color: black; border: 0.25pt solid #000000; }
</style>
<title>Friendship 7 Corp - Ore Status Page</title>
</HEAD>
<BODY bgcolor="#e1e1e2">
<p align="center"><b><font size="6">Friendship 7 Corporation Ore Status Page</font></b></p>
<p><b><i><font size="4">5-6QW7</font><font size="4"> Office<br>
</font></i></b><font size="1"><a href="http://f7.sanjiyan.co.uk/ore/admin/5-6QW7.php">Edit Ore Status</a></font></p>
<TABLE width="0%" border="0" cellpadding="2" cellspacing="0" class="plain">
<TR>
<TD class="plain"><b>Mineral</b></TD>
<TD class="plain"><b>Baseline</b></TD>
<TD class="plain"><b>Amount</b></TD>
<TD class="plain"><b>± Factor</b></TD>
<TD class="plain"><b>Meter</b></TD>
</TR>
<?
# Mysql bits (needs to be able to SELECT, UPDATE only)
$dbhost = "localhost"; // host
$dbuser = "sanjiyan_ore";
$dbpassword = "xxxxxx";
$dbname = "sanjiyan_ore";
/* Change this -> */ $barLength = 20;
# number of | max. for each status bar .. 100% or more ore = a bar of $barLength */
$me = $_SERVER['PHP_SELF'];
$link = mysql_connect( "$dbhost",
"$dbuser",
"$dbpassword" )
OR DIE("Could not connect to MySQL Server '$dbhost': " . mysql_error());
$func = mysql_select_db("$dbname")
or DIE("Connected but couldn't open Database: " . mysql_error());
$func = mysql_query("SELECT * FROM `5-6QW7` ORDER BY mineral ASC", $link)
or DIE("Query Failed: " . mysql_error());
# Variables to control output coloring:
# as a percentage of "baseline"
$good = 0.85; // above $good = green (by default)
$bad = 0.65; // above $bad = yellow (")
# $ugly = 50; // below $bad = red (")
while ($resultRow = mysql_fetch_array($func, MYSQL_ASSOC)) {
$mineral = $resultRow['mineral'];
$baseline = $resultRow['baseline'];
$actual = $resultRow['actual'];
$volume = $resultRow['Volume'];
if($baseline > 0) { $factor = round(($actual / $baseline),3); } else { $factor = 1; }
$percentage = $factor * 100;
if ($percentage > 100) { $percentage = 100; }
$numBars = $percentage/(100/$barLength);
if($factor >= $good) { $textColor = "good"; }
elseif($factor >= $bad) { $textColor = "bad"; }
else { $textColor = "ugly"; }
?>
<TR>
<TD class="plain" width="42" height="1"><?=$mineral?></TD>
<TD class="plain" width="50" height="1"><?=$baseline?></TD>
<TD class="plain" width="45" height="1"><?=$actual?></TD>
<TD class="<?=$textColor?>" width="50" height="1"><?=$percentage?>%</TD>
<TD class="<?=$textColor?>" width="35" height="1"><?=str_repeat("|", $numBars)?><?=str_repeat(" ", round($barLength-$numBars))?></TD>
</TR><?
}
?>
</TABLE>
<p><br>
<i><b><font size="4"><br>
MO-GZ5 Office<br>
</font></b></i><font size="1"><a href="http://f7.sanjiyan.co.uk/ore/admin/MO-GZ5.php">Edit Ore Status</a></font></p>
<TABLE width="0%" border="0" cellpadding="2" cellspacing="0" class="plain">
<TR>
<TD class="plain"><b>Mineral</b></TD>
<TD class="plain"><b>Baseline</b></TD>
<TD class="plain"><b>Amount</b></TD>
<TD class="plain"><b>± Factor</b></TD>
<TD class="plain"><b>Meter</b></TD>
</TR>
<?
# Mysql bits (needs to be able to SELECT, UPDATE only)
$dbhost = "localhost"; // host
$dbuser = "sanjiyan_ore";
$dbpassword = "xxxxxx";
$dbname = "sanjiyan_ore";
/* Change this -> */ $barLength = 20;
# number of | max. for each status bar .. 100% or more ore = a bar of $barLength */
$me = $_SERVER['PHP_SELF'];
$link = mysql_connect( "$dbhost",
"$dbuser",
"$dbpassword" )
OR DIE("Could not connect to MySQL Server '$dbhost': " . mysql_error());
$func = mysql_select_db("$dbname")
or DIE("Connected but couldn't open Database: " . mysql_error());
$func = mysql_query("SELECT * FROM `MO-GZ5` ORDER BY mineral ASC", $link)
or DIE("Query Failed: " . mysql_error());
# Variables to control output coloring:
# as a percentage of "baseline"
$good = 0.85; // above $good = green (by default)
$bad = 0.65; // above $bad = yellow (")
# $ugly = 50; // below $bad = red (")
while ($resultRow = mysql_fetch_array($func, MYSQL_ASSOC)) {
$mineral = $resultRow['mineral'];
$baseline = $resultRow['baseline'];
$actual = $resultRow['actual'];
$volume = $resultRow['Volume'];
if($baseline > 0) { $factor = round(($actual / $baseline),3); } else { $factor = 1; }
$percentage = $factor * 100;
if ($percentage > 100) { $percentage = 100; }
$numBars = $percentage/(100/$barLength);
if($factor >= $good) { $textColor = "good"; }
elseif($factor >= $bad) { $textColor = "bad"; }
else { $textColor = "ugly"; }
?>
<TR>
<TD class="plain" width="42" height="1"><?=$mineral?></TD>
<TD class="plain" width="50" height="1"><?=$baseline?></TD>
<TD class="plain" width="45" height="1"><?=$actual?></TD>
<TD class="<?=$textColor?>" width="50" height="1"><?=$percentage?>%</TD>
<TD class="<?=$textColor?>" width="35" height="1"><?=str_repeat("|", $numBars)?><?=str_repeat(" ", round($barLength-$numBars))?></TD>
</TR><?
}
?>
</TABLE>
<p><br>
<br>
</p>
</BODY>
</HTML>
Any ideas? I have none...
Brian
07-23-2004, 03:41 PM
For one thing, you don't need <html>, <head>, and those other tags as these will already be on the page. Secondly, you can't use PHP in templates.
Sanjiyan
07-24-2004, 07:48 PM
yep I found that out, any ideas how I can make a basic HTML page but use the VB style? Apart from making it all the same by physcially making the background and table the same colours, is there a quick and easier way?
IE could I use vbadvanced to make a new page, and use a template to call that .php file and place it inside the new page?
apokalupsis
07-24-2004, 08:10 PM
Watson, or San...
Are you trying to put in a nav panel (or create middle column content) like this: www.myfamilycorner.net ?
I have it set up, so that the nav menu is a template. It also is a module that shows on the left column of my pages. Is that what you are trying to do? Just trying to clarify before trying to help. ;)
See the links: About Us, Rules, then F.A.Q.
It's all integrated, w/o leaving the front page. Only the center area changes (w/ exception of the FAQ, in which case, the center and the right changes).
Sanjiyan
07-24-2004, 08:38 PM
Well I made a new module and made it so that it calls the .php file in that way....
It works, but its putting the module at the top of the screen, see attached image....
I have attached my new php code, including the stuff for the module.
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><strong>$vba_options[portal_blockbullet] 5-7QW7 Ore Status</strong></span></td>
</tr>
<tr>
<td class="$getbgrow" width="100%">
<!-- Begin custom code -->
<!-- Ore Status (5-6QW7 Office) Block -->
<style>
th {font: 80% Arial, Helvetica, sans-serif; color: white; }
th.empty {font: 10% Arial, Helvetica, sans-serif; color: silver; }
th.black {font: 80% Arial, Helvetica, sans-serif; color: white; }
th.green { font: 10% Arial, Helvetica, sans-serif; color: #597D4F; }
td.empty { font: 10% Arial, Helvetica, sans-serif; color: silver; }
td.good { font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; border: 0.25pt solid #000000; color: green; }
td.bad { font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; border: 0.25pt solid #000000; color: orange; }
td.ugly { font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; border: 0.25pt solid #000000; color: red; }
td.volgood { background-color: #009900; font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; color: green; }
td.volbad { background-color: #e1e1e2; font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; color: orange; }
td.volugly { background-color: #e1e1e2; font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; color: red; }
.plain { font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; color: black; border: 0.25pt solid #000000; }
</style>
<td class="plain"><p><b>5-6QW7 Office</b></p></td>
<TABLE width="0%" border="0" cellpadding="2" cellspacing="0" class="plain">
<TR>
<TD class="plain"><b>Mineral</b></TD>
<TD class="plain"><b>Amount</b></TD>
<TD class="plain"><b>± Factor</b></TD>
</TR>
<?
# Mysql bits (needs to be able to SELECT, UPDATE only)
$dbhost = "localhost"; // host
$dbuser = "sanjiyan_ore";
$dbpassword = "xxxxxxxx";
$dbname = "sanjiyan_ore";
/* Change this -> */ $barLength = 20;
# number of | max. for each status bar .. 100% or more ore = a bar of $barLength */
$me = $_SERVER['PHP_SELF'];
$link = mysql_connect( "$dbhost",
"$dbuser",
"$dbpassword" )
OR DIE("Could not connect to MySQL Server '$dbhost': " . mysql_error());
$func = mysql_select_db("$dbname")
or DIE("Connected but couldn't open Database: " . mysql_error());
$func = mysql_query("SELECT * FROM `5-6QW7` ORDER BY mineral ASC", $link)
or DIE("Query Failed: " . mysql_error());
# Variables to control output coloring:
# as a percentage of "baseline"
$good = 0.85; // above $good = green (by default)
$bad = 0.65; // above $bad = yellow (")
# $ugly = 50; // below $bad = red (")
while ($resultRow = mysql_fetch_array($func, MYSQL_ASSOC)) {
$mineral = $resultRow['mineral'];
$baseline = $resultRow['baseline'];
$actual = $resultRow['actual'];
$volume = $resultRow['Volume'];
if($baseline > 0) { $factor = round(($actual / $baseline),3); } else { $factor = 1; }
$percentage = $factor * 100;
if ($percentage > 100) { $percentage = 100; }
$numBars = $percentage/(100/$barLength);
if($factor >= $good) { $textColor = "good"; }
elseif($factor >= $bad) { $textColor = "bad"; }
else { $textColor = "ugly"; }
?>
<TR>
<TD class="plain" width="42" height="1"><?=$mineral?></TD>
<TD class="plain" width="45" height="1"><?=$actual?></TD>
<TD class="<?=$textColor?>" width="50" height="1"><?=$percentage?>
%</TD>
</TR>
<?
}
?>
</TABLE>
<!-- End Navigation Block -->
<!-- End custom code -->
</td>
</tr>
</table>
<br />
Sanjiyan
07-24-2004, 08:53 PM
anyone got any ideas on how to fix this location thing?
Oh I cant add it to exclude a template, as I dont have it calling any template, I have tried that idea. I really want this to work, and I am tearing my hair out.
Sanjiyan
07-24-2004, 10:32 PM
I have it working now thanks to this thread:
http://www.vbadvanced.com/forum/showthread.php?t=1082
Its amazing when you just get tired of trying to solve your php bugs, and just browse the site for something to do, and stumble across the 'help' needed to solve your own issues.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.