Fix up style images and a couple of typos.
Fix up style images and a couple of typos.

File last commit:

9aa578e06d0d
e8561709c1cb
Show More
manage-pages.php
67 lines | 1.8 KiB | text/x-php | XmlPhpLexer
/ manage-pages.php
Add most necessary files for admin interface.
r1 <?php
/* This page displays a list of comics, 15 per page. */
require_once('include/admin.inc.php');
auth_redirect(); // Require logged in user to access this page.
adminhead('Manage Pages');
adminmenu();
?>
<h2>Manage Pages</h2>
<?php
$page = 1;
if( isset($_GET['page'] )) $page = (int) $_GET['page'];
$perpage = 15;
More updates to rants and pages.
r28 $start = ($page - 1) * $perpage;
Add most necessary files for admin interface.
r1
More updates to rants and pages.
r28 $total = ceil( $dbConnection->fetchColumn('SELECT COUNT(url_name) FROM static_page') / $perpage );
Declare parameter types and fix a typo.
r29 $pages = $dbConnection->fetchAll('SELECT url_name, pubdate, status, title, body FROM static_page ORDER BY url_name ASC LIMIT ?, ?', array($start, $perpage), array(PDO::PARAM_INT, PDO::PARAM_INT));
Add most necessary files for admin interface.
r1
pagination( $page, $total );
?>
<table class="widefat">
<thead>
<tr>
<th scope="col" style="text-align: center;">Page&nbsp;Name</th>
<th scope="col">Title</th>
<th scope="col">Status</th>
<th scope="col">Published&nbsp;On</th>
<th scope="col">Excerpt</th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</thead>
<tbody id="the-list">
<?php
$alternate=false;
foreach( $pages as $p ) {
$alternate=!$alternate;
?>
<tr id="page-<?php echo $p->url_name; ?>" <?php if($alternate) echo 'class="alternate"'; ?>>
<th scope="row" style="text-align: center;"><?php echo $p->url_name ?></th>
<td><?php echo $p->title; ?></td>
<td><?php echo $p->status; ?></td>
<td><?php echo $p->pubdate; ?></td>
<td><?php echo Excerpt($p->body,185); ?></td>
<td><?php echo '<a href="' . SITE_HOST.SITE_PATH.'/' . $p->url_name . '">View</a>'; ?></td>
<td style="text-align: center;"><a href="edit-page.php?page_name=<?php echo $p->url_name; ?>">Edit</a></td>
<td style="text-align: center;"><a class="delete" href="delete-page.php?page_name=<?php echo $p->url_name; ?>">Delete</a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
adminfooter();
?>