Esempio n. 1
0
 if ($result2->rows()) {
     $headerPrinted = false;
     for ($j = 0; list($blogId) = $result2->fetchrow_array(); $j++) {
         $blogIndex = new Blog($blogId);
         if ($blogIndex->hasReadPermission()) {
             if (!$headerPrinted) {
                 if (!empty($category)) {
                     printSubsectionHeader($category);
                 }
                 $headerPrinted = true;
                 echo "<table width=\"100%\">";
             }
             echo "<tr>";
             echo "<td height=\"60\" valign=\"top\" width=\"50\">";
             if (file_exists(scriptPath . "/" . folderUploadedFiles . "/blog_" . $blogIndex->id . ".jpg")) {
                 echo "<a href=\"" . $blogIndex->getBlogLink() . "\"><img src=\"" . scriptUrl . "/" . folderUploadedFiles . "/blog_" . $blogIndex->id . ".jpg\" height=\"50\" width=\"50\" border=\"0\" alt=\"" . $blogIndex->title . "\" title=\"" . $blogIndex->title . "\" class=\"border\" /></a>";
             } else {
                 echo "<a href=\"" . $blogIndex->getBlogLink() . "\"><img src=\"" . iconUrl . "/picture5050.gif\" height=\"50\" width=\"50\" border=\"0\" alt=\"" . $blogIndex->title . "\" title=\"" . $blogIndex->title . "\" class=\"border\" /></a>";
             }
             echo "</td>";
             echo "<td valign=\"top\" height=\"35\" width=\"100%\">";
             echo "<a href=\"" . $blogIndex->getBlogLink() . "\"><b>" . (!empty($blogIndex->title) ? $blogIndex->title : "&nbsp;") . "</b> (" . $blogIndex->getNumberOfPosts() . ")</a><br />";
             echo !empty($blogIndex->description) ? $blogIndex->description : $lBlogIndex["NoDescription"];
             if ($blogIndex->hasEditPermission()) {
                 echo " <span class=\"small1\">";
                 if ($result2->rows() > 1) {
                     echo " <a href=\"" . scriptUrl . "/" . folderBlog . "/index.php?blogId=" . $blogIndex->id . "&amp;up=1\">" . $lBlogIndex["MoveUp"] . "</a>";
                     echo " <a href=\"" . scriptUrl . "/" . folderBlog . "/index.php?blogId=" . $blogIndex->id . "&amp;down=1\">" . $lBlogIndex["MoveDown"] . "</a>";
                 }
                 echo " <a href=\"" . scriptUrl . "/" . folderBlog . "/" . fileBlogEdit . "?blogId=" . $blogIndex->id . "&amp;return=1\">" . $lBlogIndex["EditBlog"] . "</a>";
                 echo "</span>";
Esempio n. 2
0
if (!empty($post->id)) {
    $blog = $post->blog;
} else {
    if (!empty($_GET["blogId"])) {
        $blog = new Blog($_GET["blogId"]);
    }
}
if (!empty($blog->id)) {
    // Include language
    include scriptPath . "/" . folderBlog . "/include/language/" . $blog->language . "/general.php";
    // Get the post list
    $items = array();
    $result = $dbi->query("SELECT id,moduleContentId FROM " . commentTableName . " WHERE moduleId=" . $dbi->quote(blogModuleId) . " AND moduleContentTypeId=" . $dbi->quote(blogPostContentId) . " AND spam='0' AND " . (!empty($post->id) ? "moduleContentId=" . $dbi->quote($post->id) : "moduleContentId IN(SELECT Id FROM " . blogPostTableName . " WHERE blogId=" . $dbi->quote($blog->id) . " AND draft=0)") . " ORDER BY posted DESC LIMIT 15");
    for ($i = 0; list($id, $postId) = $result->fetchrow_array(); $i++) {
        $comment = new Comment($id);
        // Get name of user
        $name = "";
        if (!empty($comment->userId)) {
            $user = new User($comment->userId);
            $name = $user->name;
        } else {
            $name = $comment->name;
        }
        // Create new item
        $item = new RSSItem($comment->id, $name, array(), "", "", scriptUrl . "/" . folderBlog . "/" . fileBlogPost . "?postId=" . $postId . "#comments", $comment->message, "", $comment->posted, $comment->subject);
        $items[] = $item;
    }
    // Print feed
    $rss = new RSS($blog->title . " - " . $lComment["Header"], $blog->description, $blog->getBlogLink(), scriptUrl . "/" . folderBlog . "/" . fileBlogCommentRSS . "?blogId=" . $blog->id, $items);
    $rss->printRSSFeed();
}
Esempio n. 3
0
 /**
  * Get link to given blog.
  * @param	$id	Identifier of blog.
  * @return	Link to given blog.
  */
 function getLink($id = "")
 {
     if (!empty($id)) {
         $blog = new Blog($id);
         return $blog->getBlogLink();
     }
     return scriptUrl . "/" . folderBlog;
 }
Esempio n. 4
0
// Include common functions and declarations
require_once "../../include/common.php";
require_once "../include/config.php";
// Create blog object
$blog = new Blog(!empty($_GET["blogId"]) ? $_GET["blogId"] : 0);
if (!empty($blog->id)) {
    // Include language
    include scriptPath . "/" . folderBlog . "/include/language/" . $blog->language . "/general.php";
    // Protect page
    if (!empty($blog->userlevel)) {
        protectPage($blog->userlevel);
    }
    // Get the post list
    $items = array();
    $result = $dbi->query("SELECT id FROM " . blogPostTableName . " WHERE blogId=" . $blog->id . " AND draft=0 ORDER BY posted DESC LIMIT 15");
    for ($i = 0; list($id) = $result->fetchrow_array(); $i++) {
        $post = new Post($id);
        // Get categories
        $categories = array();
        for ($i = 0; $i < sizeof($post->categories); $i++) {
            $categories[] = $post->categories[$i][1];
        }
        // Create new item
        $item = new RSSItem($post->id, $post->user->name, $categories, $post->getPostLink() . "#comments", scriptUrl . "/" . folderBlog . "/" . fileBlogCommentRSS . "?postId=" . $post->id, $post->getPostLink(), stripHtml(!empty($post->text) ? $post->text : $post->summary), $post->printRSSPostSummary(), $post->posted, $post->subject);
        $items[] = $item;
    }
    // Print feed
    $rss = new RSS($blog->title, $blog->description, $blog->getBlogLink(), scriptUrl . "/" . folderBlog . "/" . fileBlogPostRSS . "?blogId=" . $blog->id, $items);
    $rss->printRSSFeed();
}