YaWK  24.1
Yet another WebKit
blog.php
Go to the documentation of this file.
1 <script src="system/plugins/blog/js/comments.js"></script>
2 <script src="system/plugins/blog/js/voting.js"></script>
3 <?php
4 // include blog class
5 include 'classes/blog.php';
6 // create new blog object
7 $blog = new \YAWK\PLUGINS\BLOG\blog();
8 // current templateID
10 
11 // a blog can be called by GET variable or via page include
12 // set default blog (1), if no blog ID was set
13 if (!isset($_GET['blogid']))
14 { // if no blog ID is set
15  if (!isset($blog_id))
16  { // if its not included by $_GET param
17  $blog->blogid = 1; // set default blog
18  }
19  else
20  { // called from default page
21  $blog->blogid = $blog_id;
22  }
23 }
24 // set the blog ID via $_GET param
25 else
26  { // blogID was set via GET param
27  $blog->blogid = $_GET['blogid'];
28  }
29 
30  // load global blog properties
31  if ($blog->loadBlogProperties($db, $blog->blogid) === false)
32  { // failed to load...
33  echo "Unable to load Blog settings";
34  }
35 
36 // if blog is not offline, get entries from db + draw it on screen.
37 if ($blog->published != 0)
38 {
39  // check, if there is an item ID set
40  if (!isset($item_id))
41  { // zero, because no ID was set
42  $item_id = 0;
43  }
44  // check group id, only load title if own gid is bigger
45  // if (isset($_SESSION['gid']) && $_SESSION['gid'] >= $blog->gid)
46 
47  // load blog title
48  $blog->getTitle($db, $blog->blogid);
49 
50  // load the blog entries into blog object
51  if (!isset($full_view))
52  { //
53  $full_view = 0;
54  }
55 
56  // check entries should be limited to (x)
57  if (!isset($blog->limitEntries))
58  { // zero means no limitation wanted
59  $blog->limitEntries = 0;
60  }
61 
62  // load all entries of this blog
63  $blog->getFrontendEntries($db, $blog->blogid, $item_id, $full_view, $blog->limitEntries);
64 
65  // check footer setting and load it on demand
66  //if ($blog->getBlogProperty($db, $blog->blogid, "footer")){
67  // $blog->getFooter($db);
68  //}
69  // finally: draw the blog
70  print $blog->draw();
71  print "</div>";
72 }
73 else
74 { // blog is not published, draw message
75  echo \YAWK\alert::draw("warning", "Entschuldigung!", "Dieser Bereich ist im Moment offline, da gerade daran gearbeitet wird. Bitte komm sp&auml;ter wieder.","","4800");
76 }
77 ?>
$blog
Definition: blog.php:122
$templateID
Definition: blog.php:9
static getCurrentTemplateId(object $db)
return ID of current (active) template
Definition: template.php:73
print $_GET['id']
Definition: page-edit.php:357