Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Błąd w kodzie (konstrukcja if).
kiepski96
post
Post #1





Grupa: Zarejestrowani
Postów: 233
Pomógł: 0
Dołączył: 22.02.2010

Ostrzeżenie: (0%)
-----


Witam, mam kod i coś nie działa (IMG:style_emoticons/default/biggrin.gif)
Mógłbym prosić o poprawę albo chociaż podpowiedzi ?

  1. <?php
  2. $unlock1 = true;
  3. $unlock2 = true;
  4. $name = "Test skryptu Heheszki.pl";
  5. $url = "http://4rapiddev.com/facebook-graph-api/facebook-publish-to-wall-with-popup-or-dialog-and-call-back/";
  6. $obrazek = "http://4rapiddev.com/wp-content/uploads/2011/09/Example-Publish-To-Wall-With-Popup-Windows.jpg";
  7. $opis = "I have experienced with Share On Wall with Popup windows and would like to share with you. Check it now.";
  8.  
  9. if $unlock1 = true and unlock2 = true
  10. echo "Witaj Świecie";
  11. // Drukujemy początek skryptu
  12. print "<script type='text/javascript'><!--\n";
  13. print "FB.init({\n";
  14. print "appId:'XXX',\n";
  15. print "status : true,\n";
  16. print "cookie : true,\n";
  17. print "xfbml : true\n";
  18. print "});\n";
  19. print "</script>\n";
  20. print "<script type='text/javascript'>\n";
  21. // skrypt łączenia share
  22. print "window.fbAsyncInit = function() {\n";
  23. print "FB.init({\n";
  24. print "appId:'XXX',\n";
  25. print "status : true,\n";
  26. print "cookie : true,\n";
  27. print "xfbml : true\n";
  28. print "});\n";
  29. print "};\n";
  30. print "</script>\n";
  31. print "<script type='text/javascript'>\n";
  32. print "$(document).ready(function(){\n";
  33. print "FB.getLoginStatus(function(response) {\n";
  34. print "if (response.status == 'connected') {\n";
  35. print "var user_id = response.authResponse.userID;\n";
  36. print "var page_id = 'XXX';\n";
  37. print "var fql_query = 'SELECT uid FROM page_fan WHERE page_id =' + page_id + ' and uid=' + user_id;\n";
  38. print "var the_query = FB.Data.query(fql_query);\n";
  39. print "the_query.wait(function(rows) {\n";
  40. print "if (rows.length == 1 && rows[0].uid == user_id) {\n";
  41. print "$unlock1\n";
  42. print "} else {\n";
  43. print "$('#blokada').show();\n";
  44. print "}\n";
  45. print "});\n";
  46. print "} else {\n";
  47. print "}\n";
  48. print "});\n";
  49. print "});\n";
  50. print "</script>\n";
  51. print "<script type='text/javascript'>\n";
  52. print "function streampublish_popup(){\n";
  53. print "FB.ui(\n";
  54. print "{\n";
  55. print "method: 'stream.publish',\n";
  56. print "attachment: {\n";
  57. print "name: '$name',\n";
  58. print "description: ('$opis'\n";
  59. print "),\n";
  60. print "href:'$url'\n";
  61. print "media: [\n";
  62. print "{\n";
  63. print "'type':'image',\n";
  64. print "'src':'$obrazek',\n";
  65. print "'href':'$url'\n";
  66. print "}\n";
  67. print "]\n";
  68. print "},\n";
  69. print "display: 'popup'\n";
  70. print "},\n";
  71. print "function(response) {\n";
  72. print "if (response && response.post_id) {\n";
  73. print "$unlock2\n";
  74. print "} else {\n";
  75. print "$('#blokada').show();\n";;
  76. print "}\n";
  77. print "});\n";
  78. print "}\n";
  79. print "</script>\n";
  80. ?>


Ten post edytował kiepski96 6.06.2012, 18:54:37
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.09.2025 - 15:19