Exemplo n.º 1
0
<?php

require_once 'header.php';
if (!$loggedin) {
    die;
}
echo "<div class='main'>";
if (isset($_GET['view'])) {
    $view = sanitizeString($_GET['view']);
    if ($view == $user) {
        $name = "Your";
    } else {
        $name = "{$view}'s";
    }
    echo "<h3>{$name} Profile</h3>";
    showProfile($view);
    echo "<a class='button' href='messages.php?view={$view}'>" . "View {$name} messages</a><br><br>";
    die("</div></body></html>");
}
if (isset($_GET['add'])) {
    $add = sanitizeString($_GET['add']);
    $result = queryMysql("SELECT * FROM friends WHERE user='******'\nAND friend='{$user}'");
    if (!$result->num_rows) {
        queryMysql("INSERT INTO friends VALUES ('{$add}', '{$user}')");
    }
} elseif (isset($_GET['remove'])) {
    $remove = sanitizeString($_GET['remove']);
    queryMysql("DELETE FROM friends WHERE user='******' AND friend='{$user}'");
}
$result = queryMysql("SELECT user FROM members ORDER BY user");
$num = $result->num_rows;
Exemplo n.º 2
0
        $tw = $w;
        $th = $h;
        if ($w > $h && $max < $w) {
            $th = $max / $w * $h;
            $tw = $max;
        } elseif ($h > $w && $max < $h) {
            $tw = $max / $h * $w;
            $th = $max;
        } elseif ($max < $w) {
            $tw = $th = $max;
        }
        $tmp = imagecreatetruecolor($tw, $th);
        imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tw, $th, $w, $h);
        imageconvolution($tmp, array(array('−1', '−1', '−1'), array('−1', '16', '−1'), array('−1', '−1', '−1')), '8', '0');
        imagejpeg($tmp, $saveto);
        imagedestroy($tmp);
        imagedestroy($src);
    }
}
showProfile($conn, $user, $fname);
echo <<<_END
</div>
<div class='right_panel'>
<form method='post' action='profile.php' enctype='multipart/form-data'>
<h3>Enter or edit your details and/or upload an image</h3>
<textarea name='text' cols='50' rows='3'>{$text}</textarea><br />
_END;
?>
Image: <input type='file' name='image' size='14' maxlength='32' />
<input type='submit' value='Save Profile' />
</form></div><br /></body></html>
Exemplo n.º 3
0
    $text = sanitizeString($conn, $_POST['text']);
    if ($text != "") {
        $pm = substr(sanitizeString($conn, $_POST['pm']), 0, 1);
        $time = time();
        queryMysql($conn, "INSERT INTO `messages` VALUES(NULL, '{$user}',\n'{$view}', '{$pm}', {$time}, '{$text}')");
    }
}
if ($view != "") {
    if ($view == $user) {
        $name1 = $name2 = "Your";
    } else {
        $name1 = "<a href='members.php?view={$view}'>{$view}</a>'s";
        $name2 = $view;
    }
    echo "<div class='main'><h3> {$name1} Messages</h3>";
    showProfile($conn, $view, $fname);
    echo "</div>" . "<div class='right_panel' ><form method='post' action='messages.php?view={$view}'>\n\tType here to leave a message:<br />\n\t<textarea name='text' cols='40' rows='3'></textarea><br />\n\tPublic<input type='radio' name='pm' value='0' checked='checked' />";
    if ($view != $user) {
        echo "Private<input type='radio' name='pm' value='1' />";
    }
    echo "<input type='submit' class='button' value='Post Message' /></form><br />";
    if (isset($_GET['erase'])) {
        $erase = sanitizeString($conn, $_GET['erase']);
        queryMysql($conn, "DELETE FROM `messages` WHERE `id`={$erase} AND `recip`='{$user}'");
    }
    $query = "SELECT * FROM `messages` WHERE recip='{$view}' OR auth='{$view}' ORDER BY `time` DESC";
    $result = queryMysql($conn, $query);
    $num = $result->num_rows;
    for ($j = 0; $j < $num; ++$j) {
        $row = mysqli_fetch_row($result);
        if ($user == $view) {
Exemplo n.º 4
0
            $tw = $max;
        } elseif ($h > $w && $max < $h) {
            $tw = $max / $h * $w;
            $th = $max;
        } elseif ($max < $w) {
            $tw = $th = $max;
        }
        // resize the image
        $temp = imagecreatetruecolor($tw, $th);
        imagecopyresampled($temp, $src, 0, 0, 0, 0, $tw, $th, $w, $h);
        // image may blurred
        //imageconvolution($temp, array(array(-1,-1,-1),array(-1,16,-1),array(-1,-1,-1)), 8, 0); // sharpen the image
        imagejpeg($temp, $saveto);
        imagedestroy($temp);
        imagedestroy($src);
    }
}
showProfile($user);
echo "</div>";
// profile form
echo <<<_END
        <div class='display'>
        <form class='left' method="post" action="profile.php" enctype="multipart/form-data">
            <h4>Enter or edit your details and/or upload an image</h4>
            <textarea name="text" cols="50" rows="3">{$text}</textarea><br>
            Image: <input type="file" name="image" size="14">
            <input class="submit" type="submit" value="Save Profile">
        </form>
        </div>
