root/releases/0.6rc2/_weblog/view_post.php

Revision 296, 1.7 kB (checked in by carmartin, 3 years ago)

Includes should use full path given that we know where things are. Patch 1.

  • Property svn:eol-style set to native
Line 
1 <?php
2
3 //    ELGG weblog view page
4
5 // Run includes
6 require_once(dirname(dirname(__FILE__))."/includes.php");
7
8 run("profile:init");
9 run("friends:init");
10 run("weblogs:init");
11
12 define("context", "weblog");
13
14 global $profile_id;
15 global $individual;
16
17 $individual = 1;
18
19 $post = optional_param('post',0,PARAM_INT);
20 if (!empty($post)) {
21     
22     $where = run("users:access_level_sql_where",$_SESSION['userid']);
23     
24     if (!$post = get_record_select('weblog_posts','('.$where.') AND ident = '.$post)) {
25         $post = new StdClass;
26         $post->weblog = -1;
27         $post->owner = -1;
28         $post->title = gettext("Access denied or post not found");
29         $post->posted = time();
30         $post->ident = -1;
31         $post->body = gettext("Either this blog post doesn't exist or you don't currently have access privileges to view it.");
32     }
33     
34     global $page_owner;
35     global $profile_id;
36     $profile_id = $post->weblog;
37     $page_owner = $post->weblog;
38     
39     $title = run("profile:display:name") . " :: " . gettext("Weblog") . " :: " . stripslashes($post->title);
40     templates_page_setup();
41     
42     $time = gmdate("F d, Y",$post->posted);
43     $body = "<h2 class=\"weblog_dateheader\">$time</h2>\n";
44     
45     $body .= run("weblogs:posts:view:individual",$post);
46     
47     $body = templates_draw(array(
48                                  'context' => 'contentholder',
49                                  'title' => $title,
50                                  'body' => $body
51                                  )
52                            );
53     
54     echo templates_page_draw( array(
55                                           $title, $body
56                                           )
57              );
58     
59 }
60
61 ?>
Note: See TracBrowser for help on using the browser.