Dotclear

source: plugins/agora/inc/class.rs.agora.php @ 1864

Revision 1864, 1.8 KB checked in by Osku, 14 years ago (diff)

Agora - Work in progress

Line 
1<?php
2# -- BEGIN LICENSE BLOCK ----------------------------------
3#
4# This file is part of agora, a plugin for Dotclear 2.
5#
6# Copyright (c) 2009 Osku , Tomtom and contributors
7## Licensed under the GPL version 2.0 license.
8# A copy of this license is available in LICENSE file or at
9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10#
11# -- END LICENSE BLOCK ------------------------------------
12
13class rsExtagora
14{
15     public static function getURL($rs)
16     {
17          return $rs->core->blog->url.$rs->core->url->getBase('forum').'/'.
18          html::sanitizeURL($rs->post_url);
19     }
20
21     public static function NewPosts($rs)
22     {
23          $now = dt::toUTC(time());
24         
25          // to be continued
26         
27     }
28
29     public static function getThreadURL($rs)
30     {
31
32
33     }
34}
35class rsExtMessage
36{
37     public static function getContent($rs,$absolute_urls=false)
38     {
39          if ($absolute_urls) {
40               return html::absoluteURLs($rs->message_content_xhtml,$rs->getURL());
41          } else {
42               return $rs->message_content_xhtml;
43          }
44     }
45
46     public static function getURL($rs)
47     {
48          return $rs->core->blog->url.$rs->core->getPostPublicURL(
49                    $rs->post_type,html::sanitizeURL($rs->post_url)
50               );
51     }
52
53     public static function getDate($rs,$format)
54     {
55          if ($format) {
56               return dt::dt2str($format,$rs->message_dt);
57          } else {
58               return dt::dt2str($rs->core->blog->settings->date_format,$rs->message_dt);
59          }
60     }
61     
62     public static function getTime($rs,$format)
63     {
64          if ($format) {
65               return dt::dt2str($format,$rs->messsage_dt);
66          } else {
67               return dt::dt2str($rs->core->blog->settings->time_format,$rs->message_dt);
68          }
69     }
70
71     public static function getTS($rs)
72     {
73          return strtotime($rs->messsage_dt);
74     }
75     
76     public static function getISO8601Date($rs)
77     {
78          return dt::iso8601($rs->getTS(),$rs->message_tz);
79     }
80     
81     public static function getRFC822Date($rs)
82     {
83          return dt::rfc822($rs->getTS(),$rs->message_tz);
84     }
85}
86?>
Note: See TracBrowser for help on using the repository browser.

Sites map