|
@@ -0,0 +1,155 @@
|
|
1
|
+<?php
|
|
2
|
+/**
|
|
3
|
+ * This version of #quickpostform is used in all subsections
|
|
4
|
+ * Instead of modifying multiple places, just modify this one.
|
|
5
|
+ *
|
|
6
|
+ * To include it in a section use this example.
|
|
7
|
+
|
|
8
|
+ View::parse('generic/reply/quickreply.php', array(
|
|
9
|
+ 'InputTitle' => 'Post reply',
|
|
10
|
+ 'InputName' => 'thread',
|
|
11
|
+ 'InputID' => $ThreadID,
|
|
12
|
+ 'ForumID' => $ForumID,
|
|
13
|
+ 'TextareaCols' => 90
|
|
14
|
+ ));
|
|
15
|
+
|
|
16
|
+ * Note that InputName and InputID are the only required variables
|
|
17
|
+ * They're used to construct the $_POST.
|
|
18
|
+ *
|
|
19
|
+ * Eg
|
|
20
|
+ * <input name="thread" value="123" />
|
|
21
|
+ * <input name="groupid" value="321" />
|
|
22
|
+ *
|
|
23
|
+ * Globals are required as this template is included within a
|
|
24
|
+ * function scope.
|
|
25
|
+ *
|
|
26
|
+ * To add a "Subscribe" box for non-forum pages (like artist/collage/...
|
|
27
|
+ * comments), add a key 'SubscribeBox' to the array passed to View::parse.
|
|
28
|
+ * Example:
|
|
29
|
+
|
|
30
|
+ View::parse('generic/reply/quickreply.php', array(
|
|
31
|
+ 'InputTitle' => 'Post comment',
|
|
32
|
+ 'InputName' => 'groupid',
|
|
33
|
+ 'InputID' => $GroupID,
|
|
34
|
+ 'TextareaCols' => 65,
|
|
35
|
+ 'SubscribeBox' => true
|
|
36
|
+ ));
|
|
37
|
+ */
|
|
38
|
+ global $HeavyInfo, $UserSubscriptions, $ThreadInfo, $Document;
|
|
39
|
+
|
|
40
|
+if (G::$LoggedUser['DisablePosting']) {
|
|
41
|
+ return;
|
|
42
|
+}
|
|
43
|
+if (!isset($TextareaCols)) {
|
|
44
|
+ $TextareaCols = 70;
|
|
45
|
+}
|
|
46
|
+if (!isset($TextareaRows)) {
|
|
47
|
+ $TextareaRows = 8;
|
|
48
|
+}
|
|
49
|
+if (!isset($InputAction)) {
|
|
50
|
+ $InputAction = 'reply';
|
|
51
|
+}
|
|
52
|
+if (!isset($InputTitle)) {
|
|
53
|
+ $InputTitle = 'Post comment';
|
|
54
|
+}
|
|
55
|
+
|
|
56
|
+ $ReplyText = new TEXTAREA_PREVIEW(
|
|
57
|
+ 'body',
|
|
58
|
+ 'quickpost',
|
|
59
|
+ '',
|
|
60
|
+ $TextareaCols,
|
|
61
|
+ $TextareaRows,
|
|
62
|
+ false,
|
|
63
|
+ false,
|
|
64
|
+ true,
|
|
65
|
+ array(
|
|
66
|
+ 'tabindex="1"',
|
|
67
|
+ 'onkeyup="resize(\'quickpost\')"'
|
|
68
|
+ )
|
|
69
|
+ );
|
|
70
|
+ ?>
|
|
71
|
+
|
|
72
|
+ <br />
|
|
73
|
+ <div id="reply_box">
|
|
74
|
+ <h3><?=$InputTitle?></h3>
|
|
75
|
+ <div class="box pad">
|
|
76
|
+ <table class="forum_post box vertical_margin hidden preview_wrap" id="preview_wrap_<?=$ReplyText->getID()?>">
|
|
77
|
+ <colgroup>
|
|
78
|
+<?php if (Users::has_avatars_enabled()) { ?>
|
|
79
|
+ <col class="col_avatar" />
|
|
80
|
+<?php } ?>
|
|
81
|
+ <col class="col_post_body" />
|
|
82
|
+ </colgroup>
|
|
83
|
+ <tr class="colhead_dark">
|
|
84
|
+ <td colspan="<?=(Users::has_avatars_enabled() ? 2 : 1)?>">
|
|
85
|
+ <div class="float_left"><a href="#quickreplypreview">#XXXXXX</a>
|
|
86
|
+ by <strong><?=Users::format_username(G::$LoggedUser['ID'], true, true, true, true)?></strong> Just now
|
|
87
|
+ </div>
|
|
88
|
+ <div class="float_right">
|
|
89
|
+ <a href="#quickreplypreview" class="brackets">Report</a>
|
|
90
|
+
|
|
91
|
+ <a href="#">↑</a>
|
|
92
|
+ </div>
|
|
93
|
+ </td>
|
|
94
|
+ </tr>
|
|
95
|
+ <tr>
|
|
96
|
+<?php if (Users::has_avatars_enabled()) { ?>
|
|
97
|
+ <td class="avatar valign_top">
|
|
98
|
+ <?=Users::show_avatar(G::$LoggedUser['Avatar'], G::$LoggedUser['ID'], G::$LoggedUser['Username'], (!isset($HeavyInfo['DisableAvatars']) || $HeavyInfo['DisableAvatars']))?>
|
|
99
|
+ </td>
|
|
100
|
+<?php } ?>
|
|
101
|
+ <td class="body valign_top">
|
|
102
|
+ <div id="contentpreview" style="text-align: left;">
|
|
103
|
+ <div id="preview_<?=$ReplyText->getID()?>"></div>
|
|
104
|
+ </div>
|
|
105
|
+ </td>
|
|
106
|
+ </tr>
|
|
107
|
+ </table>
|
|
108
|
+ <form class="send_form center" name="reply" id="quickpostform" <?=isset($Action)?'action="'.$Action.'"':''?> method="post"<?php if (!check_perms('users_mod')) {
|
|
109
|
+ ?> onsubmit="quickpostform.submit_button.disabled = true;"<?php
|
|
110
|
+ } ?> <?php if (!G::$LoggedUser['DisableAutoSave']) {
|
|
111
|
+ ?>data-autosave-text="quickpost"<?php
|
|
112
|
+ } ?>>
|
|
113
|
+ <input type="hidden" name="action" value="<?=$InputAction?>" />
|
|
114
|
+ <input type="hidden" name="auth" value="<?=G::$LoggedUser['AuthKey']?>" />
|
|
115
|
+ <input type="hidden" name="<?=$InputName?>" data-autosave-id="<?=$InputID?>" value="<?=$InputID?>" />
|
|
116
|
+ <div id="quickreplytext">
|
|
117
|
+<?php
|
|
118
|
+ echo $ReplyText->getBuffer();
|
|
119
|
+?>
|
|
120
|
+ <br />
|
|
121
|
+ </div>
|
|
122
|
+ <div class="preview_submit">
|
|
123
|
+<?php
|
|
124
|
+if (isset($SubscribeBox) && !isset($ForumID) && Subscriptions::has_subscribed_comments($Document, $InputID) === false) {
|
|
125
|
+ ?>
|
|
126
|
+ <input id="subscribebox" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe']) ? ' checked="checked"' : ''?> tabindex="2" />
|
|
127
|
+ <label for="subscribebox">Subscribe</label>
|
|
128
|
+ <?php
|
|
129
|
+}
|
|
130
|
+ // Forum thread logic
|
|
131
|
+ // This might use some more abstraction
|
|
132
|
+if (isset($ForumID)) {
|
|
133
|
+ if (!Subscriptions::has_subscribed($InputID)) {
|
|
134
|
+ ?>
|
|
135
|
+ <input id="subscribebox" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe']) ? ' checked="checked"' : ''?> tabindex="2" />
|
|
136
|
+ <label for="subscribebox">Subscribe</label>
|
|
137
|
+ <?php
|
|
138
|
+ }
|
|
139
|
+ if ($ThreadInfo['LastPostAuthorID'] == G::$LoggedUser['ID']
|
|
140
|
+ && (check_perms('site_forums_double_post')
|
|
141
|
+ || in_array($ForumID, FORUMS_TO_ALLOW_DOUBLE_POST))
|
|
142
|
+ ) {
|
|
143
|
+ ?>
|
|
144
|
+ <input id="mergebox" type="checkbox" name="merge" tabindex="2" />
|
|
145
|
+ <label for="mergebox">Merge</label>
|
|
146
|
+ <?php
|
|
147
|
+ }
|
|
148
|
+}
|
|
149
|
+?>
|
|
150
|
+ <input type="button" value="Preview" class="hidden button_preview_<?=$ReplyText->getID()?>" tabindex="1" />
|
|
151
|
+ <input type="submit" value="Post reply" id="submit_button" tabindex="1" />
|
|
152
|
+ </div>
|
|
153
|
+ </form>
|
|
154
|
+ </div>
|
|
155
|
+ </div>
|