Example #1
0
     }
 }
 $action = $params['action'];
 $type = $params['type'];
 $query = $params['query'];
 $page = $params['page'];
 $limit = $params['limit'];
 $sort = $params['sort'];
 if ($action == "search") {
     $data = searchExperiments($query, $page, $limit, $sort);
 } else {
     if ($sort == "default" || $sort == "recent") {
         $data = browseExperimentsByRecent($page, $limit, true);
     } else {
         if ($sort == "popularity") {
             $data = browseExperimentsByPopular($page, $limit, true);
         } else {
             if ($sort == "activity") {
                 $data = browseExperimentsByActivity($page, $limit, true);
             } else {
                 if ($sort == "rating") {
                     $data = browseExperimentsByRating($page, $limit, true);
                 }
             }
         }
     }
 }
 if (count($data) > 0) {
     for ($i = 0; $i < count($data); $i++) {
         $imgs = getImagesForExperiment($data[$i]['meta']['experiment_id']);
         if (count($imgs) > 0) {
Example #2
0
 } else {
     if ($type == "people") {
         $results = browsePeople($page, $limit);
         $count = browsePeople(-1, $limit);
     } else {
         if ($type == "activities") {
             $results = browseActivities($page, $limit);
             $count = browseActivities(-1, $limit);
         } else {
             if ($sort == "default" || $sort == "recent") {
                 $results = browseExperimentsByRecent($page, $limit);
                 $count = browseExperimentsByRecent(-1, $limit);
             } else {
                 if ($sort == "popularity") {
                     $results = browseExperimentsByPopular($page, $limit);
                     $count = browseExperimentsByPopular(-1, $limit);
                 } else {
                     if ($sort == "activity") {
                         $results = browseExperimentsByActivity($page, $limit);
                         $count = browseExperimentsByActivity(-1, $limit);
                     } else {
                         if ($sort == "rating") {
                             $results = browseExperimentsByRating($page, $limit);
                             $count = browseExperimentsByRating(-1, $limit);
                         }
                     }
                 }
             }
         }
     }
 }