PageRenderTime 23ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/web/renren_test/if/index_bar.php

https://github.com/uning/mall-back
PHP | 443 lines | 350 code | 79 blank | 14 comment | 29 complexity | c54544e6803c1fb3352facd603723d4d MD5 | raw file
  1. <?php
  2. require_once('../config.php');
  3. //
  4. $pid = $_REQUEST['xn_sig_user'];
  5. $gflg = $_REQUEST['glink'];
  6. if($gflg){
  7. $ts = TT::TTWeb();
  8. $data = $ts->getbyid($gflg);
  9. $bids = $data['rfids'];
  10. if(strstr($bids,$pid)){
  11. }else{//给玩家礼物
  12. $flag = $data['gift_id'];
  13. $fconf = ItemConfig::get($flag);//取礼物信息
  14. $tu = TT::TTUser($pid);
  15. //
  16. $bids .=','.$pid;
  17. }
  18. $ts->puto($data);
  19. }
  20. ?>
  21. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  22. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xn="http://www.renren.com/2009/xnml">
  23. <head>
  24. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  25. <?php //include FB_CURR.'/cs/check_connect_redirect.php';?>
  26. <link rel="stylesheet"href="<?php echo RenrenConfig::$resource_urlp;?>css/main.css?2" />
  27. <link rel="shortcut icon"
  28. href="<?php echo RenrenConfig::$resource_urlp;?>images/favicon.ico"
  29. type="image/x-icon" />
  30. <link rel="stylesheet"
  31. href="<?php echo RenrenConfig::$resource_urlp;?>css/boxy.css" type="text/css" />
  32. <link rel='stylesheet'
  33. href='<?php echo RenrenConfig::$resource_urlp;?>css/installbar.css'
  34. type='text/css' />
  35. <script src="<?php echo RenrenConfig::$resource_urlp;?>js/jquery-1.4.2.min.js"></script>
  36. <script src="<?php echo RenrenConfig::$resource_urlp;?>js/jquery.boxy.js"></script>
  37. <script src="<?php echo RenrenConfig::$resource_urlp;?>js/loader.js"></script>
  38. <script src="<?php echo RenrenConfig::$resource_urlp;?>js/stat/common.js"></script>
  39. <script src="<?php echo RenrenConfig::$resource_urlp;?>js/pageUtil.js"></script>
  40. <script type="text/javascript" src="http://static.connect.renren.com/js/v1.0/FeatureLoader.jsp"></script>
  41. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"> </script>
  42. <script type="text/javascript">
  43. // load the flash movie.
  44. //swfobject.embedSWF("/work/mall/Venus/to-company/MallLoader.swf?v=<?php echo md5_file('/work/mall/Venus/to-company/MallLoader.swf');?>", "flashapp", "760", "620", "9.0.0", "playerProductInstall.swf", flashVars, params, attrs);
  45. function install_swf(){
  46. //For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. -->
  47. var swfVersionStr = "10.0.0";
  48. swfVersionStr = "0.0.0";
  49. //<!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
  50. var xiSwfUrlStr = "playerProductInstall.swf";
  51. //get query to it
  52. var flashvars = {};
  53. var hash;
  54. var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
  55. for(var i = 0; i < hashes.length; i++)
  56. {
  57. hash = hashes[i].split('=');
  58. flashvars[hash[0]] = hash[1];
  59. //console.log('query:'+hash[0]+'='+hash[1]);
  60. }
  61. flashvars.platform_id = flashvars.fb_sig_user;
  62. flashvars.pconf = '0_mall_config.xml';
  63. flashvars.languagetype = "0";
  64. flashvars.fb_sig_app_secret = "60d180ac578ce34093b3ce2d1d450f84";
  65. flashvars.platform = "renren";
  66. var flash_width = 760+200;
  67. var flash_height = 700;
  68. var params = {};
  69. params.quality = "high";
  70. params.bgcolor = "#F0F8FF";
  71. params.allowscriptaccess = "always"; // must be always since html is different domain from swf :(
  72. params.allowfullscreen = "true";
  73. params.wmode = "opaque";//opaque
  74. params.flashvars = flashvars;
  75. var attributes = {};
  76. attributes.id = "flash_run_id";
  77. attributes.name = "SuperMall";
  78. attributes.align = "t";
  79. attributes.salign = "tl";
  80. /*flashDivId*/
  81. params.base = "http://127.0.0.1/work/mall/Venus/to-company/";
  82. swfobject.embedSWF(
  83. "/work/mall/Venus/to-company/MallLoader.swf?v=<?php echo md5_file('/work/mall/Venus/to-company/MallLoader.swf');?>", "flashapp",
  84. flash_width, flash_height,
  85. swfVersionStr, xiSwfUrlStr,
  86. flashvars, params, attributes);
  87. //<!-- JavaScript enabled so display the div in case it is not replaced with a swf object. -->
  88. //swfobject.createCSS("flashContainer", "display:block;text-align:left;");
  89. }
  90. install_swf();
  91. </script>
  92. </head>
  93. <body style="overflow: auto;">
  94. <div id="tabs">
  95. <ul>
  96. <li class="first"><a title="free gift" href="../pop/gift.php?">免费礼物</a></li>
  97. <li class="selected" id="flashTab"><a
  98. title='玩游戏' href="#switchToFlash">我的商厦</a></li>
  99. <li><a title="invite friends" href="../pop/invite/invite.php?giftId=42442"
  100. id="invite">邀请好友</a></li>
  101. <li class=''><a
  102. title='论坛'
  103. href='<?php echo RenrenConfig::$app_id;?>'
  104. target='_blank'>论坛</a></li>
  105. </ul>
  106. </div>
  107. <div id="appFrame" class="flashVisible">
  108. <div id="flashFrame"
  109. style="background: black; margin-top: 0px; padding: 0px">
  110. <div id="flashDIV" style="width: 760px; height: 700px; margin-top: 0px;">
  111. <div id="flashOuterContainer" style="margin-top: 0px;">
  112. <div id="flashapp" style="margin-top: 0px;"><span
  113. style="font-size: 19px; font-family: tahoma; color: #4880d7; margin-top: 0px; padding-top: 0px">Loading
  114. Game...</span><br />
  115. <span
  116. style="font-size: 16px; font-family: tahoma; margin-top: 0px; padding-top: 0px">If
  117. your game does not load within 10 seconds, you may need to upgrade your
  118. version of Flash. Please do so by clicking <a
  119. href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BUIGP">here</a></span>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <div id="htmlFrame" class="offscreen" style="width: 760px;">
  126. </div>
  127. <div id="loadingFrame" class="offscreen" style="display: none"><img
  128. src="../static/images/loading.gif" /></div>
  129. <div style="text-align: center; margin-bottom: 10px"><?php echo get_lang('Having trouble to load game');?>? <?php echo get_lang('Please');?> <a
  130. href='http://get.adobe.com/flashplayer/' target="_blank"><?php echo get_lang('update your flash player'); ?></a> <?php echo('by clicking');?> <a
  131. href='http://get.adobe.com/flashplayer/' target="_blank"><?php echo get_lang('Here');?></a>.</div>
  132. <div style="display: none; position: absolute; left: 16px; top: 30.5px;"
  133. id="inviteDiv">
  134. <table cellspacing="0" cellpadding="0" border="0"
  135. class="boxy-wrapper fixed">
  136. <tbody>
  137. <tr>
  138. <td class="top-left"></td>
  139. <td class="top"></td>
  140. <td class="top-right"></td>
  141. </tr>
  142. <tr>
  143. <td class="left"></td>
  144. <td class="boxy-inner">
  145. <div class="title-bar boxy-content">
  146. <h2>&nbsp;</h2>
  147. <a onclick="closeInvite();return false" class="close" href="#">[close]</a></div>
  148. <div class="loading boxy-content" id="invite_loading"
  149. style="display: none;"><img
  150. src="<?php echo RenrenConfig::$resource_urlp;?>images/spinner.gif" /></div>
  151. <div class="boxy-content"><iframe id="inviteFrame" width="728"
  152. height="500" frameborder="0" style="overflow: auto;"
  153. src="pop/blank.php"></iframe></div>
  154. </td>
  155. <td class="right"></td>
  156. </tr>
  157. <tr>
  158. <td class="bottom-left"></td>
  159. <td class="bottom"></td>
  160. <td class="bottom-right"></td>
  161. </tr>
  162. </tbody>
  163. </table>
  164. </div>
  165. <script>
  166. PL.js(['../static/js/jquery-1.4.2.min.js','../static/js/install_bar.js' ],function(){
  167. IBar.bind();
  168. PL.js(['../static/js/jquery.boxy.js'])
  169. });
  170. </script>
  171. <div><input type="button" value="feed me" onclick="popUpFeed();" /></div>
  172. </body>
  173. </html>
  174. <script type="text/javascript">
  175. <!--
  176. var appFrame, flashFrame, loadingFrame, htmlFrame, iframe, oldIframe, tabs, flashTab, preloadedUrls = {}, needToRestore;
  177. var cleanup = function() {
  178. if(oldIframe)
  179. oldIframe.remove();
  180. if (needToRestore) {
  181. preloadUrl(needToRestore);
  182. needToRestore = null;
  183. }
  184. };
  185. var hideFlash = function() {
  186. window.location.hash = '#notOnFlash';
  187. flashFrame.addClass('offscreen');
  188. };
  189. var hideHtml = function() { htmlFrame.addClass('offscreen'); };
  190. var hideLoading = function() {loadingFrame.addClass('offscreen');loadingFrame.css('display','none'); };
  191. var showHtml = function() {
  192. hideLoading();
  193. hideFlash();
  194. htmlFrame.removeClass('offscreen');
  195. appFrame.removeClass('flashVisible');
  196. };
  197. var showLoading = function() {
  198. hideHtml();
  199. hideFlash();
  200. loadingFrame.show();
  201. loadingFrame.removeClass('offscreen');
  202. appFrame.removeClass('flashVisible');
  203. };
  204. var showFlash = function() {
  205. hideHtml();
  206. hideLoading();
  207. flashFrame.removeClass('offscreen');
  208. flashFrame.show();
  209. appFrame.addClass('flashVisible');
  210. oldIframe = iframe;
  211. iframe = false;
  212. tabs.children('a').parent().removeClass('selected');
  213. flashTab.addClass('selected');
  214. setTimeout(cleanup, 1000);
  215. };
  216. var interval, innerDoc, lastHeight;
  217. var innerIFramePoller = function() {
  218. try {
  219. if (iframe == null || (iframe[0].contentWindow && iframe[0].contentWindow.location.hash == "#switchToFlash")) {
  220. iframe && iframe.unbind('load', iframeLoaded);
  221. showFlash();
  222. clearInterval(interval);
  223. interval = null;
  224. if (iframe)
  225. iframe[0].contentWindow.location.hash = '#switched';
  226. } else {
  227. if (!innerDoc || lastHeight == null || lastHeight == 0) {
  228. innerDoc = $(iframe[0].contentWindow.document.body);
  229. }
  230. var height = innerDoc.outerHeight();
  231. if (height != lastHeight) {
  232. iframe.height(height);
  233. lastHeight = height;
  234. }
  235. }
  236. } catch(e) {
  237. }
  238. };
  239. var iframeLoaded = function() {
  240. iframe && iframe.unbind('load', iframeLoaded);
  241. showHtml();
  242. };
  243. var navigateTo = function(url) {
  244. //return;
  245. if (url.match(/^#switchToFlash/)) {
  246. switchToFlash();
  247. return;
  248. }
  249. setupElements();
  250. showLoading();
  251. if (!iframe) {
  252. iframe = createIframe().appendTo(htmlFrame);
  253. }
  254. iframe.load(iframeLoaded);
  255. iframe.attr('src', url);
  256. innerDoc = null; lastHeight = 0;
  257. interval = setInterval(innerIFramePoller, 500);
  258. };
  259. var switchToFlash = function() {
  260. interval && clearInterval(interval);
  261. interval = null;
  262. showFlash();
  263. };
  264. var preloadFuncs = [];
  265. var preloadUrl = function(url) {
  266. var preloader = function(){
  267. var preloadedFrame = createIframe();
  268. preloadedFrame.addClass('preloaded').attr('src', prepUrl(url)).appendTo(htmlFrame).load(function() {
  269. preloadedUrls[url] = preloadedFrame;
  270. });
  271. };
  272. if(preloadFuncs.push){
  273. preloadFuncs.push(preloader);
  274. }
  275. };
  276. var readyToPreload = function() {
  277. setupElements();
  278. var funcs = preloadFuncs;
  279. preloadFuncs = [];
  280. setTimeout(function() {
  281. for (var i = 0; i < funcs.length; ++i) {
  282. funcs[i]();
  283. }
  284. }, 5000);
  285. };
  286. var createIframe = function() {
  287. return $("<iframe/>", {scrolling: 'no', border: '0', frameborder: '0', height: '0'});
  288. };
  289. var setupElements = function() {
  290. appFrame = $('#appFrame');
  291. flashFrame = $('#flashFrame');
  292. loadingFrame = $('#loadingFrame');
  293. htmlFrame = $('#htmlFrame');
  294. flashTab = $('#flashTab');
  295. };
  296. $(document).ready(
  297. function(){
  298. /** Opens an overlaying iframe */
  299. (function() {
  300. var tabClick = function(e) {
  301. if (e && e.target) {
  302. var el = $(e.target);
  303. if (!el.is('a')) {
  304. el = el.parents('a');
  305. }
  306. navigateTo(el.attr('href'));
  307. tabs.children('a').parent().removeClass('selected');
  308. el.parent().addClass('selected');
  309. return false;
  310. }
  311. };
  312. $(function() {
  313. tabs = $('#tabs li');
  314. console.log(tabs.children('a'));
  315. tabs.children('a').not('.fullpage').click(tabClick);
  316. setupElements();
  317. });
  318. })();
  319. });
  320. //-->
  321. var config = {
  322. log:1,//init log? server can force debug, just for develop
  323. fb:1,//init fb?
  324. fbd:1,//init fb debug?
  325. logcb:function(r){//log init callback
  326. console.log('log callback' + window.location.href);
  327. },
  328. after_fbinit: function(){//before FB.init callback
  329. console.log('index after_fbinit');
  330. XN.Main.apiClient.friends_get(Log.info.bind('XN.Main.apiClient.friends_get'));
  331. },
  332. before_fbinit:function(){//after FB.init callback
  333. },
  334. cb:function(){//after config callback
  335. PL.js(['fb_jsflash.js','pageUtil.js']);
  336. }
  337. }
  338. PL.init('../static/js/fb_config.js',config);
  339. </script>
  340. <script type="text/javascript">
  341. function publish_feed(template_id, body_data)
  342. {
  343. template_id = template_id||1;
  344. body_data =body_data|| "body";
  345. var feedSettings = {
  346. template_bundle_id: 1,
  347. template_data: {images:[
  348. {src:"http://hdn511.xnimg.cn/photos/hdn511/20090330/21/30/head_9Ncx_314828j204236.jpg",
  349. href:"http://xiaonei.com/profile.do?id=240650143"}
  350. ]
  351. ,feedtype:'在购物天堂大发慈悲发布免费礼物'
  352. ,content:',数量有限,欲抢从速 ^o^ '
  353. ,xnuid:PL.conf('pid')
  354. ,action:'feed'
  355. },
  356. body_general: '',
  357. callback: function(ok){console.log('here in feed callback!!');},
  358. user_message_prompt: "有啥想法没?^o^",
  359. user_message: "here user_message"
  360. };
  361. XN.Connect.showFeedDialog(feedSettings);
  362. }
  363. </script>
  364. <?php include FB_CURR.'/cs/gajs_init.php';?>