Ejemplo n.º 1
0
<?php

//open $session
session_start();
//if user is not logged in, go to login index
if (!isset($_SESSION['user'])) {
    header('Location: user/login.php');
}
//connect to database
include_once 'db_info.php';
$post = grab_post($_GET['postid']);
?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>View Post</title>

    <!--Bootstrap-->
    <link href="bootstrap/css/bootstrap.css" rel="stylesheet"/>
    <!--Customizable Stylesheet-->
    <link href="style.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<div class="container">

    <div class="row">
Ejemplo n.º 2
0
<?php

include_once '../db_info.php';
session_start();
//todo if tag added from two different accounts, duplicate will be made
//set variables
$postID = $_GET['postid'];
$tagID = $_GET['tagid'];
$tag = strtolower($_GET['tag']);
//make lowercase to ensure no duplicates
$post = grab_post($postID);
//create $post object
/*
 * XML STRUCTURE
 * <tag>
 *     <status></status>
 *     <tag_id></tag_id>
 *     <tag_body></tag_body>
 * </tag>
 */
//XML declaration
header('Content-type: text/xml');
//make this an XML file
echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<tag>';
//root element
//ADD NEW TAG (if focus was on <input id='new-tag'>)
if ($tagID == 'new-tag') {
    $dupCheck = array_search($tag, $post->gTags);
    //Duplicate Check: searches for tag in $posts->gTags (global)
    if ($tag == '') {