Returns the name associated to the specified administrator login.
public getAdminstratorName ( $login ) |
//////////////// // BEGIN HTML require_once '../includes/header.inc.php'; ?> <h1>Blog Management</h1> <hr /> <h2>Delete Blog Post</h2> <h3><?php echo $post['title']; ?> </h3> <p>Posted <strong><?php echo date_format(date_create($post['date']), "F jS, Y"); ?> </strong> by <strong><?php echo $common->getAdminstratorName($post['author']); ?> </strong>.</p> <div class="alert alert-danger" role="alert"> <p> <strong>Confirm Delete</strong><br /> Are you sure you want to delete this blog post? </p> </div> <form id="delete-blog-post" method="post" action="delete.php?title=<?php echo urlencode($post['title']); ?> "> <input type="submit" class="btn btn-default" value="Delete Post"> <a href="/admin/blog/" class="btn btn-info" role="button">Cancel</a> </form>
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // // SOFTWARE. // ///////////////////////////////////////////////////////////////////////////////////// // Start session session_start(); // Load the common PHP classes. require_once 'classes/common.class.php'; require_once 'classes/template.class.php'; require_once 'classes/blog.class.php'; $common = new common(); $template = new template(); $blog = new blog(); $pageData = array(); // Get the requested blog post. $post = $blog->getPostByTitle(urldecode($_GET['title'])); // The title of this page. $pageData['title'] = $post['title']; // Add blog post data to the $pageData array. $pageData['postTitle'] = $post['title']; $pageData['postAuthor'] = $common->getAdminstratorName($post['author']); $pageData['postContents'] = $post['contents']; // Properly format the date and convert to slected time zone. $date = new DateTime($post['date'], new DateTimeZone('UTC')); $date->setTimezone(new DateTimeZone($common->getSetting('timeZone'))); $pageData['postDate'] = $date->format($common->getSetting('dateFormat')); $template->display($pageData);