function getPeopleList($startWith, $count) { $s = mysql_query("\n SELECT id, name, display_name\n FROM people\n LIMIT {$startWith}, {$count}\n "); $ret = array(); while ($r = mysql_fetch_array($s)) { $r['tiny_image'] = getTinyImgUrl($r['id']); $ret[] = $r; } return $ret; } /** * This is hacked up utility used for finding links about people. It will * open a few iframes with a google search for their blog, and their website, * and it will allow me to add links that i get from those google searches. */ $id = (int) $_GET['id']; // A person is selected. Fetch their name. $person = new Person(); $person->setId($id); $person->loadFromDb(); $COUNT = $_GET['count'] ? $_GET['count'] : 15; $start = $_GET['start'] ? $_GET['start'] : 0; $people = getPeopleList($start, $COUNT); $t = new Smarty(); $t->assign('name', $person->displayName); $t->assign('id', $person->id); $t->assign('people', $people); $t->assign('start', $start); $t->assign('prev', $start - $COUNT); $t->assign('next', $start + $COUNT); $t->display('links_searches.tpl');
$room = $_GET['room'] == 'cdep' ? 'cdep' : 'senat'; $csum = $_GET['csum']; $uid = getTagAuthorUid($tagid); // HACK? $year = '2008'; $title = 'Tag "' . getTagNameForId($tagid) . '"'; if (!$_GET['iframe']) { include 'header.php'; } $t = new Smarty(); $t->assign('tag', getTagNameForId($tagid)); $t->assign('description', getTagDescriptionForId($tagid)); $votes = getVotesForTag($room, $year, $tagid, $uid); $possible = sizeof($votes); $t->assign('votes', $votes); $people = getPeopleList($room, $year); $non_zero_people = array(); $zero_people = array(); for ($i = 0; $i < sizeof($people); $i++) { $context = getBeliefContext($room, $year, $uid, $people[$i]['id'], $tagid, $possible, 200); foreach ($context as $key => $value) { $people[$i][$key] = $value; } // Since I'm here, fix a few things. A little hacky. $people[$i]['link'] = "?cid=9&id=" . $people[$i]['id']; $people[$i]['tiny_photo'] = getTinyImgUrl($people[$i]['id']); if ($context['yes_cnt'] + $context['no_cnt'] > 0) { array_push($non_zero_people, $people[$i]); } else { array_push($zero_people, $people[$i]); }