Пример #1
0
<th>College</th>



</tr>
<?php 
$con = connect();
$rank = 1;
$graph_url = "https://graph.facebook.com/me/friends" . '?fields=username,name&access_token=' . $_SESSION['access_token'];
$user = json_decode(file_get_contents($graph_url), true);
$query = "SELECT fb_id,username,level,college from register where username not in ('Shiva Sah','Dhruv Jagetiya','Ankit Gupta', 'Gaurav Yadav', 'Shuchit Khurana' ,'Manaswini Thakur', 'Kushagra Chandra', 'Aditya Sinha', 'Ra Hihoha')  ORDER BY level  desc , registertime asc";
$output = mysql_query($query);
if (isset($_SESSION['username'])) {
    $usernames = $_SESSION['username'];
} else {
    $usernames = cleandata(extract_username());
    $_SESSION['username'] = $usernames;
}
$name22 = $usernames;
while ($row = mysql_fetch_array($output)) {
    if ($row['fb_id'] == $name22) {
        echo "<tr style = 'background-color: green; font-weight: bold; font-color:white;'><td><font color = 'white'>" . $rank++ . "</td><td ><font color = 'white'>" . $row["username"] . "</td><td><font color = 'white'>" . $row["level"] . "</td><td><font color = 'white'>" . $row["college"] . "</td></tr>";
    } else {
        foreach ($user['data'] as $x) {
            if (in_array($row['fb_id'], $x)) {
                if ($row["level"] == 60) {
                    continue;
                }
                echo "<tr><td>" . $rank++ . "</td><td>" . $row["username"] . "</td>";
                //echo "<td><a href = 'https://www.facebook.com/".$row['fb_id']."'><img src = 'https://graph.facebook.com/" .$row['fb_id']."/picture'/></a></td>";
                echo "<td>" . $row["level"] . "</td><td>" . $row["college"] . "</td></tr>";
Пример #2
0
function pagelevel()
{
    $con = connect();
    $username = extract_username();
    $sql_query = "select page from levelans , register where levelans.number=register.level and register.fb_id='" . $username . "'";
    $r = mysql_query($sql_query);
    $page = "notfound.php";
    if ($row = mysql_fetch_array($r)) {
        $page = $row['page'];
    }
    return $page;
}