Frontend elements to SugoiMusic, including CSS and public/private headers.
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

150 righe
5.3 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. $ReplyText = new TEXTAREA_PREVIEW('body', 'quickpost', '',
  52. $TextareaCols, $TextareaRows, false, false, true, array(
  53. 'tabindex="1"',
  54. 'onkeyup="resize(\'quickpost\')"'
  55. ));
  56. ?>
  57. <br />
  58. <div id="reply_box">
  59. <h3><?=$InputTitle?></h3>
  60. <div class="box pad">
  61. <table class="forum_post box vertical_margin hidden preview_wrap" id="preview_wrap_<?=$ReplyText->getID()?>">
  62. <colgroup>
  63. <? if (Users::has_avatars_enabled()) { ?>
  64. <col class="col_avatar" />
  65. <? } ?>
  66. <col class="col_post_body" />
  67. </colgroup>
  68. <tr class="colhead_dark">
  69. <td colspan="<?=(Users::has_avatars_enabled() ? 2 : 1)?>">
  70. <div style="float: left;"><a href="#quickreplypreview">#XXXXXX</a>
  71. by <strong><?=Users::format_username(G::$LoggedUser['ID'], true, true, true, true)?></strong> Just now
  72. </div>
  73. <div style="float: right;">
  74. <a href="#quickreplypreview" class="brackets">Report</a>
  75. &nbsp;
  76. <a href="#">&uarr;</a>
  77. </div>
  78. </td>
  79. </tr>
  80. <tr>
  81. <? if (Users::has_avatars_enabled()) { ?>
  82. <td class="avatar valign_top">
  83. <?=Users::show_avatar(G::$LoggedUser['Avatar'], G::$LoggedUser['ID'], G::$LoggedUser['Username'], (!isset($HeavyInfo['DisableAvatars']) || $HeavyInfo['DisableAvatars']))?>
  84. </td>
  85. <? } ?>
  86. <td class="body valign_top">
  87. <div id="contentpreview" style="text-align: left;">
  88. <div id="preview_<?=$ReplyText->getID()?>"></div>
  89. </div>
  90. </td>
  91. </tr>
  92. </table>
  93. <form class="send_form center" name="reply" id="quickpostform" <?=isset($Action)?'action="'.$Action.'"':''?> method="post"<? if (!check_perms('users_mod')) { ?> onsubmit="quickpostform.submit_button.disabled = true;"<? } ?>>
  94. <input type="hidden" name="action" value="<?=$InputAction?>" />
  95. <input type="hidden" name="auth" value="<?=G::$LoggedUser['AuthKey']?>" />
  96. <input type="hidden" name="<?=$InputName?>" value="<?=$InputID?>" />
  97. <div id="quickreplytext">
  98. <?
  99. echo $ReplyText->getBuffer();
  100. ?>
  101. <br />
  102. </div>
  103. <div class="preview_submit">
  104. <?
  105. if (isset($SubscribeBox) && !isset($ForumID) && Subscriptions::has_subscribed_comments($Document, $InputID) === false) {
  106. ?>
  107. <input id="subscribebox" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe']) ? ' checked="checked"' : ''?> tabindex="2" />
  108. <label for="subscribebox">Subscribe</label>
  109. <?
  110. }
  111. // Forum thread logic
  112. // This might use some more abstraction
  113. if (isset($ForumID)) {
  114. if (!Subscriptions::has_subscribed($InputID)) {
  115. ?>
  116. <input id="subscribebox" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe']) ? ' checked="checked"' : ''?> tabindex="2" />
  117. <label for="subscribebox">Subscribe</label>
  118. <?
  119. }
  120. if ($ThreadInfo['LastPostAuthorID'] == G::$LoggedUser['ID']
  121. && (check_perms('site_forums_double_post')
  122. || in_array($ForumID, FORUMS_TO_ALLOW_DOUBLE_POST))
  123. ) {
  124. ?>
  125. <input id="mergebox" type="checkbox" name="merge" tabindex="2" />
  126. <label for="mergebox">Merge</label>
  127. <?
  128. }
  129. if (!G::$LoggedUser['DisableAutoSave']) {
  130. ?>
  131. <script type="application/javascript">
  132. var storedTempTextarea = new StoreText('quickpost', 'quickpostform', <?=$InputID?>);
  133. </script>
  134. <?
  135. }
  136. }
  137. ?>
  138. <input type="button" value="Preview" class="hidden button_preview_<?=$ReplyText->getID()?>" tabindex="1" />
  139. <input type="submit" value="Post reply" id="submit_button" tabindex="1" />
  140. </div>
  141. </form>
  142. </div>
  143. </div>