_END;
include_once '../templates/footer.php';
Exemplo n.º 5
0
} else {
    print "\n";
    print "Feed record ok, not changing.\n\n";
}
print "\n";
print "Pinging hub {$sub->huburi} with new subscription for {$sub->uri}\n";
$ok = $sub->subscribe();
if ($ok) {
    print "ok\n";
} else {
    print "Could not confirm.\n";
}
$o2 = Ostatus_profile::staticGet('uri', $uri);
print "\n";
print "New profile state:\n";
showProfile($o2);
print "\n";
print "New feed state:\n";
$sub2 = FeedSub::ensureFeed($feedurl);
showSub($sub2);
function showProfile($oprofile)
{
    print "  Feed URL: {$oprofile->feeduri}\n";
    print "  Salmon URL: {$oprofile->salmonuri}\n";
    print "  Avatar URL: {$oprofile->avatar}\n";
    print "  Profile ID: {$oprofile->profile_id}\n";
    print "  Group ID: {$oprofile->group_id}\n";
    print "  Record created: {$oprofile->created}\n";
    print "  Record modified: {$oprofile->modified}\n";
}
function showSub($sub)
Exemplo n.º 6
0
<div class="main_content">
<?php 
include "leftwidget.php";
?>
<div class="center_table">
<table align="center" width="800" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<th scope="col"></th>
    </tr>
    <tr>
		<td>
<!-----------------------Server Side Scripting begins--------------------------->
				<?php 
