<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>肖建彬的博客 &#187; facebook</title>
	<atom:link href="http://www.xiaojb.com/archives/tag/facebook/feed" rel="self" type="application/rss+xml" />
	<link>http://www.xiaojb.com</link>
	<description>奋斗无止境 爱拼才会赢</description>
	<lastBuildDate>Sun, 16 Oct 2011 14:27:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>facebook首页的php源码泄漏?</title>
		<link>http://www.xiaojb.com/archives/it/facebook-home-page-php-code.shtml</link>
		<comments>http://www.xiaojb.com/archives/it/facebook-home-page-php-code.shtml#comments</comments>
		<pubDate>Mon, 13 Aug 2007 02:39:21 +0000</pubDate>
		<dc:creator>xjb</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[Pagerank]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.xiaojb.com/archives/it/facebook-home-page-php-code.shtml</guid>
		<description><![CDATA[来源：http://facebooksecrets.blogspot.com/2007/08/facebook-home-page-code.html]]></description>
			<content:encoded><![CDATA[<p>来源：<a href="http://facebooksecrets.blogspot.com/2007/08/facebook-home-page-code.html">http://facebooksecrets.blogspot.com/2007/08/facebook-home-page-code.html<br />
</a><br />
<coolcode lang="php"><br />
<?php</p>
<p>include_once $_SERVER['PHP_ROOT'].'/html/init.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/home.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/requests.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/feed/newsfeed.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/poke.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/share.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/orientation.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/feed/newsfeed.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/mobile/register.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/forms_lib.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/contact_importer/contact_importer.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/feed/util.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/hiding_prefs.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/abtesting.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/friends.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/statusupdates.php';</p>
<p>// lib/display/feed.php has to be declared here for scope issues.<br />
// This keeps display/feed.php cleaner and easier to understand.<br />
include_once $_SERVER['PHP_ROOT'].'/lib/display/feed.php';<br />
include_once $_SERVER['PHP_ROOT'].'/lib/monetization_box.php';</p>
<p>// require login<br />
$user = require_login();<br />
print_time('require_login');<br />
param_request(array( 'react' => $PARAM_EXISTS));</p>
<p>// Check and fix broken emails<br />
// LN &#8211; disabling due to excessive can_see dirties and sets when enabled.<br />
//check_and_fix_broken_emails($user);</p>
<p>// migrate AIM screenname from profile to screenname table if needed<br />
migrate_screenname ($user);</p>
<p>// homepage announcement variables<br />
$HIDE_ANNOUNCEMENT_BIT = get_site_variable(&#8216;HIDE_ANNOUNCEMENT_BIT&#8217;);<br />
$HIDE_INTRO_BITMASK = get_site_variable(&#8216;HIDE_INTRO_BITMASK&#8217;);</p>
<p>// redirects<br />
if (is_sponsor_user()) {<br />
  redirect(&#8216;bizhome.php&#8217;, &#8216;www&#8217;);<br />
 }</p>
<p>include_once $_SERVER['PHP_ROOT'].&#8217;/lib/mesg.php&#8217;;<br />
include_once $_SERVER['PHP_ROOT'].&#8217;/lib/invitetool.php&#8217;;<br />
include_once $_SERVER['PHP_ROOT'].&#8217;/lib/grammar.php&#8217;;<br />
include_once $_SERVER['PHP_ROOT'].&#8217;/lib/securityq.php&#8217;;<br />
include_once $_SERVER['PHP_ROOT'].&#8217;/lib/events.php&#8217;;<br />
include_once $_SERVER['PHP_ROOT'].&#8217;/lib/rooster/stories.php&#8217;;</p>
<p>// todo: password confirmation redirects here (from html/reset.php),<br />
// do we want a confirmation message?</p>
<p>param_get_slashed(array(<br />
            &#8216;feeduser&#8217; => $PARAM_INT, //debug: gets feed for user here<br />
            &#8216;err&#8217; => $PARAM_STRING, // returning from a failed entry on an orientation form<br />
            &#8216;error&#8217; => $PARAM_STRING, // an error can also be here because the profile photo upload code is crazy<br />
            &#8216;ret&#8217; => $PARAM_INT,<br />
            &#8216;success&#8217; => $PARAM_INT, // successful profile picture upload<br />
            &#8216;jn&#8217; => $PARAM_INT, // joined a network for orientation<br />
            &#8216;np&#8217; => $PARAM_INT, // network pending (for work/address network)<br />
            &#8216;me&#8217; => $PARAM_STRING, // mobile error<br />
            &#8216;mr&#8217; => $PARAM_EXISTS, // force mobile reg view<br />
            &#8216;mobile&#8217; => $PARAM_EXISTS, // mobile confirmation code sent<br />
            &#8216;jif&#8217; => $PARAM_EXISTS, // just imported friends<br />
            &#8216;ied&#8217; => $PARAM_STRING, // import email domain<br />
            &#8216;o&#8217; => $PARAM_EXISTS, // first time orientation, passed on confirm<br />
            &#8216;verified&#8217; => $PARAM_EXISTS)); // verified mobile phone</p>
<p>param_post(array(<br />
         &#8216;leave_orientation&#8217; => $PARAM_EXISTS,<br />
         &#8216;show_orientation&#8217; => $PARAM_INT, // show an orientation step<br />
         &#8216;hide_orientation&#8217; => $PARAM_INT)); // skip an orientation step</p>
<p>// homepage actions<br />
if ($req_react &#038;&#038; validate_expiring_hash($req_react, $GLOBALS['url_md5key'])) {<br />
  $show_reactivated_message = true;<br />
 } else {<br />
  $show_reactivated_message = false;<br />
 }<br />
tpl_set(&#8216;show_reactivated_message&#8217;, $show_reactivated_message);</p>
<p>// upcoming events<br />
events_check_future_events($user); // make sure big tunas haven&#8217;t moved around<br />
$upcoming_events = events_get_imminent_for_user($user);</p>
<p>// this is all stuff that can be fetched together!<br />
$upcoming_events_short = array();<br />
obj_multiget_short(array_keys($upcoming_events), true, $upcoming_events_short);<br />
$new_pokes = 0;<br />
//only get the next N pokes for display<br />
//where N is set in the dbget to avoid caching issues<br />
$poke_stats = get_num_pokes($user);<br />
get_next_pokes($user, true, $new_pokes);<br />
$poke_count = $poke_stats['unseen'];</p>
<p>$targeted_data = array();<br />
home_get_cache_targeted_data($user, true, $targeted_data);<br />
$announcement_data = array();<br />
home_get_cache_announcement_data($user, true, $announcement_data);<br />
$orientation = 0;<br />
orientation_get_status($user, true, $orientation);<br />
$short_profile = array();<br />
profile_get_short($user, true, $short_profile);<br />
// pure priming stuff<br />
privacy_get_network_settings($user, true);<br />
$presence = array();<br />
mobile_get_presence_data($user, true, $presence);<br />
feedback_get_event_weights($user, true);<br />
// Determine if we want to display the feed intro message<br />
$intro_settings = 0;<br />
user_get_hide_intro_bitmask($user, true, $intro_settings);<br />
$user_friend_finder = true;<br />
contact_importer_get_used_friend_finder($user, true, $used_friend_finder);<br />
$all_requests = requests_get_cache_data($user);<br />
// FIXME?: is it sub-optimal to call this both in requests_get_cache_data and here?<br />
$friends_status = statusupdates_get_recent($user, null, 3);<br />
memcache_dispatch(); // populate cache data</p>
<p>// Merman&#8217;s Admin profile always links to the Merman&#8217;s home<br />
if (user_has_obj_attached($user)) {<br />
  redirect(&#8216;mhome.php&#8217;, &#8216;www&#8217;);<br />
 }</p>
<p>if (is_array($upcoming_events)) {<br />
  foreach ($upcoming_events as $event_id => $data) {<br />
    $upcoming_events[$event_id]['name'] = txt_set($upcoming_events_short[$event_id]['name']);<br />
  }<br />
 }</p>
<p>tpl_set(&#8216;upcoming_events&#8217; , $upcoming_events);</p>
<p>// disabled account actions<br />
$disabled_warning = ((IS_DEV_SITE || IS_QA_SITE) &#038;&#038; is_disabled_user($user));<br />
tpl_set(&#8216;disabled_warning&#8217;, $disabled_warning);</p>
<p>// new pokes (no more messages here, they are in the top nav!)<br />
if (!user_is_guest($user)) {<br />
  tpl_set(&#8216;poke_count&#8217; , $poke_count);<br />
  tpl_set(&#8216;pokes&#8217; , $new_pokes);<br />
 }</p>
<p>// get announcement computations<br />
tpl_set(&#8216;targeted_data&#8217; , $targeted_data);<br />
tpl_set(&#8216;announcement_data&#8217; , $announcement_data);</p>
<p>// birthday notifications<br />
tpl_set(&#8216;birthdays&#8217; , $birthdays = user_get_birthday_notifications($user, $short_profile));<br />
tpl_set(&#8216;show_birthdays&#8217; , $show_birthdays = (count($birthdays) || !$orientation));</p>
<p>// user info<br />
tpl_set(&#8216;first_name&#8217; , user_get_first_name(txt_set($short_profile['id'])));<br />
tpl_set(&#8216;user&#8217; , $user);</p>
<p>// decide if there are now any requests to show<br />
$show_requests = false;<br />
foreach ($all_requests as $request_category) {<br />
  if ($request_category) {<br />
    $show_requests = true;<br />
    break;<br />
  }<br />
}<br />
tpl_set(&#8216;all_requests&#8217;, $show_requests ? $all_requests : null);</p>
<p>$permissions = privacy_get_reduced_network_permissions($user, $user);</p>
<p>// status<br />
$user_info = array(&#8216;user&#8217; => $user,<br />
           &#8216;firstname&#8217; => user_get_first_name($user),<br />
           &#8216;see_all&#8217; => &#8216;/statusupdates/?ref=hp&#8217;,<br />
           &#8216;profile_pic&#8217; => make_profile_image_src_direct($user, &#8216;thumb&#8217;),<br />
           &#8216;square_pic&#8217; => make_profile_image_src_direct($user, &#8216;square&#8217;));</p>
<p>if (!empty($presence) &#038;&#038; $presence['status_time'] > (time() &#8211; 60*60*24*7)) {<br />
  $status = array(&#8216;message&#8217; => txt_set($presence['status']),<br />
          &#8216;time&#8217; => $presence['status_time'],<br />
          &#8216;source&#8217; => $presence['status_source']);<br />
 } else {<br />
  $status = array(&#8216;message&#8217; => null, &#8216;time&#8217; => null, &#8216;source&#8217; => null);<br />
 }<br />
tpl_set(&#8216;user_info&#8217;, $user_info);</p>
<p>tpl_set(&#8216;show_status&#8217;, $show_status = !$orientation);<br />
tpl_set(&#8216;status&#8217;, $status);<br />
tpl_set(&#8216;status_custom&#8217;, $status_custom = mobile_get_status_custom($user));<br />
tpl_set(&#8216;friends_status&#8217;, $friends_status);</p>
<p>// orientation<br />
if ($orientation) {<br />
  if ($post_leave_orientation) {<br />
    orientation_update_status($user, $orientation, 2);<br />
    notification_notify_exit_orientation($user);<br />
    dirty_user($user);<br />
    redirect(&#8216;home.php&#8217;);<br />
  } else if (orientation_eligible_exit(array(&#8216;uid&#8217;=>$user)) == 2) {<br />
    orientation_update_status($user, $orientation, 1);<br />
    notification_notify_exit_orientation($user);<br />
    dirty_user($user);<br />
    redirect(&#8216;home.php&#8217;);<br />
  }<br />
 }</p>
<p>// timezone &#8211; outside of stealth, update user&#8217;s timezone if necessary<br />
$set_time = !user_is_alpha($user, &#8216;stealth&#8217;);<br />
tpl_set(&#8216;timezone_autoset&#8217;, $set_time );<br />
if ($set_time) {<br />
  $daylight_savings = get_site_variable(&#8216;DAYLIGHT_SAVINGS_ON&#8217;);<br />
  tpl_set(&#8216;timezone&#8217;, $short_profile['timezone'] &#8211; ($daylight_savings ? 4 : 5) );<br />
 }</p>
<p>// set next step if we can<br />
if (!$orientation) {<br />
  user_set_next_step($user, $short_profile);<br />
 }</p>
<p>// note: don&#8217;t make this an else with the above statement, because then no news feed stories will be fetched if they&#8217;re exiting orientation<br />
if ($orientation) {<br />
  extract(orientation_get_const());</p>
<p>  require_js(&#8216;js/dynamic_dialog.js&#8217;);<br />
  require_js(&#8216;js/suggest.js&#8217;);<br />
  require_js(&#8216;js/typeahead_ns.js&#8217;);<br />
  require_js(&#8216;js/suggest.js&#8217;);<br />
  require_js(&#8216;js/editregion.js&#8217;);<br />
  require_js(&#8216;js/orientation.js&#8217;);<br />
  require_css(&#8216;css/typeahead.css&#8217;);<br />
  require_css(&#8216;css/editor.css&#8217;);</p>
<p>  if ($post_hide_orientation &#038;&#038; $post_hide_orientation <= $ORIENTATION_MAX) {<br />
    $orientation['orientation_bitmask'] |= ($post_hide_orientation * $ORIENTATION_SKIPPED_MODIFIER);<br />
    orientation_update_status($user, $orientation);<br />
  } else if ($post_show_orientation &#038;&#038; $post_show_orientation <= $ORIENTATION_MAX) {<br />
    $orientation['orientation_bitmask'] &#038;= ~($post_show_orientation * $ORIENTATION_SKIPPED_MODIFIER);<br />
    orientation_update_status($user, $orientation);<br />
  }</p>
<p>  $stories = orientation_get_stories($user, $orientation);<br />
  switch ($get_err) {<br />
  case $ORIENTATION_ERR_COLLEGE:<br />
    $temp = array(); // the affil_retval_msg needs some parameters won't be used<br />
    $stories[$ORIENTATION_NETWORK]['failed_college']=affil_retval_msg($get_ret, $temp, $temp);<br />
    break;<br />
  case $ORIENTATION_ERR_CORP:<br />
    $temp = array();<br />
    // We special case the network not recognized error here, because affil_retval_msg is retarded.<br />
    $stories[$ORIENTATION_NETWORK]['failed_corp'] = ($get_ret == 70) ? 'The email you entered did not match any of our supported networks. ' .<br />
      'Click <a href="/networks/networks.php?view=companies">here</a> to see our supported list. &#8216; .<br />
      &#8216;Go <a href="help.php?tab=suggest">here</a> to suggest your network for the future.&#8217;<br />
      : affil_retval_msg($get_ret, $temp, $temp);<br />
    break;<br />
  }</p>
<p>  // photo upload error<br />
  if ($get_error) {<br />
    $stories[$ORIENTATION_ORDER[$ORIENTATION_PROFILE]]['upload_error'] = pic_get_error_text($get_error);<br />
  }<br />
  // photo upload success<br />
  else if ($get_success == 1) {<br />
    $stories[$ORIENTATION_ORDER[$ORIENTATION_PROFILE]]['uploaded_pic'] = true;<br />
    // join network success<br />
  } else if ($get_jn) {<br />
    $stories[$ORIENTATION_ORDER[$ORIENTATION_NETWORK]]['joined'] = array(<br />
                                     &#8216;id&#8217; => $get_jn,<br />
                                     &#8216;name&#8217; => network_get_name($get_jn));<br />
    // network join pending<br />
  } else if ($get_np) {</p>
<p>    $stories[$ORIENTATION_ORDER[$ORIENTATION_NETWORK]]['join_pending'] = array(<br />
                                           &#8216;id&#8217; => $get_np,<br />
                                           &#8216;email&#8217; => get_affil_email_conf($user, $get_np),<br />
                                           &#8216;network&#8217; => network_get_name($get_np));<br />
    // just imported friend confirmation<br />
  } else if ($get_jif) {<br />
    $stories[$ORIENTATION_ORDER[$ORIENTATION_NETWORK]]['just_imported_friends'] = true;<br />
    $stories[$ORIENTATION_ORDER[$ORIENTATION_NETWORK]]['domain'] = $get_ied;<br />
  }</p>
<p>  // Mobile web API params<br />
  if ($get_mobile) {<br />
    $stories[$ORIENTATION_ORDER[$ORIENTATION_MOBILE]]['sent_code'] = true;<br />
    $stories[$ORIENTATION_ORDER[$ORIENTATION_MOBILE]]['view'] = &#8216;confirm&#8217;;<br />
  }<br />
  if ($get_verified) {<br />
    $stories[$ORIENTATION_ORDER[$ORIENTATION_MOBILE]]['verified'] = true;<br />
  }<br />
  if ($get_me) {<br />
    $stories[$ORIENTATION_ORDER[$ORIENTATION_MOBILE]]['error'] = $get_me;<br />
  }<br />
  if ($get_mr) {<br />
    $stories[$ORIENTATION_ORDER[$ORIENTATION_MOBILE]]['view'] = &#8216;register&#8217;;<br />
  }</p>
<p>  if (orientation_eligible_exit($orientation)) {<br />
    tpl_set(&#8216;orientation_show_exit&#8217;, true);<br />
  }<br />
  tpl_set(&#8216;orientation_stories&#8217;, $stories);</p>
<p>  //if in orientation, we hide all feed intros (all 1&#8242;s in bitmask)<br />
  $intro_settings = -1;</p>
<p> }<br />
tpl_set(&#8216;orientation&#8217;, $orientation);</p>
<p>// Rooster Stories<br />
if (!$orientation &#038;&#038;<br />
    ((get_site_variable(&#8216;ROOSTER_ENABLED&#8217;) == 2) ||<br />
     (get_site_variable(&#8216;ROOSTER_DEV_ENABLED&#8217;) == 2))) {<br />
  $rooster_story_count = get_site_variable(&#8216;ROOSTER_STORY_COUNT&#8217;);<br />
  if (!isset($rooster_story_count)) {<br />
    // Set default if something is wrong with the sitevar<br />
    $rooster_story_count = 2;<br />
  }<br />
  $rooster_stories = rooster_get_stories($user, $rooster_story_count, $log_omissions = true);<br />
  if (!empty($rooster_stories) &#038;&#038; !empty($rooster_stories['stories'])) {<br />
    // Do page-view level logging here<br />
    foreach($rooster_stories['stories'] as $story) {<br />
      rooster_log_action($user, $story, ROOSTER_LOG_ACTION_VIEW);<br />
    }<br />
    tpl_set(&#8216;rooster_stories&#8217;, $rooster_stories);<br />
  }<br />
 }</p>
<p>// set the variables for the home announcement code<br />
$hide_announcement_tpl = ($intro_settings | $HIDE_INTRO_BITMASK) &#038; $HIDE_ANNOUNCEMENT_BIT;<br />
// if on qa/dev site, special rules<br />
$HIDE_INTRO_ON_DEV = get_site_variable(&#8216;HIDE_INTRO_ON_DEV&#8217;);<br />
if ((IS_QA_SITE || IS_DEV_SITE) &#038;&#038; !$HIDE_INTRO_ON_DEV) {<br />
  $hide_announcement_tpl = 0;<br />
 }</p>
<p>tpl_set(&#8216;hide_announcement&#8217;, $hide_announcement_tpl);<br />
if($is_candidate = is_candidate_user($user)) {<br />
  tpl_set(&#8216;hide_announcement&#8217;, false);<br />
 }<br />
$home_announcement_tpl = !$hide_announcement_tpl || $is_candidate ? home_get_announcement_info($user) : 0;<br />
tpl_set(&#8216;home_announcement&#8217;, $home_announcement_tpl);<br />
tpl_set(&#8216;hide_announcement_bit&#8217;, $HIDE_ANNOUNCEMENT_BIT);</p>
<p>$show_friend_finder = !$orientation &#038;&#038; contact_importer_enabled($user) &#038;&#038; !user_get_hiding_pref($user, &#8216;home_friend_finder&#8217;);<br />
tpl_set(&#8216;show_friend_finder&#8217;, $show_friend_finder);<br />
if ($show_friend_finder &#038;&#038; (user_get_friend_count($user) > 20)) {<br />
  tpl_set(&#8216;friend_finder_hide_options&#8217;, array(&#8216;text&#8217;=>&#8217;close&#8217;,<br />
                          &#8216;onclick&#8217;=>&#8221;return clearFriendFinder()&#8221;));<br />
 } else {<br />
  tpl_set(&#8216;friend_finder_hide_options&#8217;, null);<br />
 }</p>
<p>$account_info = user_get_account_info($user);<br />
$account_create_time = $account_info['time'];</p>
<p>tpl_set(&#8216;show_friend_finder_top&#8217;,<br />
    !$used_friend_finder);</p>
<p>tpl_set(&#8216;user&#8217;, $user);</p>
<p>// MONETIZATION BOX<br />
$minimize_monetization_box = user_get_hiding_pref($user, &#8216;home_monetization&#8217;);<br />
$show_monetization_box = (!$orientation &#038;&#038;<br />
              get_site_variable(&#8216;HOMEPAGE_MONETIZATION_BOX&#8217;));<br />
tpl_set(&#8216;show_monetization_box&#8217;, $show_monetization_box);<br />
tpl_set(&#8216;minimize_monetization_box&#8217;, $minimize_monetization_box);</p>
<p>if ($show_monetization_box) {<br />
  $monetization_box_data = monetization_box_user_get_data($user);<br />
  txt_set(&#8216;monetization_box_data&#8217;, $monetization_box_data);<br />
 }</p>
<p>// ORIENTATION<br />
if ($orientation) {<br />
  $network_ids = id_get_networks($user);<br />
  $network_names = multiget_network_name($network_ids);<br />
  $in_corp_network = in_array($GLOBALS['TYPE_CORP'], array_map(&#8216;extract_network_type&#8217;, $network_ids));<br />
  $show_corp_search = $in_corp_network ||<br />
    get_age(user_get_basic_info_attr($user, &#8216;birthday&#8217;)) >= 21;<br />
  $pending_hs = is_hs_pending_user($user);<br />
  $hs_id = null;<br />
  $hs_name = null;<br />
  if ($pending_hs) {<br />
    foreach (id_get_pending_networks($user) as $network) {<br />
      if (extract_network_type($network['network_key']) == $GLOBALS['TYPE_HS']) {<br />
    $hs_id = $network['network_key'];<br />
    $hs_name = network_get_name($hs_id);<br />
    break;<br />
      }<br />
    }<br />
  }<br />
  //$orientation_people = orientation_get_friend_and_inviter_ids($user);<br />
  $orientation_people = array(&#8216;friends&#8217; => user_get_all_friends($user),<br />
                  &#8216;pending&#8217; => array_keys(user_get_friend_requests($user)),<br />
                  &#8216;inviters&#8217;=> array(), // wc: don&#8217;t show inviters for now<br />
                  );<br />
  $orientation_info = array_merge($orientation_people,<br />
                  array(&#8216;network_names&#8217; => $network_names,<br />
                    &#8216;show_corp_search&#8217; => $show_corp_search,<br />
                    &#8216;pending_hs&#8217; => array(&#8216;hs_id&#8217;=>$hs_id,<br />
                                  &#8216;hs_name&#8217;=>$hs_name),<br />
                    &#8216;user&#8217; => $user,<br />
                    ));<br />
  tpl_set(&#8216;orientation_info&#8217;, $orientation_info);</p>
<p>  tpl_set(&#8216;simple_orientation_first_login&#8217;, $get_o); // unused right now<br />
 }</p>
<p>// Roughly determine page length for ads<br />
// first, try page length using right-hand panel<br />
$ads_page_length_data = 3 + // 3 for profile pic + next step<br />
  ($show_friend_finder ? 1 : 0) +<br />
  ($show_status ? ($status_custom ? count($friends_status) : 0) : 0) +<br />
  ($show_monetization_box ? 1 : 0) +<br />
  ($show_birthdays ? count($birthdays) : 0) +<br />
  count($new_pokes);</p>
<p>// page length using feed stories<br />
if ($orientation) {<br />
  $ads_page_length_data = max($ads_page_length_data, count($stories) * 5);<br />
 }<br />
tpl_set(&#8216;ads_page_length_data&#8217;, $ads_page_length_data);</p>
<p>$feed_stories = null;<br />
if (!$orientation) { // if they&#8217;re not in orientation they get other cool stuff<br />
  // ad_insert: the ad type to try to insert for the user<br />
  // (0 if we don&#8217;t want to try an insert)<br />
  $ad_insert = get_site_variable(&#8216;FEED_ADS_ENABLE_INSERTS&#8217;);</p>
<p>  $feed_off = false;</p>
<p>  if (check_super($user) &#038;&#038; $get_feeduser){<br />
    $feed_stories = user_get_displayable_stories($get_feeduser, 0, null, $ad_insert);<br />
  } else if (can_see($user, $user, &#8216;feed&#8217;)) {<br />
    $feed_stories = user_get_displayable_stories($user, 0, null, $ad_insert);<br />
  } else {<br />
    $feed_off = true;<br />
  }</p>
<p>  // Friend&#8217;s Feed Selector &#8211; Requires dev.php constant<br />
  if (is_friendfeed_user($user)) {<br />
    $friendfeed = array();<br />
    $friendfeed['feeduser'] = $get_feeduser;<br />
    $friendfeed['feeduser_name'] = user_get_name($get_feeduser);<br />
    $friendfeed['friends'] = user_get_all_friends($user);<br />
    tpl_set(&#8216;friendfeed&#8217;, $friendfeed);<br />
  }</p>
<p>  $feed_stories = feed_adjust_timezone($user, $feed_stories);</p>
<p>  tpl_set(&#8216;feed_off&#8217;, $feed_off ? redirect(&#8216;privacy.php?view=feeds&#8217;, null, false) : false);<br />
 }<br />
tpl_set(&#8216;feed_stories&#8217;, $feed_stories);</p>
<p>render_template($_SERVER['PHP_ROOT'].&#8217;/html/home.phpt&#8217;);</p>
<p>?></p>
<p></coolcode></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiaojb.com/archives/it/facebook-home-page-php-code.shtml/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

