3_3_forum_post_poll.tpl.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?php if(!defined('IN_DISCUZ')) exit('Access Denied');
  2. 0
  3. || checktplrefresh('./template/default/forum/post_poll.htm', './template/default/common/upload.htm', 1524717458, '3', './data/template/3_3_forum_post_poll.tpl.php', './template/wfdsoft_jiaohu', 'forum/post_poll')
  4. ;?>
  5. <input type="hidden" name="polls" value="yes" />
  6. <div class="exfm cl">
  7. <div class="sinf sppoll z">
  8. <input type="hidden" name="fid" value="<?php echo $_G['fid'];?>" />
  9. <?php if($_GET['action'] == 'newthread') { ?>
  10. <input type="hidden" name="tpolloption" value="1" />
  11. <div class="cl">
  12. <h4 class="z">
  13. <em>选项: </em>
  14. 最多可填写 <?php echo $_G['setting']['maxpolloptions'];?> 个选项 &nbsp;
  15. <span class="xw0"><input id="pollchecked" type="checkbox" class="pc" onclick="switchpollm(1)" /><label for="pollchecked">单框模式</label></span>
  16. </h4>
  17. </div>
  18. <div id="pollm_c_1" class="mbm">
  19. <span id="polloption_new"></span>
  20. <p id="polloption_hidden" style="display: none">
  21. <a href="javascript:;" class="d" onclick="delpolloption(this)">del</a>
  22. <input type="text" name="polloption[]" class="px vm" autocomplete="off" style="width:290px;" tabindex="1" />
  23. <span id="pollUploadProgress" class="vm" style="display: none;"></span>
  24. <span id="newpoll" class="vm"></span>
  25. </p>
  26. <p><a href="javascript:;" onclick="addpolloption()">+增加一项</a></p>
  27. </div>
  28. <div id="pollm_c_2" class="mbm" style="display:none">
  29. <textarea name="polloptions" class="pt" style="width:340px;" tabindex="1" rows="6" onchange="switchpollm(0)" /></textarea>
  30. <p class="cl">每行填写 1 个选项</p>
  31. </div>
  32. <?php } else { if(is_array($poll['polloption'])) foreach($poll['polloption'] as $key => $option) { $ppid = $poll['polloptionid'][$key];?><p>
  33. <input type="hidden" name="polloptionid[<?php echo $poll['polloptionid'][$key];?>]" value="<?php echo $poll['polloptionid'][$key];?>" />
  34. <input type="text" name="displayorder[<?php echo $poll['polloptionid'][$key];?>]" class="px pxs vm" autocomplete="off" tabindex="1" value="<?php echo $poll['displayorder'][$key];?>" />
  35. <input type="text" name="polloption[<?php echo $poll['polloptionid'][$key];?>]" class="px vm" autocomplete="off" style="width:230px;" tabindex="1" value="<?php echo $option;?>"<?php if(!$_G['group']['alloweditpoll']) { ?> readonly="readonly"<?php } ?> />
  36. <!--img src="<?php echo $poll['imginfo'][$ppid]['small'];?>" class="cur1" /-->
  37. <span id="newpoll_<?php echo $key;?>" class="vm"></span>
  38. <span id="pollUploadProgress_<?php echo $key;?>" class="vm">
  39. <?php if($poll['isimage']) { ?>
  40. <img src="<?php echo IMGDIR;?>/attachimg_2.png" class="cur1" onmouseover="showMenu({'menuid':'poll_img_preview_<?php echo $poll['imginfo'][$ppid]['aid'];?>_menu','ctrlclass':'a','duration':2,'timeout':0,'pos':'34'});" onmouseout="hideMenu('poll_img_preview_<?php echo $poll['imginfo'][$ppid]['aid'];?>_menu');" />
  41. <?php } ?>
  42. <input type="hidden" name="pollimage[<?php echo $poll['polloptionid'][$key];?>]" id="pollUploadProgress_<?php echo $key;?>_aid" value="<?php echo $poll['imginfo'][$ppid]['aid'];?>" />
  43. <span id="poll_img_preview_<?php echo $poll['imginfo'][$ppid]['aid'];?>_menu" style="display: none">
  44. <img src="<?php echo $poll['imginfo'][$ppid]['small'];?>" />
  45. </span>
  46. </span>
  47. </p>
  48. <?php } ?>
  49. <span id="polloption_new"></span>
  50. <p id="polloption_hidden" style="display: none">
  51. <a href="javascript:;" class="d" onclick="delpolloption(this)">del</a>
  52. <input type="text" name="displayorder[]" class="px pxs vm" autocomplete="off" tabindex="1" />
  53. <input type="text" name="polloption[]" class="px vm" autocomplete="off" style="width:230px;" tabindex="1" />
  54. <span id="newpoll" class="vm"></span>
  55. <span id="pollUploadProgress" class="vm" style="display: none;"></span>
  56. </p>
  57. <p><a href="javascript:;" onclick="addpolloption()">+增加一项</a></p>
  58. <?php } ?>
  59. </div>
  60. <div class="sadd z">
  61. <p class="mbn">
  62. <label for="maxchoices">最多可选</label>
  63. <input type="text" name="maxchoices" id="maxchoices" class="px pxs" value="<?php if($_GET['action'] == 'edit' && $poll['maxchoices']) { ?><?php echo $poll['maxchoices'];?><?php } else { ?>1<?php } ?>" tabindex="1" /> 项
  64. </p>
  65. <p class="mbn">
  66. <label for="polldatas">记票天数</label>
  67. <input type="text" name="expiration" id="polldatas" class="px pxs" value="<?php if($_GET['action'] == 'edit') { if(!$poll['expiration']) { ?>0<?php } elseif($poll['expiration'] < 0) { ?>关闭投票<?php } elseif($poll['expiration'] < TIMESTAMP) { ?>已结束<?php } else { echo (round(($poll['expiration'] - TIMESTAMP) / 86400)); } } ?>" tabindex="1" /> 天
  68. </p>
  69. <p class="mbn">
  70. <input type="checkbox" name="visibilitypoll" id="visibilitypoll" class="pc" value="1"<?php if($_GET['action'] == 'edit' && !$poll['visible']) { ?> checked<?php } ?> tabindex="1" /><label for="visibilitypoll">投票后结果可见</label>
  71. </p>
  72. <p class="mbn">
  73. <input type="checkbox" name="overt" id="overt" class="pc" value="1"<?php if($_GET['action'] == 'edit' && $poll['overt']) { ?> checked<?php } ?> tabindex="1" /><label for="overt">公开投票参与人</label>
  74. </p>
  75. <?php if(!empty($_G['setting']['pluginhooks']['post_poll_extra'])) echo $_G['setting']['pluginhooks']['post_poll_extra'];?>
  76. </div>
  77. </div><?php if(empty($_G['uploadjs'])) { ?>
  78. <script src="<?php echo $_G['setting']['jspath'];?>upload.js?<?php echo VERHASH;?>" type="text/javascript"></script><?php $_G['uploadjs'] = 1;?><?php } ?><script type="text/javascript" reload="1">
  79. var maxoptions = parseInt('<?php echo $_G['setting']['maxpolloptions'];?>');
  80. <?php if($_GET['action'] == 'newthread') { ?>
  81. var curoptions = 0;
  82. var curnumber = 1;
  83. addpolloption();
  84. addpolloption();
  85. addpolloption();
  86. <?php } else { ?>
  87. var curnumber = curoptions = <?php echo count($poll['polloption']); ?>;
  88. for(var i=0; i < curnumber; i++) {
  89. addUploadEvent('newpoll_'+i, 'pollUploadProgress_'+i);
  90. }
  91. <?php } ?>
  92. function addUploadEvent(imgid, pollstr) {
  93. <?php if(empty($_G['setting']['pluginhooks']['post_upload_extend']) && empty($_G['setting']['pluginhooks']['post_poll_upload_extend'])) { ?>
  94. new SWFUpload({
  95. upload_url: SITEURL + 'misc.php?mod=swfupload&action=swfupload&operation=poll&fid=<?php echo $_G['fid'];?>',
  96. post_params: {"uid":"<?php echo $_G['uid'];?>", "hash":"<?php echo $swfconfig['hash'];?>"},
  97. file_size_limit : "2048",
  98. file_types : "*.jpg;*.jpeg;*.gif;*.png;*.bmp",
  99. file_types_description : "图片文件",
  100. file_upload_limit : 0,
  101. file_queue_limit : 1,
  102. swfupload_preload_handler : preLoad,
  103. swfupload_load_failed_handler : loadFailed,
  104. file_dialog_start_handler : fileDialogStart,
  105. file_queued_handler : fileQueued,
  106. file_queue_error_handler : fileQueueError,
  107. file_dialog_complete_handler : fileDialogComplete,
  108. upload_start_handler : uploadStart,
  109. upload_progress_handler : uploadProgress,
  110. upload_error_handler : uploadError,
  111. upload_success_handler : uploadSuccess,
  112. upload_complete_handler : uploadComplete,
  113. button_image_url : IMGDIR+"/uploadbutton_small_pic.png",
  114. button_placeholder_id : imgid,
  115. button_width: 26,
  116. button_height: 26,
  117. button_cursor:SWFUpload.CURSOR.HAND,
  118. button_window_mode: "transparent",
  119. custom_settings : {
  120. progressTarget : pollstr,
  121. uploadSource: 'forum',
  122. uploadType: 'poll'
  123. },
  124. debug: false
  125. });
  126. <?php } else { ?>
  127. <?php if(!empty($_G['setting']['pluginhooks']['post_poll_upload_extend'])) echo $_G['setting']['pluginhooks']['post_poll_upload_extend'];?>
  128. <?php } ?>
  129. }
  130. </script>