root/releases/0.1.1b/_weblog/view_post.php

Revision 2, 1.1 kB (checked in by sven, 3 years ago)

importing elgg-0.1.1a

Line 
1 <?php
2
3     //    ELGG weblog view page
4
5     // Run includes
6         require("../includes.php");
7         
8         run("profile:init");
9         run("friends:init");
10         run("weblogs:init");
11         
12         global $profile_id;
13         global $individual;
14         
15         $individual = 1;
16         
17         if (isset($_REQUEST['post'])) {
18             
19             $post = (int) $_REQUEST['post'];
20             
21             $where = run("users:access_level_sql_where",$_SESSION['userid']);
22             $post = db_query("select * from weblog_posts where ($where) and ident = $post");
23             $post = $post[0];
24             
25             global $page_owner;
26             global $profile_id;
27             $profile_id = $post->owner;
28             $page_owner = $post->owner;
29             
30             $title = run("profile:display:name") . " :: Weblog :: " . stripslashes($post->title);
31             
32             $time = gmdate("F d, Y",$post->posted);
33             $body = "<h2 class=\"weblogdateheader\">$time</h2>\n";
34             
35             $body .= run("weblogs:posts:view",$post);
36             
37             $body = run("templates:draw", array(
38                             'context' => 'infobox',
39                             'name' => $title,
40                             'contents' => $body
41                         )
42                         );
43             
44             echo run("templates:draw:page", array(
45                             $title, $body
46                         )
47                         );
48
49         }
50
51 ?>
Note: See TracBrowser for help on using the browser.