| 340 | | foreach ($posts as $post) { |
|---|
| 341 | | //$body .= run("weblogs:posts:view", $post); |
|---|
| 342 | | |
|---|
| 343 | | $postedby = __gettext("Posted by"); |
|---|
| 344 | | $commentsStr = __gettext("Comments"); |
|---|
| 345 | | $date = gmdate("H:i",$post->posted); |
|---|
| 346 | | $username = user_info('username', $post->owner); |
|---|
| 347 | | $anyComments = __gettext("comment(s)"); |
|---|
| 348 | | |
|---|
| 349 | | $body .= '<h3><a href="' . $CFG->wwwroot . user_info('username', $post->weblog) . '/weblog/' . $post->ident . '.html">' . $post->title . '</a></h3>'; |
|---|
| 350 | | $body .= $postedby . ' ' . $username . ' (' . $date . ')<br><br>'; |
|---|
| 351 | | $body .= $post->body . '<br>'; |
|---|
| 352 | | |
|---|
| 353 | | if (!isset($_SESSION['comment_cache'][$post->ident]) || (time() - $_SESSION['comment_cache'][$post->ident]->created > 120)) { |
|---|
| 354 | | $numcomments = count_records('weblog_comments','post_id',$post->ident); |
|---|
| 355 | | $_SESSION['comment_cache'][$post->ident]->created = time(); |
|---|
| 356 | | $_SESSION['comment_cache'][$post->ident]->data = $numcomments; |
|---|
| 357 | | } |
|---|
| 358 | | $numcomments = $_SESSION['comment_cache'][$post->ident]->data; |
|---|
| 359 | | $comments = "<a href=\"".url.$username."/weblog/{$post->ident}.html\">$numcomments $anyComments</a>"; |
|---|
| 360 | | |
|---|
| 361 | | $body .= $comments; |
|---|
| 362 | | } |
|---|
| | 340 | foreach ($posts as $post) { |
|---|
| | 341 | $body .= run("weblogs:posts:view", $post); |
|---|
| | 342 | } |
|---|