Exemplo n.º 1
0
           $code='<fb:request-form action="'.URL_CANVAS.'?p=share" method="post" type="'.SITE_TITLE_SHORT.'" content="'.htmlentities($content).'" image="'.$image.'">  <fb:multi-friend-selector bypass="******" showborder="false" actiontext="Select friends you wish to share the story with below:" exclude_ids="" /> </fb:request-form> ';
           */
     /*    $code.='<form id="dialog_form" name="dialog_form">' //onsubmit="return false;">';
           $code .= '<p><strong>To:</strong> <fb:multi-friend-input width="350px" border_color="#8496ba" /></p>';
            $code.='</form>';*/
     // TODO: php redirect after submit
     break;
 case 'fetchTeamFriendsList':
     if (isset($_GET['state'])) {
         $state = $_GET['state'];
     } else {
         $state = 'collapsed';
     }
     require_once PATH_FACEBOOK . "/pages/pageTeam.class.php";
     $db->log($userid);
     $code = pageTeam::fetchTeamFriendList($fb->db, $userid, $state, true);
     break;
 case 'fetchHomePage':
     // replace just storyList
     /*
      * 			  	if (isset($_GET['userid']))
     						$userid=$_GET['userid'];
     					else
     						$userid='default';		
     */
     require_once PATH_CORE . "/classes/home.class.php";
     $homeObj = new home();
     $code = $homeObj->fetchHomePage($currentPage);
     break;
 case 'dialogPublish':
     $error = false;
 function fetchTeam($mode = 'fullPage', $page = '', $option = '')
 {
     // fetches team subtab via ajax
     switch ($page) {
         case 'team':
             require_once PATH_FACEBOOK . '/pages/pageTeam.class.php';
             $teamObj = new pageTeam($this);
             $code = $teamObj->fetch($mode, $option);
             break;
         case 'wall':
             require_once PATH_FACEBOOK . '/pages/pageWall.class.php';
             $wallObj = new pageWall($this);
             $code = $wallObj->fetch($mode, $option, $arg3);
             break;
         case 'rewards':
             require_once PATH_FACEBOOK . '/pages/pageRewards.class.php';
             $prizesObj = new pageRewards($this);
             $code = $prizesObj->fetch($mode);
             break;
         case 'winners':
             require_once PATH_FACEBOOK . '/pages/pageRewards.class.php';
             $prizesObj = new pageRewards($this);
             $code = $prizesObj->fetch($mode, 'winners');
             break;
         case 'challenges':
             require_once PATH_FACEBOOK . '/pages/pageChallenges.class.php';
             $challengesObj = new pageChallenges($this);
             $code = $challengesObj->fetch($mode);
             break;
         case 'challengeSubmit':
             require_once PATH_FACEBOOK . '/pages/pageChallengeSubmit.class.php';
             $challengeSubmitObj = new pageChallengeSubmit($this);
             $code = $challengeSubmitObj->fetch($mode);
             break;
         case 'leaders':
             require_once PATH_FACEBOOK . '/pages/pageLeaders.class.php';
             $leadersObj = new pageLeaders($this);
             $code = $leadersObj->fetch($mode, $option);
             break;
         case 'rules':
             require_once PATH_FACEBOOK . '/pages/pageRules.class.php';
             $rulesObj = new pageRules($this);
             $code = $rulesObj->fetch($mode);
             break;
         case 'redeem':
             // check auth for member
             require_once PATH_FACEBOOK . '/pages/pageRedeem.class.php';
             $redeemObj = new pageRedeem($this);
             $code = $redeemObj->fetch($mode);
             break;
         case 'orders':
             // check auth for member
             require_once PATH_FACEBOOK . '/pages/pageOrders.class.php';
             $ordersObj = new pageOrders($this);
             $code = $ordersObj->fetch($mode);
             break;
     }
     return $code;
 }
 static function fetchTeamFriendList($db, $userid, $state = 'expanded', $isAjax = false, $panelTitle)
 {
     if ($userid) {
         $memberfriends = pageTeam::getMemberFriends($db, $userid);
     }
     $code = '<div class="panelBar clearfix"><h2>' . $panelTitle . ' (' . count($memberfriends) . ')</h2>';
     $code .= '<div class="bar_link"><a href="?p=invite" onclick="switchPage(\'invite\');return false;">Invite more</a></div><div id="friendsSeeAll" class="bar_link ' . ($state == 'collapsed' ? '' : 'hidden') . '"><a href="#" onclick="refreshTeamFriendsList(\'expanded\');return false;">See all</a></div>';
     $code .= '<div id="friendsSeeFewer" class="bar_link ' . ($state == 'collapsed' ? 'hidden' : '') . '"><a class="" href="#" onclick="refreshTeamFriendsList(\'collapsed\');return false;">See fewer</a></div>';
     if ($state == 'collapsed') {
         $maxfriends = 6;
     } else {
         $maxfriends = 300;
     }
     $code .= '</div><!--end "panelBar"-->';
     $code .= '<div id="ajaxTeamFriendsList">';
     // using a token to str_replace below because of your need to set maxfriends before building array of pics
     $code .= '{inside}';
     $code .= '</div><!-- end ajaxTeamFriendsList -->';
     $inside = '<div class="panel_block">';
     require_once PATH_CORE . '/classes/template.class.php';
     for ($i = 0; $i < min($maxfriends, count($memberfriends)); $i++) {
         $inside .= '<div class="friend">' . template::buildLinkedProfilePic($memberfriends[$i]) . '</div>';
     }
     $inside .= '</div><!--end "panel_block"-->';
     if ($isAjax) {
         return $inside;
     }
     $code = str_replace('{inside}', $inside, $code);
     return $code;
 }