3_wechat_module.tpl.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?php if(!defined('IN_DISCUZ')) exit('Access Denied'); function wechat_tpl_login_bar() {
  2. global $_G;?><?php
  3. $return = <<<EOF
  4. <a
  5. EOF;
  6. if($_G['wechat']['setting']['wechat_qrtype']) {
  7. $return .= <<<EOF
  8. href="plugin.php?id=wechat:login"
  9. EOF;
  10. } else {
  11. $return .= <<<EOF
  12. href="javascript:;" onclick="showWindow('wechat_bind', 'plugin.php?id=wechat:bind')"
  13. EOF;
  14. }
  15. $return .= <<<EOF
  16. ><img src="source/plugin/wechat/image/wechat_login.png" class="vm" /></a>
  17. EOF;
  18. ?><?php return $return;?><?php }
  19. function wechat_tpl_login_extra_bar() {
  20. global $_G;?><?php
  21. $return = <<<EOF
  22. <div class="fastlg_fm y" style="margin-right: 10px; padding-right: 10px">
  23. <p><a
  24. EOF;
  25. if($_G['wechat']['setting']['wechat_qrtype']) {
  26. $return .= <<<EOF
  27. href="plugin.php?id=wechat:login"
  28. EOF;
  29. } else {
  30. $return .= <<<EOF
  31. href="javascript:;" onclick="showWindow('wechat_bind', 'plugin.php?id=wechat:bind')"
  32. EOF;
  33. }
  34. $return .= <<<EOF
  35. ><img src="source/plugin/wechat/image/wechat_login.png" class="vm" /></a></p>
  36. <p class="hm xg1" style="padding-top: 2px;">{$_G['Plang']['lang_wechat_logintip']}</p>
  37. </div>
  38. EOF;
  39. ?><?php return $return;?><?php }
  40. function wechat_tpl_user_bar() {
  41. global $_G;?><?php
  42. $return = <<<EOF
  43. <span class="pipe">|</span><a
  44. EOF;
  45. if($_G['wechat']['setting']['wechat_qrtype'] && $_G['cookie']['qrauth']) {
  46. $return .= <<<EOF
  47. href="plugin.php?id=wechat:login"
  48. EOF;
  49. } else {
  50. $return .= <<<EOF
  51. href="javascript:;" onclick="showWindow('wechat_bind', 'plugin.php?id=wechat:bind')"
  52. EOF;
  53. }
  54. $return .= <<<EOF
  55. ><img src="source/plugin/wechat/image/wechat_bind.png" class="qq_bind" align="absmiddle" /></a>
  56. EOF;
  57. ?><?php return $return;?><?php }
  58. function wechat_tpl_float_qrcode($idstr = '') {
  59. global $_G;?><?php
  60. $__STATICURL = STATICURL;$return = <<<EOF
  61. EOF;
  62. if($_G['basescript'] != 'userapp' && empty($_G['cookie']['wechatfqrc'])) {
  63. $return .= <<<EOF
  64. <div id="wechat_float_qrcode" class="p_pop xg1" style="display:none;text-align:center;float:left;position:fixed;top:220px;z-index:100;margin-left: 2px;width:110px">
  65. <p class="cl"><img class="y" style="cursor:pointer" onclick="display('wechat_float_qrcode');setcookie('wechatfqrc', 1, 86400)" src="{$__STATICURL}image/common/ad_close.gif"></p>
  66. <img src="plugin.php?id=wechat:qrcode{$idstr}&amp;access=yes" width="98" />
  67. <p>
  68. EOF;
  69. if($_G['wechat']['setting']['wechat_float_text']) {
  70. $return .= <<<EOF
  71. {$_G['wechat']['setting']['wechat_float_text']}
  72. EOF;
  73. } else {
  74. $return .= <<<EOF
  75. 用微信扫一扫<br />互动赢积分
  76. EOF;
  77. }
  78. $return .= <<<EOF
  79. </p>
  80. </div>
  81. <script>
  82. function wechat_qrcode(type) {
  83. if(type && $('wechat_float_qrcode').style.display == 'none') {
  84. return;
  85. }
  86. var qrleft = parseInt($('ft').clientWidth + parseInt(fetchOffset($('ft'))['left']));
  87. $('wechat_float_qrcode').style.display = '';
  88. if(qrleft + $('wechat_float_qrcode').clientWidth > document.documentElement.clientWidth) {
  89. $('wechat_float_qrcode').style.cssFloat = 'right';
  90. $('wechat_float_qrcode').style.left = 'auto';
  91. $('wechat_float_qrcode').style.right = 0;
  92. } else {
  93. $('wechat_float_qrcode').style.cssFloat = 'left';
  94. $('wechat_float_qrcode').style.left = (qrleft) + 'px';
  95. $('wechat_float_qrcode').style.right = 'auto';
  96. }
  97. }
  98. _attachEvent(window, 'scroll', function () { wechat_qrcode(1); })
  99. _attachEvent(window, 'load', function() { wechat_qrcode(0); }, document);
  100. </script>
  101. EOF;
  102. }
  103. $return .= <<<EOF
  104. EOF;
  105. ?><?php return $return;?><?php }
  106. function wechat_tpl_share($isshow) {
  107. global $_G;?><?php
  108. $return = <<<EOF
  109. <a href="javascript:;" onclick="showWindow('wechat_share', 'plugin.php?id=wechat:qrcode&threadqr={$_G['tid']}&access=yes&share=yes')"><i><img src="source/plugin/wechat/image/share.png" alt="微信" />微信</i></a>
  110. EOF;
  111. if($isshow) {
  112. $return .= <<<EOF
  113. <script>
  114. if(document.getElementsByName('ijoin').length) {
  115. if($('post_reply')) {
  116. document.getElementsByName('ijoin')[0].onclick = function() {
  117. $('post_reply').click();
  118. }
  119. } else {
  120. document.getElementsByName('ijoin')[0].style.display = 'none';
  121. }
  122. }
  123. if($('vfastpost')) {
  124. $('vfastpost').style.display = 'none';
  125. }
  126. </script>
  127. EOF;
  128. }
  129. $return .= <<<EOF
  130. EOF;
  131. ?><?php return $return;?><?php }
  132. function wechat_tpl_register() {
  133. global $_G;?><?php
  134. $return = <<<EOF
  135. <div class="rfm pbm">填写以下信息完成微信帐号注册</div>
  136. EOF;
  137. ?><?php return $return;?><?php }
  138. function wechatshowactivity_tpl_voters($post) {
  139. global $_G;?><?php
  140. $__STATICURL = STATICURL;$return = <<<EOF
  141. <span class="pipe">|</span> <img src="{$__STATICURL}image/common/agree.gif" class="vm"> 已有 <strong class="xi1">{$post['voters']}</strong> 人点赞
  142. EOF;
  143. ?><?php return $return;?><?php }
  144. function wechatshowactivity_tpl_share($post) {
  145. global $_G;?><?php
  146. $return = <<<EOF
  147. <p class="xs3 quote"><img src="source/plugin/wechat/image/share.png"> <a href="javascript:;" onclick="showWindow('wechat_share', 'plugin.php?id=wechat:qrcode&threadqr={$post['tid']}&pid={$post['pid']}&showactivity=yes&access=yes')">通过微信扫描二维码为我拉票</a></p>
  148. <br /><br />
  149. EOF;
  150. ?><?php return $return;?><?php }
  151. function wechat_tpl_resourcepush() {
  152. global $_G;?><?php
  153. $return = <<<EOF
  154. <a href="javascript:;" onclick="showWindow('wechat_resourcepush', 'plugin.php?id=wechat:resourcepush&tid={$_G['tid']}')">推送到微信素材</a>
  155. EOF;
  156. ?><?php return $return;?><?php }?>