Example #1
0
    } else {
        $err_msg = "Invalid login";
    }
}
?>
<html>
	<head>
		<title>Login</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('login');
?>
      <div class="jumbotron">
		<form class="form-signin" role="form" action='login.php' method='POST'>
			<h2 class="form-signin-heading">Login</h2>
			<h3 class="form-signin-heading"><?php 
echo $err_msg;
?>
 </h3>
			<input type="text" class="form-control" name='username' placeholder="Username" required autofocus>
			<input type="password" class="form-control" name='pw' placeholder="Password" required>
			<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
	  </form>
      </div>
	</body>
</html>
Example #2
0
if (!isset($_GET['user'])) {
    header('Location: ' . $home . 'login.php');
}
$dbh = db_connect($MY_HOST, $MY_DB_PORT, $MY_DB, $DB_USER, $DB_PW);
?>
<html>
	<head>
		<title>Yak</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('user', $_SESSION['user']);
?>

<?php 
html_user($dbh, $_GET['user'], $_SESSION['user']);
?>

<?php 
$num_posts = 0;
if (isset($_GET['start'])) {
    $resp = get_user_posts($dbh, $_GET['user'], 15, $_GET['start']);
} else {
    $resp = get_user_posts($dbh, $_GET['user'], 15);
}
$last_time = -1;
if ($resp['status'] == 1) {
Example #3
0
			        	distance.attr("readonly", true);
			        	location.attr("disabled", true);			        							
					}
					
				});				
			});	
		</script>		
		<title>Yak</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 		<div class="container">
			<?php 
html_nav('search', $_SESSION['user']);
?>

			<div class="row" style='border-bottom: 1px solid #ccc;'>
				<form action='search.php' method='POST'>
				<div class="row" style='padding-left: 30px; padding-right: 30px; padding-top: 5px;'>
					<div class="col-md-3"> <b>Keyword</b><br>(required *): </div>
					<div class="col-md-9"> 
<?php 
echo '<input type="text" class="form-control" value="' . $_POST['keyword'] . '"
						  name="keyword" placeholder="keyword of post" required autofocus>';
?>
					</div>
				</div>
				<hr>
				<div class="row" style='padding-left: 30px; padding-right: 30px; padding-top: 5px;'>
Example #4
0
include "config.php";
include "private_functions.php";
include "functions.php";
$dbh = db_connect($MY_HOST, $MY_DB_PORT, $MY_DB, $DB_USER, $DB_PW);
?>
<html>
	<head>
		<title>Yak</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('stats', $_SESSION['user']);
?>

	  <div class="row" style='border-bottom: 1px solid #000; margin-bottom: 10px;'>
		  <div class="row" style='padding-left: 10px; padding-right: 10px; padding-top: 5px;'>
				<div class="col-md-10"><h2>Most Active Users</h2></div>
		  </div>
		</div>
<?php 
$num_result = 0;
$resp = get_most_active_users($dbh, 5);
if ($resp['status'] == 1) {
    $users = $resp['users'];
    for ($i = 0; $i < count($users); $i++) {
        html_user($dbh, $users[$i], $_SESSION['user']);
        $num_result++;
Example #5
0
    } else {
        $err_msg = "Usernames can only consist of letters or numbers";
    }
}
?>
<html>
	<head>
		<title>Register</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('register');
?>
      <div class="jumbotron">
		<form class="form-signin" role="form" action='register.php' method='POST'>
			<h2 class="form-signin-heading">Register</h2>
			<h3 class="form-signin-heading"><?php 
echo $err_msg;
?>
 </h3>
			<input type="text" class="form-control" name='username' placeholder="Username" required autofocus>
			<input type="password" class="form-control" name='pw' placeholder="Password" required>
			<button class="btn btn-lg btn-primary btn-block" type="submit">Register</button>
	  </form>
      </div>
	</body>
</html>
Example #6
0
include "config.php";
include "private_functions.php";
include "functions.php";
$dbh = db_connect($MY_HOST, $MY_DB_PORT, $MY_DB, $DB_USER, $DB_PW);
?>
<html>
	<head>
		<title>Postly</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('findUsers', $_SESSION['user']);
?>

	  <div class="row" style='border-bottom: 1px solid #ccc;'>
		<form action='find_users.php' method='GET'>
	  <div class="row" style='padding-left: 30px; padding-right: 30px; padding-top: 5px;'>
			<div class="col-md-10"> <input style='height: 45px; padding:10px; font-size: 21px' type="text" class="form-control" name='username' placeholder="Username" required autofocus> </div>
			<div class="col-md-2"> <button class="btn btn-lg btn-primary btn-block" type="submit">Search</button> </div>
	  </div>
	  </form>
		</div>


<?php 
$num_results = 0;
if (isset($_GET['username'])) {
Example #7
0
include "config.php";
include "private_functions.php";
include "functions.php";
$dbh = db_connect($MY_HOST, $MY_DB_PORT, $MY_DB, $DB_USER, $DB_PW);
?>
<html>
	<head>
		<title>Yak</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('findTag', $_SESSION['user']);
?>

	  <div class="row" style='border-bottom: 1px solid #ccc;'>
		<form action='find_tags.php' method='GET'>
	  <div class="row" style='padding-left: 30px; padding-right: 30px; padding-top: 5px;'>
			<div class="col-md-10"> 
				<div class="input-group input-group-lg">
  					<span class="input-group-addon" id="sizing-addon1">#</span>
<?php 
if (isset($_GET['tagname'])) {
    $tagname = $_GET['tagname'];
}
echo '<input style=\'height: 45px; padding:10px; font-size: 21px\' value="' . $_GET['tagname'] . '"
	type="text" class="form-control" name=\'tagname\' placeholder="tagname" required autofocus>';
?>
Example #8
0
    if ($res['status'] == 0) {
        $err_msg = "<h4 style='text-align:center;'>Error posting message</h4>";
    }
}
?>
<html>
	<head>
		<title>Postly</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('timeline', $_SESSION['user']);
?>
	  <div class="row" style='border-bottom: 1px solid #ccc;'>
<?php 
echo $err_msg;
?>
		<form action='timeline.php' method='POST'>
	  <div class="row" style='padding-left: 30px; padding-right: 30px'>
			<input class="form-control" name="title" placeholder="title"></textarea>
	  </div>
	  <div class="row" style='padding-left: 30px; padding-right: 30px'>
			<textarea class="form-control" rows="4" name="message" placeholder="content"></textarea>
	  </div>
	  <div class="row" style='padding-left: 30px; padding-right: 30px; padding-top: 5px;'>
			<div class="col-md-10"></div>
			<div class="col-md-2"> <button class="btn btn-lg btn-primary btn-block" type="submit">Post</button> </div>