forked from phamtienthanh-luvina/samforum
/
index.php
85 lines (63 loc) · 2.72 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
</html>
<?PHP
//******************************************//
//* This copyright notice must not be removed
//* under any circumstances.
//* It must stay intact in all the files.
//* Samforum
//* Version 1.0
//* Script created by Samiuddin Samiuddin
//* Email: phpdevsami@gmail.com
//* Skype: n0h4cks
//* - This is not an open source project, functions/classes
//* or any other code form this script cannot be
//* used for other scripts or applications.
//* You are not allowed to resell this script.
//* - You are free to make modification/changes,
//* however it must be for your own use.
//*********************************************************************//
//work on search feature
include_once("track_clicks_class.php");
include_once("general/general_class.php");
include_once("connection_to_db.php");
include_once("show_data_class.php");
include_once("login_user/login_class.php");
$Data_display = new Data_display($conn);
$Login = new Login($conn);
session_start();
if(!$Login->is_user_logged_in("logged_in")){
//if user is not logged in then show login, register, and recover_password options
//link to search bar
echo "<a href=\"search/search.php\"> Search on this site </a> </br>";
echo "<a href='login_user/login.php'> Login </a> </br>";
echo "<a href='register_account/register.php'> Register new account </a> </br>";
echo "<a href='recover_password/recover_password.php'> Recover password </a> </br>";
}
if($Login->is_user_logged_in("logged_in")){
//greet user
echo "<p style=\"display:inline\">Hello</p> <p style=\"display:inline\" class='thread_by'> {$_SESSION["logged_in"]} </p> </br>";
//link to search bar
echo "<a href=\"search/search.php\"> Search on this site </a> </br>";
echo "<a href=\"login_user/logout.php\"> Logout </a> </br>";
echo "<a href=\"user_profile.php\"> My profile </a> </br>";
echo "<a href=\"chatbox/chat_box.php\"> Join chat </a> </br>";
//If user is logged in(session exists), we're going to check if user is admin.
//..checks if user is admin
if($Login->is_user_admin()){
echo "<a href=\"admin/admin_cp.php\"> Admin control panel </a> </br>";
}
}
//Shows categories and other things.
$Data_display->show_categories();
//instantiating Click class.
$click_tracker = new Click($conn);
//Calling store_clicks();
$click_tracker->store_clicks();
//Calling show_hits_amount(), this shows the amount your site has been hit.
$click_tracker->show_hits_amount();
echo "</br> </br> </br> </br> </br> <p style='background-color:yellow; color:black; width:300px'>Forum script by <a href='https://github.com/phpdevsami/samforum'> samforum S. Samiuddin</a> </p>";
?>