-
Notifications
You must be signed in to change notification settings - Fork 0
/
author.php
69 lines (67 loc) · 2.92 KB
/
author.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
include_once dirname(__FILE__) . '/core/partials/pageCheck.php';
include_once dirname(__FILE__) . '/core/classes/user.php';
include_once dirname(__FILE__) . '/classes/feature.php';
$thisPage="author";
$id = Utility::getRequestVariable('id', 0);
$errorMsg = "";
if ($id==0) {
$errorMsg ="You must specify a valid author id.";
}
else {
try {
$class = new User($id,$tenantID);
$author = $class->getEntity($id);
Log::logPageView('author', $id,'');
$feature = new Feature($userID,$tenantID);
$filters = array("author"=>$author["id"],"status"=>"Published");
$features = $feature->getEntities($filters, 9, 0);
}
catch(Exception $ex) {
$errorMsg="Unable to load requested author: " . $ex->getMessage();
}
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title><?php echo Utility::getTenantProperty($applicationID, $_SESSION['tenantID'],$userID,'title') ?></title>
<?php include("partials/includes.php"); ?>
<link rel="stylesheet" type="text/css" href="static/css/product.css" />
<link rel="stylesheet" type="text/css" href="static/css/author.css" />
<script type="text/javascript" src="js/product.js"></script>
</head>
<body>
<div id="maincontent">
<div id="outer">
<?php include('partials/header.php');?>
<?php include('partials/productModal.php');?>
<div class="container">
<?php if (strlen($errorMsg)>0) {
echo '<br/><p>' . $errorMsg . '<p>';
}
else {
?>
<h3>Author Profile</h3>
<h1><?php echo $author["name"]?></h1>
<p class="col-sm-8"><?php echo Utility::renderWebContent($author["bio"])?></p>
<?php if (count($features)>0) {
echo '<div class="articleList"><h3>Stories by ' . $author["name"] . '</h3>';
foreach($features as $feature) {
echo '<div class="col-sm-4">';
echo '<div class="imageWrapper"><img class="coverImage" src="' . $feature["coverImage"] . '"></div>';
echo '<h3><a href="feature.php?id=' . $feature["id"] . '">' . $feature["headline"] . '</a></h3>';
echo '<p>' . $feature["subhead"] . "</p>";
echo '</div>';
}
echo '</div>';
}?>
<?php } ?>
</div>
<?php include("partials/footer.php")?>
</div>
</div>
</body>
</html>