Esempio n. 1
0
 /** Print the body part of the page. */
 function printPageBody()
 {
     global $dbi, $login;
     global $lPage;
     // Print text
     if (empty($this->text)) {
         $result = $dbi->query("SELECT id,title FROM " . pageTableName . " WHERE (parentId=" . $this->id . ") AND (showInMenu=1) ORDER BY position");
         if ($result->rows()) {
             // printSectionHeader($this->title);
             echo "<p>" . $lPage["UnderConstruction"] . "</p>";
             echo "<h2>" . $lPage["Subpages"] . "</h2>";
             echo "<ul>";
             for ($i = 0; list($id2, $title2) = $result->fetchrow_array(); $i++) {
                 echo "<li><a href=\"" . $this->getLink($id2) . "\">{$title2}</a></li>";
             }
             echo "</ul>";
         } else {
             //printSectionHeader($this->title);
             echo "<p>" . $lPage["UnderConstruction"] . "</p>";
         }
     } else {
         // Print text
         echo parseBodyText($this->text);
     }
     // Print last modified
     $this->printLastModified();
     // Print comments
     $this->printPageComments();
 }
Esempio n. 2
0
 /** Print RSS blog post summary. */
 function printRSSPostSummary()
 {
     if (!empty($this->id)) {
         global $dbi, $login;
         // Include language
         include scriptPath . "/" . folderBlog . "/include/language/" . $this->blog->language . "/general.php";
         // Prepare variables
         $categoryLinks = "";
         if (sizeof($this->categories) != 0) {
             for ($i = 0; $i < sizeof($this->categories); $i++) {
                 $categoryLinks .= ($i != 0 ? ", " : "") . "<a href=\"" . $this->blog->getBlogCategoryLink($this->categories[$i][2], $this->categories[$i][1]) . "\">" . $this->categories[$i][1] . "</a>";
             }
         } else {
             $categoryLinks .= "<a href=\"" . $this->blog->getBlogCategoryLink(0) . "\">" . $lBlogPost["Uncategorized"] . "</a>";
         }
         $comment = new Comment();
         $commentsLink = $this->showComments ? "<a href=\"" . $this->getPostLink() . "#comments\" alt=\"" . $lBlogPost["Comments"] . "\" title=\"" . $lBlogPost["Comments"] . "\">" . $comment->getNumberOfComments(blogModuleId, blogPostContentId, $this->id) . " " . $lBlogPost["Comments"] . "</a>" : "";
         $readMoreLink = !empty($this->summary) && !empty($this->text) ? '<a href="' . scriptUrl . '/' . folderBlog . '/' . fileBlogPost . '?postId=' . $this->id . '">' . $lBlogPost["ReadMore"] . '</a>' : '';
         $subject = $this->subject;
         $text = parseBodyText(!empty($this->text) ? $this->text : $this->summary);
         // Output summary
         $summary = "<p>" . $lBlogPost["PostedIn"] . " " . $categoryLinks . "</p>" . $text . "<p>" . (!empty($readMoreLink) ? $readMoreLink : "") . (!empty($commentsLink) ? (!empty($readMoreLink) ? " | " : "") . $commentsLink : "") . "</p>";
         return $summary;
     }
     return "";
 }