* @return {Array} The array of recently added people. */ function getMostRecentNewPeople() { $s = mysql_query("\n SELECT idperson, value, display_name, name, time\n FROM moderation_queue\n LEFT JOIN people ON people.id = moderation_queue.idperson\n WHERE type='add_person'\n ORDER BY time DESC\n LIMIT 8"); $results = array(); while ($r = mysql_fetch_array($s)) { array_push($results, $r); } return $results; } // current_user is a variable set by Wordpress. $uid = is_user_logged_in() ? $current_user->ID : 0; $user_login = is_user_logged_in() ? $current_user->user_login : ''; $title = 'Profil ' . $user_login; include 'header.php'; // Grab the tags that this user has created for the Senate and for Cdep. $senatTags = getTagsList('senat_2008_votes_details', $uid); $cdepTags = getTagsList('cdep_2008_votes_details', $uid); // Try to display everything. $t = new Smarty(); $t->assign('senatTags', $senatTags); $t->assign('cdepTags', $cdepTags); $t->assign('user_login', $user_login); $t->assign('user_is_admin', getUserLevel($uid) > 0); if (getUserLevel($uid) > 0) { // Also show the history of the most recent 5 people added. $t->assign('recent_people', getMostRecentNewPeople()); } $t->assign('followed_people', followedPeopleAsArray()); $t->display('my_account_summary.tpl');
function getTags() { $tags = getTagsList(); echo json_encode($tags); }
function showBeliefs($room, $year, $uid, $idperson) { // Get the tags that are for my table (this gets both the count and // the tags themselves). $tags = getTagsList("{$room}_{$year}_votes_details", false); if (sizeof($tags) > 0) { $t = new Smarty(); $t->assign('title', 'Poziția pe următoarele issue-uri'); $t->display("parl_person_beliefs_header.tpl"); foreach ($tags as $tag) { displayOneIndividualTag($room, $year, $uid, $idperson, $tag); } } if ($uid != 0) { $your_tags = getTagsList("{$room}_{$year}_votes_details", $uid); if (sizeof($your_tags) > 0) { $t = new Smarty(); $t->assign('title', 'Poziția pe tag-urile tale private'); $t->display("parl_person_beliefs_header.tpl"); foreach ($your_tags as $tag) { displayOneIndividualTag($room, $year, $uid, $idperson, $tag); } } } }
/** * Enter description here... * * @param string $urlRoot * @param string $name * @return boolean */ function isTagExist($urlRoot, $name) { $arOutput = getTagsList($urlRoot); while (list($idx, $row) = each($arOutput)) { if (preg_match("/^{$name}/", $row) == 1) { return true; } } return false; }