Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 1.45 KB  |  hits: 28  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. <?php
  2.  
  3. $app_name = "Outbreak: Revenge";
  4. $app_url = "outbreakrevenge";
  5. $app_image = "";
  6. $invite_href = "recruit.php";
  7.  
  8. if(isset($_POST["ids"]))
  9. {
  10.   echo "<fieldset><center>You have recruited ".sizeof($_POST["ids"])." of your friends to play <b><a href=\"http://apps.facebook.com/".$app_url."/\">".$app_name."</a></b>.<br><br>\n</center></fieldset><br>";
  11.   include("index.php");
  12. }
  13. else
  14. {
  15.   $fql = 'SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$user_id.') AND is_app_user = 1';
  16.   $_friends = $facebook->api_client->fql_query($fql);
  17.  
  18.   $friends = array();
  19.   if (is_array($_friends) && count($_friends))
  20.   {
  21.     foreach ($_friends as $friend) { $friends[] = $friend['uid'];
  22.   }
  23. }
  24.  
  25. $friends = implode(',', $friends);
  26. $content = "<fb:name uid=\"".$user."\" firstnameonly=\"true\" shownetwork=\"false\"/> has recruited you to his raiding squad in <a href=\"http://apps.facebook.com/".$app_url."/\">".$app_name."</a>!  \n"."Grab your weapons, join your squad, and avenge the human race from the infected!"."<fb:req-choice url=\"".$facebook->get_add_url()."\" label=\"Join the Hunt!\"/>";
  27.  
  28. ?>
  29.  
  30. <fb:request-form action="<?php echo $invite_href; ?>" method="post" type="<?php echo $app_name; ?>" content="<?php echo htmlentities($content); ?>" image="<?php echo $app_image; ?>"> <fb:multi-friend-selector actiontext="Recruit your friends to help avenge humanity!" exclude_ids="<?php echo $friends; ?>" /> </fb:request-form><br> <?php }
  31.  
  32. ?>