$lastauthed = time(); } else { $lastauthed = 1293858000; //end of 2010 } } $sec_since_auth = time() - $lastauthed; if ($is_authed == 0){ echo '<P><font style="font-size:2em; color: red;">This user is currently NOT AUTHENTICATED. '; if ($sec_since_auth > 2592000){ // 30 days echo 'This user has not authenticated for more than ' . intval($sec_since_auth/86400) . ' days. '; } echo 'If you are currently talking to someone who claims to be this person, you may be talking to an impostor and scammer.</font></P>'; } ?> <h3>List of <?php echo $signs[$sign]; ?> ratings <?php echo $types[$type]; ?> <sup>[<a href="<?php jsonlink(); ?>">json</a>]</sup></h3> <table class="datadisplay sortable"> <tr> <?php foreach ($validkeys as $key) $colheaders[$key] = array('linktext' => str_replace("_", " ", $key)); $colheaders["created_at"]["othertext"] = "(UTC)"; foreach ($colheaders as $by => $colhdr) { echo " <th>" . $colhdr["linktext"] . (!empty($colhdr["othertext"]) ? "<br>".$colhdr["othertext"] : "")."</th>\n"; } ?> </tr> <?php $typequeries = array('RECV' => "users2.nick LIKE ? ESCAPE '|' AND users2.id = ratings.rated_user_id AND users.id = ratings.rater_user_id", 'SENT' => "users.nick LIKE ? ESCAPE '|' AND users.id = ratings.rater_user_id AND users2.id = ratings.rated_user_id"); $sql = "SELECT ratings.id as id, users.nick as rater_nick, users.total_rating as rater_total_rating, users2.nick as rated_nick, users2.total_rating as ratee_total_rating, ratings.created_at as created_at, ratings.rating as rating, ratings.notes as notes from users, users as users2, ratings WHERE " . $typequeries[$type] . $signqueries[$sign] . " ORDER BY " . $sortby . ' COLLATE NOCASE ' . $sortorder; $sth = $db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY)); $sth->execute(array($nickfilter));
<div class="breadcrumbs"> <a href="/">Home</a> › <a href="trust.php">Web of Trust</a> › <a href="viewratings.php">Web of Trust Data</a> › Rating Symmetry for <?php echo htmlentities($nick); ?> </div> <h3>About <?php echo htmlentities($nick); ?></h3> <ul> <?php echo '<li><a href="viewgpg.php?nick=' . htmlentities($nick) . '">GPG identity</a></li>'; echo '<li><a href="viewratingdetail.php?nick=' . htmlentities($nick) . '">Rating detail</a></li>'; ?> </ul> <h3>Rating exchanges<sup>[<a href="<?php jsonlink(); ?>">json</a>]</sup></h3> <?php $results = array(); $sql = "SELECT users.nick as rater_nick, users2.nick as rated_nick, ratings.rating as rating from users, users as users2, ratings WHERE users.id = ratings.rater_user_id AND users2.id = ratings.rated_user_id AND (users.nick LIKE ? ESCAPE '|' OR users2.nick LIKE ? ESCAPE '|');"; $sth = $db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY)); $sth->execute(array($nickfilter, $nickfilter)); if (!$sth) echo "<tr><td>No matching records found</td></tr>\n"; else { while ($entry = $sth->fetch(PDO::FETCH_BOTH)) { if ($entry['rater_nick'] == $nick){ if (array_key_exists($entry['rated_nick'], $results)){ $results[$entry['rated_nick']]['rating_sent'] = $entry['rating']; } else { $results[$entry['rated_nick']] = array('rater_nick' => $entry['rater_nick'], 'rating_sent' => $entry['rating'],