if ($action == "showprofile") {
    showProfile();
} else {
    if ($action == "editprofile") {
        editProfile();
    } else {
        if ($action == "updateprofile") {
            updateProfile();
        } else {
            verify();
        }
    }
}
function verify()
{
    global $tname, $t;
    include "dbconnect.php";
Exemplo n.º 7
0
if (!$loggedin) {
    die;
}
echo "<div class='container marketing'>\n        <div class='col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-3'>";
echo "<div class='main'>";
echo "<ul class='menus'>" . "<li><a href='members.php'>Members</a></li>" . "<li><a href='messages.php'>Messages</a></li>" . "<li><a href='profile.php'>Edit Profile</a></li>" . "<li><a href='logout.php'>Log out</a></li></ul><br>";
if (isset($_GET['view'])) {
    $view = sanitizeString($_GET['view']);
    if ($view == $user) {
        $name = "Your";
    } else {
        $name = "{$view}'s";
    }
    echo "<h2>{$name} Profile</h2>";
    echo '<div id="pic">';
    echo showProfile($view) . '</div>';
    /*
    Getting individual rank of user from leaderboard
    @author 
    @date 17/04/2015
    @source http://stackoverflow.com/questions/1293817/mysql-get-users-rank
    */
    $database = mysql_connect('localhost', 'root', 'password') or die('Could not connect: ' . mysql_error());
    mysql_select_db('robinsnest') or die('Could not select database');
    $query = "\n      SELECT  uo.*, \n        (\n        SELECT  COUNT(DISTINCT ui.quiz_score)\n        FROM    members ui\n        WHERE   (ui.quiz_score, ui.id) >= (uo.quiz_score, uo.id)\n        ) AS rank\nFROM    members uo\n  WHERE user =  '******';";
    $result = mysql_query($query) or die('Query failed: ' . mysql_error());
    $num_results = mysql_num_rows($result);
    while ($row = mysql_fetch_array($result)) {
        ?>
    
        <h2><?php 
Exemplo n.º 8
0
    $result = mysql_query("select * from posts where email='{$email}'");
    $num = mysql_num_rows($result);
    if ($num == 0) {
        $x = "No posts yet!";
    } else {
        $x = "{$user}'s posts:";
    }
    echo "<h2 style=\"color:#123987\"; id=\"users_stat\">{$x}</h2>";
    for ($j = 0; $j < $num; $j++) {
        $row = mysql_fetch_row($result);
        echo "<div id='post'>{$row['2']}<div style=\"font-size:0.7em\";>Written on: {$row['3']}</div></div> <br>";
    }
    die;
}
echo "<span  class=\"user\"> {$user}</span> <br/>  ";
showProfile($id);
echo "<br/><br/><br/><br/>";
?>

Choose your profile pic:
 <form method='post' action='' enctype='multipart/form-data'>

 <input type='file' name='image' size='14' maxlength='32'  />
 <input type='submit' value='Upload' />
 </form><br><br>
 
<div id='posts'>
	Update Your Status:
	<form method='post' action='profile.php'> 
	<textarea name='text' cols='50' rows='3'></textarea><br>
	<input type='submit' />
Exemplo n.º 9
0
<?php

include "../universal/config.php";
//---pageType---//
if (isset($_POST["showPage"])) {
    $resultArray = explode(":|:|:|:", pageType($_POST["q"]));
    $pageType = $resultArray[0];
    $match = $resultArray[1];
    //---showProfile---//
    if ($pageType === "profile") {
        include "showProfile.php";
        $result = showProfile($match);
        echo $pageType . ":|:|:|:" . $result;
    } elseif ($pageType === "project") {
        include "showProject.php";
        $result = showProject($match);
        echo $pageType . ":|:|:|:" . $result;
    } elseif ($pageType === "search") {
        include "showSearch.php";
        $result = showSearch($match);
        if ($result === "") {
            echo $pageType;
        } else {
            echo $pageType . ":|:|:|:" . $result;
        }
    } elseif ($pageType === "home") {
        echo "home";
    }
} elseif (isset($_POST["showList"])) {
    include "showList.php";
    if (isset($_POST["q"])) {
Exemplo n.º 10
0
function showRecommendations($jrec, $req)
{
    global $debugar;
    $content = '';
    $rec = objectToArray(json_decode($jrec));
    // Retrieve list of skills and qualifications
    $sysSkills = objectToArray(requestER('er/skills'));
    $sysQualif = objectToArray(requestER('er/' . STRING_SUBSKILLS));
    // Analyse the recommendations
    $content .= '<h2>Recommended experts:</h2>';
    // RAW
    if ($debugar) {
        $content .= '<p>Raw recommendation:<pre>' . print_r($rec, TRUE) . '</pre>';
    }
    // HTML
    $i = 1;
    $content .= '<ol id="recommendations">';
    $lastAssess = -1;
    foreach ($rec as $expert) {
        if ($lastAssess == $expert['assess']) {
            // Mantenemos el numero
            $ii = $iiAnt;
        } else {
            $ii = $i;
            $iiAnt = $ii;
            $lastAssess = $expert['assess'];
        }
        $txtClass = '';
        if ($i == count($rec)) {
            //$txtClass = ' class="clear"';
        }
        $content .= '  <li class="candidate" value="' . $iiAnt . '"' . $txtClass . '><strong>' . $expert['firstname'] . ' ' . $expert['lastname'] . '</strong> (' . $expert['department'] . ')<br />Assessment: ' . $expert['assess'] . '.';
        $content .= showProfile($expert, $req, $sysSkills, $sysQualif);
        // Mostramos sus habilidades
        //$content .= '  Skills:';
        $content .= '  </li>' . "\n";
        $i = $i + 1;
    }
    $content .= '</ol>';
    if (FALSE) {
        // Test: show the objects
        $content .= '<div class="debugInfo"><h2>Debug information:</h2>';
        //$content .= '<h3>Skills list</h3><pre>'.print_r($sysSkills, TRUE). '</pre>';
        //$content .= '<h3>Qualifications list</h3><pre>'.print_r($sysQualif, TRUE). '</pre>';
        $content .= '<h3 class="float">Raw requirements</h3><pre>' . print_r($req, TRUE) . '</pre>';
        $content .= '<h3 class="float">Raw recommendation</h3><pre>' . print_r($rec, TRUE) . '</pre>';
        $content .= '</div>';
    }
    return $content;
}
Exemplo n.º 11
0
<?php

include_once 'header.php';
if (!$loggedin) {
    die;
}
echo "<div class='main'>";
if (isset($_GET['view'])) {
    $view = sanitizeString($conn, $_GET['view']);
    if ($view == $user) {
        $name = "Your";
    } else {
        $name = "{$view}'s";
    }
    echo "<h3>{$name} Profile</h3>";
    showProfile($conn, $view);
    echo "<br/><a  href='messages.php?view={$view}'>" . "<Button class='button'>View {$name} messages</Button></a><br /><br />";
    die("</div></body></html>");
}
if (isset($_GET['add'])) {
    $add = sanitizeString($conn, $_GET['add']);
    if (!queryMysql($conn, "SELECT * FROM `friends` WHERE `user`='{$add}' AND `friend`='{$user}'")->num_rows) {
        queryMysql($conn, "INSERT INTO `friends` VALUES (NULL,'{$add}', '{$user}')");
    }
} elseif (isset($_GET['remove'])) {
    $remove = sanitizeString($_GET['remove']);
    queryMysql($conn, "DELETE FROM `friends` WHERE `user`='{$remove}' AND `friend`='{$user}'");
}
$result = queryMysql($conn, "SELECT `user` FROM `members` ORDER BY `user`");
$num = $result->num_rows;
echo "<h3>Other Members</h3><ul>";