OSDN Git Service

4dc4f80a31e64cb6f5bf73e601932d49fc371b0d
[nucleus-jp/nucleus-plugins.git] / NP_CommentEdit / trunk / NP_CommentEdit.php
1 <?php
2
3 class NP_CommentEdit extends NucleusPlugin
4 {
5
6         function getName()
7         {       // name of plugin
8                 return 'Comment Editable';
9         }
10
11         function getAuthor()
12         {       // author of plugin
13                 return 'nakahara21';
14         }
15
16         function getURL()
17         {       // an URL to the plugin website
18                 return 'http://japan.nucleuscms.org/wiki/plugins:commentedit';
19         }
20
21         function getVersion()
22         {       // version of the plugin
23                 return '0.3';
24         }
25
26         // a description to be shown on the installed plugins listing
27         function getDescription()
28         { 
29                 return 'Comment Editable';
30         }
31
32         function supportsFeature($what)
33         {
34                 switch($what){
35                         case 'SqlTablePrefix':
36                                 return 1;
37                         default:
38                                 return 0;
39                 }
40         }
41
42         function doTemplateCommentsVar(&$item, &$comment, $type, $param1 = 'QQQQQ') { 
43                 global $CONF, $member;
44
45                 if ($member->isLoggedIn()) {
46                         $commentid = intval($comment['commentid']);
47                         if ($member->canAlterComment($commentid)) {
48                                 $editLink  = $CONF['AdminURL']
49                                                    . 'index.php?action=commentedit&amp;commentid='
50                                                    . $commentid;
51                                 $delLink   = $CONF['AdminURL']
52                                                    . 'index.php?action=commentdelete&amp;commentid='
53                                                    . $commentid;
54                                 $printData = "<small>\n"
55                                                    . '[ <a href="' . $editLink . '" target="_blank"> '
56                                                    . _LISTS_EDIT . "</a> ]\n"
57                                                    . '[ <a href="' . $delLink . '" target="_blank"> '
58                                                    . _LISTS_DELETE . "</a> ]\n"
59                                                    . "</small>\n";
60                                 echo $printData;
61                         }
62                 }
63         }
64
65 }