Example #1
0
File: api.php Project: HBir/zahabe
 *API-Dokumentation
 *URL parametrar:
 *id             = Return MV with specified ID
 *cnt            = Return MV with ordered numbered specified
 *add            = Adds a new MV
 *type >
 *=daily
 *=stories       = Returns all 
 *no parameters  = Returns all MVs
 *
 *returns json format
 */
include 'functions.php';
$db = new PDO('sqlite:zahabe.db');
if (isset($_GET['id'])) {
    $rows = getMVByID($db, $_GET['id']);
} else {
    if (isset($_GET['cnt'])) {
        $rows = getMVByNumber($db, $_GET['cnt']);
    } else {
        if (isset($_GET['add'])) {
            /*Not implemented*/
            print "To be implemented";
        } else {
            if (isset($_GET['type'])) {
                if ($_GET['type'] == "daily") {
                    $rows = getDailyMV($db);
                } else {
                    if ($_GET['type'] == "stories") {
                        $rows = getAllStories($db);
                    }
Example #2
0
<!DOCTYPE html>
<?php 
include 'functions.php';
header('Content-Type: text/html; charset=utf-8');
$ID = $_GET["id"];
$db = new PDO('sqlite:zahabe.db');
$row = getMVByID($db, $ID);
?>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title><?php 
echo $row['Text'];
?>
</title>

		<meta name="description" content="Stories of Zahabe">
		<meta name="keywords" content="Zahabe">
		<meta name="author" content="Hannes Birgersson">
		<meta name="contact" content="*****@*****.**">

		<link rel="stylesheet" href="style.css">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<!--Google analytics kod-->
		<script>
  		(function (i, s, o, g, r, a, m) {
  			i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
  				(i[r].q = i[r].q || []).push(arguments)
  			}, i[r].l = 1 * new Date(); a = s.createElement(o),
  		m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
  		})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');