has('publications', ['pubid' => $VARS['pubid']])) {
$pub = $VARS['pubid'];
$pubdata = $database->get("publications", ["[>]pub_permissions" => ["permid" => "permid"]], ["pubname", "uid", "pubdate", "style", "columns", "page_size", "landscape", "publications.permid", "permname", "pwd"], ["pubid" => $pub]);
if ($pubdata["permname"] != "LINK") {
dieifnotloggedin();
}
if ($pubdata["uid"] != $_SESSION['uid']) {
if ($pubdata["permname"] == "OWNER") {
die(lang("no permission"));
}
}
if ($pubdata['permname'] == "LINK" && !is_empty($pubdata['pwd']) && $_SESSION['loggedin'] != true) {
$passok = false;
$passfail = false;
if (isset($VARS['password'])) {
$passok = password_verify($VARS['password'], $pubdata['pwd']);
$passfail = !$passok;
}
if (!$passok) {
?>
';
foreach ($pages as $page) {
?>
" data-tileid="" data-page="" data-styleid="" data-width="" data-order="">
-content" class="tile-style-">
";
$content = ob_get_clean();
if (defined("HTML_ME") || !defined("IN_NEWSPEN")) {
$contentcss = file_get_contents(__DIR__ . "/../static/css/content.css");
$bootstrapcss = file_get_contents(__DIR__ . "/../static/css/bootstrap.min.css");
$title = htmlspecialchars($pubdata["pubname"] . " | " . date("Y-m-d", strtotime($pubdata["pubdate"])));
$content = "\n"
. "\n"
. "\n"
. "$title\n"
. "\n"
. "$content";
// Credit: https://stackoverflow.com/a/709684
$content = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $content);
// End credit
$content = str_replace("\t", " ", $content);
// TODO: replace this loop with something less freshman
while (strpos($content, " ") !== FALSE) {
$content = str_replace(" ", " ", $content);
}
}
if (!defined("IN_NEWSPEN")) {
echo $content;
}
?>