Frontend elements to SugoiMusic, including CSS and public/private headers.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

160 lines
5.1 KiB

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