Skip to content

Commit

Permalink
start on main webpage
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Torok committed Sep 9, 2018
1 parent 41b92c5 commit e7e5f8c
Show file tree
Hide file tree
Showing 8 changed files with 291 additions and 319 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public_html/jquery
.idea
1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

480 changes: 168 additions & 312 deletions .idea/workspace.xml

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions public_html/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#titleBar {
background: black;
margin-top: -3em;
margin-left: -.5em;
margin-right: -.5em;
padding-top: .25em;
padding-bottom: .25em;
}

#title {
color: white;
margin-left: .4em;
font-size: 36pt;
font-family: Comfortaa, sans-serif;
font-style: normal;
}

#subtitle {
color: white;
padding-left: 1.25em;
margin-top: -2.25em;
margin-bottom: .5em;
font-size: 14pt;
font-style: italic;
font-family: sans-serif;
}

.asRow {
display: flex;
flex-direction: row;
align-items: flex-start;
}

#barMenus {
margin-top: 3.5em;
margin-left: 10em;
}

.barMenu {
color: white;
font-family: sans-serif;
font-size: 13pt;
padding-right: 3em;
cursor: pointer;
}

.barMenu:hover {
text-decoration: underline;
}

#titleBarBorder {
background: #663366;
margin-left: -.5em;
margin-right: -.5em;
height: .5em;
}

#scrollBar {
background: #885588;
margin-right: -.5em;
height: .5em;
width: 3.5em;
margin-left: 30em;
}
Empty file added public_html/index.js
Empty file.
22 changes: 21 additions & 1 deletion public_html/index.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
<?php
echo ('<p>This is php output</p>');

?>

<html>
<head>
<title>Paintbrush LMS Home Page</title>
<link rel="stylesheet" href="index.css">
<script type="text/javascript" src="index.js"></script>
</head>
<body>
<div id="titleBarWrapper">
<div id="titleBar" class="asRow">
<div>
<p id="title">paintbrush.</p>
<p id="subtitle">Let's get something done today.</p>
</div>
<div id="barMenus" class="asRow">
<p class="barMenu">About</p>
<p class="barMenu">For Students</p>
<p class="barMenu">For Teachers</p>
<p class="barMenu">For Schools</p>
</div>
</div>
<div id="titleBarBorder">
<div id="scrollBar">

</div>
</div>
</div>
<p>This is a web server used for the function of the Paintbrush LMS client program. Please visit our home page for more information.</p>
</body>
</html>
31 changes: 25 additions & 6 deletions public_html/post/getPosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,32 @@
$stmt->execute();
$numLikes = $stmt->get_result()->fetch_row()[0];

$first = "Anonymous";
$last = "";
$posterUN = "Anonymous";

$notAnonymous = $row[7] == "true";
if ($notAnonymous) {
$userId = (is_numeric($row[3]) ? (int) $row[3] : 0);
$stmt = $connection-> prepare("SELECT `first`, `last`, username FROM users WHERE id = ?");
$stmt->bind_param("i", $userId);
$stmt->execute();
$posterData = $stmt->get_result();
$posterRow = $posterData->fetch_row();
$first = $row[0];
$last = $row[1];
$posterUN = $row[2];
}

//encode post
$postLiteral =
escape($row[0]) . ";" . escape($row[1]) . ";" . escape($row[2]) . ";" .
escape($row[3]) . ";" . escape($row[4]). ";" . escape($row[5]). ";" .
escape($row[6]). ";" . escape($row[7]). ";" . escape($row[8]). ";" .
escape($row[9]). ";" . escape($row[10]) . ";" . $likedThis ? 1 : 0 . ";" . $numLikes . ";" . $viewedThis ? 1 : 0 . ";" . $numViews;
echo base64_encode($postLiteral . "\n");
//not all of these really needed to be escaped, but it's better to be safe
$postLiteral = escape($row[0]) . ";" . escape($row[1]) . ";" . escape($row[2]) . ";" .
escape($row[3]) . ";" . escape($row[4]) . ";" . escape($row[5]) . ";" . escape($row[6]) . ";" .
escape($row[7]) . ";" . escape($row[8]) . ";" . escape($row[9]) . ";" . escape($row[10]) . ";" .
escape($row[11]) . ";" . escape($numLikes) . ";" . escape($likedThis) . ";" . escape($numViews) . ";" .
escape($viewedThis) . ";" . escape($first) . ";" . escape($last) . ";" . escape($posterUN);

echo base64_encode($postLiteral . "\n");
}
}

Expand Down
10 changes: 10 additions & 0 deletions public_html/util/time.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
/**
* Created by PhpStorm.
* User: rtorok
* Date: 8/15/18
* Time: 4:33 PM
*/

//outputs the current unix timestamp in milliseconds
echo (int) round(1000 * microtime(true));

0 comments on commit e7e5f8c

Please sign in to comment.