function pageContent()
{
    $foundMatch = false;
    global $pagesArray, $subpagesArray;
    foreach ($pagesArray as $p) {
        if (isset($_REQUEST[$p])) {
            navGroup($p);
            $foundMatch = true;
        }
    }
    foreach ($subpagesArray as $p) {
        if (isset($_REQUEST[$p])) {
            echo dbReadPage($p, 1);
            $foundMatch = true;
        }
    }
    if (isset($_REQUEST['sitemap'])) {
        echo '<table>';
        $first = true;
        foreach ($pagesArray as $p) {
            if (!$first) {
                echo '<tr><td colspan="2" style="height: 1px; background: #666;"></td></tr>';
            }
            echo '<tr><td><a href="?' . $p . '">' . dbReadTitle($p) . '</a></td><td><ul>';
            navGroup($p);
            echo '</ul></td></tr>';
            $first = false;
        }
        echo '</table>';
    }
    if (!$foundMatch) {
        echo dbReadPage('home', 1);
    }
}
Example #2
0
    $tmp = array_merge($pagesArray, $subpagesArray);
    $first = true;
    foreach ($tmp as $v) {
        echo "\n" . '<div id="pn_' . $v . '" class="pageTitle"' . ($first ? ' style="display: inline;"' : '') . '><input type="text" name="pnt_' . $v . '" id="pnt_' . $v . '" value="' . dbReadTitle($v) . '"></div>';
        $first = false;
    }
    ?>
                    <div style="float: right;"><input type="button" value="  Save Changes  " onclick="sendCode('websiteContent');" /></div>
                </td></tr>
                <tr><td colspan="2">Pages in the select field with a<b style="background: #F66;"> red </b>background are navigation only pages. Editing these could cause navigational errors.</td></tr>
                <tr><td colspan="2">
                	<?php 
    $first = true;
    foreach ($tmp as $v) {
        echo "\n" . '<textarea class="pageContent" id="pc_' . $v . '" name="pc_' . $v . '"' . ($first ? ' style="display: block;"' : '') . '>';
        echo dbReadPage($v);
        //if (!file_exists("pages/".$v.".html")) { $f = fopen("pages/".$v.".html", "w"); fwrite($f, ""); fclose($f); }
        //echo file_get_contents("pages/".$v.".html");
        echo '</textarea>';
        $first = false;
    }
    ?>
                </td></tr></table>
            </div>
        </td></tr>
    </table>
    <?php 
} else {
    ?>
	<table class="login">
    	<tr><td>Username:</td><td><input type="text" name="u" size="15" /></td></tr>