PDA

View Full Version : Making a Page


Battle_Ring
11-16-2009, 11:48 PM
I want to make a page in my Vbulletin site with this php code on it

How can i do this?

<style>
<!--
body { background-color: #ffffff; font-family: Verdana, Arial; font-size: 11px; }
.size1 { font-family: Arial, Verdana; font-size: 12px; color: #000000; font-weight: normal}
.size1 a:link { color: navy; text-decoration: none; font-weight: normal}
.size1 a:visited { color: navy; text-decoration: none; font-weight: normal}
.size1 a:hover { color: red; text-decoration: underline; font-weight: normal}
.size1 a:active { color: navy; text-decoration: none; font-weight: normal}
.size2 { font-family: Trebuchet MS, verdana, tahoma; font-size: 13px; color: #000000; font-weight:normal}
.size2 a:link { color: blue; text-decoration: none; font-weight:normal}
.size2 a:visited { color: blue; text-decoration: none ; font-weight: normal}
.size2 a:hover { color: red; text-decoration: underline ; font-weight: normal}
.size2 a:active { color: blue; text-decoration: none ; font-weight: normal}

.raised {
background:transparent;
width:100%;
}
.raised h1, .raised p {
margin:0 10px;
}
.raised h1 {
font-size:2em;
color:#fff;
}
.raised p {
padding-bottom:0.5em;
}
.raised .b1, .raised .b2, .raised .b3, .raised .b4, .raised .b1b, .raised .b2b, .raised .b3b, .raised .b4b {
display:block;
overflow:hidden;
font-size:1px;
}
.raised .b1, .raised .b2, .raised .b3, .raised .b1b, .raised .b2b, .raised .b3b {
height:1px;
}
.raised .b2 {
background:#00CED1;
border-left:1px solid #fff;
border-right:1px solid #eee;
}
.raised .b3 {
background:#00CED1;
border-left:1px solid #fff;
border-right:1px solid #ddd;
}
.raised .b4 {
background:#00CED1;
border-left:1px solid #fff;
border-right:1px solid #aaa;
}
.raised .b4b {
background:#E6E6FA;
border-left:1px solid #eee;
border-right:1px solid #999;
}
.raised .b3b {
background:#E6E6FA;
border-left:1px solid #ddd;
border-right:1px solid #999;
}
.raised .b2b {
background:#E6E6FA;
border-left:1px solid #aaa;
border-right:1px solid #999;
}
.raised .b1 {
margin:0 5px;
background:#fff;
}
.raised .b2, .raised .b2b {
margin:0 3px;
border-width:0 2px;
}
.raised .b3, .raised .b3b {
margin:0 2px;
}
.raised .b4, .raised .b4b {
height:2px; margin:0 1px;
}
.raised .b1b {
margin:0 5px; background:#999;
}
.raised .boxcontentt {
display:block;
background:#00CED1;
border-left:1px solid #fff;
border-right:1px solid #999;
}
.raised .boxcontent {
display:block;
background:#E6E6FA;
border-left:1px solid #fff;
border-right:1px solid #999;
}
-->
</style>
<?
$aa="Select your activity|Aerobics, Step: 10inch - 12inch step|Aerobics, Step: 6inch - 8inch step|Aerobics: high impact|Aerobics: low impact|Aerobics: water|Archery: non-hunting|Badminton: general, social|Bakery: general, moderate effort|Bartending/Server|Basketball: officiating a game|Basketball: playing a game|Basketball: shooting baskets |Basketball: wheelchair|Bicycling, Stationary: moderate, 150 watts|Bicycling, Stationary: vigorous, 200 watts|Bicycling: > 20 mph, racing, not drafting|Bicycling: 12-13.9 mph, leisure, moderate effort|Bicycling: 14-15.9 mph, leisure racing, fast, vigorous|Bicycling: 16-19 mph, very fast, not drafting|Bicycling: BMX or mountain|Billiards |Bowling|Boxing: in the ring|Boxing: punching bag|Boxing: sparring|Building Road: hauling debris, driving heavy machinery|Calisthenics: Moderate, back exercises, going up and down from the floor|Calisthenics: Vigorous, jumping jacks, push-ups, sit-ups, pullups|Carpentry Work|Carpentry, installing rain gutters, building fence|Carpentry: finish or refinish furniture or cabinets|Carrying & stacking wood|Caulking: bathroom, windows|Child games: moderate, hop-scotch, jacks, etc.|Child-care: bathing, feeding, etc.|Chopping & splitting wood|Circuit Training: w/some aerobic, minimal rest|Cleaning House: general|Cleaning rain gutters|Cleaning: light dusting, straightening up, taking out trash, etc.|Coaching Sports|Coaching: football, soccer, basketball, etc.|Coal Mining|Computer Work|Construction: outside, remodeling|Cooking / Food Preparation|Crafts: Standing, light effort|Cricket: batting, bowling|Curling|Custodial Word: general cleaning, moderate effort|Dancing: disco, ballroom, square, line, Irish step, polka|Dancing: Fast, ballet, twist|Dancing: slow, waltz, foxtrot, tango, fox trot|Digging, spading dirt, composting|Driving vehicle to work|Electrical Work|Elliptical Trainer: general|Fencing|Firefighting|Food Shopping: with or without cart|Football or Baseball: playing catch|Football: competitive|Football: touch, flag, general|Forestry, general|Forestry: planting trees by hand|Frisbee: general|Frisbee: Ultimate|Gardening: general|Gardening: weeding|Golf: carrying clubs|Golf: driving range, miniature|Golf: using cart|Golf: walking and pulling clubs|Gymnastics: general|Hacky sack|Handball: general|Handball: team|Hang Gliding|Hang sheet rock, paper or plaster walls|Heavy Cleaning: wash car, windows|Heavy Equip. Operator|Hiking: cross-country|Hockey: field & ice|Horse Grooming|Horseback Riding: general|Ice Skating: general|Ironing|Kayaking|Lay or remove carpet/tile|Laying sod / crushed rock|Light Office Work|Locksmith|Making Bed|Martial Arts: judo, karate, kick boxing, tae kwan do|Masonry|Masseur, standing|Motor-Cross|Moving / Pushing heavy objects >75 lbs. |Moving: carrying boxes|Moving: household furniture|Moving: unpacking|Mowing Lawn: push, hand|Mowing Lawn: push, power|Operate Snow Blower: walking|Orienteering|Paint outside of home|Paint, paper, remodel: inside|Patient Care: Nursing|Plant trees|Planting seedlings, shrubs|Playing w/kids: moderate effort|Playing w/kids: vigorous effort|Plumbing|Police Officer: making an arrest|Polo|Printing: operator, standing|Race Walking|Racquetball: casual, general|Racquetball: competitive|Raking Lawn|Reading: sitting|Riders: general (ie., HealthRider)|Riding in a bus or vehicle to work|Rock Climbing: ascending|Rock Climbing: rappelling|Rollerblade / In-Line Skating|Roofing|Rope Jumping: general, moderate|Rowing, Stationary: moderate, 100 watts|Rowing, Stationary: vigorous, 150 watts|Running: 10 mph (6 min/mile)|Running: 5 mph (12 min/mile)|Running: 5.2 mph (11.5 min/mile)|Running: 6 mph (10 min/mile)|Running: 6.7 mph (9 min/mile)|Running: 7 mph (8.5 min/mile)|Running: 8.6 mph (7 min/mile)|Running: cross-country|Running: on track, team practice|Running: stairs, up|Running: training, pushing wheelchair, marathon wheeling|Sacking grass or leaves|Sanding floors with a power sander|Scuba or skin diving|Shoe Repair: general|Shoveling Snow: by hand|Sitting in Class|Sitting: light office work, meeting|Skateboarding|Ski Machine: general|Skiing: cross-country, light effort, general, 2.5 mph|Skiing: cross-country, vigorous, 5.0 - 7.9 mph|Skiing: downhill, moderate effort|Skiing: downhill, vigorous effort, racing|Sky diving|Sledding, luge, toboggan, bobsled|Sleeping|Snorkeling|Snow Shoeing|Soccer: competitive play|Soccer: general|Softball or Baseball: slow or fast pitch, general|Softball: Officiating|Softball: pitching|Squash|Stair Step Machine: General, without supporting any bodyweight on hand rails |Standing in line|Standing: bathing dog|Standing: filing, light work|Steel Mill: general|Storm Windows: hanging|Stretching: Mild, Hatha Yoga|Surfing: body or board|Sweeping: garage, sidewalks, outside of house|Swimming: backstroke|Swimming: breaststroke|Swimming: butterfly|Swimming: crawl, moderate, 50 yds/min|Swimming: general, leisurely, no laps|Swimming: lake, ocean, river|Swimming: laps, vigorous|Swimming: synchronized|Swimming: treading, moderate effort|Table Tennis / Ping Pong|Tai Chi|Teaching aerobics|Tennis: doubles, competitive|Tennis: general play|Tennis: singles, competitive|Theater Work|Track & Field: high jump, long jump, triple jump, javelin, pole vault|Track & Field: shot, discus, hammer throw|Track & Field: steeplechase, hurdles|Trimming shrubs/trees: manual cutter|Trimming: using edger, power cutter, etc.|Truck Driving: loading and unloading truck|Typing: Computer, electric or manual|Vacuuming|Volleyball: beach|Volleyball: competitive, gymnasium play|Volleyball: non-competitive, general play, 6 - 9 member team|Walk: 2 mph (30 min/mi)|Walk: 3 mph (20 min/mi)|Walk: 3.5 mph (17 min/mi)|Walk: 4 mph (15 min/mi)|Walk: 4.5 mph (13 min/mi)|Walk: 5 mph (12 min/mi)|Walking: work break|Watching TV|Water Polo|Water Skiing|Water Volleyball|Watering plants, by hand|Weight Lifting: Light, free weight, nautilus or universal-type|Weight Lifting: Vigorous, free weight, nautilus or universal-type|Welding|Whitewater: rafting, kayaking|Wiring and Plumbing|Workshop: general carpentry|Wrestling: one match = 5 minutes|Yard: applying seed or fertilizer, walking|Yard: watering by hand, standing/walking|";
$bb="0|0.0757|0.0643|0.053|0.0378|0.0303|0.0265|0.034|0 .0303|0.01509|0.053|0.0606|0.034|0.0492|0.053|0.07 95|0.1212|0.0606|0.0757|0.0909|0.0643|0.0189|0.022 69|0.090901|0.04539|0.0681|0.04539|0.0265|0.0606|0 .0265|0.04539|0.034|0.0378|0.034|0.0303|0.02269|0. 04539|0.0606|0.02269|0.0378|0.0189|0.0303|0.0303|0 .04539|0.01130|0.0416|0.01509|0.0136|0.0378|0.0303 |0.0265|0.034|0.0363|0.02269|0.0378|0.015099999999 999999|0.0265|0.0545|0.045399999999999996|0.090900 00000000001|0.0174|0.0189|0.0681|0.0606|0.0606|0.0 45399999999999996|0.022699999999999998|0.0606|0.03 03|0.034|0.034|0.022699999999999998|0.0265|0.0325| 0.0303|0.0303|0.09090000000000001|0.0606|0.0265|0. 022699999999999998|0.022699999999999998|0.0189|0.0 45399999999999996|0.0606|0.045399999999999996|0.03 03|0.053|0.0174|0.0378|0.034|0.0378|0.011300000000 000001|0.0265|0.015099999999999999|0.0757|0.053|0. 0303|0.0303|0.056799999999999996|0.0424|0.04539999 9999999996|0.0265|0.045399999999999996|0.0416|0.03 4|0.0681|0.0378|0.034|0.022699999999999998|0.034|0 .034|0.0303|0.0378|0.0265|0.0303|0.0757|0.0174|0.0 492|0.053|0.0757|0.0325|0.0075|0.0303|0.0075|0.083 3|0.0606|0.09459999999999999|0.045399999999999996| 0.0757|0.053|0.0643|0.1212|0.0606|0.0681|0.0757|0. 0833|0.0871|0.106|0.0681|0.0757|0.1135999999999999 9|0.0606|0.0303|0.034|0.053|0.0189|0.0453999999999 99996|0.0136|0.011300000000000001|0.0378|0.053|0.0 53|0.0681|0.045399999999999996|0.0606|0.0265|0.053 |0.0068|0.0378|0.0606|0.0757|0.053|0.0378|0.0303|0 .045399999999999996|0.09090000000000001|0.0681|0.0 090|0.0265|0.0174|0.0606|0.0378|0.0189|0.022699999 999999998|0.0303|0.053|0.0757|0.0833|0.0606|0.0453 99999999999996|0.045399999999999996|0.0757|0.0606| 0.0606|0.0303|0.0303|0.045399999999999996|0.0378|0 .053|0.0606|0.0181|0.045399999999999996|0.0303|0.0 757|0.034|0.0265|0.0492|0.011300000000000001|0.026 5|0.0606|0.0606|0.022699999999999998|0.0189|0.025| 0.0287|0.0378|0.047700000000000006|0.0606|0.0265|0 .0075|0.0757|0.045399999999999996|0.02269999999999 9998|0.0189|0.022699999999999998|0.045399999999999 996|0.022699999999999998|0.0378|0.0226999999999999 98|0.022699999999999998|0.045399999999999996|0.018 9|0.011300000000000001|";
?>
<script language=javascript>
<!-- Begin
function ClearForm(form){
form.myWeight.value = "";
form.myTime.value = "";
form.myActivity.value = "";
}
// End -->

</script>
<table cellspacing=0 cellpadding=0 width=100% border=0>
<tr class=size2 valign=top><td>
<div class="raised">
<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
<div class="boxcontent">&nbsp;<br>
<table border=0 cellpadding=11 cellspacing=0>
<tr class=size2>
<form METHOD="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<td></td><td><b>Your Weight</b></td><td><b>Duration of Activity</td>
</tr>
<tr class=size2>
<td></td><td><input type=text name=myWeight size="4"> pounds</td>
<td><input type=text name=myTime size="4"> min</td>
</tr>
<tr class=size2>
<td><b>Activity</b></td><td colspan=2>
<select name=myActivity>
<?
$num = 223;
$ac = explode("|", $aa);
for ($a=0; $a<$num; $a++){
echo "<option value =".$a.">".$ac[$a]."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td></td><td><input type=submit value="Calculate"></td>
<td><input type=BUTTON value=" Reset " onClick="ClearForm(this.form)"></td>
</TR>
<tr>
<td bgcolor="#eeeeee" colspan=3 class=size2>
<table width=100% cellpadding=3 cellspacing=0 border=1>
<tr class=size2><td><b>Activity</b></td><td><b>Duration (min)</b></td><td><b>Calories</b></td></tr>
<?
$actno = 0;
$actno = $_POST[actno];
if ($actno == ""){ $actno = 1; }
if ($actno > 1){
for ($ae=2; $ae<$actno+1; $ae++){
$activ0 = $activ[$ae];
echo "<input type=hidden name=activ[".$ae."] value=\"".$activ0."\">\n";
$bce = explode("|", $activ0);
echo "<tr class=size1><td>".$bce[0]."</td><td align=center>".$bce[1]."</td><td align=right style='padding-right:7px;'>".number_format($bce[2], 2, '.', '')."</td></tr>";
$totalcal = $totalcal + $bce[2];
}
}
if ($_POST[myWeight] && $_POST[myActivity] && $_POST[myTime]){
$noact = $actno+1;
$acn = $_POST[myActivity];
$bc = explode("|", $bb);
$vl = $bc[$acn];
$tc = $_POST[myWeight] * $vl * $_POST[myTime];
echo "<tr class=size1><td>".$ac[$acn]."</td><td align=center>".$_POST[myTime]."</td><td align=right style='padding-right:7px;'>".number_format($tc, 2, '.', '')."</td></tr>";
$totalcal = $totalcal + $tc;
echo "<tr class=size1><td colspan=2><b>TOTAL</b></td><td align=right style='padding-right:7px;'><b>".number_format($totalcal, 2, '.', '')."</b></td></tr>";
$tactivity = $ac[$acn]."|".$_POST[myTime]."|".$tc;
if ($noact < 1){ $noact = 1; }
echo "<input type=hidden name=actno value=".$noact.">\n";
echo "\n<input type=hidden name=activ[".$noact."] value=\"".$tactivity."\">";
}
?>
</table>
</td>
</tr>
</form>
</TABLE><br>&nbsp;<p align=center>Put Daily Activity Calorie Counter on Your Site<br>
<a href=http://www.fullhealth.net/ftincludes/dailycalcounter.zip taret=_blank>dailycalcounter.zip</a>&nbsp;by <a href=http://www.fullhealth.net target=_blank>FullHealth.net</a></p>
<b class="b4b"></b><b class="b3b"></b><b class="b2b"></b><b class="b1b"></b>
</div>
</td></tr></table>


--------------- Added 1258427659 at 1258427659 ---------------

wow lots of help around here these days

kh99
11-17-2009, 01:50 AM
OK, how about trying this: http://www.vbulletin.com/docs/html/templates_externalfiles (the section on including a php file). Then you can put the variable in a template.

Lynne
11-17-2009, 01:55 AM
--------------- Added 16 Nov 2009 at 19:14 ---------------

wow lots of help around here these days
You waited less than two hours after your original post and then post this? Have you read the General Site Rules (https://vborg.vbsupport.ru/info.php?do=rules)?
No "Bumping" (Your threads/posts): Please do not repeatedly bump your threads to try and get attention. Most members of the site are not online 24 hours a day and so will not see your post the instant it is made. Do not bump a thread within 24 hours, and not more than twice a week.You need to be a bit patient as some of us are helping out both here and on vb.com.

Battle_Ring
11-17-2009, 01:57 AM
I tried that and i got

Warning: include(/dailycalcounter.php) [function.include]: failed to open stream: No such file or directory in [path]/global.php(400) : eval()'d code on line 200

Warning: include() [function.include]: Failed opening '/dailycalcounter.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/global.php(400) : eval()'d code on line 200

kh99
11-17-2009, 02:06 AM
Did you maybe put

include('/dailycalcounter.php');

in your plugin? You need to have the path on the server to the included file. Try

include('./dailycalcounter.php');

Battle_Ring
11-17-2009, 02:42 PM
yes thats what i put