Skip to content

Commit

Permalink
Merge pull request #4 from bethropolis/test
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
bethropolis authored Jun 6, 2021
2 parents f224106 + 06305a3 commit 5eb9c9f
Show file tree
Hide file tree
Showing 51 changed files with 3,256 additions and 374 deletions.
4 changes: 2 additions & 2 deletions .gitattribute
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lib/
js/
cs/
js/
test/

31 changes: 13 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,45 +118,45 @@ like system is fully working together with the follow system and
bothare perfect and most secure.

## live messaging/chat system (whole new look)
<img src="https://raw.githubusercontent.com/bethropolis/suplike-social-website/major/_githubasserts/messages.webp" align="center" style="width: 70%"><br/>
<img src="./_githubasserts/messages.webp" align="center" style="width: 70%"><br/>
in previous version, one of the issues was that the messaging page was just
a page. Live messaging was not well supported and you could not choose who to chat with until
you clicked message on their profile page. But in the new version, the entire code was re writen and the
whole of that is gone, you can chat with the people you follow
and it is more mobile responsive than previous and the only client page that uses Vuejs.

## home page
<img src="https://raw.githubusercontent.com/bethropolis/suplike-social-website/major/_githubasserts/3.png" align="center" style="width: 70%"><br>
<img src="./_githubasserts/3.png" align="center" style="width: 70%"><br>
the home page is the main page where you can see post from some of the people you follow
and the first page you will land on.

## profile page
<img src="https://raw.githubusercontent.com/bethropolis/suplike-social-website/major/_githubasserts/10.png" align="center" style="width: 70%"><br>
<img src="./_githubasserts/10.png" align="center" style="width: 70%"><br>
the profile page is still in my future update plans, still needs more work.

## settings page
<img src="https://raw.githubusercontent.com/bethropolis/suplike-social-website/major/_githubasserts/5.png" align="center" style="width: 70%"> <br>
<img src="./_githubasserts/5.png" align="center" style="width: 70%"> <br>
also needs more work

## login/signup system
<img src="https://raw.githubusercontent.com/bethropolis/suplike-social-website/major/_githubasserts/7.png" align="center" style="width: 70%"><br>
<img src="./_githubasserts/7.png" align="center" style="width: 70%"><br>
you will have login or sign up to use the site.

## search page
<img src="https://raw.githubusercontent.com/bethropolis/suplike-social-website/major/_githubasserts/6.png" align="center" style="width: 70%"><br>
<img src="./_githubasserts/6.png" align="center" style="width: 70%"><br>
the search page is where you can search for users for now.

## following page
<img src="https://raw.githubusercontent.com/bethropolis/suplike-social-website/major/_githubasserts/4.png" align="center" style="width: 70%"><br>
<img src="./_githubasserts/4.png" align="center" style="width: 70%"><br>
The following page is where you can vue the users you follow (for now);

## post page (new)
<img src="https://raw.githubusercontent.com/bethropolis/suplike-social-website/major/_githubasserts/8.png" align="center" style="width: 70%"><br>
<img src="./_githubasserts/8.png" align="center" style="width: 70%"><br>
the post page is new in v1.2, this is where you can make a post other than the main page it self


## dashboard (new)
<img src="https://raw.githubusercontent.com/bethropolis/suplike-social-website/major/_githubasserts/dashboard.webp" align="center" style="width: 70%"><br>
<img src="./_githubasserts/dashboard.webp" align="center" style="width: 70%"><br>
The Admin Dashboard is a whole new upgrade in v1.2, The dashboard is where you can view
your analytics. The dashboard is one the biggest features of v1.2 and currently undergoing alot of modifications<br>

Expand All @@ -172,23 +172,18 @@ your analytics. The dashboard is one the biggest features of v1.2 and currently
# Future Improvements
---
* making the whole system depend on ajax api requests for speed on page load and easier for expansion (`social.php` would be a great example);
* `laravel` and `vue.js` would really make this even easier;
* `laravel` would really make this even easier;
* adding lazy loading to the posts would make load time quicker
* improving the UI
* implementing PHPmailer to send emails e.g forgot password system
* admin dashboard []
* Admin intergrations/addons
* Profile page upgrade
* Settings update
* Adding authentication
* adding PWA features
* youtube video posting and more formarts
* Continuous Bug fixes and improvements

