-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplugin.php
35 lines (28 loc) · 1.01 KB
/
plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
// Copyright 2014 Toby Zerner, Simon Zerner
// This file is part of esoTalk. Please see the included license file for usage information.
if (!defined("IN_ESOTALK")) exit;
ET::$pluginInfo["UserSince"] = array(
"name" => "User Since",
"description" => "Shows the year that the user joined the forum on their posts.",
"version" => ESOTALK_VERSION,
"author" => "Toby Zerner",
"authorEmail" => "support@esotalk.org",
"authorURL" => "http://esotalk.org",
"license" => "GPLv2",
"dependencies" => array(
"esoTalk" => "1.0.0g4"
)
);
class ETPlugin_UserSince extends ETPlugin {
public function handler_postModel_getPostsBefore($sender, $sql)
{
$sql->select("m.joinTime", "joinTime");
}
public function handler_conversationController_formatPostForTemplate($sender, &$formatted, $post, $conversation)
{
if ($post["deleteMemberId"]) return;
if (date("Y", $post["joinTime"]) < date("Y"))
$formatted["info"][] = "<span class='usersince'>".sprintf(T("User since %s"), date("Y", $post["joinTime"]))."</span>";
}
}