3_qqconnect_module.tpl.php 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108
  1. <?php if(!defined('IN_DISCUZ')) exit('Access Denied'); function tpl_global_login_extra() {
  2. global $_G;?><?php
  3. $__IMGDIR = IMGDIR;$return = <<<EOF
  4. <div class="fastlg_fm y" style="margin-right: 10px; padding-right: 10px">
  5. <p><a href="{$_G['connect']['login_url']}&statfrom=login_simple"><img src="{$__IMGDIR}/qq_login.gif" class="vm" alt="QQ登录" /></a></p>
  6. <p class="hm xg1" style="padding-top: 2px;">只需一步,快速开始</p>
  7. </div>
  8. EOF;
  9. ?><?php return $return;?><?php }
  10. function tpl_global_usernav_extra1() {
  11. global $_G;?><?php
  12. $__IMGDIR = IMGDIR;$return = <<<EOF
  13. EOF;
  14. if(CURMODULE != 'connect') { if($_G['connectguest']) {
  15. $return .= <<<EOF
  16. <span class="pipe">|</span><a href="member.php?mod=connect" target="_blank" title="体验本站更多功能">完善帐号信息</a><span class="pipe">|</span><a href="member.php?mod=connect&amp;ac=bind" target="_blank" title="使用QQ帐号快速登录本站">绑定已有帐号</a>
  17. EOF;
  18. } else {
  19. $return .= <<<EOF
  20. <span class="pipe">|</span><a href="connect.php?mod=config" target="_blank"><img src="{$__IMGDIR}/qq_bind_small.gif" class="qq_bind" align="absmiddle" alt="QQ绑定" /></a>
  21. EOF;
  22. } }
  23. $return .= <<<EOF
  24. EOF;
  25. ?><?php return $return;?><?php }
  26. function tpl_global_footer($loadJs) {?><?php
  27. $return = <<<EOF
  28. EOF;
  29. if($loadJs['qsharejs']) {
  30. $return .= <<<EOF
  31. <script src="{$loadJs['qsharejs']['jsurl']}" type="text/javascript"></script><script type="text/javascript">_share_tencent_weibo(null, {$loadJs['qsharejs']['func']}("t_f", null, "td"), "{$_G['siteurl']}", "{$loadJs['qsharejs']['appkey']}", "{$loadJs['qsharejs']['sitename']}");</script>
  32. EOF;
  33. } if($loadJs['feedjs']) {
  34. $return .= <<<EOF
  35. <script type="text/javascript">_attachEvent(window, 'load', function () { appendscript('{$loadJs['feedjs']['jsurl']}', '', 1, 'utf-8') }, document);</script>
  36. EOF;
  37. } if($loadJs['cookieloginjs']) {
  38. $return .= <<<EOF
  39. <script type="text/javascript">var cookieLogin = Ajax("TEXT");cookieLogin.get("{$loadJs['cookieloginjs']['jsurl']}", function() {});</script>
  40. EOF;
  41. } if($loadJs['guestloginjs']) {
  42. $return .= <<<EOF
  43. <script type="text/javascript">_attachEvent(window, 'load', function () { appendscript('{$loadJs['guestloginjs']['jsurl']}', '', 1, 'utf-8') }, document);</script>
  44. EOF;
  45. } if($loadJs['syncpostjs']) {
  46. $return .= <<<EOF
  47. <script type="text/javascript">_attachEvent(window, 'load', function () { appendscript('{$loadJs['syncpostjs']['jsurl']}', '', 1, 'utf-8') }, document);</script>
  48. EOF;
  49. }
  50. $return .= <<<EOF
  51. EOF;
  52. ?><?php return $return;?><?php }
  53. function tpl_login_bar() {
  54. global $_G;?><?php
  55. $__IMGDIR = IMGDIR;$return = <<<EOF
  56. EOF;
  57. if(!$_G['connectguest']) {
  58. $return .= <<<EOF
  59. <a href="{$_G['connect']['login_url']}&statfrom=login" target="_top" rel="nofollow"><img src="{$__IMGDIR}/qq_login.gif" class="vm" /></a>
  60. EOF;
  61. }
  62. $return .= <<<EOF
  63. EOF;
  64. ?><?php return $return;?><?php }
  65. function tpl_index_status_extra() {
  66. global $_G;?><?php
  67. $return = <<<EOF
  68. <iframe id="connectlike" allowtransparency="true" scrolling="no" border="0" width="280" height="25" frameborder="0"></iframe>
  69. <script type="text/javascript">_attachEvent(window, 'load', function () { $('connectlike').src = 'api/connect/like.php';}, document);</script>
  70. EOF;
  71. ?><?php return $return;?><?php }
  72. function tpl_sync_method($allowconnectfeed, $allowconnectt, $cssextra = '') {
  73. global $_G;?><?php
  74. $return = <<<EOF
  75. EOF;
  76. if($allowconnectt) {
  77. $return .= <<<EOF
  78. <script type="text/javascript">
  79. //var _allow_qq =
  80. EOF;
  81. if($allowconnectfeed) {
  82. $return .= <<<EOF
  83. true
  84. EOF;
  85. } else {
  86. $return .= <<<EOF
  87. false
  88. EOF;
  89. }
  90. $return .= <<<EOF
  91. ;
  92. var _allow_t =
  93. EOF;
  94. if($allowconnectt) {
  95. $return .= <<<EOF
  96. true
  97. EOF;
  98. } else {
  99. $return .= <<<EOF
  100. false
  101. EOF;
  102. }
  103. $return .= <<<EOF
  104. ;
  105. //var _syn_qq =
  106. EOF;
  107. if(intval($_G['cookie']['connect_not_sync_feed'])) {
  108. $return .= <<<EOF
  109. false
  110. EOF;
  111. } else { if($_G['member']['conisbind'] && $_G['member']['conispublishfeed']) {
  112. $return .= <<<EOF
  113. true
  114. EOF;
  115. } else {
  116. $return .= <<<EOF
  117. false
  118. EOF;
  119. } }
  120. $return .= <<<EOF
  121. ;
  122. var _syn_t =
  123. EOF;
  124. if(intval($_G['cookie']['connect_not_sync_t'])) {
  125. $return .= <<<EOF
  126. false
  127. EOF;
  128. } else { if($_G['member']['conisbind'] && $_G['member']['conispublisht']) {
  129. $return .= <<<EOF
  130. true
  131. EOF;
  132. } else {
  133. $return .= <<<EOF
  134. false
  135. EOF;
  136. } }
  137. $return .= <<<EOF
  138. ;
  139. var _is_oauth_user =
  140. EOF;
  141. if($_G['member']['conisbind']) {
  142. $return .= <<<EOF
  143. true
  144. EOF;
  145. } else {
  146. $return .= <<<EOF
  147. false
  148. EOF;
  149. }
  150. $return .= <<<EOF
  151. ;
  152. var _is_feed_auth =
  153. EOF;
  154. if(($_G['member']['conuinsecret'] || $_G['member']['conuintoken']) && $_G['member']['is_feed']) {
  155. $return .= <<<EOF
  156. true
  157. EOF;
  158. } else {
  159. $return .= <<<EOF
  160. false
  161. EOF;
  162. }
  163. $return .= <<<EOF
  164. ;
  165. var _is_token_outofdate =
  166. EOF;
  167. if($_G['member']['conuinsecret'] || $_G['member']['conuintoken']) {
  168. $return .= <<<EOF
  169. false
  170. EOF;
  171. } else {
  172. $return .= <<<EOF
  173. true
  174. EOF;
  175. }
  176. $return .= <<<EOF
  177. ;
  178. function connect_post_init() {
  179. // if (_allow_qq && _syn_qq) {
  180. // if (_is_feed_auth && !_is_token_outofdate) {
  181. // $('connectPost_synQQ').className = 'syn_qq_check';
  182. // $('connectPost_synQQ').title = '已设置同步至QQ空间';
  183. // $('connect_publish_feed').value = 1;
  184. // } else {
  185. // $('connectPost_synQQ').className = 'syn_qq';
  186. // $('connectPost_synQQ').title = '未设置同步至QQ空间';
  187. // $('connect_publish_feed').value = 0;
  188. // }
  189. // }
  190. if (_allow_t && _syn_t) {
  191. if (_is_feed_auth && !_is_token_outofdate) {
  192. $('connectPost_synT').className = 'syn_tqq_check';
  193. $('connectPost_synT').title = '已设置同步至腾讯微博';
  194. $('connect_publish_t').value = 1;
  195. } else {
  196. $('connectPost_synT').className = 'syn_tqq';
  197. $('connectPost_synT').title = '未设置同步至腾讯微博';
  198. $('connect_publish_t').value = 0;
  199. }
  200. }
  201. // if (_allow_qq) {
  202. // $('connectPost_synQQ').onclick = function () {
  203. // connect_syn_option_toggle(this);
  204. // }
  205. // }
  206. if (_allow_t) {
  207. $('connectPost_synT').onclick = function () {
  208. connect_syn_option_toggle(this);
  209. }
  210. }
  211. if (getcookie('connect_synpost_tip')) {
  212. connect_post_tip();
  213. }
  214. }
  215. function connect_syn_option_toggle(opt) {
  216. if (_is_feed_auth && !_is_token_outofdate) {
  217. if ($(opt.getAttribute('rel')).value == 1) {
  218. opt.className = opt.className.replace('_check', '');
  219. opt.title = opt.title.replace('已', '未');
  220. $(opt.getAttribute('rel')).value = 0;
  221. } else {
  222. $(opt.getAttribute('rel')).value = 1;
  223. opt.className += '_check';
  224. opt.title = opt.title.replace('未', '已');
  225. }
  226. } else {
  227. var _auth_text = '马上完善授权,您将可以发表主题时同步到QQ空间和腾讯微博,第一时间和大家分享您在论坛中的新鲜事儿。';
  228. if (_is_token_outofdate) {
  229. _auth_text = '为了您的账号安全,请使用QQ帐号重新登录,将为您升级帐号安全机制<br/><br/>点击<a href="{$_G['connect']['login_url']}"><img src="static/image/common/qq_login.gif" class="vm" alt="QQ登录" /></a>页面将发生跳转,请确保您已保存好帖子数据';
  230. var _button = '我知道了';
  231. showDialog(_auth_text, 'notice', null, null, 0, null, null, _button);
  232. return;
  233. } else if (!_is_oauth_user) {
  234. _auth_text = '马上绑定QQ账号,您将可以发表主题时同步到QQ空间和腾讯微博,第一时间和大家分享您在论坛中的新鲜事儿。';
  235. }
  236. showDialog(_auth_text, 'notice', '授权提示', 'connect_goto_setting()', 0, null, null, '修改授权');
  237. }
  238. }
  239. function connect_post_tip() {
  240. if ($('fastpostform')) {
  241. return;
  242. }
  243. if (_is_token_outofdate) {
  244. if ($('synnotice')) {
  245. $('synnotice').style.display = 'none';
  246. }
  247. return;
  248. }
  249. var r = document.getElementById('rstnotice');
  250. var c = document.createElement('div');
  251. c.setAttribute('id', 'synnotice');
  252. c.setAttribute('class', 'ntc_l bbs');
  253. if(BROWSER.ie) {
  254. c.id = 'synnotice';
  255. c.className = 'ntc_l bbs';
  256. }
  257. c.style.display = 'block';
  258. r.parentNode.insertBefore(c, r.nextSibling);
  259. c.innerHTML = '<a href="javascript:void(0);" title="关闭同步发帖提示" class="d y" onclick="connect_syn_tip_hide();">close</a>此主题将同步到腾讯微博,您的听众能够看到您发表的主题。&nbsp;&nbsp;<a class="xi2" href="javascript:void(0);" onclick="connect_syn_cancel();" title="取消发表主题时同步到腾讯微博,将来您可以到“设置-QQ绑定”页面重新设置。"><strong>暂不同步</strong></a>';
  260. }
  261. function connect_syn_tip_hide() {
  262. setcookie('connect_synpost_tip', '', '-1');
  263. $('synnotice').style.display = 'none';
  264. }
  265. function connect_syn_cancel() {
  266. ajaxget('{$_G['siteurl']}connect.php?mod=config&op=synconfig', '');
  267. // $('connectPost_synQQ').className = 'syn_qq';
  268. // $('connectPost_synQQ').title = '未设置同步至QQ空间';
  269. // $('connect_publish_feed').value = 0;
  270. $('connectPost_synT').className = 'syn_tqq';
  271. $('connectPost_synT').title = '未设置同步至腾讯微博';
  272. $('connect_publish_t').value = 0;
  273. $('synnotice').style.display = 'none';
  274. }
  275. function connect_goto_setting() {
  276. var _url = "{$_G['siteurl']}home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp";
  277. hideMenu('fwin_dialog', 'dialog')
  278. var _newWindow = window.open(_url, 'newWindow');
  279. _newWindow.focus();
  280. }
  281. _attachEvent(window, 'load', function(){
  282. connect_post_init();
  283. });
  284. </script>
  285. EOF;
  286. if($allowconnectt) {
  287. $return .= <<<EOF
  288. <a title="未设置同步至腾讯微博" class="syn_tqq" href="javascript:void(0);" id="connectPost_synT" rel="connect_publish_t">腾讯微博</a>
  289. <input type="hidden" name="connect_publish_t" id="connect_publish_t" value="0" />
  290. EOF;
  291. } }
  292. $return .= <<<EOF
  293. EOF;
  294. ?><?php return $return;?><?php }
  295. function tpl_infloat_sync_method($allowconnectfeed, $allowconnectt) {
  296. global $_G;?><?php
  297. $return = <<<EOF
  298. EOF;
  299. if($allowconnectt) {
  300. $return .= <<<EOF
  301. <a title="未设置同步至腾讯微博" class="syn_tqq" href="javascript:void(0);" id="connectPost_synT_infloat" rel="connect_publish_t_infloat">腾讯微博</a>
  302. <input type="hidden" name="connect_publish_t" id="connect_publish_t_infloat" value="0" />
  303. <script type="text/javascript" reload="1">
  304. //var _allow_qq_infloat =
  305. EOF;
  306. if($allowconnectfeed) {
  307. $return .= <<<EOF
  308. true
  309. EOF;
  310. } else {
  311. $return .= <<<EOF
  312. false
  313. EOF;
  314. }
  315. $return .= <<<EOF
  316. ;
  317. var _allow_t_infloat =
  318. EOF;
  319. if($allowconnectt) {
  320. $return .= <<<EOF
  321. true
  322. EOF;
  323. } else {
  324. $return .= <<<EOF
  325. false
  326. EOF;
  327. }
  328. $return .= <<<EOF
  329. ;
  330. //var _syn_qq_infloat =
  331. EOF;
  332. if(intval($_G['cookie']['connect_not_sync_feed'])) {
  333. $return .= <<<EOF
  334. false
  335. EOF;
  336. } else { if($_G['member']['conisbind'] && $_G['member']['conispublishfeed']) {
  337. $return .= <<<EOF
  338. true
  339. EOF;
  340. } else {
  341. $return .= <<<EOF
  342. false
  343. EOF;
  344. } }
  345. $return .= <<<EOF
  346. ;
  347. var _syn_t_infloat =
  348. EOF;
  349. if(intval($_G['cookie']['connect_not_sync_t'])) {
  350. $return .= <<<EOF
  351. false
  352. EOF;
  353. } else { if($_G['member']['conisbind'] && $_G['member']['conispublisht']) {
  354. $return .= <<<EOF
  355. true
  356. EOF;
  357. } else {
  358. $return .= <<<EOF
  359. false
  360. EOF;
  361. } }
  362. $return .= <<<EOF
  363. ;
  364. var _is_oauth_user_infloat =
  365. EOF;
  366. if($_G['member']['conisbind']) {
  367. $return .= <<<EOF
  368. true
  369. EOF;
  370. } else {
  371. $return .= <<<EOF
  372. false
  373. EOF;
  374. }
  375. $return .= <<<EOF
  376. ;
  377. var _is_feed_auth_infloat =
  378. EOF;
  379. if(($_G['member']['conuinsecret'] || $_G['member']['conuintoken']) && $_G['member']['is_feed']) {
  380. $return .= <<<EOF
  381. true
  382. EOF;
  383. } else {
  384. $return .= <<<EOF
  385. false
  386. EOF;
  387. }
  388. $return .= <<<EOF
  389. ;
  390. var _is_token_outofdate =
  391. EOF;
  392. if($_G['member']['conuinsecret'] || $_G['member']['conuintoken']) {
  393. $return .= <<<EOF
  394. false
  395. EOF;
  396. } else {
  397. $return .= <<<EOF
  398. true
  399. EOF;
  400. }
  401. $return .= <<<EOF
  402. ;
  403. function connect_post_init_infloat() {
  404. // if (_allow_qq_infloat && _syn_qq_infloat) {
  405. // if (_is_feed_auth_infloat && !_is_token_outofdate) {
  406. // $('connectPost_synQQ_infloat').className = 'syn_qq_check';
  407. // $('connectPost_synQQ_infloat').title = '已设置同步至QQ空间';
  408. // $('connect_publish_feed_infloat').value = 1;
  409. // } else {
  410. // $('connectPost_synQQ_infloat').className = 'syn_qq';
  411. // $('connectPost_synQQ_infloat').title = '未设置同步至QQ空间';
  412. // $('connect_publish_feed_infloat').value = 0;
  413. // }
  414. // }
  415. if (_allow_t_infloat && _syn_t_infloat) {
  416. if (_is_feed_auth_infloat && !_is_token_outofdate) {
  417. $('connectPost_synT_infloat').className = 'syn_tqq_check';
  418. $('connectPost_synT_infloat').title = '已设置同步至腾讯微博';
  419. $('connect_publish_t_infloat').value = 1;
  420. } else {
  421. $('connectPost_synT_infloat').className = 'syn_tqq';
  422. $('connectPost_synT_infloat').title = '未设置同步至腾讯微博';
  423. $('connect_publish_t_infloat').value = 0;
  424. }
  425. }
  426. // if (_allow_qq_infloat) {
  427. // $('connectPost_synQQ_infloat').onclick = function () {
  428. // connect_syn_option_toggle_infloat(this);
  429. // }
  430. // }
  431. if (_allow_t_infloat) {
  432. $('connectPost_synT_infloat').onclick = function () {
  433. connect_syn_option_toggle_infloat(this);
  434. }
  435. }
  436. if (getcookie('connect_synpost_tip')) {
  437. connect_post_tip_infloat();
  438. }
  439. }
  440. function connect_syn_option_toggle_infloat(opt) {
  441. if (_is_feed_auth_infloat && !_is_token_outofdate) {
  442. if ($(opt.getAttribute('rel')).value == 1) {
  443. opt.className = opt.className.replace('_check', '');
  444. opt.title = opt.title.replace('已', '未');
  445. $(opt.getAttribute('rel')).value = 0;
  446. } else {
  447. $(opt.getAttribute('rel')).value = 1;
  448. opt.className += '_check';
  449. opt.title = opt.title.replace('未', '已');
  450. }
  451. } else {
  452. var _auth_text = '马上完善授权,您将可以发表主题时同步到QQ空间和腾讯微博,第一时间和大家分享您在论坛中的新鲜事儿。';
  453. if (_is_token_outofdate) {
  454. _auth_text = '为了您的账号安全,请使用QQ帐号重新登录,将为您升级帐号安全机制<br/><br/>点击<a href="{$_G['connect']['login_url']}"><img src="static/image/common/qq_login.gif" class="vm" alt="QQ登录" /></a>页面将发生跳转,请确保您已保存好帖子数据';
  455. var _button = '我知道了';
  456. showDialog(_auth_text, 'notice', null, null, 0, null, null, _button);
  457. return;
  458. } else if (!_is_oauth_user_infloat) {
  459. _auth_text = '马上绑定QQ账号,您将可以发表主题时同步到QQ空间和腾讯微博,第一时间和大家分享您在论坛中的新鲜事儿。';
  460. }
  461. showDialog(_auth_text, 'notice', '授权提示', 'connect_goto_setting_infloat()', 0, null, null, '修改授权');
  462. }
  463. }
  464. function connect_post_tip_infloat() {
  465. if ($('fastpostform')) {
  466. return;
  467. }
  468. var r = document.getElementById('rstnotice');
  469. var c = document.createElement('div');
  470. c.setAttribute('id', 'synnotice');
  471. c.setAttribute('class', 'ntc_l bbs');
  472. if(BROWSER.ie) {
  473. c.id = 'synnotice';
  474. c.className = 'ntc_l bbs';
  475. }
  476. c.style.display = 'block';
  477. r.parentNode.insertBefore(c, r.nextSibling);
  478. c.innerHTML = '<a href="javascript:void(0);" title="关闭同步发帖提示" class="d y" onclick="connect_syn_tip_hide_infloat();">close</a>此主题将同步到腾讯微博,您的听众能够看到您发表的主题。&nbsp;&nbsp;<a class="xi2" href="javascript:void(0);" onclick="connect_syn_cancel_infloat();" title="取消发表主题时同步到腾讯微博,将来您可以到“设置-QQ绑定”页面重新设置。"><strong>暂不同步</strong></a>';
  479. }
  480. function connect_syn_tip_hide_infloat() {
  481. setcookie('connect_synpost_tip', '', '-1');
  482. $('synnotice').style.display = 'none';
  483. }
  484. function connect_syn_cancel_infloat() {
  485. ajaxget('{$_G['siteurl']}connect.php?mod=config&op=synconfig', '');
  486. //$('connectPost_synQQ_infloat').className = 'syn_qq';
  487. //$('connectPost_synQQ_infloat').title = '未设置同步至QQ空间';
  488. //$('connect_publish_feed_infloat').value = 0;
  489. $('connectPost_synT_infloat').className = 'syn_tqq';
  490. $('connectPost_synT_infloat').title = '未设置同步至腾讯微博';
  491. $('connect_publish_t_infloat').value = 0;
  492. $('synnotice').style.display = 'none';
  493. }
  494. function connect_goto_setting_infloat() {
  495. var _url = "{$_G['siteurl']}home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp";
  496. hideMenu('fwin_dialog', 'dialog')
  497. var _newWindow = window.open(_url, 'newWindow');
  498. _newWindow.focus();
  499. }
  500. connect_post_init_infloat();
  501. </script>
  502. EOF;
  503. }
  504. $return .= <<<EOF
  505. EOF;
  506. ?><?php return $return;?><?php }
  507. function tpl_viewthread_share_method($jsurl) {
  508. global $_G;
  509. if (!$_G['setting']['connect']['allow']) return;
  510. $connect_thread_subject = addslashes(strip_tags($_G['thread']['subject']));?><?php
  511. $__IMGDIR = IMGDIR;$__FORMHASH = FORMHASH;$return = <<<EOF
  512. EOF;
  513. if($_G['member']['conisbind'] && ($_G['member']['conuinsecret'] || $_G['member']['conuintoken'])) {
  514. $return .= <<<EOF
  515. <a href="{$_G['connect']['qq_share_url']}" id="k_share_to_qq" title="QQ好友和群" target="_blank"><i><img src="{$__IMGDIR}/qq_share.png" alt="QQ好友和群" />QQ好友和群</i></a>
  516. <a href="javascript:void(0);" ref="{$_G['connect']['weibo_share_url']}" id="k_weiboshare" title="腾讯微博"><i><img src="{$__IMGDIR}/weibo.png" alt="腾讯微博" />腾讯微博</i></a>
  517. <a href="javascript:void(0);" ref="{$_G['connect']['pengyou_share_url']}" id="k_pengyoushare" title="QQ空间"><i><img src="{$__IMGDIR}/qzone.gif" alt="QQ空间" />QQ空间</i></a>
  518. <script type="text/javascript">
  519. var _is_oauth_user =
  520. EOF;
  521. if($_G['member']['conuinsecret'] || $_G['member']['conuintoken']) {
  522. $return .= <<<EOF
  523. true
  524. EOF;
  525. } else {
  526. $return .= <<<EOF
  527. false
  528. EOF;
  529. }
  530. $return .= <<<EOF
  531. ;
  532. var _is_share_token_outofdate =
  533. EOF;
  534. if($_G['member']['conuinsecret'] || $_G['member']['conuintoken']) {
  535. $return .= <<<EOF
  536. false
  537. EOF;
  538. } else {
  539. $return .= <<<EOF
  540. true
  541. EOF;
  542. }
  543. $return .= <<<EOF
  544. ;
  545. var _is_feed_auth = true;
  546. var _share_buttons = ['k_weiboshare', 'k_pengyoushare'];
  547. function connect_share_init() {
  548. for (var i = 0; i < _share_buttons.length; i++) {
  549. $(_share_buttons[i]).onclick = function () {
  550. connect_share_form(this);
  551. return false;
  552. }
  553. }
  554. }
  555. function connect_share_form(obj) {
  556. if (_is_oauth_user && _is_feed_auth) {
  557. var _url = obj.getAttribute('ref');
  558. showWindow(obj.id, _url, 'get', 1);
  559. } else {
  560. if (_is_share_token_outofdate) {
  561. var _text = '为了您的账号安全,请使用QQ帐号重新登录,将为您升级帐号安全机制<br/><br/>点击<a href="{$_G['connect']['login_url']}"><img src="static/image/common/qq_login.gif" class="vm" alt="QQ登录" /></a>页面将发生跳转';
  562. var _button = '我知道了';
  563. showDialog(_text, 'notice', null, null, 0, null, null, _button);
  564. } else if (!_is_oauth_user) {
  565. var _text = '很抱歉,由于分享功能升级,您需要使用QQ帐号重新登录本站,即可马上体验全新的分享到QQ空间、腾讯微博和腾讯朋友功能。<br /><span style="font-size: 12px;">提示:点击<a href="member.php?mod=logging&amp;action=logout&amp;formhash={$__FORMHASH}" class="xi2">这里退出</a>后,重新使用QQ账号登录。</span>';
  566. var _button = '我知道了';
  567. showDialog(_text, 'notice', null, 'connect_goto_setting()', 0, null, null, _button);
  568. } else if (!_is_feed_auth) {
  569. var _title = '授权提示';
  570. var _text = '独乐乐不如众乐乐,马上完善授权,您将可以把本站精彩内容分享到QQ空间、腾讯微博和腾讯朋友,跟大家分享每个精彩瞬间。';
  571. var _button = '修改授权';
  572. showDialog(_text, 'notice', _title, 'connect_goto_setting()', 0, null, null, _button);
  573. }
  574. }
  575. }
  576. function connect_goto_setting() {
  577. if (_is_oauth_user) {
  578. var _url = "{$_G['siteurl']}home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp";
  579. hideMenu('fwin_dialog', 'dialog');
  580. var _newWindow = window.open(_url, 'newWindow');
  581. _newWindow.focus();
  582. } else {
  583. hideMenu('fwin_dialog', 'dialog');
  584. }
  585. }
  586. _attachEvent(window, 'load', function(){
  587. connect_share_init();
  588. });
  589. </script>
  590. EOF;
  591. } else {
  592. $return .= <<<EOF
  593. <a href="{$_G['connect']['qq_share_url']}" id="k_share_to_qq" title="QQ好友和群" target="_blank"><i><img src="{$__IMGDIR}/qq_share.png" alt="QQ好友和群" />QQ好友和群</i></a>
  594. <a href="javascript:void(0);" id="k_qqshare" onclick="postToQzone();" title="QQ空间"><i><img src="{$__IMGDIR}/qzone.gif" alt="QQ空间" />QQ空间</i></a>
  595. <a href="javascript:void(0)" onclick="postToWb();" id="k_weiboshare" title="腾讯微博"><i><img src="{$__IMGDIR}/weibo.png" alt="腾讯微博" />腾讯微博</i></a>
  596. <a href="javascript:void(0);" onclick="postToPengyou();" id="k_pengyoushare" title="腾讯朋友"><i><img src="{$__IMGDIR}/pengyou.png" alt="腾讯朋友" />腾讯朋友</i></a>
  597. <script type="text/javascript">
  598. function postToWb(){
  599. var _t = encodeURI(document.title);
  600. var _url = encodeURIComponent(document.location);
  601. var _appkey = encodeURI("{$_G['connect']['weibo_appkey']}");
  602. var _pic = "{$_G['connect']['share_images']}";
  603. var _site = encodeURIComponent("{$_G['setting']['bbname']}");
  604. var _from = 'discuz';
  605. var _u = 'http://v.t.qq.com/share/share.php?url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic+'&title='+_t+'&from='+_from;
  606. window.open( _u,'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
  607. }
  608. function postToPengyou(){
  609. var _url = encodeURIComponent(document.location.href);
  610. var _site = encodeURIComponent("{$_G['setting']['bbname']}");
  611. var _title = encodeURIComponent("{$connect_thread_subject}");
  612. var _pics = "{$_G['connect']['share_images']}";
  613. var _from = 'discuz';
  614. var _u = '{$_G['connect']['qzone_public_share_url']}?to=pengyou&url='+_url+'&site='+_site+'&title='+_title+'&pics='+_pics+'&from='+_from;
  615. window.open(_u);
  616. }
  617. </script>
  618. EOF;
  619. }
  620. $return .= <<<EOF
  621. EOF;
  622. if($jsurl) {
  623. $return .= <<<EOF
  624. <script type="text/javascript">_attachEvent(window, 'load', function () { appendscript('{$jsurl}', '', 1, 'utf-8') }, document);</script>
  625. EOF;
  626. }
  627. $return .= <<<EOF
  628. EOF;
  629. ?><?php return $return;?><?php }
  630. function tpl_viewthread_bottom($jsurl) {
  631. global $_G;?><?php
  632. $__IMGDIR = IMGDIR;$return = <<<EOF
  633. <script type="text/javascript">
  634. var connect_qzone_share_url = '{$_G['connect']['qzone_share_url']}';
  635. var connect_weibo_share_url = '{$_G['connect']['weibo_share_url']}';
  636. var connect_thread_info = {
  637. thread_url: '{$_G['siteurl']}{$GLOBALS['canonical']}',
  638. thread_id: '{$_G['tid']}',
  639. post_id: '{$_G['connect']['first_post']['pid']}',
  640. forum_id: '{$_G['fid']}',
  641. author_id: '{$_G['connect']['first_post']['authorid']}',
  642. author: '{$_G['connect']['first_post']['author']}'
  643. };
  644. connect_autoshare = '{$_GET['connect_autoshare']}';
  645. connect_isbind = '{$_G['member']['conisbind']}';
  646. if(connect_autoshare == 1 && connect_isbind) {
  647. _attachEvent(window, 'load', function(){
  648. connect_share(connect_weibo_share_url, connect_openid);
  649. });
  650. }
  651. </script>
  652. EOF;
  653. if($_G['member']['conisbind']) {
  654. $return .= <<<EOF
  655. <div id="connect_share_unbind" style="display: none;">
  656. <div class="c hm">
  657. <div style="font-size:14px; margin:10px 0;">绑定QQ帐号,轻松分享到QQ空间与腾讯微博</div>
  658. <div><a href="connect.php?mod=config&amp;connect_autoshare=1" target="_blank"><img src="{$__IMGDIR}/qq_bind.gif" align="absmiddle" style="margin-top:5px;" /></a></div>
  659. </div>
  660. <input type="hidden" id="connect_thread_title" name="connect_thread_title" value="{$_G['forum_thread']['subject']}" />
  661. </div>
  662. EOF;
  663. } if($jsurl) {
  664. $return .= <<<EOF
  665. <script type="text/javascript">_attachEvent(window, 'load', function () { appendscript('{$jsurl}', '', 1, 'utf-8') }, document);</script>
  666. EOF;
  667. }
  668. $return .= <<<EOF
  669. EOF;
  670. ?><?php return $return;?><?php }
  671. function tpl_sync_post_viewthread_bottom($jsurl) {?><?php
  672. $return = <<<EOF
  673. <div style="display:none;"><iframe src='{$jsurl}' style="display:none;"></div>
  674. EOF;
  675. ?><?php return $return;?><?php }
  676. function tpl_register_input() {
  677. global $_G;
  678. $connect_app_id = $_G['qc']['connect_app_id'];
  679. $connect_openid = $_G['qc']['connect_openid'];?><?php
  680. $return = <<<EOF
  681. EOF;
  682. if($connect_app_id && $connect_openid) {
  683. $return .= <<<EOF
  684. <div class="rfm">
  685. <table>
  686. <tr>
  687. <th></th>
  688. <td>
  689. <label for="use_qzone_avatar_qqshow"><input type="checkbox" name="use_qzone_avatar_qqshow" id="use_qzone_avatar_qqshow" class="pc" value="1" checked="checked" tabindex="1" />使用QQ头像和QQ秀</label>
  690. </td>
  691. </tr>
  692. </table>
  693. </div>
  694. EOF;
  695. }
  696. $return .= <<<EOF
  697. <input type="hidden" id="auth_hash" name="auth_hash" value="{$_G['qc']['connect_auth_hash']}" />
  698. <input type="hidden" id="is_notify" name="is_notify" value="{$_G['qc']['connect_is_notify']}" />
  699. <input type="hidden" id="is_feed" name="is_feed" value="{$_G['qc']['connect_is_feed']}" />
  700. EOF;
  701. ?><?php return $return;?><?php }
  702. function tpl_register_bottom() {
  703. global $_G;
  704. $loginhash = 'L'.random(4);
  705. $change_qq_url = $_G['connect']['discuz_change_qq_url'];
  706. $qq_nick = $_G['qc']['qq_nick'];
  707. $connect_app_id = $_G['qc']['connect_app_id'];
  708. $connect_openid = $_G['qc']['connect_openid'];
  709. $connect_tab_1 = $_GET['ac'] != 'bind' && $_G['setting']['regconnect'] ? ' class="a"' : '';
  710. $connect_tab_2 = $_GET['ac'] == 'bind' ? ' class="a"' : '';?><?php
  711. $js2 = <<<EOF
  712. EOF;
  713. if($_GET['ac'] == 'bind' || $_G['setting']['regconnect']) {
  714. $js2 .= <<<EOF
  715. <div id="loggingbox" class="loggingbox">
  716. <div class="loging_tit cl">
  717. <div class="z avt" style="display:block;"><img src="{$_G['connect']['avatar_url']}/{$connect_app_id}/{$connect_openid}" width="48" height="48" /></div>
  718. <div class="z">
  719. <p class="welcome mbn cl" style="clear:both; width:100%; "><strong>Hi</strong>,<strong>{$_G['member']['username']}</strong>, <span class="xg2">欢迎使用QQ帐号登录 {$_G['setting']['bbname']}</span></p>
  720. <ul class="tb cl z">
  721. <li id="connect_tab_1"{$connect_tab_1}><a id="loginlist" href="javascript:;" onclick="connect_switch(1);this.blur();" tabindex="900">创建新帐号</a></li>
  722. <li id="connect_tab_2"{$connect_tab_2}><a id="loginlist2" href="javascript:;" onclick="connect_switch(2);this.blur();" tabindex="900">已有本站帐号</a></li>
  723. </ul>
  724. </div>
  725. </div>
  726. </div>
  727. EOF;
  728. }
  729. $js2 .= <<<EOF
  730. EOF;
  731. ?><?php $js2 = str_replace(array("'", "\r", "\n"), array("\'", '', ''), $js2);?><?php
  732. $__FORMHASH = FORMHASH;$__IMGDIR = IMGDIR;$return = <<<EOF
  733. <div class="b1lr">
  734. <form method="post" autocomplete="off" name="login" id="loginform_{$loginhash}" class="cl"
  735. EOF;
  736. if($_G['setting']['regconnect']) {
  737. $return .= <<<EOF
  738. style="display:none"
  739. EOF;
  740. }
  741. $return .= <<<EOF
  742. onsubmit="ajaxpost('loginform_{$loginhash}', 'returnmessage4', 'returnmessage4', 'onerror');return false;" action="member.php?mod=connect&amp;action=login&amp;loginsubmit=yes
  743. EOF;
  744. if(!empty($_GET['handlekey'])) {
  745. $return .= <<<EOF
  746. &amp;handlekey={$_GET['handlekey']}
  747. EOF;
  748. }
  749. $return .= <<<EOF
  750. &amp;loginhash={$loginhash}">
  751. <div class="c cl bm_c">
  752. <input type="hidden" name="formhash" value="{$__FORMHASH}" />
  753. <input type="hidden" name="referer" value="{$_G['qc']['dreferer']}" />
  754. <input type="hidden" id="auth_hash" name="auth_hash" value="{$_G['qc']['connect_auth_hash']}" />
  755. <input type="hidden" id="is_notify" name="is_notify" value="{$_G['qc']['connect_is_notify']}" />
  756. <input type="hidden" id="is_feed" name="is_feed" value="{$_G['qc']['connect_is_feed']}" />
  757. EOF;
  758. if($_G['qc']['uinlimit']) {
  759. $return .= <<<EOF
  760. <!--<div class="bm xi1 xw1"><div class="bm_c"><img src="{$__IMGDIR}/connect_qq.gif" alt="QQ" class="vm" />&nbsp;您的QQ帐号在本站注册的帐号数量达到上限,请绑定已有帐号,或<a href="{$change_qq_url}">更换其他QQ账号</a></div></div>-->
  761. <div class="rfm">
  762. <table>
  763. <tr>
  764. <th><img src="{$__IMGDIR}/connect_qq.gif" alt="QQ" class="mtn" /></th>
  765. <td>
  766. 您的QQ帐号在本站注册的帐号数量达到上限,请绑定已有帐号,或<a href="{$change_qq_url}">更换其他QQ账号</a>
  767. </td>
  768. </tr>
  769. </table>
  770. </div>
  771. EOF;
  772. }
  773. $return .= <<<EOF
  774. <div class="rfm">
  775. <table>
  776. <tr>
  777. <th>
  778. EOF;
  779. if($_G['setting']['autoidselect']) {
  780. $return .= <<<EOF
  781. <label for="username">帐号:</label>
  782. EOF;
  783. } else {
  784. $return .= <<<EOF
  785. <span class="login_slct">
  786. <select name="loginfield" style="float: left;" width="45" id="loginfield_{$loginhash}">
  787. <option value="username">用户名</option>
  788. <option value="uid">UID</option>
  789. <option value="email">Email</option>
  790. </select>
  791. </span>
  792. EOF;
  793. }
  794. $return .= <<<EOF
  795. </th>
  796. <td><input type="text" name="username" id="username_{$loginhash}" autocomplete="off" size="36" class="txt" tabindex="1" value="{$username}" /></td>
  797. </tr>
  798. </table>
  799. </div>
  800. <div class="rfm">
  801. <table>
  802. <tr>
  803. <th><label for="password3_{$loginhash}">密码:</label></th>
  804. <td><input type="password" id="password3_{$loginhash}" name="password" size="36" class="txt" tabindex="1" /></td>
  805. </tr>
  806. </table>
  807. </div>
  808. <div class="rfm">
  809. <table>
  810. <tr>
  811. <th>安全提问:</th>
  812. <td><select id="loginquestionid_{$loginhash}" width="213" name="questionid" onchange="if($('loginquestionid_{$loginhash}').value > 0) $('loginanswer_row_{$loginhash}').style.display=''; else $('loginanswer_row_{$loginhash}').style.display='none'">
  813. <option value="0">安全提问(未设置请忽略)</option>
  814. <option value="1">母亲的名字</option>
  815. <option value="2">爷爷的名字</option>
  816. <option value="3">父亲出生的城市</option>
  817. <option value="4">您其中一位老师的名字</option>
  818. <option value="5">您个人计算机的型号</option>
  819. <option value="6">您最喜欢的餐馆名称</option>
  820. <option value="7">驾驶执照最后四位数字</option>
  821. </select></td>
  822. </tr>
  823. </table>
  824. </div>
  825. <div class="rfm" id="loginanswer_row_{$loginhash}" style="display:none">
  826. <table>
  827. <tr>
  828. <th>答案:</th>
  829. <td><input type="text" name="answer" id="loginanswer_{$loginhash}" autocomplete="off" size="36" class="txt" tabindex="1" /></td>
  830. </tr>
  831. </table>
  832. </div>
  833. <div class="rfm">
  834. <table>
  835. <tr>
  836. <th></th>
  837. <td>
  838. <p><label for="use_qqshow_bind"><input type="checkbox" name="use_qqshow" id="use_qqshow_bind" class="pc" value="1" checked="checked" tabindex="1" /> <span title="QQ秀将展示在论坛帖子左侧和个人空间首页">使用QQ秀形象</span></label></p>
  839. </td>
  840. </tr>
  841. </table>
  842. </div>
  843. </div>
  844. <div class="rfm mbw bw0">
  845. <table>
  846. <tr>
  847. <th>&nbsp;</th>
  848. <td><button class="pn pnc" type="submit" name="loginsubmit" value="true" tabindex="1"><strong>绑定帐号</strong></button></td>
  849. </tr>
  850. </table>
  851. </div>
  852. </form>
  853. </div>
  854. <style type="text/css">
  855. .loggingbox { width: 760px; margin: 40px auto 0; }
  856. .loging_tit { border-bottom: 1px solid #CCC; _overflow:hidden; }
  857. .ie_all .loging_tit { height:66px;}
  858. .loggingbox .fm_box { border-bottom:0; padding: 20px 0; }
  859. .loggingbox .welcome { font-size:14px; width:100%; line-height:30px;}
  860. .loggingbox .welcome span { font-size:12px; }
  861. .loggingbox .avt img { margin: 0 5px 5px 0; padding:0; border:0; width:60px; height:60px; }
  862. .loggingbox .tb{ border-bottom: 0; margin-top: 0; padding-left: 0px; }
  863. .loggingbox .tb a { background:#F6F6F6; padding:0 20px; }
  864. .loggingbox .tb .a a { background:#FFF; }
  865. </style>
  866. <script type="text/javascript">
  867. EOF;
  868. if($_G['setting']['regconnect']) {
  869. $return .= <<<EOF
  870. $('reginfo_a').parentNode.className = '';
  871. $('{$_G['setting']['reginput']['password']}').parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
  872. $('{$_G['setting']['reginput']['username']}').outerHTML += '{$js1}';
  873. $('{$_G['setting']['reginput']['password']}').required = 0;
  874. $('{$_G['setting']['reginput']['password2']}').parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
  875. $('{$_G['setting']['reginput']['password2']}').required = 0;
  876. $('main_hnav').outerHTML = '{$js2}';
  877. function connect_switch(op) {
  878. $('returnmessage4').className='';
  879. $('returnmessage4').innerHTML='';
  880. if(op == 1) {
  881. $('loginform_{$loginhash}').style.display='none';$('registerform').style.display='block';
  882. $('connect_tab_1').className = 'a';
  883. $('connect_tab_2').className = '';
  884. //$('connect_login_register_tip').style.display = '';
  885. //$('connect_login_bind_tip').style.display = 'none';
  886. } else {
  887. $('loginform_{$loginhash}').style.display='block';$('registerform').style.display='none';
  888. $('connect_tab_2').className = 'a';
  889. $('connect_tab_1').className = '';
  890. //$('connect_login_register_tip').style.display = 'none';
  891. //$('connect_login_bind_tip').style.display = '';
  892. }
  893. }
  894. function connect_use_available(value) {
  895. $('{$_G['setting']['reginput']['username']}').value = value;
  896. checkusername(value);
  897. }
  898. EOF;
  899. if($_G['qc']['uinlimit']) {
  900. $return .= <<<EOF
  901. $('registerformsubmit').disabled = true;
  902. EOF;
  903. } if($_GET['action'] != 'activation') {
  904. $return .= <<<EOF
  905. $('registerformsubmit').innerHTML = '<span>完成,继续浏览</span>';
  906. EOF;
  907. } } else {
  908. $return .= <<<EOF
  909. $('layer_reginfo_t').innerHTML = '绑定已有帐号';
  910. EOF;
  911. } if($_GET['action'] != 'activation') { if(!$_G['setting']['autoidselect']) {
  912. $return .= <<<EOF
  913. simulateSelect('loginfield_{$loginhash}');
  914. EOF;
  915. } } if($_G['setting']['regconnect'] && $_GET['ac'] != 'bind') {
  916. $return .= <<<EOF
  917. function connect_get_user_info() {
  918. var x = new Ajax();
  919. x.get('connect.php?mod=user&op=get&hash={$__FORMHASH}&inajax=1&_r='+Math.random(), function(s){
  920. var nick = s;
  921. if(nick) {
  922. document.getElementById('{$_G['setting']['reginput']['username']}').value = nick;
  923. }
  924. });
  925. }
  926. window.load=connect_get_user_info();
  927. EOF;
  928. }
  929. $return .= <<<EOF
  930. </script>
  931. EOF;
  932. ?><?php return $return;?><?php }
  933. function tpl_spacecp_profile_bottom() {
  934. global $_G;?><?php
  935. $__FORMHASH = FORMHASH;$return = <<<EOF
  936. <script type="text/javascript">
  937. function connect_handle_get_weibosign(response, ajax) {
  938. // 返回值形如: errCode=XX&result=XX
  939. if (typeof(response) == "string" && response.indexOf("&") > 0) {
  940. var errCode = response.substring(0, response.indexOf("&"));
  941. errCode = errCode.substring(errCode.indexOf("=") + 1);
  942. var result = response.substring(response.indexOf("&") + 1);
  943. result = result.substring(result.indexOf("=") + 1);
  944. response = {"errCode" : errCode, "result" : result};
  945. } else {
  946. return false;
  947. }
  948. if (response.errCode == '0') {
  949. seditor_insertunit('sightml', response.result);
  950. } else {
  951. // 请求失败
  952. showDialog('网络繁忙,暂时无法使用腾讯微博签名档功能');
  953. }
  954. }
  955. function connect_get_weibosign() {
  956. var sign_url = '{$_G['siteurl']}connect.php?mod=config&op=weibosign&hash={$__FORMHASH}&_r='+Math.random();
  957. var get_weibosign_ajax = Ajax("HTML", null);
  958. get_weibosign_ajax.get(sign_url, connect_handle_get_weibosign);
  959. }
  960. if($('sightmlsml')) {
  961. var a = document.createElement('a');
  962. a.href = 'javascript:void(0);';
  963. a.style.background = 'url(' + STATICURL + 'image/common/weibo.png) no-repeat 0 2px';
  964. a.onmouseover = function () { showTip(this); };
  965. a.onclick = connect_get_weibosign;
  966. a.setAttribute('tip', '插入腾讯微博做为论坛签名,可第一时间将您的微博最新信息展示给本站的会员和游客');
  967. $('sightmlsml').parentNode.appendChild(a);
  968. }
  969. </script>
  970. EOF;
  971. ?><?php return $return;?><?php }?>