> you can show support to this project by staring this repo, it really means alot to me.
# inspiration
my biggest inspiration to make this website was was the [KLIK social website](https://github.com/msaad1999/KLiK-SocialMediaWebsite) on github
my biggest inspiration to make this website was was the [KLIK social website](https://) on github
whom I also made > 50% of the Readme from and also top social websites like [facebook](https://facebook.com) gave me some tips.

# behind it all
Expand All @@ -203,10 +198,10 @@ if you like to contribute please don't mind sending a pull request I will
check it out the see if I can merge it, all ideas aloud.


<img src="https://avatars1.githubusercontent.com/u/66518866" width="100px">
<img src="img/myicon.jpg" width="100px">

[bethropolis](https://github.com/bethropolis)

# License
it is licensed under my favourate License [MIT license](https://mit-license.org/).


Binary file added _githubasserts/1 .png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _githubasserts/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _githubasserts/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _githubasserts/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _githubasserts/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _githubasserts/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _githubasserts/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _githubasserts/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _githubasserts/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _githubasserts/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _githubasserts/dashboard.webp
Binary file not shown.
Binary file added _githubasserts/messages.webp
Binary file not shown.
6 changes: 5 additions & 1 deletion css/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:root{
--bg: #ddd9d9;
--bg: #fff;
--co: #000;
--ho: rgba(67, 22, 228, 0.844);
--ac: rgba(50, 159, 192, 0.844);
Expand All @@ -9,6 +9,10 @@

/*
@params */

html {
scroll-behavior: smooth;
}
body{
padding: 0;
margin: 0;
Expand Down
14 changes: 7 additions & 7 deletions dashboard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<link rel="stylesheet" href="../lib/font-awesome/font-awesome.min.css">
<!-- Bootstrap core CSS -->
<link href="../lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="http://localhost/lib/datatables/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css">
<!-- Custom styles for this template -->
<link href="dashboard.css?b4" rel="stylesheet">
<style>
Expand All @@ -37,17 +37,16 @@
user-select: none;
}

@media (min-width: 768px) {
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
</style>
<script src="../lib/jquery/jquery.js"></script>
<script src="../lib/chart.js/Chart.min.js"></script>
<script src="../lib/datatables/jquery.dataTables.js"></script>
<script src="../lib/datatables/dataTables.bootstrap4.js "></script>
<script src="../lib/vue/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
<script src="../lib/vue/vue.min.js"></script>
</head>
<body onload="app.load()">
<div id="app">
Expand Down Expand Up @@ -460,6 +459,7 @@
data: null,
reports: [],
user: sessionStorage.getItem('name') || 'Unknown',
token: sessionStorage.getItem('user') || 'Unknown'

},
methods: {
Expand All @@ -477,7 +477,7 @@
}
)

$.get('../inc/data/data.a.inc.php?type=all&key=OytsaB78Ze5Y912027', (data)=>{
$.get('../inc/data/data.a.inc.php?type=all&key='+this.token, (data)=>{
this.data = data;
}
)
Expand Down
2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<script src="./lib/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="./lib/bootstrap/js/bootstrap.bundle.min.js" ></script>
<script type="text/javascript" src="js/index.js?v1.2"></script>
11 changes: 5 additions & 6 deletions header.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<?php
session_start();
?>
Expand All @@ -15,11 +14,11 @@
<meta name="apple-mobile-web-app-status-bar-style" content="rgba(67, 22, 228, 0.844)">
<title>suplike</title>
<link rel="icon" type="image/png" href="img/logo.png">
<link rel="stylesheet" href="./lib/font-awesome/font-awesome.min.css">
<link rel="stylesheet" href="./lib/font-awesome/font-awesome.min.css" defer>
<link rel="stylesheet" href="./lib/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="./css/style.css?hhy">
<script type="text/javascript" src="./lib/jquery/jquery.js"></script>
<script src="./js/online.js"></script>
<link rel="stylesheet" href="./css/style.css?kk">
<script type="text/javascript" src="./lib/jquery/jquery.js"></script>
<script src="./js/online.js" defer></script>
</head>
<body>
<header>
Expand Down Expand Up @@ -47,7 +46,7 @@
<a href="message.php"><i title="direct inbox" class="fa fa-envelope fa-2x"></i></a>
<a href="search.php"><i title="search for users or post" class="fa fa-search fa-2x" ></i></a>
<a href="settings.php"><i title="settings" class="fa fa-cog fa-2x"></i></a>
<a href="inc/logout.inc.php"><i title="logout" class="fa fa-sign-out fa-2x"></i></a>
<a href="inc/logout.inc.php"><i id="logout" title="logout" class="fa fa-sign-out fa-2x"></i></a>
</ul>
<div class="header-right">';
}
Expand Down
17 changes: 17 additions & 0 deletions inc/Auth/a.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
require '../dbh.inc.php';
require '../errors/error.inc.php';
require 'auth.php';


$er = new Err();
$er->_set_log('../errors/error.log.txt');
$er->err(2,3,"The testing is not completely ready");








100 changes: 100 additions & 0 deletions inc/Auth/auth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?php
class Auth
{
public $token;
public $chat_auth;
public $browser_auth;
public $user_auth;
public $api_key;
public $user;
private $conn;

public function __construct()
{
global $conn;
$this->conn = $conn;
$this->token = bin2hex(openssl_random_pseudo_bytes(21));
$this->chat_auth = bin2hex(openssl_random_pseudo_bytes(8));
$this->browser_auth = bin2hex(openssl_random_pseudo_bytes(16));
$this->user_auth = bin2hex(openssl_random_pseudo_bytes(14));
$this->api_key = bin2hex(openssl_random_pseudo_bytes(32));
}

public function _getUser($str)
{
$length = strlen($str);
$sql = '';
switch ($length) {
case 42:
//token
$sql = "SELECT `user` FROM `auth_key` WHERE `token` = '$str'";

break;
case 16:
//chat token
$sql = "SELECT `user` FROM `auth_key` WHERE `chat_auth` = '$str'";
break;
case 32:
//browser token
$sql = "SELECT `user` FROM `auth_key` WHERE `browser_auth` = '$str'";
break;

case 28:
//user token
$sql = "SELECT `user` FROM `auth_key` WHERE `user_auth` = '$str'";
break;

case 64:
//api key
$sql = "SELECT `user` FROM `auth_key` WHERE `api_key` = '$str'";
break;
default:
die("auth Error");
}
$this->user = (mysqli_fetch_assoc($this->conn->query($sql)))['user'];
return $this->user;
}

public function _queryUser($id, $type){
$sql = '';
$ty = '';
switch ($type) {
case 1:
//token
$sql = "SELECT `token` FROM `auth_key` WHERE `user` = '$id'";
$ty ="token";
break;
case 2:
//chat token
$sql = "SELECT `chat_auth` FROM `auth_key` WHERE `user` = '$id'";
$ty = "chat_auth";
break;
case 3:
//browser token
$sql = "SELECT `browser_auth` FROM `auth_key` WHERE `user` = '$id'";
$ty = "browser_auth";
break;

case 4:
//user token
$sql = "SELECT `user_auth` FROM `auth_key` WHERE `user` = '$id'";
$ty = "user_auth";
break;

case 5:
//api key
$sql = "SELECT `api_key` FROM `auth_key` WHERE `user` = '$id'";
$ty = "api_key";
break;
default:
die("auth Error");
}

$this->user = (mysqli_fetch_assoc($this->conn->query($sql)))[$ty];

return $this->user;
}

}

$un_ravel = new Auth();
Loading

0 comments on commit 5eb9c9f

Please sign in to comment.