示例#1
0
        die(json_encode(array('success' => 0, 'message' => 'Cannot load school.', 'request' => $request_message_specific)));
    }
    if ($college->latitude == 0 || $college->longitude == 0) {
        die(json_encode(array('success' => 0, 'message' => 'Cannot locate school.', 'request' => $request_message_specific)));
    }
    // new school, add to database
    $college->updateDatabase($db);
}
// add friend to hs
$db->addAssociation($friend, $curhs->id, AssociationTypes::HighSchool);
// add friend to college
$db->addAssociation($friend, $college->id, AssociationTypes::College);
// add concentrations
if (!$concentrations) {
    foreach ($concentrations as $fb_concentration) {
        $concentration = new Concentration($fb_concentration['id']);
        if (!$concentration->fromDatabase($db)) {
            // try getting cached data from db
            // if we fail, this concentration doesn't exist yet
            $concentration->fromFacebook($facebook);
            $concentration->updateDatabase($db);
        }
        $db->addAssociation($friend, $concentration->id, AssociationTypes::Concentration);
    }
}
// add student
$friend->year = $curyear;
$friend->updateDatabase($db);
$feed = array('link' => AppInfo::getPageUrl("/?school=" . $curhs->id . "&year=" . $curyear), 'picture' => 'http://home.web2go.com/basic/nfpi/3.90/ql/0/0/lg?' . $college->imageurl, 'name' => $curhs->name . ' class of ' . $curyear . ' College Map', 'description' => 'Your friend ' . $myself->name . ' added you to ' . $college->name . ' on the college map for ' . $curhs->name . ' class of ' . $curyear);
$school = array('id' => $college->id, 'name' => $college->name, 'image' => $college->imageurl, 'location' => array('latitude' => (int) $college->latitude, 'longitude' => (int) $college->longitude));
echo json_encode(array('success' => 1, 'message' => 'Friend added.', 'feed' => $feed, 'school' => $school));
示例#2
0
						<li>We cache the following information about you in our databases: your name, your Facebook ID, your high school graduation year, your school rank (if you provided it), an link to your profile picture, and your education history (from your profile).</li>
						<li>All information we store are for caching purposes only (so the site will load faster), and we will NEVER sell your information.</li>
						<li>If you choose to remove yourself via the "Delete" button, all the information we have about you will be wiped from our databases.</li>
						<li>If you add your friend to the map, this applies to them too.</li>
					</ul>
				</div>
			</div>
			<div id="credits_modal" class="modal hide fade">
				<div class="modal-header">
					<a href="#" class="close">&times;</a>
					<h3>Credits</h3>
				</div>
				<div class="modal-body">
					<p>This has been Yifan's attempt at making a real web app. He designed, coded, and tested this site by himself, so please excuse the quality. You can find his site <a href="http://yifan.lu/" target="_blank">here</a>. UI elements are courtesy of <a href="http://ckrack.github.com/fbootstrapp/" target="_blank">Fbootstrapp</a>. Javascript code is powered by <a href="http://jquery.com/" target="_blank">jQuery</a>. The app icon is from <a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">FamFamFam silk icon set</a>. Thanks to anyone forgotten. Bug reports should be directed <a href="https://www.facebook.com/CollegesMapCommunity" target="_blank">to the creator directly</a>. If you don't know him… well, your problem will never be solved.</p>
				</div>
			</div>
		</div>
		<div id="content">
			<div class="messagebox" id="message" style="display:none;"></div>
			<div class="map" id="map_canvas"></div>
			<div class="comments">
				<div class="fb-comments" data-href="<?php 
echo he(AppInfo::getPageUrl('/?school=' . $curhs->id . '&year=' . $curyear));
?>
" data-num-posts="4"></div>
			</div>
		</div>
		<footer>Made with love by <a href="http://yifan.lu/" target="_blank">Yifan Lu</a> &bull; <a href="#" data-controls-modal="privacy_modal" data-backdrop="true" data-keyboard="true">Privacy Policy</a> &bull; <a href="#" data-controls-modal="credits_modal" data-backdrop="true" data-keyboard="true">Credits</a> &bull; <a href="https://www.facebook.com/CollegesMapCommunity" target="_blank">Community</a></footer>
	</body>
</html>