website/plan.php
Jeff Teunissen 9e6f75ccbd Update for PHP 7.x
PHP 7 doesn't like the old short tags we were using (it's possible to re-enable
them, but won't be for version 8, so we might as well switch now), and the old
MySQL APIs are now gone entirely, replaced with something different.

This should make everything work at least as well as it used to.

Also, one file used to be checked in with CRLF line endings. ??
2022-04-27 13:14:47 -04:00

39 lines
1 KiB
PHP

<?php // Preamble
$pageName = "Developer Plans";
$currPage = "plans"; // Name of the page, for the menu
$modules = "plan_search";
require "parts/preamble.php"; // Load most of document
$user='';
if (isset($_SERVER['PATH_INFO']))
$user = $_SERVER['PATH_INFO'];
need ('plan');
if (strlen ($user) > 1) {
$user = substr ($user, 1); // strip off the starting slash
if (($pos = strpos ($user, '/')) !== false) { // and all others
$user = substr ($user, 0, $pos);
}
if (is_array ($plans = latestPlans ($user, 5))) {
newsBoxOpen ("Latest Plans for " . $plans[0]['p_user']);
foreach ($plans as $plan) {
printPlanArray ($plan);
}
newsBoxClose ();
} else {
newsBoxOpen ("Latest Plans for " . $user);
printPlan ("Now", "Web Server", "Sorry", "<P>I don't know any user named &quot;$user&quot;.</P>");
newsBoxClose ();
}
} else {
if (is_array ($plans = latestPlans (null, 5))) {
newsBoxOpen ("Latest Plans for All Users");
foreach ($plans as $plan) {
printPlanArray ($plan);
}
newsBoxClose ();
}
}
?>