- Stuff
- Thursday, August 16th, 2007 at 10:30:34pm MDT
- /*
- * Facebook Search Code
- * @author Mark Slee
- *
- * @package ubersearch
- */
- safe we are increasing the memory limit for search
- include_once $_SERVER['PHP_ROOT'].'/html
- /init.php'; // final
- lib include
- include_once $_SERVER['PHP_ROOT'].'/lib/s.php';
- include_once $_SERVER['PHP_ROOT'].'/lib/browse.php';
- include_once $_SERVER['PHP_ROOT'].'/lib/events.php';
- include_once $_SERVER['PHP_ROOT'].'/lib/websearch_classifier/websearch_classifier.php';
- flag_allow_guest();
- $user = search_require_login();
- if($_POST) {
- $qs = '?';
- foreach($arr as $key=>$val) {
- }
- redirect($_SERVER['PHP_SELF'].$qs);
- }
- // If they performed a classmates search, these values are
- // needed to pre-populate dropdowns
- 'hs'=>$PARAM_INT,
- 'adv'=>$PARAM_EXISTS,
- 'events'=>$PARAM_EXISTS,
- 'groups'=>$PARAM_EXISTS,
- 'classmate'=>$PARAM_EXISTS,
- 'coworker'=>$PARAM_EXISTS));
- if($pos !== false) {
- } else {
- $hsyear = null;
- }
- tpl_set('hs_id', $hsid);
- tpl_set('hs_name', get_high_school($hsid));
- tpl_set('hs_year', $hsyear);
- tpl_set('is_advanced_search', $get_adv);
- tpl_set('user', $user);
- tpl_set('count_total', 0); // pre-set count_total for the sake of ads
- page length
- // Events search calendar data
- 'n' => $PARAM_SINT));
- if (($get_k == search_module::get_key(SEARCH_MOD_EVENT, SEARCH_TYPE_AS))) {
- $EVENTS_CAL_DAYS_AHEAD = 60;
- (86400 * $EVENTS_CAL_DAYS_AHEAD));
- 'dy2' => $events_end);
- $results = events_get_calendar($user, $get_n, $events_params);
- tpl_set('events_date', $results['events_date']);
- }
- // Holy shit, is this the cleanest fucking frontend file you've ever seen?!
- ubersearch($_GET, $embedded=false, $template=true);
- // Render it
- render_template($_SERVER['PHP_ROOT'].'/html/s.phpt');
- /**
- * login function for s.php
- *
- * @author Philip Fung
- */
- function search_require_login() {
- //check if user is logged in
- $user = require_login(true);
- if($user 0 && !is_unregistered($user)) { return $user; }
- // this is an unregistered user
- (used by rest of ubersearch code)
- ));
- global $get_k;
- $search_key = $get_k;
- //Let user see event or group search if criteria are obeyed
- if ($search_key
- && (search_module::get_key_type($search_key) ==
- SEARCH_MOD_EVENT || search_module::get_key_type($search_key) ==
- SEARCH_MOD_GROUP) //event or group search
- ) {
- return $user;
- } else {
- go_home();
- }
- }
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.