public static function loadRecommendations($filename) { $f = fopen($filename, "r"); while (!feof($f)) { $l = fgets($f); $l = chop($l); $s = preg_split("@\t@", $l); if (sizeof($s) >= 3) { $u = User::newFromName($s[0]); $t = Title::newFromId($s[1]); $score = intVal($s[2]); if ($u && $t && $score) { RecommendationPresenter::addRecommendation($u, $t, $score); if (sizeof($s) > 3) { $n = 3; while ($n < sizeof($s)) { RecommendationPresenter::addRecommendationReason($u, $t, intVal($s[$n])); $n++; } } } } } }