Beispiel #1
0
function deletePage($pageid)
{
    if ($pageid != '1') {
        if (pageExists($pageid)) {
            $db = Database::obtain();
            $sql = "DELETE FROM `" . TABLE_PAGES . "` WHERE `id`={$pageid}";
            $db->query($sql);
            sysMsg(MSG00013);
        } else {
            sysMsg(MSG00014);
        }
    }
}
function displayPageContent($category, $pageName)
{
    //$db = new Database("107.180.51.84","fcncContent","Fcnc@915","fcncContent");
    $db = new Database("localhost", "root", "root", "FCNC_v3.0");
    $db->setTable("contentTiles");
    // If varables have not been set, display the home page
    if ($category == '' && $pageName == '') {
        $queryString = ['category' => 'index', 'pageName' => 'index'];
        $pageTileResults = $db->retrieveStrict($queryString);
        displayHTML($pageTileResults->getRow());
    } else {
        if (isset($category)) {
            //error check if category and pageName exitst!!!!!
            $queryString = ['category' => $category, 'pageName' => $pageName];
            $pageTileResults = $db->retrieveStrict($queryString);
            // This can probably be cleaned up
            // if page exists display it
            // else display 404 error page
            if (pageExists(count($pageTileResults->getRow()))) {
                displayHTML($pageTileResults->getRow());
            } else {
                display404Error($db);
            }
        } else {
            //error check if pageName does not exist!!!!!
            $queryString = ['category' => "", 'pageName' => $pageName];
            $pageTileResults = $db->retrieveStrict($queryString);
            if (count($pageTileResults->getRow()) == 0) {
                // Page not found... display 404 error page
                $queryString['pageName'] = '404';
                $pageTileResults = $db->retrieveStrict($queryString);
                displayHTML($pageTileResults->getRow());
            } else {
                displayHTML($pageTileResults->getRow());
            }
        }
    }
}
Beispiel #3
0
function yambeMakeURL($page, $display)
{
    if (pageExists($page['title'], $page['namespaceid'])) {
        return linkFromText($page['title'], $display, $page['namespaceid']);
    } else {
        return "";
    }
}
Beispiel #4
0
/**
 * Get the content of the page.
 * @param string $page
 * @return string|false
 */
function getContent($page)
{
    $path = getFilePath($page);
    if (pageExists($page)) {
        return file_get_contents($path);
    }
    return false;
}
         pg_close($dbconn);
         return;
     }
 }
 // get this item's page
 $page = getPageForItem($hash, $dbconn);
 if ($page === "ERROR") {
     error_log("ERROR: Retrieve - getting current item's page failed");
     echo "#ERROR";
     pg_close($dbconn);
     return;
 }
 if ($nav === "next") {
     $page++;
     // get canvas content for next item
     $pageExists = pageExists($page, $dbconn);
     if ($pageExists === "ERROR") {
         error_log("ERROR: Retrieve - checking if page {$page} exists failed");
         echo "#ERROR";
         pg_close($dbconn);
         return;
     }
     if ($pageExists) {
         $result = getContentForPage($page, $dbconn);
         if ($result === "ERROR") {
             error_log("ERROR: Retrieve - retrieving content failed - get canvas content for next item");
             echo "#ERROR";
             pg_close($dbconn);
             return;
         } else {
             echo $result;
Beispiel #6
0
# Hook to load page Cache
exec_action('index-header');
if (!$plugins) {
    debugLog("GS ERROR: plugins is empty!");
}
if (!$pagesArray) {
    debugLog("GS ERROR: pagesArray is empty!");
}
# get page id (url slug) that is being passed via .htaccess mod_rewrite
if (isset($_GET['id'])) {
    $id = str_replace('..', '', $_GET['id']);
    $id = str_replace('/', '', $id);
    $id = lowercase($id);
} else {
    $id = getDef('GSINDEXSLUG');
    if (!pageExists($id)) {
        $id = 'index';
    }
}
// filter to modify page id request
$id = exec_filter('indexid', $id);
// @filter indexid (str) filter the front end index id/slug
// $_GET['id'] = $id; // @todo: do we need this for support for plugins that are checking get?
$data_index = null;
// load page data
if (previewingDraft()) {
    // display draft if specified else
    $data_index = getDraftXml($id);
} else {
    if (isset($pagesArray[$id])) {
        // apply page data if page id exists